Struct NcPixel Copy item path Source pub struct NcPixel(pub NcPixel_u32 );Expand description An ABGR pixel.
§ DiagramAAAAAAAA BBBBBBBB GGGGGGGG RRRRRRRR
NcPixel 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.
Constructs a libav-compatible ABGR pixel from RGB components.
Constructs a libav-compatible ABGR pixel from RGBA components.
Converts to an RGB pixel.
Converts to an RGBA pixel.
Extracts the 8-bit alpha component from an ABGR pixel.
Extracts the 8 bit blue component from an ABGR pixel.
Extracts the 8 bit green component from an ABGR pixel.
Extracts the 8 bit red component from an ABGR pixel.
Sets the 8-bit alpha component of an ABGR pixel.
Sets the 8-bit green component of an ABGR pixel.
Sets the 8-bit blue component of an ABGR pixel.
Sets the 8-bit red component of an ABGR pixel.
Sets the RGB components of an ABGR pixel.
Formats the value using the given formatter.
Read more Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Returns the “default value” for a type.
Read more Formats the value using the given formatter.
Read more Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Formats the value using the given formatter.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more Converts the given value to a
String.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.