Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // the declaring pixel's type
- using pixel_type = PixelType;
- // this type
- using type = pixel_channel<pixel_type,ChannelTraits,Index,BitsToLeft>;
- // the name type for the channel
- using name_type = typename ChannelTraits::name_type;
- // the integer type for the channel
- using int_type = typename ChannelTraits::int_type;
- // the floating point type for the channel
- using real_type = typename ChannelTraits::real_type;
- // the declaring pixel's integer type
- using pixel_int_type = typename PixelType::int_type;
- // the number of bits to the left of this channel
- constexpr static const size_t bits_to_left = ChannelTraits::bit_depth!=0?BitsToLeft:0;
- // the total bits to the right of this channel including padding
- constexpr static const size_t total_bits_to_right = ChannelTraits::bit_depth!=0?sizeof(pixel_int_type)*8-BitsToLeft-ChannelTraits::bit_depth:0;
- // the bits to the right of this channel excluding padding
- constexpr static const size_t bits_to_right =ChannelTraits::bit_depth!=0?total_bits_to_right-PixelType::pad_right_bits:0;
- // the name of the channel
- constexpr static inline const char* name() { return ChannelTraits::name(); }
- // the bit depth of the channel
- constexpr static const size_t bit_depth = ChannelTraits::bit_depth;
- // the mask of the channel's value
- constexpr static const int_type value_mask = ChannelTraits::mask;
- // the mask of the channel's value within the entire pixel's value
- constexpr static const pixel_int_type channel_mask = (value_mask>0)?pixel_int_type(pixel_int_type(value_mask)<<total_bits_to_right):pixel_int_type(0);
- // the minimum value for the channel
- constexpr static const int_type min = ChannelTraits::min;
- // the maximum value for the channel
- constexpr static const int_type max = ChannelTraits::max;
- // the default value for the channel
- constexpr static const int_type default_ = ChannelTraits::default_;
- // the scale denominator
- constexpr static const int_type scale = ChannelTraits::scale;
- // the reciprocal of the scale denominator
- constexpr static const real_type scaler = ChannelTraits::scaler;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement