Boost GIL


Classes
packed_pixel

A heterogeneous pixel used to represent packed pixels with non-byte-aligned channels. Models PixelValueConcept. More...

Classes

struct  packed_pixel< BitField, ChannelRefs, Layout >
 Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and their index. Models ColorBaseValueConcept, PixelValueConcept, PixelBasedConcept Typical use for this is a model of a packed pixel (like 565 RGB) More...
 

Detailed Description

A heterogeneous pixel used to represent packed pixels with non-byte-aligned channels. Models PixelValueConcept.

Example:

using rgb565_pixel_t = packed_pixel_type<uint16_t, mp11::mp_list-c<unsigned,5,6,5>, rgb_layout_t>::type;
static_assert(sizeof(rgb565_pixel_t) == 2, "");
rgb565_pixel_t r565;
get_color(r565,red_t()) = 31;
get_color(r565,green_t()) = 63;
get_color(r565,blue_t()) = 31;
assert(r565 == rgb565_pixel_t((uint16_t)0xFFFF));