EffectImagePixels
struct · ferroui-base · v0.5.0
struct EffectImagePixels
The pixels of an EffectImage: premultiplied RGBA, eight bits a
channel, rows of width * 4 bytes without padding.
Members
new
fn new(width: usize, height: usize, rgba: impl Into<Arc<[u8]>>) -> Option<Self>
Pixels of width by height from rgba (premultiplied, width * 4
bytes a row); None when the length does not match.
width
fn width(self: &Self) -> usize
The width in pixels.
height
fn height(self: &Self) -> usize
The height in pixels.
rgba
fn rgba(self: &Self) -> &[u8]
The premultiplied RGBA bytes.
texel
fn texel(self: &Self, x: i64, y: i64) -> [u8; 4]
The texel at column x and row y; transparent beyond the image.
sample_stretched
fn sample_stretched(self: &Self, coord: [f32; 2], layer_size: [f32; 2]) -> [u8; 4]
The image at coord (device pixels of the area of an effect whose
size is layer_size) as the programs of the shader effects sample a
child (the convention of
ShaderEffectDescription): the image
stretched over the area, the texel under coord * size / layer_size
(single precision, in that order), transparent beyond the image.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafePropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneDebugStructuralPartialEqPartialEq
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.