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
impl PixelFormat
pub const GRAY_8: PixelFormat = _
pub const GRAY_8_REV: PixelFormat = _
pub const GRAY_16: PixelFormat = _
pub const GRAY_16_REV: PixelFormat = _
pub const GRAY_16_SE: PixelFormat = _
pub const GRAYA_8: PixelFormat = _
pub const GRAYA_16: PixelFormat = _
pub const GRAYA_16_SE: PixelFormat = _
pub const GRAYA_8_PLANAR: PixelFormat = _
pub const GRAYA_16_PLANAR: PixelFormat = _
pub const RGB_8: PixelFormat = _
pub const RGB_8_PLANAR: PixelFormat = _
pub const BGR_8: PixelFormat = _
pub const BGR_8_PLANAR: PixelFormat = _
pub const RGB_16: PixelFormat = _
pub const RGB_16_PLANAR: PixelFormat = _
pub const RGB_16_SE: PixelFormat = _
pub const BGR_16: PixelFormat = _
pub const BGR_16_PLANAR: PixelFormat = _
pub const BGR_16_SE: PixelFormat = _
pub const RGBA_8: PixelFormat = _
pub const RGBA_8_PLANAR: PixelFormat = _
pub const RGBA_16: PixelFormat = _
pub const RGBA_16_PLANAR: PixelFormat = _
pub const RGBA_16_SE: PixelFormat = _
pub const ARGB_8: PixelFormat = _
pub const ARGB_8_PLANAR: PixelFormat = _
pub const ARGB_16: PixelFormat = _
pub const ABGR_8: PixelFormat = _
pub const ABGR_8_PLANAR: PixelFormat = _
pub const ABGR_16: PixelFormat = _
pub const ABGR_16_PLANAR: PixelFormat = _
pub const ABGR_16_SE: PixelFormat = _
pub const BGRA_8: PixelFormat = _
pub const BGRA_8_PLANAR: PixelFormat = _
pub const BGRA_16: PixelFormat = _
pub const BGRA_16_SE: PixelFormat = _
pub const CMY_8: PixelFormat = _
pub const CMY_8_PLANAR: PixelFormat = _
pub const CMY_16: PixelFormat = _
pub const CMY_16_PLANAR: PixelFormat = _
pub const CMY_16_SE: PixelFormat = _
pub const CMYK_8: PixelFormat = _
pub const CMYKA_8: PixelFormat = _
pub const CMYK_8_REV: PixelFormat = _
pub const CMYK_8_PLANAR: PixelFormat = _
pub const CMYK_16: PixelFormat = _
pub const CMYK_16_REV: PixelFormat = _
pub const CMYK_16_PLANAR: PixelFormat = _
pub const CMYK_16_SE: PixelFormat = _
pub const KYMC_8: PixelFormat = _
pub const KYMC_16: PixelFormat = _
pub const KYMC_16_SE: PixelFormat = _
pub const KCMY_8: PixelFormat = _
pub const KCMY_8_REV: PixelFormat = _
pub const KCMY_16: PixelFormat = _
pub const KCMY_16_REV: PixelFormat = _
pub const KCMY_16_SE: PixelFormat = _
pub const CMYK5_8: PixelFormat = _
pub const CMYK5_16: PixelFormat = _
pub const CMYK5_16_SE: PixelFormat = _
pub const KYMC5_8: PixelFormat = _
pub const KYMC5_16: PixelFormat = _
pub const KYMC5_16_SE: PixelFormat = _
pub const CMYK6_8: PixelFormat = _
pub const CMYK6_8_PLANAR: PixelFormat = _
pub const CMYK6_16: PixelFormat = _
pub const CMYK6_16_PLANAR: PixelFormat = _
pub const CMYK6_16_SE: PixelFormat = _
pub const CMYK7_8: PixelFormat = _
pub const CMYK7_16: PixelFormat = _
pub const CMYK7_16_SE: PixelFormat = _
pub const KYMC7_8: PixelFormat = _
pub const KYMC7_16: PixelFormat = _
pub const KYMC7_16_SE: PixelFormat = _
pub const CMYK8_8: PixelFormat = _
pub const CMYK8_16: PixelFormat = _
pub const CMYK8_16_SE: PixelFormat = _
pub const KYMC8_8: PixelFormat = _
pub const KYMC8_16: PixelFormat = _
pub const KYMC8_16_SE: PixelFormat = _
pub const CMYK9_8: PixelFormat = _
pub const CMYK9_16: PixelFormat = _
pub const CMYK9_16_SE: PixelFormat = _
pub const KYMC9_8: PixelFormat = _
pub const KYMC9_16: PixelFormat = _
pub const KYMC9_16_SE: PixelFormat = _
pub const CMYK10_8: PixelFormat = _
pub const CMYK10_16: PixelFormat = _
pub const CMYK10_16_SE: PixelFormat = _
pub const KYMC10_8: PixelFormat = _
pub const KYMC10_16: PixelFormat = _
pub const KYMC10_16_SE: PixelFormat = _
pub const CMYK11_8: PixelFormat = _
pub const CMYK11_16: PixelFormat = _
pub const CMYK11_16_SE: PixelFormat = _
pub const KYMC11_8: PixelFormat = _
pub const KYMC11_16: PixelFormat = _
pub const KYMC11_16_SE: PixelFormat = _
pub const CMYK12_8: PixelFormat = _
pub const CMYK12_16: PixelFormat = _
pub const CMYK12_16_SE: PixelFormat = _
pub const KYMC12_8: PixelFormat = _
pub const KYMC12_16: PixelFormat = _
pub const KYMC12_16_SE: PixelFormat = _
pub const XYZ_16: PixelFormat = _
pub const Lab_8: PixelFormat = _
pub const LabV2_8: PixelFormat = _
pub const ALab_8: PixelFormat = _
pub const ALabV2_8: PixelFormat = _
pub const Lab_16: PixelFormat = _
pub const LabV2_16: PixelFormat = _
pub const Yxy_16: PixelFormat = _
pub const YCbCr_8: PixelFormat = _
pub const YCbCr_8_PLANAR: PixelFormat = _
pub const YCbCr_16: PixelFormat = _
pub const YCbCr_16_PLANAR: PixelFormat = _
pub const YCbCr_16_SE: PixelFormat = _
pub const YUV_8: PixelFormat = _
pub const YUV_8_PLANAR: PixelFormat = _
pub const YUV_16: PixelFormat = _
pub const YUV_16_PLANAR: PixelFormat = _
pub const YUV_16_SE: PixelFormat = _
pub const HLS_8: PixelFormat = _
pub const HLS_8_PLANAR: PixelFormat = _
pub const HLS_16: PixelFormat = _
pub const HLS_16_PLANAR: PixelFormat = _
pub const HLS_16_SE: PixelFormat = _
pub const HSV_8: PixelFormat = _
pub const HSV_8_PLANAR: PixelFormat = _
pub const HSV_16: PixelFormat = _
pub const HSV_16_PLANAR: PixelFormat = _
pub const HSV_16_SE: PixelFormat = _
pub const NAMED_COLOR_INDEX: PixelFormat = _
pub const XYZ_FLT: PixelFormat = _
pub const Lab_FLT: PixelFormat = _
pub const LabA_FLT: PixelFormat = _
pub const GRAY_FLT: PixelFormat = _
pub const RGB_FLT: PixelFormat = _
pub const RGBA_FLT: PixelFormat = _
pub const ARGB_FLT: PixelFormat = _
pub const BGR_FLT: PixelFormat = _
pub const BGRA_FLT: PixelFormat = _
pub const CMYK_FLT: PixelFormat = _
pub const XYZ_DBL: PixelFormat = _
pub const Lab_DBL: PixelFormat = _
pub const GRAY_DBL: PixelFormat = _
pub const RGB_DBL: PixelFormat = _
pub const BGR_DBL: PixelFormat = _
pub const CMYK_DBL: PixelFormat = _
pub const GRAY_HALF_FLT: PixelFormat = _
pub const RGB_HALF_FLT: PixelFormat = _
pub const RGBA_HALF_FLT: PixelFormat = _
pub const CMYK_HALF_FLT: PixelFormat = _
pub const ARGB_HALF_FLT: PixelFormat = _
pub const BGR_HALF_FLT: PixelFormat = _
pub const BGRA_HALF_FLT: PixelFormat = _
sourcepub fn premultiplied(&self) -> bool
pub fn premultiplied(&self) -> bool
M: Premultiplied alpha (only works when extra samples is 1)
sourcepub fn float(&self) -> bool
pub fn float(&self) -> bool
A: Floating point – With this flag we can differentiate 16 bits as float and as int
sourcepub fn optimized(&self) -> bool
pub fn optimized(&self) -> bool
O: Optimized – previous optimization already returns the final 8-bit value
sourcepub fn pixel_type(&self) -> PixelType
pub fn pixel_type(&self) -> PixelType
T: Color space (PT_*
)
sourcepub fn min_is_white(&self) -> bool
pub fn min_is_white(&self) -> bool
F: Flavor 0=MinIsBlack(Chocolate) 1=MinIsWhite(Vanilla)
sourcepub fn bytes_per_channel(&self) -> usize
pub fn bytes_per_channel(&self) -> usize
B: bytes per sample
sourcepub fn bytes_per_pixel(&self) -> usize
pub fn bytes_per_pixel(&self) -> usize
size of pixel
Trait Implementations§
source§impl Clone for PixelFormat
impl Clone for PixelFormat
source§fn clone(&self) -> PixelFormat
fn clone(&self) -> PixelFormat
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PixelFormat
impl Debug for PixelFormat
source§impl PartialEq for PixelFormat
impl PartialEq for PixelFormat
source§fn eq(&self, other: &PixelFormat) -> bool
fn eq(&self, other: &PixelFormat) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for PixelFormat
impl Eq for PixelFormat
impl StructuralPartialEq for PixelFormat
Auto Trait Implementations§
impl RefUnwindSafe for PixelFormat
impl Send for PixelFormat
impl Sync for PixelFormat
impl Unpin for PixelFormat
impl UnwindSafe for PixelFormat
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more