Generic Image Library : pixel Struct Template Reference

Modules | Alphabetical List | Class List | Directories | File List | File Members | GIL Home Page

# pixel Struct Template Reference
[pixel, pixel, Models]

`#include <pixel.hpp>`

List of all members.

## Detailed Description

### template<typename ChannelValue, typename Layout>
struct boost::gil::pixel< ChannelValue, Layout >

Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept.

A pixel is a set of channels defining the color at a given point in an image. Conceptually, a pixel is little more than a color base whose elements model `ChannelConcept`. The class `pixel` defines a simple, homogeneous pixel value. It is used to store the value of a color. The built-in C++ references to `pixel`, `pixel&` and `const` `pixel&` are used to represent a reference to a pixel inside an interleaved image view (a view in which all channels are together in memory). Similarly, built-in pointer types `pixel*` and `const` `pixel*` are used as the standard iterator over a row of interleaved homogeneous pixels.

Since `pixel` inherits the properties of color base, assigning, equality comparison and copy-construcion are allowed between compatible pixels. This means that an 8-bit RGB pixel may be assigned to an 8-bit BGR pixel, or to an 8-bit planar reference. The channels are properly paired semantically.

The single-channel (grayscale) instantiation of the class pixel, (i.e. `pixel<T,gray_layout_t>`) is also convertible to/from a channel value. This allows grayscale pixels to be used in simpler expressions like *gray_pix1 = *gray_pix2 instead of more complicated at_c<0>(gray_pix1) = at_c<0>(gray_pix2) or get_color<gray_color_t>(gray_pix1) = get_color<gray_color_t>(gray_pix2)

## Public Types

typedef pixel | value_type
typedef value_type & | reference
typedef const value_type & | const_reference

## Public Member Functions

| BOOST_STATIC_CONSTANT (bool, is_mutable=channel_traits< channel_t >::is_mutable)
| pixel (channel_t v)
| pixel (channel_t v0, channel_t v1)
| pixel (channel_t v0, channel_t v1, channel_t v2)
| pixel (channel_t v0, channel_t v1, channel_t v2, channel_t v3)
| pixel (channel_t v0, channel_t v1, channel_t v2, channel_t v3, channel_t v4)
| pixel (channel_t v0, channel_t v1, channel_t v2, channel_t v3, channel_t v4, channel_t v5)
| pixel (const pixel &p)
pixel & | operator= (const pixel &p)
template<typename Pixel>
| pixel (const Pixel &p, typename enable_if_c< is_pixel< Pixel >::value >::type *dummy=0)
template<typename P>
pixel & | operator= (const P &p)
template<typename P>
bool | operator== (const P &p) const
template<typename P>
bool | operator!= (const P &p) const
channel_traits< channel_t >::reference | operator[] (std::size_t i)
channel_traits< channel_t >::const_reference | operator[] (std::size_t i) const
pixel & | operator= (channel_t chan)
bool | operator== (channel_t chan) const

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

- pixel.hpp