Trait exr::image::crop::CropWhere

source ·
pub trait CropWhere<Sample>: Sized {
    type Cropped;

    // Required methods
    fn crop_where(
        self,
        discard_if: impl Fn(Sample) -> bool
    ) -> CropResult<Self::Cropped, Self>;
    fn crop_where_eq(
        self,
        discard_color: impl Into<Sample>
    ) -> CropResult<Self::Cropped, Self>
       where Sample: PartialEq;
    fn crop_nowhere(self) -> Self::Cropped;
}
Expand description

Crop away unwanted pixels from the border if they match the specified rule.

Required Associated Types§

source

type Cropped

The type of the cropped image (probably the same as the original image).

Required Methods§

source

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.

source

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_where with a closure instead. 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.

source

fn crop_nowhere(self) -> Self::Cropped

Convert this data to cropped data without discarding any pixels.

Implementors§

source§

impl<T> CropWhere<<T as InspectSample>::Sample> for Twhere T: Crop + InspectSample,

§

type Cropped = <T as Crop>::Cropped