Struct libnotcurses_sys::NcPixel
source · [−]pub struct NcPixel(pub NcPixel_u32);Expand description
An ABGR pixel.
Diagram
AAAAAAAA BBBBBBBB GGGGGGGG RRRRRRRRNcPixel has 8 bits of alpha, more or less linear, contributing
directly to the usual alpha blending equation.
We map the 8 bits of alpha to 2 bits of alpha via a level function
The NcPixel API facilitates direct management of the pixels within an
NcVisual (NcVisuals keep a backing store of 32-bit RGBA pixels,
and render them down to terminal graphics in NcVisual.render).
Per libav, we “store as BGRA on little-endian, and ARGB on big-endian”. This is an RGBA byte-order scheme. libav emits bytes, not words. Those bytes are R-G-B-A. When read as words, on little endian this will be ABGR, and on big-endian this will be RGBA. force everything to LE ABGR, a no-op on (and thus favoring) little-endian, which is the dominant ordering for processor architectures (x86, most ARM implementations, base RISC-V implementations) and their associated memory.
Tuple Fields
0: NcPixel_u32Implementations
Trait Implementations
sourceimpl From<&'_ NcPixel> for *const NcPixel_u32
impl From<&'_ NcPixel> for *const NcPixel_u32
sourceimpl From<&'_ mut NcPixel> for *mut NcPixel_u32
impl From<&'_ mut NcPixel> for *mut NcPixel_u32
sourceimpl<'a> From<&'a NcPixel> for &'a NcPixel_u32
impl<'a> From<&'a NcPixel> for &'a NcPixel_u32
sourceimpl<'a> From<&'a mut NcPixel> for &'a mut NcPixel_u32
impl<'a> From<&'a mut NcPixel> for &'a mut NcPixel_u32
sourceimpl<'a> From<&'a mut u32> for NcPixel
impl<'a> From<&'a mut u32> for NcPixel
sourcefn from(p: &'a mut NcPixel_u32) -> Self
fn from(p: &'a mut NcPixel_u32) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<&'a u32> for NcPixel
impl<'a> From<&'a u32> for NcPixel
sourcefn from(p: &'a NcPixel_u32) -> Self
fn from(p: &'a NcPixel_u32) -> Self
Converts to this type from the input type.
sourceimpl From<NcPixel> for NcPixel_u32
impl From<NcPixel> for NcPixel_u32
sourceimpl From<u32> for NcPixel
impl From<u32> for NcPixel
sourcefn from(p: NcPixel_u32) -> Self
fn from(p: NcPixel_u32) -> Self
Converts to this type from the input type.
impl Copy for NcPixel
impl Eq for NcPixel
impl StructuralEq for NcPixel
impl StructuralPartialEq for NcPixel
Auto Trait Implementations
impl RefUnwindSafe for NcPixel
impl Send for NcPixel
impl Sync for NcPixel
impl Unpin for NcPixel
impl UnwindSafe for NcPixel
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more