Crate rgb [−] [src]
Basic struct for RGB
and RGBA
pixels. Packed, with red first, alpha last.
This crate is intended to be the lowest common denominator for sharing RGB
/RGBA
bitmaps between other crates.
The crate includes convenience functions for converting between the struct and bytes, and overloaded operators that work on all channels at once.
This crate intentionally doesn't implement color management and other colorspaces.
Structs
RGB | |
RGBA |
Traits
ComponentBytes |
Casting the struct to slices/bytes of its components |
ComponentMap |
Applying operation to every component |
Type Definitions
RGB16 |
16-bit RGB in machine's native endian. Be careful to perform byte-swapping when reading from files. |
RGB8 |
8-bit RGB. The colorspace is techincally undefined, but generally sRGB is assumed. |
RGBA16 | |
RGBA8 |
Alpha is last. The crate doesn't impose which value represents transparency, but usually it's 0 = transparent, 255 = opaque. |