Struct image_canvas::layout::Texel
source · [−]pub struct Texel {
pub block: Block,
pub bits: SampleBits,
pub parts: SampleParts,
}
Expand description
One Unit of bytes in a texture.
Fields
block: Block
Which part of the image a single texel refers to.
bits: SampleBits
How the values are encoded as bits in the bytes.
parts: SampleParts
Which values are encoded, which controls the applicable color spaces.
Implementations
sourceimpl Texel
impl Texel
pub fn new_u8(parts: SampleParts) -> Self
pub fn new_i8(parts: SampleParts) -> Self
pub fn new_u16(parts: SampleParts) -> Self
pub fn new_i16(parts: SampleParts) -> Self
pub fn new_f32(parts: SampleParts) -> Self
sourcepub fn channel_texel(&self, channel: ColorChannel) -> Option<Texel>
pub fn channel_texel(&self, channel: ColorChannel) -> Option<Texel>
Get the texel describing a single channel. Returns None if the channel is not contained, or if it can not be extracted on its own.
FIXME(color): review what this means for block layouts. But since it only works for UInt?x?
this is not a big deal yet.
Trait Implementations
impl StructuralPartialEq for Texel
Auto Trait Implementations
impl RefUnwindSafe for Texel
impl Send for Texel
impl Sync for Texel
impl Unpin for Texel
impl UnwindSafe for Texel
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more