Trait Crop
pub trait Crop: Sized
Crop some pixels ways when specifying a smaller rectangle
Associated Types
type Cropped;The type of this image after cropping (probably the same as before)
Required Methods
fn crop(self, bounds: IntegerBounds) -> Self::CroppedCrop the image to exclude unwanted pixels. Panics for invalid (larger than previously) bounds. The bounds are specified in absolute coordinates. Does not reduce allocation size of the current image, but instead only adjust a few boundary numbers. Use
reallocate_cropped()on the return value to actually reduce the memory footprint.
Provided Methods
fn try_crop(self, bounds: Option<IntegerBounds>) -> CropResult<Self::Cropped, Self>Reduce your image to a smaller part, usually to save memory. Crop if bounds are specified, return the original if no bounds are specified. Does not reduce allocation size of the current image, but instead only adjust a few boundary numbers. Use
reallocate_cropped()on the return value to actually reduce the memory footprint.