Trait exr::image::crop::CropWhere[][src]

pub trait CropWhere<Sample>: Sized {
    type Cropped;
    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.

Associated Types

type Cropped[src]

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>
[src]

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
[src]

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.

fn crop_nowhere(self) -> Self::Cropped[src]

Convert this data to cropped data without discarding any pixels.

Implementors

impl<T> CropWhere<<T as InspectSample>::Sample> for T where
    T: Crop + InspectSample
[src]

type Cropped = <Self as Crop>::Cropped

fn crop_where(
    self,
    discard_if: impl Fn(T::Sample) -> bool
) -> CropResult<Self::Cropped, Self>
[src]

fn crop_where_eq(
    self,
    discard_color: impl Into<T::Sample>
) -> CropResult<Self::Cropped, Self> where
    T::Sample: PartialEq
[src]

fn crop_nowhere(self) -> Self::Cropped[src]