Enum afi::ColorChannels [−][src]
#[repr(u8)]pub enum ColorChannels { Grayscale, Rgb, Rgba, Bgr, Bgra, YCbCr, }
The format for the color channels of the Video
.
Variants
Grayscale
Grayscale color format, 1 channel (stored in red channel).
Rgb
RGB color format, 3 channels.
Rgba
RGBA color format, 4 channels.
Bgr
BGR color format, 3 channels.
Bgra
BGRA color format, 4 channels.
YCbCr
YCbCr color format, 3 channels
Methods
impl ColorChannels
[src]
impl ColorChannels
pub fn from(self, from: ColorChannels, p: [u8; 4]) -> [u8; 4]
[src]
pub fn from(self, from: ColorChannels, p: [u8; 4]) -> [u8; 4]
Convert a pixel to this format from another.
pub fn pack(p: [u8; 4]) -> u32
[src]
pub fn pack(p: [u8; 4]) -> u32
Pack an RGBA [u8; 4] into an RGBA u32
pub fn unpack(p: u32) -> [u8; 4]
[src]
pub fn unpack(p: u32) -> [u8; 4]
Unpack an RGBA u32 into an RGBA [u8; 4]
pub fn n_channels(self) -> usize
[src]
pub fn n_channels(self) -> usize
Return the number of channels.
Trait Implementations
impl Copy for ColorChannels
[src]
impl Copy for ColorChannels
impl Clone for ColorChannels
[src]
impl Clone for ColorChannels
fn clone(&self) -> ColorChannels
[src]
fn clone(&self) -> ColorChannels
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for ColorChannels
[src]
impl PartialEq for ColorChannels
fn eq(&self, other: &ColorChannels) -> bool
[src]
fn eq(&self, other: &ColorChannels) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]This method tests for !=
.
impl Default for ColorChannels
[src]
impl Default for ColorChannels
fn default() -> ColorChannels
[src]
fn default() -> ColorChannels
Returns the "default value" for a type. Read more
Auto Trait Implementations
impl Send for ColorChannels
impl Send for ColorChannels
impl Sync for ColorChannels
impl Sync for ColorChannels