Struct lcms2_sys::ffi::PixelFormat

source ·
#[repr(transparent)]
pub struct PixelFormat(pub u32);
Expand description

Format of pixel is defined by one u32, using bit fields as follows

                          2                1          0
                   4 3 2 10987 6 5 4 3 2 1 098 7654 321
                   M A O TTTTT U Y F P X S EEE CCCC BBB

       M: Premultiplied alpha (only works when extra samples is 1)
       A: Floating point -- With this flag we can differentiate 16 bits as float and as int
       O: Optimized -- previous optimization already returns the final 8-bit value
       T: Pixeltype
       F: Flavor  0=MinIsBlack(Chocolate) 1=MinIsWhite(Vanilla)
       P: Planar? 0=Chunky, 1=Planar
       X: swap 16 bps endianness?
       S: Do swap? ie, BGR, KYMC
       E: Extra samples
       C: Channels (Samples per pixel)
       B: bytes per sample
       Y: Swap first - changes ABGR to BGRA and KCMY to CMYK

Tuple Fields§

§0: u32

Implementations§

source§

impl PixelFormat

source

pub const GRAY_8: PixelFormat = _

source

pub const GRAY_8_REV: PixelFormat = _

source

pub const GRAY_16: PixelFormat = _

source

pub const GRAY_16_REV: PixelFormat = _

source

pub const GRAY_16_SE: PixelFormat = _

source

pub const GRAYA_8: PixelFormat = _

source

pub const GRAYA_16: PixelFormat = _

source

pub const GRAYA_16_SE: PixelFormat = _

source

pub const GRAYA_8_PLANAR: PixelFormat = _

source

pub const GRAYA_16_PLANAR: PixelFormat = _

source

pub const RGB_8: PixelFormat = _

source

pub const RGB_8_PLANAR: PixelFormat = _

source

pub const BGR_8: PixelFormat = _

source

pub const BGR_8_PLANAR: PixelFormat = _

source

pub const RGB_16: PixelFormat = _

source

pub const RGB_16_PLANAR: PixelFormat = _

source

pub const RGB_16_SE: PixelFormat = _

source

pub const BGR_16: PixelFormat = _

source

pub const BGR_16_PLANAR: PixelFormat = _

source

pub const BGR_16_SE: PixelFormat = _

source

pub const RGBA_8: PixelFormat = _

source

pub const RGBA_8_PLANAR: PixelFormat = _

source

pub const RGBA_16: PixelFormat = _

source

pub const RGBA_16_PLANAR: PixelFormat = _

source

pub const RGBA_16_SE: PixelFormat = _

source

pub const ARGB_8: PixelFormat = _

source

pub const ARGB_8_PLANAR: PixelFormat = _

source

pub const ARGB_16: PixelFormat = _

source

pub const ABGR_8: PixelFormat = _

source

pub const ABGR_8_PLANAR: PixelFormat = _

source

pub const ABGR_16: PixelFormat = _

source

pub const ABGR_16_PLANAR: PixelFormat = _

source

pub const ABGR_16_SE: PixelFormat = _

source

pub const BGRA_8: PixelFormat = _

source

pub const BGRA_8_PLANAR: PixelFormat = _

source

pub const BGRA_16: PixelFormat = _

source

pub const BGRA_16_SE: PixelFormat = _

source

pub const CMY_8: PixelFormat = _

source

pub const CMY_8_PLANAR: PixelFormat = _

source

pub const CMY_16: PixelFormat = _

source

pub const CMY_16_PLANAR: PixelFormat = _

source

pub const CMY_16_SE: PixelFormat = _

source

pub const CMYK_8: PixelFormat = _

source

pub const CMYKA_8: PixelFormat = _

source

pub const CMYK_8_REV: PixelFormat = _

source

pub const CMYK_8_PLANAR: PixelFormat = _

source

pub const CMYK_16: PixelFormat = _

source

pub const CMYK_16_REV: PixelFormat = _

source

