Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
color_element_type, color_element_reference_type, color_element_const_reference_type, get_color, contains_color

get_color: Named channel accessors More...

Classes

struct  boost::gil::contains_color< ColorBase, Color >
 A predicate metafunction determining whether a given color base contains a given color. More...
 
struct  boost::gil::color_element_type< ColorBase, Color >
 Specifies the type of the element associated with a given color tag. More...
 
struct  boost::gil::color_element_reference_type< ColorBase, Color >
 Specifies the return type of the mutable element accessor by color name, get_color(color_base, Color());. More...
 
struct  boost::gil::color_element_const_reference_type< ColorBase, Color >
 Specifies the return type of the constant element accessor by color name, get_color(color_base, Color());. More...
 

Functions

template<typename ColorBase , typename Color >
color_element_reference_type
< ColorBase, Color >::type 
boost::gil::get_color (ColorBase &cb, Color=Color())
 Mutable accessor to the element associated with a given color name. More...
 
template<typename ColorBase , typename Color >
color_element_const_reference_type
< ColorBase, Color >::type 
boost::gil::get_color (const ColorBase &cb, Color=Color())
 Constant accessor to the element associated with a given color name. More...
 

Detailed Description

get_color: Named channel accessors

Support for accessing the elements of a color base by color name

Example: A function that takes a generic pixel containing a red channel and sets it to 100%:

template <typename Pixel>
void set_red_to_max(Pixel& pixel) {
boost::function_requires<MutablePixelConcept<Pixel> >();
typedef typename color_element_type<Pixel, red_t>::type red_channel_t;
}

Function Documentation

template<typename ColorBase , typename Color >
color_element_const_reference_type<ColorBase,Color>::type boost::gil::get_color ( const ColorBase &  cb,
Color  = Color() 
)