pub fn crop_layer(new_bounds: IntegerBounds, layer: Layer<Channels>) -> Layer<CroppedChannels<Channels>> {
        Layer {
            channel_data: CroppedChannels {
                cropped_bounds: new_bounds,
                full_bounds: layer.absolute_bounds(),
                full_channels: layer.channel_data,
            },

            size: new_bounds.size,

            attributes: LayerAttributes {
                layer_position: new_bounds.position,
                .. layer.attributes
            },

            encoding: layer.encoding
        }
    }
/// Wrap a layer in a cropped view with adjusted bounds, but without reallocating your pixels
Wrap a layer in a cropped view with adjusted bounds, but without reallocating your pixels
Wrap a layer in a cropped view with adjusted bounds but without reallocating your pixels
pub fn crop_layer(new_bounds: IntegerBounds, layer: Layer<Channels>) -> Layer<CroppedChannels<Channels>> {
        Layer {
            channel_data: CroppedChannels {
                cropped_bounds: new_bounds,
                full_bounds: layer.absolute_bounds(),
                full_channels: layer.channel_data,
            },
            size: new_bounds.size,
            attributes: LayerAttributes {
                layer_position: new_bounds.position,
                .. layer.attributes
            },
            encoding: layer.encoding
        }
    }
pub fn crop_layer ( new_bounds : IntegerBounds , layer : Layer < Channels > ) -> Layer < CroppedChannels < Channels > > { Layer { channel_data : CroppedChannels { cropped_bounds : new_bounds , full_bounds : layer . absolute_bounds ( ) , full_channels : layer . channel_data , } , size : new_bounds . size , attributes : LayerAttributes { layer_position : new_bounds . position , .. layer . attributes } , encoding : layer . encoding } }
Wrap a layer in a cropped view with adjusted bounds, but without reallocating your pixels
Wrap a layer in a cropped view with adjusted bounds but without reallocating your pixels
new_bounds
IntegerBounds
layer
Layer<Channels>
new_bounds
IntegerBounds
layer
Layer<Channels>