pub struct EnsureAlpha { /* private fields */ }Expand description
Add an alpha channel at a fixed level if there is none (sharp’s
ensureAlpha); an image that has one is unchanged.
Implementations§
Source§impl EnsureAlpha
impl EnsureAlpha
Sourcepub fn new(level: f32) -> Result<EnsureAlpha, PixelsError>
pub fn new(level: f32) -> Result<EnsureAlpha, PixelsError>
Add alpha at level, 0 transparent to 1 opaque; sharp’s default is 1.
§Errors
Returns PixelsError::InvalidArgument unless level is in 0..=1.
Trait Implementations§
Source§impl Clone for EnsureAlpha
impl Clone for EnsureAlpha
Source§fn clone(&self) -> EnsureAlpha
fn clone(&self) -> EnsureAlpha
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for EnsureAlpha
Source§impl Debug for EnsureAlpha
impl Debug for EnsureAlpha
Source§impl Op for EnsureAlpha
impl Op for EnsureAlpha
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
Source§impl PartialEq for EnsureAlpha
impl PartialEq for EnsureAlpha
impl StructuralPartialEq for EnsureAlpha
Auto Trait Implementations§
impl Freeze for EnsureAlpha
impl RefUnwindSafe for EnsureAlpha
impl Send for EnsureAlpha
impl Sync for EnsureAlpha
impl Unpin for EnsureAlpha
impl UnsafeUnpin for EnsureAlpha
impl UnwindSafe for EnsureAlpha
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