pub struct MultiplyLayerFactors {
pub size: PixelSize,
pub rgba: Arc<Vec<u8>>,
pub scale: f32,
}Expand description
The per-channel factors of a multiply layer: an opaque RGBA image whose
channels, divided by 255 and times scale, are the
factors of the red, green and blue channels.
Fields§
§size: PixelSizeThe size of the image in samples.
rgba: Arc<Vec<u8>>The samples, row by row from the top, 4 bytes each (the fourth 255).
scale: f32What a sample of 255 stands for (1 or more).
Implementations§
Source§impl MultiplyLayerFactors
impl MultiplyLayerFactors
Sourcepub fn factor_at(&self, u: f64, v: f64) -> [f32; 3]
pub fn factor_at(&self, u: f64, v: f64) -> [f32; 3]
The factors of the red, green and blue channels at (u, v) of the
unit square of the image (0 to 1 across it), sampled bilinearly
between the centres of the samples, as the backends sample a bitmap.
Sourcepub fn apply_to_premultiplied_rgba8(
&self,
rgba: &mut [u8],
width: usize,
to_unit: impl Fn(f64, f64) -> Option<(f64, f64)>,
)
pub fn apply_to_premultiplied_rgba8( &self, rgba: &mut [u8], width: usize, to_unit: impl Fn(f64, f64) -> Option<(f64, f64)>, )
Multiplies the premultiplied RGBA pixels rgba (row by row, width
pixels a row) by the factors; to_unit maps the centre of a pixel to
the unit square of the factors (None outside them: the pixel is
cleared, as nothing outside the bounds of the layer is kept).
Trait Implementations§
Source§impl Clone for MultiplyLayerFactors
impl Clone for MultiplyLayerFactors
Source§impl Debug for MultiplyLayerFactors
impl Debug for MultiplyLayerFactors
Source§impl PartialEq for MultiplyLayerFactors
impl PartialEq for MultiplyLayerFactors
impl StructuralPartialEq for MultiplyLayerFactors
Auto Trait Implementations§
impl Freeze for MultiplyLayerFactors
impl RefUnwindSafe for MultiplyLayerFactors
impl Send for MultiplyLayerFactors
impl Sync for MultiplyLayerFactors
impl Unpin for MultiplyLayerFactors
impl UnsafeUnpin for MultiplyLayerFactors
impl UnwindSafe for MultiplyLayerFactors
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more