[−][src]Trait pix::Format
Pixel format determines bit depth (Channel), color components, alpha mode, and gamma mode.
The naming scheme for type aliases goes:
Sep
/Assoc
for separated and associated alpha.L
/S
for linear gamma colorspace and sRGB gamma colorspace.Gray
/Mask
/Rgb
for Gray, Mask, and Rgb.8
/16
/32
for 8-bit integer, 16-bit integer, and 32-bit floating-point pixel formats.
The following types are defined:
- Gray: Gray8, Gray16, Gray32, GrayAlpha8, GrayAlpha16, GrayAlpha32
- SGray
- SepSGray: SepSGray8, SepSGray16, SepSGray32, SepSGrayAlpha8, SepSGrayAlpha16, SepSGrayAlpha32
- AssocSGray: AssocSGrayAlpha8, AssocSGrayAlpha16, AssocSGrayAlpha32
- LGray
- SepLGray: SepLGray8, SepLGray16, SepLGray32, SepLGrayAlpha8, SepLGrayAlpha16, SepLGrayAlpha32
- AssocLGray: AssocLGrayAlpha8, AssocLGrayAlpha16, AssocLGrayAlpha32
- Mask: Mask8, Mask16, Mask32
- Rgb: Rgb8, Rgb16, Rgb32, Rgba8, Rgba16, Rgba32
- SRgb
- SepSRgb: SepSRgb8, SepSRgb16, SepSRgb32, SepSRgba8, SepSRgba16, SepSRgba32
- AssocSRgb: AssocSRgba8, AssocSRgba16, AssocSRgba32
- LRgb
- SepLRgb: SepLRgb8, SepLRgb16, SepLRgb32, SepLRgba8, SepLRgba16, SepLRgba32
- AssocLRgb: AssocLRgba8, AssocLRgba16, AssocLRgba32
Associated Types
Loading content...Required methods
fn rgba(self) -> [Self::Chan; 4]
Get red, green, blue and alpha Channel
s
fn with_rgba(rgba: [Self::Chan; 4]) -> Self
Make a pixel with given RGBA Channel
s
fn difference(self, rhs: Self) -> Self
Get channel-wise difference
fn within_threshold(self, rhs: Self) -> bool
Check if all Channel
s are within threshold
Provided methods
fn convert<C, F>(self) -> F where
F: Format<Chan = C>,
C: Channel + From<Self::Chan>,
F: Format<Chan = C>,
C: Channel + From<Self::Chan>,
Convert a pixel from one Format
to another
p
Source pixel to convert.
Implementors
impl<C, A> Format for Mask<A> where
C: Channel,
A: Alpha<Chan = C> + From<C>,
[src]
C: Channel,
A: Alpha<Chan = C> + From<C>,
type Chan = C
fn rgba(self) -> [Self::Chan; 4]
[src]
Get red, green, blue and alpha Channel
s
fn with_rgba(rgba: [Self::Chan; 4]) -> Self
[src]
Make a pixel with given RGBA Channel
s
fn difference(self, rhs: Self) -> Self
[src]
Get channel-wise difference
fn within_threshold(self, rhs: Self) -> bool
[src]
Check if all Channel
s are within threshold
impl<C, A, M, G: GammaMode> Format for Rgb<C, A, M, G> where
C: Channel,
A: Alpha<Chan = C> + From<C>,
M: AlphaMode,
[src]
C: Channel,
A: Alpha<Chan = C> + From<C>,
M: AlphaMode,
type Chan = C
fn rgba(self) -> [Self::Chan; 4]
[src]
Get red, green, blue and alpha Channel
s
fn with_rgba(rgba: [Self::Chan; 4]) -> Self
[src]
Make a pixel with given RGBA Channel
s
fn difference(self, rhs: Self) -> Self
[src]
Get channel-wise difference
fn within_threshold(self, rhs: Self) -> bool
[src]
Check if all Channel
s are within threshold
impl<C, A, M: AlphaMode, G: GammaMode> Format for Gray<C, A, M, G> where
C: Channel,
A: Alpha<Chan = C> + From<C>,
[src]
C: Channel,
A: Alpha<Chan = C> + From<C>,
type Chan = C
fn rgba(self) -> [Self::Chan; 4]
[src]
Get red, green, blue and alpha Channel
s
fn with_rgba(rgba: [Self::Chan; 4]) -> Self
[src]
Make a pixel with given RGBA Channel
s
fn difference(self, rhs: Self) -> Self
[src]
Get channel-wise difference
fn within_threshold(self, rhs: Self) -> bool
[src]
Check if all Channel
s are within threshold