pixel Class Template Reference
[Pixel]

#include <pixel.hpp>

List of all members.


Detailed Description

template<typename T, typename C>
class pixel< T, C >

Represents a pixel value (a container of channels).

Models: PixelValueConcept

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>()


Public Types

typedef C color_space_t
typedef channel_traits< T
>::value_type 
channel_t
typedef channel_traits< T
>::reference 
channel_reference
typedef channel_traits< T
>::const_reference 
channel_const_reference
typedef pixel< channel_t,
color_space_t > 
pixel_value_type
typedef pixel_value_typepixel_reference
typedef const pixel_value_typepixel_const_reference

Public Member Functions

 pixel (T v)
 pixel (T v0, T v1)
 pixel (T v0, T v1, T v2)
 pixel (T v0, T v1, T v2, T v3)
 pixel (T v0, T v1, T v2, T v3, T v4)
 pixel (T v0, T v1, T v2, T v3, T v4, T v5)
 pixel (const pixel &p)
template<typename T1, typename C1>
 pixel (const pixel< T1, C1 > &p)
template<typename TR1, typename C1>
 pixel (const planar_ref< TR1, C1 > &p)
pixeloperator= (const pixel &p)
template<typename TR1, typename C1>
pixeloperator= (const planar_ref< TR1, C1 > &p)
pixeloperator= (T chan)
template<typename P>
bool operator== (const P &p) const
template<typename P>
bool operator!= (const P &p) const
channel_reference operator[] (std::size_t i)
channel_const_reference operator[] (std::size_t i) const
template<int N>
channel_reference channel ()
template<int N>
channel_const_reference channel () const
template<int N>
channel_reference semantic_channel ()
template<int N>
channel_const_reference semantic_channel () const

Static Public Attributes

static const int num_channels = color_space_t::num_channels

The documentation for this class was generated from the following file:

Copyright © 2006 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google