pub const CMYK_16_PLANAR: PixelFormat = _

source

pub const CMYK_16_SE: PixelFormat = _

source

pub const KYMC_8: PixelFormat = _

source

pub const KYMC_16: PixelFormat = _

source

pub const KYMC_16_SE: PixelFormat = _

source

pub const KCMY_8: PixelFormat = _

source

pub const KCMY_8_REV: PixelFormat = _

source

pub const KCMY_16: PixelFormat = _

source

pub const KCMY_16_REV: PixelFormat = _

source

pub const KCMY_16_SE: PixelFormat = _

source

pub const CMYK5_8: PixelFormat = _

source

pub const CMYK5_16: PixelFormat = _

source

pub const CMYK5_16_SE: PixelFormat = _

source

pub const KYMC5_8: PixelFormat = _

source

pub const KYMC5_16: PixelFormat = _

source

pub const KYMC5_16_SE: PixelFormat = _

source

pub const CMYK6_8: PixelFormat = _

source

pub const CMYK6_8_PLANAR: PixelFormat = _

source

pub const CMYK6_16: PixelFormat = _

source

pub const CMYK6_16_PLANAR: PixelFormat = _

source

pub const CMYK6_16_SE: PixelFormat = _

source

pub const CMYK7_8: PixelFormat = _

source

pub const CMYK7_16: PixelFormat = _

source

pub const CMYK7_16_SE: PixelFormat = _

source

pub const KYMC7_8: PixelFormat = _

source

pub const KYMC7_16: PixelFormat = _

source

pub const KYMC7_16_SE: PixelFormat = _

source

pub const CMYK8_8: PixelFormat = _

source

pub const CMYK8_16: PixelFormat = _

source

pub const CMYK8_16_SE: PixelFormat = _

source

pub const KYMC8_8: PixelFormat = _

source

pub const KYMC8_16: PixelFormat = _

source

pub const KYMC8_16_SE: PixelFormat = _

source

pub const CMYK9_8: PixelFormat = _

source

pub const CMYK9_16: PixelFormat = _

source

pub const CMYK9_16_SE: PixelFormat = _

source

pub const KYMC9_8: PixelFormat = _

source

pub const KYMC9_16: PixelFormat = _

source

pub const KYMC9_16_SE: PixelFormat = _

source

pub const CMYK10_8: PixelFormat = _

source

pub const CMYK10_16: PixelFormat = _

source

pub const CMYK10_16_SE: PixelFormat = _

source

pub const KYMC10_8: PixelFormat = _

source

pub const KYMC10_16: PixelFormat = _

source

pub const KYMC10_16_SE: PixelFormat = _

source

pub const CMYK11_8: PixelFormat = _

source

pub const CMYK11_16: PixelFormat = _

source

pub const CMYK11_16_SE: PixelFormat = _

source

pub const KYMC11_8: PixelFormat = _

source

pub const KYMC11_16: PixelFormat = _

source

pub const KYMC11_16_SE: PixelFormat = _

source

pub const CMYK12_8: PixelFormat = _

source

pub const CMYK12_16: PixelFormat = _

source

pub const CMYK12_16_SE: PixelFormat = _

source

pub const KYMC12_8: PixelFormat = _

source

pub const KYMC12_16: PixelFormat = _

source

pub const KYMC12_16_SE: PixelFormat = _

source

pub const XYZ_16: PixelFormat = _

source

pub const Lab_8: PixelFormat = _

source

pub const LabV2_8: PixelFormat = _

source

pub const ALab_8: PixelFormat = _

source

pub const ALabV2_8: PixelFormat = _

source

pub const Lab_16: PixelFormat = _

source

pub const LabV2_16: PixelFormat = _

source

pub const Yxy_16: PixelFormat = _

source

pub const YCbCr_8: PixelFormat = _

source

pub const YCbCr_8_PLANAR: PixelFormat = _

source

pub const YCbCr_16: PixelFormat = _

source

pub const YCbCr_16_PLANAR: PixelFormat = _

source

