Information
MediaSupport
RSSOther Adobe ProjectsOther Resources |
pixel< T, C > Class Template ReferenceRepresents a pixel value (a container of channels).
More...
|
Public Types | |
typedef channel_traits< T >::const_reference | channel_const_reference |
typedef channel_traits< T >::reference | channel_reference |
typedef channel_traits< T >::value_type | channel_t |
typedef C | color_space_t |
typedef pixel< channel_t, color_space_t > | pixel_value_type |
Public Member Functions | |
template<int N> | |
channel_const_reference | channel () const |
template<int N> | |
channel_reference | channel () |
template<typename P> | |
bool | operator!= (const P &p) const |
pixel & | operator= (T chan) |
template<typename TR1, typename C1> | |
pixel & | operator= (const planar_ref< TR1, C1 > &p) |
pixel & | operator= (const pixel &p) |
template<typename P> | |
bool | operator== (const P &p) const |
channel_const_reference | operator[] (std::size_t i) const |
channel_reference | operator[] (std::size_t i) |
template<typename TR1, typename C1> | |
pixel (const planar_ref< TR1, C1 > &p) | |
template<typename T1, typename C1> | |
pixel (const pixel< T1, C1 > &p) | |
pixel (const pixel &p) | |
pixel (T v0, T v1, T v2, T v3, T v4) | |
pixel (T v0, T v1, T v2, T v3) | |
pixel (T v0, T v1, T v2) | |
pixel (T v0, T v1) | |
pixel (T v) | |
pixel () | |
template<int N> | |
channel_const_reference | semantic_channel () const |
template<int N> | |
channel_reference | semantic_channel () |
Static Public Attributes | |
static const int | num_channels |
Classes | |
struct | kth_channel_t |
Pixels are first class objects; dereferencing, assignment, copy construction, etc. are defined and behave as expected.
Pixel values are represented as specializations of the pixel struct. Multi-channel pixels may have different channel ordering (RGB vs BGR for example). Each channel ordering is represented as a separate specialization of pixel
Interleaved pixels have channels that are consecutive in memory. Therefore their pointers and references are built-in pointers and references to the value structs. Planar pixels, on the other hand, represent non-consecutive channels and thus pointers and references to planar pixels are represented by special classes.
Pointers, references, values, color spaces and channel types of pixels are defined in iterator_traits of pixel iterators. Its base class, color_base, provides color-space specific channels. The pixel class provides per-channel operations that depend on the number of components but not on the specifics of the color space. For example, the same code is used to compare two BGR pixels, two LAB pixels and two planar pointers to RGB pixels. Per-channel operations are implemented as compile-time recursions. The binary per-channel operations pair channels semantically and not based on their order in memory. For example a binary operation between RGB and BGR color bases will properly pair the first channel of RGB to the third channel of BGR. This is done by using the semantic channel accessors semantic_channel<N>()