Trait CropWhere
pub trait CropWhere<Sample>: Sized
Crop away unwanted pixels from the border if they match the specified rule.
Associated Types
type Cropped;The type of the cropped image (probably the same as the original image).
Required Methods
fn crop_where(self, discard_if: impl Fn(Sample) -> bool) -> CropResult<Self::Cropped, Self>Crop away unwanted pixels from the border if they match the specified rule. 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.fn crop_where_eq(self, discard_color: impl Into<Sample>) -> CropResult<Self::Cropped, Self> where Sample: PartialEq,Crop away unwanted pixels from the border if they match the specified color. If you want discard based on a rule, use
crop_wherewith a closure instead. Does not reduce allocation size of the current image, but instead only adjust a few boundary numbers. Usereallocate_cropped()on the return value to actually reduce the memory footprint.fn crop_nowhere(self) -> Self::CroppedConvert this data to cropped data without discarding any pixels.
Implementors
impl<T> CropWhere<<T as InspectSample>::Sample> for Layer<Channels> where T: Crop + InspectSample,impl<T> CropWhere<<T as InspectSample>::Sample> for T where T: Crop + InspectSample,