Boost GIL


channel.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3 
4  Use, modification and distribution are subject to the Boost Software License,
5  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6  http://www.boost.org/LICENSE_1_0.txt).
7 
8  See http://stlab.adobe.com/gil for most recent version including documentation.
9 */
10 
11 /*************************************************************************************************/
12 
13 #ifndef GIL_CHANNEL_HPP
14 #define GIL_CHANNEL_HPP
15 
26 
27 #include <limits>
28 #include <cassert>
29 
30 #include <boost/cstdint.hpp>
31 #include <boost/config.hpp>
32 #include <boost/integer/integer_mask.hpp>
33 #include <boost/type_traits/remove_cv.hpp>
34 
35 #include "gil_config.hpp"
36 #include "utilities.hpp"
37 
38 namespace boost { namespace gil {
39 
40 
55 
56 namespace detail {
57  template <typename T, bool is_class> struct channel_traits_impl;
58 
59  // channel traits for custom class
60  template <typename T>
61  struct channel_traits_impl<T, true> {
62  typedef typename T::value_type value_type;
63  typedef typename T::reference reference;
64  typedef typename T::pointer pointer;
65  typedef typename T::const_reference const_reference;
66  typedef typename T::const_pointer const_pointer;
67  BOOST_STATIC_CONSTANT(bool, is_mutable=T::is_mutable);
68  static value_type min_value() { return T::min_value(); }
69  static value_type max_value() { return T::max_value(); }
70  };
71 
72  // channel traits implementation for built-in integral or floating point channel type
73  template <typename T>
74  struct channel_traits_impl<T, false> {
75  typedef T value_type;
76  typedef T& reference;
77  typedef T* pointer;
78  typedef const T& const_reference;
79  typedef T const* const_pointer;
80  BOOST_STATIC_CONSTANT(bool, is_mutable=true);
81  static value_type min_value() { return (std::numeric_limits<T>::min)(); }
82  static value_type max_value() { return (std::numeric_limits<T>::max)(); }
83  };
84 
85  // channel traits implementation for constant built-in scalar or floating point type
86  template <typename T>
87  struct channel_traits_impl<const T, false> : public channel_traits_impl<T, false> {
88  typedef const T& reference;
89  typedef const T* pointer;
90  BOOST_STATIC_CONSTANT(bool, is_mutable=false);
91  };
92 }
93 
112 template <typename T>
113 struct channel_traits : public detail::channel_traits_impl<T, is_class<T>::value> {};
114 
115 // Channel traits for C++ reference type - remove the reference
116 template <typename T> struct channel_traits< T&> : public channel_traits<T> {};
117 
118 // Channel traits for constant C++ reference type
119 template <typename T> struct channel_traits<const T&> : public channel_traits<T> {
120  typedef typename channel_traits<T>::const_reference reference;
121  typedef typename channel_traits<T>::const_pointer pointer;
122  BOOST_STATIC_CONSTANT(bool, is_mutable=false);
123 };
124 
130 
151 template <typename BaseChannelValue, // base channel (models ChannelValueConcept)
154  typename MinVal, typename MaxVal> // classes with a static apply() function returning the minimum/maximum channel values
157  typedef value_type& reference;
158  typedef value_type* pointer;
159  typedef const value_type& const_reference;
160  typedef const value_type* const_pointer;
161  BOOST_STATIC_CONSTANT(bool, is_mutable=channel_traits<BaseChannelValue>::is_mutable);
162 
163  typedef BaseChannelValue base_channel_t;
164 
165  static value_type min_value() { return MinVal::apply(); }
166  static value_type max_value() { return MaxVal::apply(); }
167 
169  scoped_channel_value(const scoped_channel_value& c) : _value(c._value) {}
170  scoped_channel_value(BaseChannelValue val) : _value(val) {}
171 
172  scoped_channel_value& operator++() { ++_value; return *this; }
173  scoped_channel_value& operator--() { --_value; return *this; }
174 
175  scoped_channel_value operator++(int) { scoped_channel_value tmp=*this; this->operator++(); return tmp; }
176  scoped_channel_value operator--(int) { scoped_channel_value tmp=*this; this->operator--(); return tmp; }
177 
178  template <typename Scalar2> scoped_channel_value& operator+=(Scalar2 v) { _value+=v; return *this; }
179  template <typename Scalar2> scoped_channel_value& operator-=(Scalar2 v) { _value-=v; return *this; }
180  template <typename Scalar2> scoped_channel_value& operator*=(Scalar2 v) { _value*=v; return *this; }
181  template <typename Scalar2> scoped_channel_value& operator/=(Scalar2 v) { _value/=v; return *this; }
182 
183  scoped_channel_value& operator=(BaseChannelValue v) { _value=v; return *this; }
184  operator BaseChannelValue() const { return _value; }
185 private:
186  BaseChannelValue _value;
187 };
188 
189 struct float_zero { static float apply() { return 0.0f; } };
190 struct float_one { static float apply() { return 1.0f; } };
191 
192 
198 
199 // It is necessary for packed channels to have their own value type. They cannot simply use an integral large enough to store the data. Here is why:
200 // - Any operation that requires returning the result by value will otherwise return the built-in integral type, which will have incorrect range
201 // That means that after getting the value of the channel we cannot properly do channel_convert, channel_invert, etc.
202 // - Two channels are declared compatible if they have the same value type. That means that a packed channel is incorrectly declared compatible with an integral type
203 namespace detail {
204  // returns the smallest fast unsigned integral type that has at least NumBits bits
205  template <int NumBits>
206  struct min_fast_uint : public mpl::if_c< (NumBits<=8),
207  uint_least8_t,
208  typename mpl::if_c< (NumBits<=16),
209  uint_least16_t,
210  typename mpl::if_c< (NumBits<=32),
211  uint_least32_t,
212  uintmax_t
213  >::type
214  >::type
215  > {};
216 
217  template <int NumBits>
218  struct num_value_fn : public mpl::if_c< ( NumBits < 32 )
219  , uint32_t
220  , uint64_t
221  > {};
222 
223  template <int NumBits>
224  struct max_value_fn : public mpl::if_c< ( NumBits <= 32 )
225  , uint32_t
226  , uint64_t
227  > {};
228 }
229 
246 template <int NumBits>
249 class packed_channel_value {
250 
251 public:
252  typedef typename detail::min_fast_uint<NumBits>::type integer_t;
253 
254 
255  typedef packed_channel_value value_type;
256  typedef value_type& reference;
257  typedef const value_type& const_reference;
258  typedef value_type* pointer;
259  typedef const value_type* const_pointer;
260 
261  static value_type min_value() { return 0; }
262  static value_type max_value() { return low_bits_mask_t< NumBits >::sig_bits; }
263 
264  BOOST_STATIC_CONSTANT(bool, is_mutable=true);
265 
266  packed_channel_value() {}
267 
268  packed_channel_value(integer_t v) { _value = static_cast< integer_t >( v & low_bits_mask_t<NumBits>::sig_bits_fast ); }
269  template <typename Scalar> packed_channel_value(Scalar v) { _value = packed_channel_value( static_cast< integer_t >( v ) ); }
270 
271  static unsigned int num_bits() { return NumBits; }
272 
273  operator integer_t() const { return _value; }
274 private:
275  integer_t _value;
276 };
277 
278 namespace detail {
279 
280 template <std::size_t K>
281 struct static_copy_bytes {
282  void operator()(const unsigned char* from, unsigned char* to) const {
283  *to = *from;
284  static_copy_bytes<K-1>()(++from,++to);
285  }
286 };
287 
288 template <>
289 struct static_copy_bytes<0> {
290  void operator()(const unsigned char* , unsigned char*) const {}
291 };
292 
293 template <typename Derived, typename BitField, int NumBits, bool Mutable>
294 class packed_channel_reference_base {
295 protected:
296  typedef typename mpl::if_c<Mutable,void*,const void*>::type data_ptr_t;
297 public:
298  data_ptr_t _data_ptr; // void* pointer to the first byte of the bit range
299 
300  typedef packed_channel_value<NumBits> value_type;
301  typedef const Derived reference;
302  typedef value_type* pointer;
303  typedef const value_type* const_pointer;
304  BOOST_STATIC_CONSTANT(int, num_bits=NumBits);
305  BOOST_STATIC_CONSTANT(bool, is_mutable=Mutable);
306 
307  static value_type min_value() { return channel_traits<value_type>::min_value(); }
308  static value_type max_value() { return channel_traits<value_type>::max_value(); }
309 
310  typedef BitField bitfield_t;
311  typedef typename value_type::integer_t integer_t;
312 
313  packed_channel_reference_base(data_ptr_t data_ptr) : _data_ptr(data_ptr) {}
314  packed_channel_reference_base(const packed_channel_reference_base& ref) : _data_ptr(ref._data_ptr) {}
315  const Derived& operator=(integer_t v) const { set(v); return derived(); }
316 
317  const Derived& operator++() const { set(get()+1); return derived(); }
318  const Derived& operator--() const { set(get()-1); return derived(); }
319 
320  Derived operator++(int) const { Derived tmp=derived(); this->operator++(); return tmp; }
321  Derived operator--(int) const { Derived tmp=derived(); this->operator--(); return tmp; }
322 
323  template <typename Scalar2> const Derived& operator+=(Scalar2 v) const { set( static_cast<integer_t>( get() + v )); return derived(); }
324  template <typename Scalar2> const Derived& operator-=(Scalar2 v) const { set( static_cast<integer_t>( get() - v )); return derived(); }
325  template <typename Scalar2> const Derived& operator*=(Scalar2 v) const { set( static_cast<integer_t>( get() * v )); return derived(); }
326  template <typename Scalar2> const Derived& operator/=(Scalar2 v) const { set( static_cast<integer_t>( get() / v )); return derived(); }
327 
328  operator integer_t() const { return get(); }
329  data_ptr_t operator &() const {return _data_ptr;}
330 protected:
331 
332  typedef typename detail::num_value_fn< NumBits >::type num_value_t;
333  typedef typename detail::max_value_fn< NumBits >::type max_value_t;
334 
335  static const num_value_t num_values = static_cast< num_value_t >( 1 ) << NumBits ;
336  static const max_value_t max_val = static_cast< max_value_t >( num_values - 1 );
337 
338 #ifdef GIL_NONWORD_POINTER_ALIGNMENT_SUPPORTED
339  const bitfield_t& get_data() const { return *static_cast<const bitfield_t*>(_data_ptr); }
340  void set_data(const bitfield_t& val) const { *static_cast< bitfield_t*>(_data_ptr) = val; }
341 #else
342  bitfield_t get_data() const {
343  bitfield_t ret;
344  static_copy_bytes<sizeof(bitfield_t) >()(gil_reinterpret_cast_c<const unsigned char*>(_data_ptr),gil_reinterpret_cast<unsigned char*>(&ret));
345  return ret;
346  }
347  void set_data(const bitfield_t& val) const {
348  static_copy_bytes<sizeof(bitfield_t) >()(gil_reinterpret_cast_c<const unsigned char*>(&val),gil_reinterpret_cast<unsigned char*>(_data_ptr));
349  }
350 #endif
351 
352 private:
353  void set(integer_t value) const { // can this be done faster??
354  this->derived().set_unsafe(((value % num_values) + num_values) % num_values);
355  }
356  integer_t get() const { return derived().get(); }
357  const Derived& derived() const { return static_cast<const Derived&>(*this); }
358 };
359 } // namespace detail
360 
377 template <typename BitField, // A type that holds the bits of the pixel from which the channel is referenced. Typically an integral type, like boost::uint16_t
378  int FirstBit, int NumBits,// Defines the sequence of bits in the data value that contain the channel
379  bool Mutable> // true if the reference is mutable
380 class packed_channel_reference;
381 
382 template <typename BitField, // A type that holds the bits of the pixel from which the channel is referenced. Typically an integral type, like boost::uint16_t
383  int NumBits, // Defines the sequence of bits in the data value that contain the channel
384  bool Mutable> // true if the reference is mutable
385 class packed_dynamic_channel_reference;
386 
389 template <typename BitField, int FirstBit, int NumBits>
390 class packed_channel_reference<BitField,FirstBit,NumBits,false>
391  : public detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,false>,BitField,NumBits,false> {
392  typedef detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,false>,BitField,NumBits,false> parent_t;
393  friend class packed_channel_reference<BitField,FirstBit,NumBits,true>;
394 
395  static const BitField channel_mask = static_cast< BitField >( parent_t::max_val ) << FirstBit;
396 
397  void operator=(const packed_channel_reference&);
398 public:
399  typedef const packed_channel_reference<BitField,FirstBit,NumBits,false> const_reference;
400  typedef const packed_channel_reference<BitField,FirstBit,NumBits,true> mutable_reference;
401  typedef typename parent_t::integer_t integer_t;
402 
403  explicit packed_channel_reference(const void* data_ptr) : parent_t(data_ptr) {}
404  packed_channel_reference(const packed_channel_reference& ref) : parent_t(ref._data_ptr) {}
405  packed_channel_reference(const mutable_reference& ref) : parent_t(ref._data_ptr) {}
406 
407  unsigned first_bit() const { return FirstBit; }
408 
409  integer_t get() const { return integer_t((this->get_data()&channel_mask) >> FirstBit); }
410 };
411 
414 template <typename BitField, int FirstBit, int NumBits>
415 class packed_channel_reference<BitField,FirstBit,NumBits,true>
416  : public detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true> {
417  typedef detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true> parent_t;
418  friend class packed_channel_reference<BitField,FirstBit,NumBits,false>;
419 
420  static const BitField channel_mask = static_cast< BitField >( parent_t::max_val ) << FirstBit;
421 
422 public:
423  typedef const packed_channel_reference<BitField,FirstBit,NumBits,false> const_reference;
424  typedef const packed_channel_reference<BitField,FirstBit,NumBits,true> mutable_reference;
425  typedef typename parent_t::integer_t integer_t;
426 
427  explicit packed_channel_reference(void* data_ptr) : parent_t(data_ptr) {}
428  packed_channel_reference(const packed_channel_reference& ref) : parent_t(ref._data_ptr) {}
429 
430  const packed_channel_reference& operator=(integer_t value) const { assert(value<=parent_t::max_val); set_unsafe(value); return *this; }
431  const packed_channel_reference& operator=(const mutable_reference& ref) const { set_from_reference(ref.get_data()); return *this; }
432  const packed_channel_reference& operator=(const const_reference& ref) const { set_from_reference(ref.get_data()); return *this; }
433 
434  template <bool Mutable1>
435  const packed_channel_reference& operator=(const packed_dynamic_channel_reference<BitField,NumBits,Mutable1>& ref) const { set_unsafe(ref.get()); return *this; }
436 
437  unsigned first_bit() const { return FirstBit; }
438 
439  integer_t get() const { return integer_t((this->get_data()&channel_mask) >> FirstBit); }
440  void set_unsafe(integer_t value) const { this->set_data((this->get_data() & ~channel_mask) | (( static_cast< BitField >( value )<<FirstBit))); }
441 private:
442  void set_from_reference(const BitField& other_bits) const { this->set_data((this->get_data() & ~channel_mask) | (other_bits & channel_mask)); }
443 };
444 
445 } } // namespace boost::gil
446 
447 namespace std {
448 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
449 // swap with 'left bias':
450 // - swap between proxy and anything
451 // - swap between value type and proxy
452 // - swap between proxy and proxy
453 
456 template <typename BF, int FB, int NB, bool M, typename R> inline
457 void swap(const boost::gil::packed_channel_reference<BF,FB,NB,M> x, R& y) {
458  boost::gil::swap_proxy<typename boost::gil::packed_channel_reference<BF,FB,NB,M>::value_type>(x,y);
459 }
460 
461 
464 template <typename BF, int FB, int NB, bool M> inline
465 void swap(typename boost::gil::packed_channel_reference<BF,FB,NB,M>::value_type& x, const boost::gil::packed_channel_reference<BF,FB,NB,M> y) {
466  boost::gil::swap_proxy<typename boost::gil::packed_channel_reference<BF,FB,NB,M>::value_type>(x,y);
467 }
468 
469 
472 template <typename BF, int FB, int NB, bool M> inline
473 void swap(const boost::gil::packed_channel_reference<BF,FB,NB,M> x, const boost::gil::packed_channel_reference<BF,FB,NB,M> y) {
474  boost::gil::swap_proxy<typename boost::gil::packed_channel_reference<BF,FB,NB,M>::value_type>(x,y);
475 }
476 } // namespace std
477 
478 namespace boost { namespace gil {
479 
497 template <typename BitField, int NumBits>
501 class packed_dynamic_channel_reference<BitField,NumBits,false>
502  : public detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,false>,BitField,NumBits,false> {
503  typedef detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,false>,BitField,NumBits,false> parent_t;
504  friend class packed_dynamic_channel_reference<BitField,NumBits,true>;
505 
506  unsigned _first_bit; // 0..7
507 
508  void operator=(const packed_dynamic_channel_reference&);
509 public:
510  typedef const packed_dynamic_channel_reference<BitField,NumBits,false> const_reference;
511  typedef const packed_dynamic_channel_reference<BitField,NumBits,true> mutable_reference;
512  typedef typename parent_t::integer_t integer_t;
513 
514  packed_dynamic_channel_reference(const void* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {}
515  packed_dynamic_channel_reference(const const_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
516  packed_dynamic_channel_reference(const mutable_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
517 
518  unsigned first_bit() const { return _first_bit; }
519 
520  integer_t get() const {
521  const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) <<_first_bit;
522  return static_cast< integer_t >(( this->get_data()&channel_mask ) >> _first_bit );
523  }
524 };
525 
529 template <typename BitField, int NumBits>
530 class packed_dynamic_channel_reference<BitField,NumBits,true>
531  : public detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,true>,BitField,NumBits,true> {
532  typedef detail::packed_channel_reference_base<packed_dynamic_channel_reference<BitField,NumBits,true>,BitField,NumBits,true> parent_t;
533  friend class packed_dynamic_channel_reference<BitField,NumBits,false>;
534 
535  unsigned _first_bit;
536 
537 public:
540  typedef typename parent_t::integer_t integer_t;
541 
542  packed_dynamic_channel_reference(void* data_ptr, unsigned first_bit) : parent_t(data_ptr), _first_bit(first_bit) {}
543  packed_dynamic_channel_reference(const packed_dynamic_channel_reference& ref) : parent_t(ref._data_ptr), _first_bit(ref._first_bit) {}
544 
545  const packed_dynamic_channel_reference& operator=(integer_t value) const { assert(value<=parent_t::max_val); set_unsafe(value); return *this; }
546  const packed_dynamic_channel_reference& operator=(const mutable_reference& ref) const { set_unsafe(ref.get()); return *this; }
547  const packed_dynamic_channel_reference& operator=(const const_reference& ref) const { set_unsafe(ref.get()); return *this; }
548 
549  template <typename BitField1, int FirstBit1, bool Mutable1>
550  const packed_dynamic_channel_reference& operator=(const packed_channel_reference<BitField1, FirstBit1, NumBits, Mutable1>& ref) const
551  { set_unsafe(ref.get()); return *this; }
552 
553  unsigned first_bit() const { return _first_bit; }
554 
555  integer_t get() const {
556  const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) << _first_bit;
557  return static_cast< integer_t >(( this->get_data()&channel_mask ) >> _first_bit );
558  }
559 
560  void set_unsafe(integer_t value) const {
561  const BitField channel_mask = static_cast< integer_t >( parent_t::max_val ) << _first_bit;
562  this->set_data((this->get_data() & ~channel_mask) | value<<_first_bit);
563  }
564 };
565 } } // namespace boost::gil
566 
567 namespace std {
568 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
569 // swap with 'left bias':
570 // - swap between proxy and anything
571 // - swap between value type and proxy
572 // - swap between proxy and proxy
573 
574 
577 template <typename BF, int NB, bool M, typename R> inline
578 void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, R& y) {
579  boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
580 }
581 
582 
585 template <typename BF, int NB, bool M> inline
586 void swap(typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type& x, const boost::gil::packed_dynamic_channel_reference<BF,NB,M> y) {
587  boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
588 }
589 
590 
593 template <typename BF, int NB, bool M> inline
594 void swap(const boost::gil::packed_dynamic_channel_reference<BF,NB,M> x, const boost::gil::packed_dynamic_channel_reference<BF,NB,M> y) {
595  boost::gil::swap_proxy<typename boost::gil::packed_dynamic_channel_reference<BF,NB,M>::value_type>(x,y);
596 }
597 } // namespace std
598 
599 namespace boost { namespace gil {
605 
609 
611 typedef uint8_t bits8;
612 
616 
618 typedef uint16_t bits16;
619 
623 
625 typedef uint32_t bits32;
626 
630 
632 typedef int8_t bits8s;
633 
637 
639 typedef int16_t bits16s;
640 
644 
646 typedef int32_t bits32s;
647 
651 
653 typedef scoped_channel_value<float,float_zero,float_one> bits32f;
654 
655 } } // namespace boost::gil
656 
657 namespace boost {
658 
659 template <int NumBits>
660 struct is_integral<gil::packed_channel_value<NumBits> > : public mpl::true_ {};
661 
662 template <typename BitField, int FirstBit, int NumBits, bool IsMutable>
663 struct is_integral<gil::packed_channel_reference<BitField,FirstBit,NumBits,IsMutable> > : public mpl::true_ {};
664 
665 template <typename BitField, int NumBits, bool IsMutable>
666 struct is_integral<gil::packed_dynamic_channel_reference<BitField,NumBits,IsMutable> > : public mpl::true_ {};
667 
668 template <typename BaseChannelValue, typename MinVal, typename MaxVal>
669 struct is_integral<gil::scoped_channel_value<BaseChannelValue,MinVal,MaxVal> > : public is_integral<BaseChannelValue> {};
670 
671 }
672 
673 // \brief Determines the fundamental type which may be used, e.g., to cast from larger to smaller channel types.
674 namespace boost { namespace gil {
675 template <typename T>
676 struct base_channel_type_impl { typedef T type; };
677 
678 template <int N>
679 struct base_channel_type_impl<packed_channel_value<N> >
680 { typedef typename packed_channel_value<N>::integer_t type; };
681 
682 template <typename B, int F, int N, bool M>
683 struct base_channel_type_impl<packed_channel_reference<B, F, N, M> >
684 { typedef typename packed_channel_reference<B,F,N,M>::integer_t type; };
685 
686 template <typename B, int N, bool M>
687 struct base_channel_type_impl<packed_dynamic_channel_reference<B, N, M> >
688 { typedef typename packed_dynamic_channel_reference<B,N,M>::integer_t type; };
689 
690 template <typename ChannelValue, typename MinV, typename MaxV>
691 struct base_channel_type_impl<scoped_channel_value<ChannelValue, MinV, MaxV> >
692 { typedef ChannelValue type; };
693 
694 template <typename T>
695 struct base_channel_type : base_channel_type_impl<typename remove_cv<T>::type > {};
696 
697 } } //namespace boost::gil
698 
699 #endif
void swap(const boost::gil::packed_dynamic_channel_reference< BF, NB, M > x, const boost::gil::packed_dynamic_channel_reference< BF, NB, M > y)
swap for packed_dynamic_channel_reference
Definition: channel.hpp:594
A channel adaptor that modifies the range of the source channel. Models: ChannelValueConcept.
Definition: channel.hpp:155
Models a constant subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept Same as packed_channel_reference, except that the offset is a runtime parameter.
Definition: channel.hpp:501
Traits for channels. Contains the following members:
Definition: channel.hpp:113
GIL configuration file.
Models a mutable subbyte channel reference whose bit offset is a runtime parameter. Models ChannelConcept Same as packed_channel_reference, except that the offset is a runtime parameter.
Definition: channel.hpp:530
Various utilities not specific to the image library. Some are non-standard STL extensions or generic ...