pub struct Threshold { /* private fields */ }Expand description
Two-level threshold (sharp’s threshold): a value at or above the
threshold becomes full, anything below becomes zero.
With greyscale, the default in sharp, the pixel’s luma is thresholded
and written to every colour channel; without it each channel is
thresholded on its own. The channel count stays the input’s, so an RGB
image stays RGB (sharp returns one channel); the values are the same.
Implementations§
Trait Implementations§
impl Copy for Threshold
Source§impl Op for Threshold
impl Op for Threshold
Source§fn rescaled(&self) -> Option<Arc<dyn Op>>
fn rescaled(&self) -> Option<Arc<dyn Op>>
A copy of this op fit for a graph rebuilt at a reduced input
resolution, or
None if this op must not be. Read moreSource§fn output_descriptor(
&self,
inputs: &[ImageDescriptor],
) -> Result<ImageDescriptor, PixelsError>
fn output_descriptor( &self, inputs: &[ImageDescriptor], ) -> Result<ImageDescriptor, PixelsError>
Compute the output shape from the input shapes. Read more
Source§fn input_regions(
&self,
output: Region,
_inputs: &[ImageDescriptor],
) -> Result<Vec<Region>, PixelsError>
fn input_regions( &self, output: Region, _inputs: &[ImageDescriptor], ) -> Result<Vec<Region>, PixelsError>
The input regions needed to produce
output. Read moreSource§fn compute(
&self,
inputs: &[Tile<'_>],
output: &mut TileMut<'_>,
) -> Result<(), PixelsError>
fn compute( &self, inputs: &[Tile<'_>], output: &mut TileMut<'_>, ) -> Result<(), PixelsError>
Source§fn access_pattern(&self) -> AccessPattern
fn access_pattern(&self) -> AccessPattern
How this op reads its inputs; drives tile negotiation (ADR-0003). Read more
impl StructuralPartialEq for Threshold
Auto Trait Implementations§
impl Freeze for Threshold
impl RefUnwindSafe for Threshold
impl Send for Threshold
impl Sync for Threshold
impl Unpin for Threshold
impl UnsafeUnpin for Threshold
impl UnwindSafe for Threshold
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more