NcPixel_u32

Type Alias NcPixel_u32 

Source
pub type NcPixel_u32 = u32;
Expand description

An ABGR pixel.

It’s recommended to use NcPixel instead.

§Diagram

AAAAAAAA BBBBBBBB GGGGGGGG RRRRRRRR

type in C: ncpixel (uint32_t)

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.

Trait Implementations§

Source§

impl<'a> From<&'a NcPixel> for &'a NcPixel_u32

Source§

fn from(s: &'a NcPixel) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut NcPixel> for &'a mut NcPixel_u32

Source§

fn from(s: &'a mut NcPixel) -> Self

Converts to this type from the input type.
Source§

impl From<NcPixel> for NcPixel_u32

Source§

fn from(s: NcPixel) -> Self

Converts to this type from the input type.