Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::gil::pixel< ChannelValue, Layout > Struct Template Reference

Represents a pixel value (a container of channels). More...

#include <typedefs.hpp>

Inheritance diagram for boost::gil::pixel< ChannelValue, Layout >:
Collaboration diagram for boost::gil::pixel< ChannelValue, Layout >:

Public Types

typedef pixel value_type
 
typedef value_typereference
 
typedef const value_typeconst_reference
 

Public Member Functions

 BOOST_STATIC_CONSTANT (bool, is_mutable=channel_traits< channel_t >::is_mutable)
 
 pixel ()
 
 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)
 
pixeloperator= (const pixel &p)
 
template<typename Pixel >
 pixel (const Pixel &p, typename enable_if_c< is_pixel< Pixel >::value >::type *dummy=0)
 
template<typename P >
pixeloperator= (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
 
pixeloperator= (channel_t chan)
 
bool operator== (channel_t chan) const
 

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)

Member Typedef Documentation

template<typename ChannelValue, typename Layout>
typedef const value_type& boost::gil::pixel< ChannelValue, Layout >::const_reference
template<typename ChannelValue, typename Layout>
typedef value_type& boost::gil::pixel< ChannelValue, Layout >::reference
template<typename ChannelValue, typename Layout>
typedef pixel boost::gil::pixel< ChannelValue, Layout >::value_type

Constructor & Destructor Documentation

template<typename ChannelValue, typename Layout>
boost::gil::pixel< ChannelValue, Layout >::pixel ( )
inline
template<typename ChannelValue, typename Layout>
boost::gil::pixel< ChannelValue, Layout >::pixel ( channel_t  v)
inlineexplicit
template<typename ChannelValue, typename Layout>
boost::gil::pixel< ChannelValue, Layout >::pixel ( channel_t  v0,
channel_t  v1 
)
inline
template<typename ChannelValue, typename Layout>
boost::gil::pixel< ChannelValue, Layout >::pixel ( channel_t  v0,
channel_t  v1,
channel_t  v2 
)
inline
template<typename ChannelValue, typename Layout>
boost::gil::pixel< ChannelValue, Layout >::pixel ( channel_t  v0,
channel_t  v1,
channel_t  v2,
channel_t  v3 
)
inline
template<typename ChannelValue, typename Layout>
boost::gil::pixel< ChannelValue, Layout >::pixel ( channel_t  v0,
channel_t  v1,
channel_t  v2,
channel_t  v3,
channel_t  v4 
)
inline
template<typename ChannelValue, typename Layout>
boost::gil::pixel< ChannelValue, Layout >::pixel ( channel_t  v0,
channel_t  v1,
channel_t  v2,
channel_t  v3,
channel_t  v4,
channel_t  v5 
)
inline
template<typename ChannelValue, typename Layout>
boost::gil::pixel< ChannelValue, Layout >::pixel ( const pixel< ChannelValue, Layout > &  p)
inline
template<typename ChannelValue, typename Layout>
template<typename Pixel >
boost::gil::pixel< ChannelValue, Layout >::pixel ( const Pixel &  p,
typename enable_if_c< is_pixel< Pixel >::value >::type dummy = 0 
)
inline

Member Function Documentation

template<typename ChannelValue, typename Layout>
boost::gil::pixel< ChannelValue, Layout >::BOOST_STATIC_CONSTANT ( bool  ,
is_mutable  = channel_traits< channel_t >::is_mutable 
)
template<typename ChannelValue, typename Layout>
template<typename P >
bool boost::gil::pixel< ChannelValue, Layout >::operator!= ( const P &  p) const
inline
template<typename ChannelValue, typename Layout>
pixel& boost::gil::pixel< ChannelValue, Layout >::operator= ( const pixel< ChannelValue, Layout > &  p)
inline
template<typename ChannelValue, typename Layout>
template<typename P >
pixel& boost::gil::pixel< ChannelValue, Layout >::operator= ( const P &  p)
inline
template<typename ChannelValue, typename Layout>
pixel& boost::gil::pixel< ChannelValue, Layout >::operator= ( channel_t  chan)
inline
template<typename ChannelValue, typename Layout>
template<typename P >
bool boost::gil::pixel< ChannelValue, Layout >::operator== ( const P &  p) const
inline
template<typename ChannelValue, typename Layout>
bool boost::gil::pixel< ChannelValue, Layout >::operator== ( channel_t  chan) const
inline
template<typename ChannelValue, typename Layout>
channel_traits<channel_t>::reference boost::gil::pixel< ChannelValue, Layout >::operator[] ( std::size_t  i)
inline
template<typename ChannelValue, typename Layout>
channel_traits<channel_t>::const_reference boost::gil::pixel< ChannelValue, Layout >::operator[] ( std::size_t  i) const
inline

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