Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept, PixelValueConcept, HomogeneousPixelBasedConcept. More...
#include <pixel.hpp>
Inherits homogeneous_color_base< Element, Layout, K >.
Public Types | |
using | value_type = pixel< ChannelValue, Layout > |
using | reference = value_type & |
using | const_reference = value_type const & |
Public Member Functions | |
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= (pixel const &p) |
template<typename Pixel > | |
pixel (Pixel const &p, typename std::enable_if< is_pixel< Pixel >::value >::type *=nullptr) | |
template<typename Pixel > | |
pixel & | operator= (Pixel const &p) |
template<typename Pixel > | |
bool | operator== (Pixel const &p) const |
template<typename Pixel > | |
bool | operator!= (Pixel const &p) const |
auto | operator[] (std::size_t index) -> typename channel_traits< channel_t >::reference |
auto | operator[] (std::size_t index) const -> typename channel_traits< channel_t >::const_reference |
pixel & | operator= (channel_t channel) |
bool | operator== (channel_t channel) const |
Static Public Attributes | |
static constexpr bool | is_mutable = channel_traits<channel_t>::is_mutable |
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)
ChannelValue | TODO |
Layout | mp11::make_integer_sequence<int, ColorSpace::size> |