boost::gil::ChannelConcept

A channel is the building block of a color. Color is defined as a mixture of primary colors and a channel defines the degree to which each primary color is used in the mixture.

Synopsis

template<typename T>
struct ChannelConcept;

Description

For example, in the RGB color space, using 8‐bit unsigned channels, the color red is defined as [255 0 0], which means maximum of Red, and no Green and Blue.

Built‐in scalar types, such as int and float, are valid GIL channels. In more complex scenarios, channels may be represented as bit ranges or even individual bits. In such cases special classes are needed to represent the value and reference to a channel.

Channels have a traits class, channel_traits, which defines their associated types as well as their operating ranges.

concept ChannelConcept<typename T> : EqualityComparable<T>
{
    typename value_type      = T;        // use channel_traits<T>::value_type to access it
    typename reference       = T&;       // use channel_traits<T>::reference to access it
    typename pointer         = T*;       // use channel_traits<T>::pointer to access it
    typename const_reference = const T&; // use channel_traits<T>::const_reference to access it
    typename const_pointer   = const T*; // use channel_traits<T>::const_pointer to access it
    static const bool is_mutable;        // use channel_traits<T>::is_mutable to access it

    static T min_value();                // use channel_traits<T>::min_value to access it
    static T max_value();                // use channel_traits<T>::max_value to access it
};

Member Functions

Data Members

Name

c

Created with MrDocs