Enum Channels
#[repr(u8)]
pub enum Channels
Number of 8-bit channels in a pixel.
Variants
-
Rgb = 3 Three 8-bit channels (RGB)
-
Rgba = 4 Four 8-bit channels (RGBA)
Implementations
impl Channels
const fn is_rgb(self) -> boolReturns true if there are 3 channels (RGB).
const fn is_rgba(self) -> boolReturns true if there are 4 channels (RGBA).
const fn as_u8(self) -> u8Converts to an integer (3 if RGB, 4 if RGBA).
Trait Implementations
impl Clone for Channels
fn clone(&self) -> Self
impl Copy for Channels
impl Debug for Channels
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for Channels
fn default() -> Self
impl Eq for Channels
impl Hash for Channels
fn hash<__H: Hasher>(&self, state: &mut __H)
impl Ord for Channels
fn cmp(&self, other: &Self) -> Ordering
impl PartialEq for Channels
fn eq(&self, other: &Self) -> bool
impl PartialOrd for Channels
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
impl StructuralPartialEq for Channels
impl TryFrom<u8> for Channels
type Error = Error;fn try_from(channels: u8) -> Result<Self>