pub struct PatternImage(/* private fields */);Expand description
Shared image sampling contract captured by a paint, independent of content decoders.
Implementations§
Source§impl PatternImage
impl PatternImage
Sourcepub fn texel(&self, level: usize, column: usize, row: usize) -> [f32; 4]
pub fn texel(&self, level: usize, column: usize, row: usize) -> [f32; 4]
Reads a linear-premultiplied texel; level and pixel indices must be valid.
Sourcepub fn extend_level(&self, level: usize, out: &mut Vec<f32>)
pub fn extend_level(&self, level: usize, out: &mut Vec<f32>)
Appends a whole level in row-major order, four f32 per texel.
Sourcepub fn identity(&self) -> usize
pub fn identity(&self) -> usize
Stable identity of the shared pixel storage, for deduplicating per-frame accounting.
Sourcepub fn downgrade(&self) -> WeakPatternImage
pub fn downgrade(&self) -> WeakPatternImage
Non-owning handle that recognizes this exact shared pixel storage without keeping it alive.
The handle keeps the allocation reserved, so its address cannot be reused by another image while the handle exists.
Trait Implementations§
Source§impl Clone for PatternImage
impl Clone for PatternImage
Auto Trait Implementations§
impl !RefUnwindSafe for PatternImage
impl !UnwindSafe for PatternImage
impl Forget for PatternImage
impl Freeze for PatternImage
impl Move for PatternImage
impl Send for PatternImage
impl Sync for PatternImage
impl Unpin for PatternImage
impl UnsafeUnpin for PatternImage
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