pub const YCbCr_16_SE: PixelFormat = _

source

pub const YUV_8: PixelFormat = _

source

pub const YUV_8_PLANAR: PixelFormat = _

source

pub const YUV_16: PixelFormat = _

source

pub const YUV_16_PLANAR: PixelFormat = _

source

pub const YUV_16_SE: PixelFormat = _

source

pub const HLS_8: PixelFormat = _

source

pub const HLS_8_PLANAR: PixelFormat = _

source

pub const HLS_16: PixelFormat = _

source

pub const HLS_16_PLANAR: PixelFormat = _

source

pub const HLS_16_SE: PixelFormat = _

source

pub const HSV_8: PixelFormat = _

source

pub const HSV_8_PLANAR: PixelFormat = _

source

pub const HSV_16: PixelFormat = _

source

pub const HSV_16_PLANAR: PixelFormat = _

source

pub const HSV_16_SE: PixelFormat = _

source

pub const NAMED_COLOR_INDEX: PixelFormat = _

source

pub const XYZ_FLT: PixelFormat = _

source

pub const Lab_FLT: PixelFormat = _

source

pub const LabA_FLT: PixelFormat = _

source

pub const GRAY_FLT: PixelFormat = _

source

pub const RGB_FLT: PixelFormat = _

source

pub const RGBA_FLT: PixelFormat = _

source

pub const ARGB_FLT: PixelFormat = _

source

pub const BGR_FLT: PixelFormat = _

source

pub const BGRA_FLT: PixelFormat = _

source

pub const CMYK_FLT: PixelFormat = _

source

pub const XYZ_DBL: PixelFormat = _

source

pub const Lab_DBL: PixelFormat = _

source

pub const GRAY_DBL: PixelFormat = _

source

pub const RGB_DBL: PixelFormat = _

source

pub const BGR_DBL: PixelFormat = _

source

pub const CMYK_DBL: PixelFormat = _

source

pub const GRAY_HALF_FLT: PixelFormat = _

source

pub const RGB_HALF_FLT: PixelFormat = _

source

pub const RGBA_HALF_FLT: PixelFormat = _

source

pub const CMYK_HALF_FLT: PixelFormat = _

source

pub const ARGB_HALF_FLT: PixelFormat = _

source

pub const BGR_HALF_FLT: PixelFormat = _

source

pub const BGRA_HALF_FLT: PixelFormat = _

source

pub fn premultiplied(&self) -> bool

M: Premultiplied alpha (only works when extra samples is 1)

source

pub fn float(&self) -> bool

A: Floating point – With this flag we can differentiate 16 bits as float and as int

source

pub fn optimized(&self) -> bool

O: Optimized – previous optimization already returns the final 8-bit value

source

pub fn pixel_type(&self) -> PixelType

T: Color space (PT_*)

source

pub fn swapfirst(&self) -> bool

Y: Swap first - changes ABGR to BGRA and KCMY to CMYK

source

pub fn min_is_white(&self) -> bool

F: Flavor 0=MinIsBlack(Chocolate) 1=MinIsWhite(Vanilla)

source

pub fn planar(&self) -> bool

P: Planar? 0=Chunky, 1=Planar

source

pub fn endian16(&self) -> bool

X: swap 16 bps endianness?

source

pub fn doswap(&self) -> bool

S: Do swap? ie, BGR, KYMC

source

pub fn extra(&self) -> usize

E: Extra samples

source

pub fn channels(&self) -> usize

C: Channels (Samples per pixel)

source

pub fn bytes_per_channel(&self) -> usize

B: bytes per sample

source

pub fn bytes_per_pixel(&self) -> usize

size of pixel

Trait Implementations§

source§

impl Clone for PixelFormat

source§

fn clone(&self) -> PixelFormat

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PixelFormat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for PixelFormat

source§

fn eq(&self, other: &PixelFormat) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for PixelFormat

source§

impl Eq for PixelFormat

source§

impl StructuralPartialEq for PixelFormat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.