Boost GIL


concept.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://opensource.adobe.com/gil for most recent version including documentation.
9 */
10 
11 /*************************************************************************************************/
12 
13 #ifndef BOOST_GIL_CONCEPT_HPP
14 #define BOOST_GIL_CONCEPT_HPP
15 
24 
25 #include <boost/gil/config.hpp>
26 
27 #include <boost/concept_check.hpp>
28 #include <boost/iterator/iterator_concepts.hpp>
29 #include <boost/mpl/and.hpp>
30 #include <boost/mpl/size.hpp>
31 #include <boost/type_traits.hpp>
32 #include <boost/utility/enable_if.hpp>
33 
34 #include <functional>
35 
36 namespace boost { namespace gil {
37 
38 #if defined(__GNUC__) && (__GNUC__ >= 4)
39 #pragma GCC diagnostic push
40 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
41 #endif
42 
43 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
44 #pragma warning(push)
45 #pragma warning(disable:4510) //default constructor could not be generated
46 #pragma warning(disable:4512) //assignment operator could not be generated
47 #pragma warning(disable:4610) //can never be instantiated - user defined constructor required
48 #endif
49 
50 template <typename T> struct channel_traits;
51 template <typename P> struct is_pixel;
52 template <typename dstT, typename srcT>
53 typename channel_traits<dstT>::value_type channel_convert(const srcT& val);
54 template <typename T> class point2;
55 template <std::size_t K, typename T> const T& axis_value(const point2<T>& p);
56 template <std::size_t K, typename T> T& axis_value( point2<T>& p);
57 template <typename ColorBase, int K> struct kth_element_type;
58 template <typename ColorBase, int K> struct kth_element_reference_type;
59 template <typename ColorBase, int K> struct kth_element_const_reference_type;
60 template <typename ColorBase, int K> struct kth_semantic_element_reference_type;
61 template <typename ColorBase, int K> struct kth_semantic_element_const_reference_type;
62 template <typename ColorBase> struct size;
63 template <typename ColorBase> struct element_type;
64 template <typename T> struct channel_type;
65 template <typename T> struct color_space_type;
66 template <typename T> struct channel_mapping_type;
67 template <typename T> struct is_planar;
68 template <typename T> struct num_channels;
69 
70 template <typename It> struct const_iterator_type;
71 template <typename It> struct iterator_is_mutable;
72 template <typename It> struct is_iterator_adaptor;
73 template <typename It, typename NewBaseIt> struct iterator_adaptor_rebind;
74 template <typename It> struct iterator_adaptor_get_base;
75 
76 
77 // forward-declare at_c
78 namespace detail { template <typename Element, typename Layout, int K> struct homogeneous_color_base; }
79 template <int K, typename E, typename L, int N>
80 typename add_reference<E>::type at_c( detail::homogeneous_color_base<E,L,N>& p);
81 
82 template <int K, typename E, typename L, int N>
83 typename add_reference<typename add_const<E>::type>::type at_c(const detail::homogeneous_color_base<E,L,N>& p);
84 
85 template <typename P, typename C, typename L> struct packed_pixel;
86 template <int K, typename P, typename C, typename L>
87 typename kth_element_reference_type<packed_pixel<P,C,L>, K>::type
88 at_c(packed_pixel<P,C,L>& p);
89 
90 template <int K, typename P, typename C, typename L>
91 typename kth_element_const_reference_type<packed_pixel<P,C,L>,K>::type
92 at_c(const packed_pixel<P,C,L>& p);
93 
94 template <typename B, typename C, typename L, bool M> struct bit_aligned_pixel_reference;
95 
96 template <int K, typename B, typename C, typename L, bool M> inline
97 typename kth_element_reference_type<bit_aligned_pixel_reference<B,C,L,M>, K>::type
99 
100 // Forward-declare semantic_at_c
101 template <int K, typename ColorBase>
102 typename disable_if<is_const<ColorBase>,typename kth_semantic_element_reference_type<ColorBase,K>::type>::type semantic_at_c(ColorBase& p);
103 template <int K, typename ColorBase>
104 typename kth_semantic_element_const_reference_type<ColorBase,K>::type semantic_at_c(const ColorBase& p);
105 
106 template <typename T> struct dynamic_x_step_type;
107 template <typename T> struct dynamic_y_step_type;
108 template <typename T> struct transposed_type;
109 
110 namespace detail {
111 template <typename T>
112 void initialize_it(T&) {}
113 } // namespace detail
114 
115 template <typename T>
116 struct remove_const_and_reference : public remove_const<typename remove_reference<T>::type> {};
117 
118 #ifdef BOOST_GIL_USE_CONCEPT_CHECK
119  #define GIL_CLASS_REQUIRE(type_var, ns, concept) BOOST_CLASS_REQUIRE(type_var, ns, concept);
120  template <typename C> void gil_function_requires() { function_requires<C>(); }
121 #else
122  #define GIL_CLASS_REQUIRE(T,NS,C)
123  template <typename C> void gil_function_requires() {}
124 #endif
125 
127 
134 template <typename T>
136  void constraints() {
137  function_requires<boost::DefaultConstructibleConcept<T> >();
138  }
139 };
140 
142 
149 template <typename T>
151  void constraints() {
152  function_requires<boost::CopyConstructibleConcept<T> >();
153  }
154 };
155 
157 
165 template <typename T>
166 struct Assignable {
167  void constraints() {
168  function_requires<boost::AssignableConcept<T> >();
169  }
170 };
172 
180 template <typename T>
182  void constraints() {
183  function_requires<boost::EqualityComparableConcept<T> >();
184  }
185 };
186 
188 
194 template <typename T, typename U>
195 struct SameType {
196  void constraints() {
197  BOOST_STATIC_ASSERT((boost::is_same<T,U>::value_core));
198  }
199 };
200 
202 
209 template <typename T>
210 struct Swappable {
211  void constraints() {
212  using std::swap;
213  swap(x,y);
214  }
215  T x,y;
216 };
217 
219 
226 template <typename T>
227 struct Regular {
228  void constraints() {
229  gil_function_requires< boost::DefaultConstructibleConcept<T> >();
230  gil_function_requires< boost::CopyConstructibleConcept<T> >();
231  gil_function_requires< boost::EqualityComparableConcept<T> >(); // ==, !=
232  gil_function_requires< boost::AssignableConcept<T> >();
233  gil_function_requires< Swappable<T> >();
234  }
235 };
236 
238 
245 template <typename T>
246 struct Metafunction {
247  void constraints() {
248  typedef typename T::type type;
249  }
250 };
252 //
253 // POINT CONCEPTS
254 //
256 
259 
274 template <typename P>
276  void constraints() {
277  gil_function_requires< Regular<P> >();
278 
279  typedef typename P::value_type value_type;
280  static const std::size_t N=P::num_dimensions; ignore_unused_variable_warning(N);
281  typedef typename P::template axis<0>::coord_t FT;
282  typedef typename P::template axis<N-1>::coord_t LT;
283  FT ft=gil::axis_value<0>(point);
284  axis_value<0>(point)=ft;
285  LT lt=axis_value<N-1>(point);
286  axis_value<N-1>(point)=lt;
287 
288 // value_type v=point[0]; ignore_unused_variable_warning(v);
289  }
290  P point;
291 };
292 
295 
311 template <typename P>
313  void constraints() {
314  gil_function_requires< PointNDConcept<P> >();
315  BOOST_STATIC_ASSERT(P::num_dimensions == 2);
316  point.x=point.y;
317  point[0]=point[1];
318  }
319  P point;
320 };
321 
323 //
324 // ITERATOR MUTABILITY CONCEPTS
325 //
326 // Taken from boost's concept_check.hpp. Isolating mutability to result in faster compile time
327 //
329 
330 namespace detail {
331  template <class TT> // Preconditions: TT Models boost_concepts::ForwardTraversalConcept
332  struct ForwardIteratorIsMutableConcept {
333  void constraints() {
334  *i++ = *i; // require postincrement and assignment
335  }
336  TT i;
337  };
338 
339  template <class TT> // Preconditions: TT Models boost::BidirectionalIteratorConcept
340  struct BidirectionalIteratorIsMutableConcept {
341  void constraints() {
342  gil_function_requires< ForwardIteratorIsMutableConcept<TT> >();
343  *i-- = *i; // require postdecrement and assignment
344  }
345  TT i;
346  };
347 
348  template <class TT> // Preconditions: TT Models boost_concepts::RandomAccessTraversalConcept
349  struct RandomAccessIteratorIsMutableConcept {
350  void constraints() {
351  gil_function_requires< BidirectionalIteratorIsMutableConcept<TT> >();
352  typename std::iterator_traits<TT>::difference_type n=0; ignore_unused_variable_warning(n);
353  i[n] = *i; // require element access and assignment
354  }
355  TT i;
356  };
357 } // namespace detail
358 
360 //
361 // COLOR SPACE CONCEPTS
362 //
364 
367 
374 template <typename Cs>
376  void constraints() {
377  // An MPL Random Access Sequence, whose elements are color tags
378  }
379 };
380 
381 template <typename ColorSpace1, typename ColorSpace2> // Models ColorSpaceConcept
382 struct color_spaces_are_compatible : public is_same<ColorSpace1,ColorSpace2> {};
383 
386 
393 template <typename Cs1, typename Cs2>
395  void constraints() {
396  BOOST_STATIC_ASSERT((color_spaces_are_compatible<Cs1,Cs2>::value));
397  }
398 };
399 
402 
409 template <typename CM>
411  void constraints() {
412  // An MPL Random Access Sequence, whose elements model MPLIntegralConstant representing a permutation
413  }
414 };
415 
416 
417 
423 
426 
448 template <typename T>
450  void constraints() {
451  gil_function_requires< boost::EqualityComparableConcept<T> >();
452 
453  typedef typename channel_traits<T>::value_type v;
454  typedef typename channel_traits<T>::reference r;
455  typedef typename channel_traits<T>::pointer p;
456  typedef typename channel_traits<T>::const_reference cr;
457  typedef typename channel_traits<T>::const_pointer cp;
458 
461  }
462 
463  T c;
464 };
465 
466 namespace detail {
467  // Preconditions: T models ChannelConcept
468  template <typename T>
469  struct ChannelIsMutableConcept {
470  void constraints() {
471  c1=c2;
472  using std::swap;
473  swap(c1,c2);
474  }
475  T c1;
476  T c2;
477  };
478 }
479 
482 
487 template <typename T>
489  void constraints() {
490  gil_function_requires<ChannelConcept<T> >();
491  gil_function_requires<detail::ChannelIsMutableConcept<T> >();
492  }
493 };
494 
497 
502 template <typename T>
504  void constraints() {
505  gil_function_requires<ChannelConcept<T> >();
506  gil_function_requires<Regular<T> >();
507  }
508 };
509 
510 
515 
522 template <typename T1, typename T2> // Models GIL Pixel
524  : public is_same<typename channel_traits<T1>::value_type, typename channel_traits<T2>::value_type> {};
525 
528 
535 template <typename T1, typename T2>
537  void constraints() {
538  BOOST_STATIC_ASSERT((channels_are_compatible<T1,T2>::value));
539  }
540 };
541 
546 
553 template <typename SrcChannel, typename DstChannel>
555  void constraints() {
556  gil_function_requires<ChannelConcept<SrcChannel> >();
557  gil_function_requires<MutableChannelConcept<DstChannel> >();
558  dst=channel_convert<DstChannel,SrcChannel>(src); ignore_unused_variable_warning(dst);
559  }
560  SrcChannel src;
561  DstChannel dst;
562 };
563 
564 
565 
566 
567 
573 
576 
616 template <typename ColorBase>
618  void constraints() {
619  gil_function_requires< CopyConstructible<ColorBase> >();
620  gil_function_requires< EqualityComparable<ColorBase> >();
621 
622  typedef typename ColorBase::layout_t::color_space_t color_space_t;
623  gil_function_requires<ColorSpaceConcept<color_space_t> >();
624 
625  typedef typename ColorBase::layout_t::channel_mapping_t channel_mapping_t;
626  // TODO: channel_mapping_t must be an MPL RandomAccessSequence
627 
628  static const std::size_t num_elements = size<ColorBase>::value;
629 
630  typedef typename kth_element_type<ColorBase,num_elements-1>::type TN;
631  typedef typename kth_element_const_reference_type<ColorBase,num_elements-1>::type CR;
632 
633  CR cr=gil::at_c<num_elements-1>(cb); ignore_unused_variable_warning(cr);
634 
635  // functions that work for every pixel (no need to require them)
636  semantic_at_c<0>(cb);
637  semantic_at_c<num_elements-1>(cb);
638  // also static_max(cb), static_min(cb), static_fill(cb,value), and all variations of static_for_each(), static_generate(), static_transform()
639  }
640 
641  ColorBase cb;
642 };
643 
646 
659 template <typename ColorBase>
661  void constraints() {
662  gil_function_requires< ColorBaseConcept<ColorBase> >();
663  gil_function_requires< Assignable<ColorBase> >();
664  gil_function_requires< Swappable<ColorBase> >();
665 
666  typedef typename kth_element_reference_type<ColorBase, 0>::type CR;
667 
668  CR r=gil::at_c<0>(cb);
669  gil::at_c<0>(cb)=r;
670  }
671 
672  ColorBase cb;
673 };
674 
677 
683 template <typename ColorBase>
685  void constraints() {
686  gil_function_requires< MutableColorBaseConcept<ColorBase> >();
687  gil_function_requires< Regular<ColorBase> >();
688  }
689 };
690 
693 
703 template <typename ColorBase>
705  void constraints() {
706  gil_function_requires< ColorBaseConcept<ColorBase> >();
707 
708  static const std::size_t num_elements = size<ColorBase>::value;
709 
710  typedef typename kth_element_type<ColorBase,0>::type T0;
711  typedef typename kth_element_type<ColorBase,num_elements-1>::type TN;
712 
713  BOOST_STATIC_ASSERT((is_same<T0,TN>::value)); // better than nothing
714  typedef typename kth_element_const_reference_type<ColorBase,0>::type CRef0;
715  CRef0 e0=dynamic_at_c(cb,0);
716  }
717  ColorBase cb;
718 };
719 
722 
731 template <typename ColorBase>
733  void constraints() {
734  gil_function_requires< ColorBaseConcept<ColorBase> >();
735  gil_function_requires< HomogeneousColorBaseConcept<ColorBase> >();
736  typedef typename kth_element_reference_type<ColorBase, 0>::type R0;
737  R0 x=dynamic_at_c(cb,0);
738  dynamic_at_c(cb,0) = dynamic_at_c(cb,0);
739  }
740  ColorBase cb;
741 };
742 
745 
753 template <typename ColorBase>
755  void constraints() {
756  gil_function_requires< MutableHomogeneousColorBaseConcept<ColorBase> >();
757  gil_function_requires< Regular<ColorBase> >();
758  }
759 };
760 
761 
764 
775 template <typename ColorBase1, typename ColorBase2>
777  void constraints() {
778  BOOST_STATIC_ASSERT((is_same<typename ColorBase1::layout_t::color_space_t,
779  typename ColorBase2::layout_t::color_space_t>::value));
780 // typedef typename kth_semantic_element_type<ColorBase1,0>::type e1;
781 // typedef typename kth_semantic_element_type<ColorBase2,0>::type e2;
782 // "e1 is convertible to e2"
783  }
784 };
785 
786 
787 
788 
789 
790 
791 
792 
793 
794 
795 
796 
797 
798 
799 
800 
801 
802 
803 
804 
805 
806 
812 
815 
830 template <typename P>
832  void constraints() {
833  typedef typename color_space_type<P>::type color_space_t;
834  gil_function_requires<ColorSpaceConcept<color_space_t> >();
835  typedef typename channel_mapping_type<P>::type channel_mapping_t;
836  gil_function_requires<ChannelMappingConcept<channel_mapping_t> >();
837 
838  static const bool planar = is_planar<P>::type::value; ignore_unused_variable_warning(planar);
839 
840 
841  // This is not part of the concept, but should still work
842  static const std::size_t nc = num_channels<P>::value;
843  ignore_unused_variable_warning(nc);
844  }
845 };
846 
849 
858 template <typename P>
860  void constraints() {
861  gil_function_requires<PixelBasedConcept<P> >();
862  typedef typename channel_type<P>::type channel_t;
863  gil_function_requires<ChannelConcept<channel_t> >();
864  }
865 };
866 
867 
870 
892 template <typename P>
893 struct PixelConcept {
894  void constraints() {
895  gil_function_requires<ColorBaseConcept<P> >();
896  gil_function_requires<PixelBasedConcept<P> >();
897 
898  BOOST_STATIC_ASSERT((is_pixel<P>::value));
899  static const bool is_mutable = P::is_mutable; ignore_unused_variable_warning(is_mutable);
900 
901  typedef typename P::value_type value_type;
902 // gil_function_requires<PixelValueConcept<value_type> >();
903 
904  typedef typename P::reference reference;
905  gil_function_requires<PixelConcept<typename remove_const_and_reference<reference>::type> >();
906 
907  typedef typename P::const_reference const_reference;
908  gil_function_requires<PixelConcept<typename remove_const_and_reference<const_reference>::type> >();
909  }
910 };
911 
912 
915 
922 template <typename P>
924  void constraints() {
925  gil_function_requires<PixelConcept<P> >();
926  BOOST_STATIC_ASSERT(P::is_mutable);
927  }
928 };
931 
938 template <typename P>
940  void constraints() {
941  gil_function_requires<PixelConcept<P> >();
942  gil_function_requires<HomogeneousColorBaseConcept<P> >();
943  gil_function_requires<HomogeneousPixelBasedConcept<P> >();
944  p[0];
945  }
946  P p;
947 };
948 
951 
958 template <typename P>
960  void constraints() {
961  gil_function_requires<HomogeneousPixelConcept<P> >();
962  gil_function_requires<MutableHomogeneousColorBaseConcept<P> >();
963  p[0]=v;
964  v=p[0];
965  }
966  typename P::template element_type<P>::type v;
967  P p;
968 };
969 
972 
979 template <typename P>
981  void constraints() {
982  gil_function_requires<PixelConcept<P> >();
983  gil_function_requires<Regular<P> >();
984  }
985 };
986 
989 
996 template <typename P>
998  void constraints() {
999  gil_function_requires<HomogeneousPixelConcept<P> >();
1000  gil_function_requires<Regular<P> >();
1001  BOOST_STATIC_ASSERT((is_same<P, typename P::value_type>::value));
1002  }
1003 };
1004 
1005 namespace detail {
1006  template <typename P1, typename P2, int K>
1007  struct channels_are_pairwise_compatible : public
1008  mpl::and_<channels_are_pairwise_compatible<P1,P2,K-1>,
1009  channels_are_compatible<typename kth_semantic_element_reference_type<P1,K>::type,
1010  typename kth_semantic_element_reference_type<P2,K>::type> > {};
1011 
1012  template <typename P1, typename P2>
1013  struct channels_are_pairwise_compatible<P1,P2,-1> : public mpl::true_ {};
1014 }
1015 
1020 template <typename P1, typename P2> // Models GIL Pixel
1022  : public mpl::and_<typename color_spaces_are_compatible<typename color_space_type<P1>::type,
1023  typename color_space_type<P2>::type>::type,
1024  detail::channels_are_pairwise_compatible<P1,P2,num_channels<P1>::value-1> > {};
1025 
1029 
1037 template <typename P1, typename P2> // precondition: P1 and P2 model PixelConcept
1039  void constraints() {
1040  BOOST_STATIC_ASSERT((pixels_are_compatible<P1,P2>::value));
1041  }
1042 };
1043 
1048 
1056 template <typename SrcP, typename DstP>
1058  void constraints() {
1059  gil_function_requires<PixelConcept<SrcP> >();
1060  gil_function_requires<MutablePixelConcept<DstP> >();
1061  color_convert(src,dst);
1062  }
1063  SrcP src;
1064  DstP dst;
1065 };
1066 
1072 
1074 
1078 
1093 template <typename D>
1095  void constraints() {
1096  gil_function_requires< boost::UnaryFunctionConcept<D,
1097  typename remove_const_and_reference<typename D::result_type>::type,
1098  typename D::argument_type> >();
1099  gil_function_requires< boost::DefaultConstructibleConcept<D> >();
1100  gil_function_requires< boost::CopyConstructibleConcept<D> >();
1101  gil_function_requires< boost::AssignableConcept<D> >();
1102 
1103  gil_function_requires<PixelConcept<typename remove_const_and_reference<typename D::result_type>::type> >();
1104 
1105  typedef typename D::const_t const_t;
1106  gil_function_requires<PixelDereferenceAdaptorConcept<const_t> >();
1107  typedef typename D::value_type value_type;
1108  gil_function_requires<PixelValueConcept<value_type> >();
1109  typedef typename D::reference reference; // == PixelConcept (if you remove const and reference)
1110  typedef typename D::const_reference const_reference; // == PixelConcept (if you remove const and reference)
1111 
1112  const bool is_mutable=D::is_mutable; ignore_unused_variable_warning(is_mutable);
1113  }
1114  D d;
1115 };
1116 
1117 template <typename P>
1118 struct PixelDereferenceAdaptorArchetype {
1119  typedef P argument_type;
1120  typedef P result_type;
1121  typedef PixelDereferenceAdaptorArchetype const_t;
1122  typedef typename remove_reference<P>::type value_type;
1123  typedef typename add_reference<P>::type reference;
1124  typedef reference const_reference;
1125  static const bool is_mutable=false;
1126  P operator()(P) const { throw; }
1127 };
1128 
1134 
1137 
1145 template <typename T>
1147  void constraints() {
1148  typedef typename dynamic_x_step_type<T>::type type;
1149  }
1150 };
1151 
1154 
1162 template <typename T>
1164  void constraints() {
1165  typedef typename dynamic_y_step_type<T>::type type;
1166  }
1167 };
1168 
1169 
1172 
1180 template <typename T>
1182  void constraints() {
1183  typedef typename transposed_type<T>::type type;
1184  }
1185 };
1186 
1190 
1193 
1209 template <typename Iterator>
1211  void constraints() {
1212  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator> >();
1213  gil_function_requires<PixelBasedConcept<Iterator> >();
1214 
1215  typedef typename std::iterator_traits<Iterator>::value_type value_type;
1216  gil_function_requires<PixelValueConcept<value_type> >();
1217 
1218  typedef typename const_iterator_type<Iterator>::type const_t;
1219  static const bool is_mut = iterator_is_mutable<Iterator>::type::value; ignore_unused_variable_warning(is_mut);
1220 
1221  const_t const_it(it); ignore_unused_variable_warning(const_it); // immutable iterator must be constructible from (possibly mutable) iterator
1222 
1223  check_base(typename is_iterator_adaptor<Iterator>::type());
1224  }
1225  void check_base(mpl::false_) {}
1226  void check_base(mpl::true_) {
1227  typedef typename iterator_adaptor_get_base<Iterator>::type base_t;
1228  gil_function_requires<PixelIteratorConcept<base_t> >();
1229  }
1230 
1231  Iterator it;
1232 };
1233 
1234 namespace detail {
1235  template <typename Iterator> // Preconditions: Iterator Models PixelIteratorConcept
1236  struct PixelIteratorIsMutableConcept {
1237  void constraints() {
1238  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<Iterator> >();
1239  typedef typename remove_reference<typename std::iterator_traits<Iterator>::reference>::type ref;
1240  typedef typename element_type<ref>::type channel_t;
1241  gil_function_requires<detail::ChannelIsMutableConcept<channel_t> >();
1242  }
1243  };
1244 }
1245 
1248 
1254 template <typename Iterator>
1256  void constraints() {
1257  gil_function_requires<PixelIteratorConcept<Iterator> >();
1258  gil_function_requires<detail::PixelIteratorIsMutableConcept<Iterator> >();
1259  }
1260 };
1261 
1262 namespace detail {
1263  // Iterators that can be used as the base of memory_based_step_iterator require some additional functions
1264  template <typename Iterator> // Preconditions: Iterator Models boost_concepts::RandomAccessTraversalConcept
1265  struct RandomAccessIteratorIsMemoryBasedConcept {
1266  void constraints() {
1267  std::ptrdiff_t bs=memunit_step(it); ignore_unused_variable_warning(bs);
1268  it=memunit_advanced(it,3);
1269  std::ptrdiff_t bd=memunit_distance(it,it); ignore_unused_variable_warning(bd);
1270  memunit_advance(it,3);
1271  // for performace you may also provide a customized implementation of memunit_advanced_ref
1272  }
1273  Iterator it;
1274  };
1275 }
1276 
1280 
1283 
1295 template <typename Iterator>
1297  void constraints() {
1298  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<Iterator> >();
1299  gil_function_requires<detail::RandomAccessIteratorIsMemoryBasedConcept<Iterator> >();
1300  }
1301 };
1302 
1307 
1314 template <typename Iterator>
1316  void constraints() {
1317  gil_function_requires<boost_concepts::ForwardTraversalConcept<Iterator> >();
1318  it.set_step(0);
1319  }
1320  Iterator it;
1321 };
1322 
1323 
1327 
1332 template <typename Iterator>
1334  void constraints() {
1335  gil_function_requires<StepIteratorConcept<Iterator> >();
1336  gil_function_requires<detail::ForwardIteratorIsMutableConcept<Iterator> >();
1337  }
1338 };
1339 
1343 
1346 
1371 template <typename Iterator>
1373  void constraints() {
1374  gil_function_requires<boost_concepts::ForwardTraversalConcept<Iterator> >();
1375 
1376  typedef typename iterator_adaptor_get_base<Iterator>::type base_t;
1377  gil_function_requires<boost_concepts::ForwardTraversalConcept<base_t> >();
1378 
1379  BOOST_STATIC_ASSERT(is_iterator_adaptor<Iterator>::value);
1380  typedef typename iterator_adaptor_rebind<Iterator, void*>::type rebind_t;
1381 
1382  base_t base=it.base(); ignore_unused_variable_warning(base);
1383  }
1384  Iterator it;
1385 };
1386 
1389 
1394 template <typename Iterator>
1396  void constraints() {
1397  gil_function_requires<IteratorAdaptorConcept<Iterator> >();
1398  gil_function_requires<detail::ForwardIteratorIsMutableConcept<Iterator> >();
1399  }
1400 };
1401 
1407 
1411 
1415 
1419 
1422 
1468 template <typename Loc>
1470  void constraints() {
1471  gil_function_requires< Regular<Loc> >();
1472 
1473  typedef typename Loc::value_type value_type;
1474  typedef typename Loc::reference reference; // result of dereferencing
1475  typedef typename Loc::difference_type difference_type; // result of operator-(pixel_locator, pixel_locator)
1476  typedef typename Loc::cached_location_t cached_location_t; // type used to store relative location (to allow for more efficient repeated access)
1477  typedef typename Loc::const_t const_t; // same as this type, but over const values
1478  typedef typename Loc::point_t point_t; // same as difference_type
1479  static const std::size_t N=Loc::num_dimensions; ignore_unused_variable_warning(N);
1480 
1481  typedef typename Loc::template axis<0>::iterator first_it_type;
1482  typedef typename Loc::template axis<N-1>::iterator last_it_type;
1483  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type> >();
1484  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type> >();
1485 
1486  // point_t must be an N-dimensional point, each dimension of which must have the same type as difference_type of the corresponding iterator
1487  gil_function_requires<PointNDConcept<point_t> >();
1488  BOOST_STATIC_ASSERT(point_t::num_dimensions==N);
1489  BOOST_STATIC_ASSERT((is_same<typename std::iterator_traits<first_it_type>::difference_type, typename point_t::template axis<0>::coord_t>::value));
1490  BOOST_STATIC_ASSERT((is_same<typename std::iterator_traits<last_it_type>::difference_type, typename point_t::template axis<N-1>::coord_t>::value));
1491 
1492  difference_type d;
1493  loc+=d;
1494  loc-=d;
1495  loc=loc+d;
1496  loc=loc-d;
1497  reference r1=loc[d]; ignore_unused_variable_warning(r1);
1498  reference r2=*loc; ignore_unused_variable_warning(r2);
1499  cached_location_t cl=loc.cache_location(d); ignore_unused_variable_warning(cl);
1500  reference r3=loc[d]; ignore_unused_variable_warning(r3);
1501 
1502  first_it_type fi=loc.template axis_iterator<0>();
1503  fi=loc.template axis_iterator<0>(d);
1504  last_it_type li=loc.template axis_iterator<N-1>();
1505  li=loc.template axis_iterator<N-1>(d);
1506 
1507  typedef PixelDereferenceAdaptorArchetype<typename Loc::value_type> deref_t;
1508  typedef typename Loc::template add_deref<deref_t>::type dtype;
1509  //gil_function_requires<RandomAccessNDLocatorConcept<dtype> >(); // infinite recursion
1510  }
1511  Loc loc;
1512 };
1513 
1516 
1554 template <typename Loc>
1556  void constraints() {
1557  gil_function_requires<RandomAccessNDLocatorConcept<Loc> >();
1558  BOOST_STATIC_ASSERT(Loc::num_dimensions==2);
1559 
1560  typedef typename dynamic_x_step_type<Loc>::type dynamic_x_step_t;
1561  typedef typename dynamic_y_step_type<Loc>::type dynamic_y_step_t;
1562  typedef typename transposed_type<Loc>::type transposed_t;
1563 
1564  typedef typename Loc::cached_location_t cached_location_t;
1565  gil_function_requires<Point2DConcept<typename Loc::point_t> >();
1566 
1567  typedef typename Loc::x_iterator x_iterator;
1568  typedef typename Loc::y_iterator y_iterator;
1569  typedef typename Loc::x_coord_t x_coord_t;
1570  typedef typename Loc::y_coord_t y_coord_t;
1571 
1572  x_coord_t xd=0; ignore_unused_variable_warning(xd);
1573  y_coord_t yd=0; ignore_unused_variable_warning(yd);
1574 
1575  typename Loc::difference_type d;
1576  typename Loc::reference r=loc(xd,yd); ignore_unused_variable_warning(r);
1577 
1578  dynamic_x_step_t loc2(dynamic_x_step_t(), yd);
1579  dynamic_x_step_t loc3(dynamic_x_step_t(), xd, yd);
1580 
1581  typedef typename dynamic_y_step_type<typename dynamic_x_step_type<transposed_t>::type>::type dynamic_xy_step_transposed_t;
1582  dynamic_xy_step_transposed_t loc4(loc, xd,yd,true);
1583 
1584  bool is_contiguous=loc.is_1d_traversable(xd); ignore_unused_variable_warning(is_contiguous);
1585  loc.y_distance_to(loc, xd);
1586 
1587  loc=loc.xy_at(d);
1588  loc=loc.xy_at(xd,yd);
1589 
1590  x_iterator xit=loc.x_at(d);
1591  xit=loc.x_at(xd,yd);
1592  xit=loc.x();
1593 
1594  y_iterator yit=loc.y_at(d);
1595  yit=loc.y_at(xd,yd);
1596  yit=loc.y();
1597 
1598  cached_location_t cl=loc.cache_location(xd,yd); ignore_unused_variable_warning(cl);
1599  }
1600  Loc loc;
1601 };
1602 
1605 
1617 template <typename Loc>
1619  void constraints() {
1620  gil_function_requires< RandomAccess2DLocatorConcept<Loc> >();
1621  gil_function_requires< PixelIteratorConcept<typename Loc::x_iterator> >();
1622  gil_function_requires< PixelIteratorConcept<typename Loc::y_iterator> >();
1623  typedef typename Loc::coord_t coord_t;
1624  BOOST_STATIC_ASSERT((is_same<typename Loc::x_coord_t, typename Loc::y_coord_t>::value));
1625  }
1626  Loc loc;
1627 };
1628 
1629 namespace detail {
1630  template <typename Loc> // preconditions: Loc Models RandomAccessNDLocatorConcept
1631  struct RandomAccessNDLocatorIsMutableConcept {
1632  void constraints() {
1633  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<typename Loc::template axis<0>::iterator> >();
1634  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<typename Loc::template axis<Loc::num_dimensions-1>::iterator> >();
1635 
1636  typename Loc::difference_type d; initialize_it(d);
1637  typename Loc::value_type v;initialize_it(v);
1638  typename Loc::cached_location_t cl=loc.cache_location(d);
1639  *loc=v;
1640  loc[d]=v;
1641  loc[cl]=v;
1642  }
1643  Loc loc;
1644  };
1645 
1646  template <typename Loc> // preconditions: Loc Models RandomAccess2DLocatorConcept
1647  struct RandomAccess2DLocatorIsMutableConcept {
1648  void constraints() {
1649  gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<Loc> >();
1650  typename Loc::x_coord_t xd=0; ignore_unused_variable_warning(xd);
1651  typename Loc::y_coord_t yd=0; ignore_unused_variable_warning(yd);
1652  typename Loc::value_type v; initialize_it(v);
1653  loc(xd,yd)=v;
1654  }
1655  Loc loc;
1656  };
1657 }
1658 
1661 
1668 template <typename Loc>
1670  void constraints() {
1671  gil_function_requires<RandomAccessNDLocatorConcept<Loc> >();
1672  gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<Loc> >();
1673  }
1674 };
1675 
1678 
1683 template <typename Loc>
1685  void constraints() {
1686  gil_function_requires< RandomAccess2DLocatorConcept<Loc> >();
1687  gil_function_requires<detail::RandomAccess2DLocatorIsMutableConcept<Loc> >();
1688  }
1689 };
1690 
1693 
1698 template <typename Loc>
1700  void constraints() {
1701  gil_function_requires<PixelLocatorConcept<Loc> >();
1702  gil_function_requires<detail::RandomAccess2DLocatorIsMutableConcept<Loc> >();
1703  }
1704 };
1705 
1711 
1715 
1719 
1723 
1726 
1775 template <typename View>
1777  void constraints() {
1778  gil_function_requires< Regular<View> >();
1779 
1780  typedef typename View::value_type value_type;
1781  typedef typename View::reference reference; // result of dereferencing
1782  typedef typename View::difference_type difference_type; // result of operator-(1d_iterator,1d_iterator)
1783  typedef typename View::const_t const_t; // same as this type, but over const values
1784  typedef typename View::point_t point_t; // N-dimensional point
1785  typedef typename View::locator locator; // N-dimensional locator
1786  typedef typename View::iterator iterator;
1787  typedef typename View::reverse_iterator reverse_iterator;
1788  typedef typename View::size_type size_type;
1789  static const std::size_t N=View::num_dimensions;
1790 
1791  gil_function_requires<RandomAccessNDLocatorConcept<locator> >();
1792  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<iterator> >();
1793  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<reverse_iterator> >();
1794 
1795  typedef typename View::template axis<0>::iterator first_it_type;
1796  typedef typename View::template axis<N-1>::iterator last_it_type;
1797  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<first_it_type> >();
1798  gil_function_requires<boost_concepts::RandomAccessTraversalConcept<last_it_type> >();
1799 
1800 // BOOST_STATIC_ASSERT((typename std::iterator_traits<first_it_type>::difference_type, typename point_t::template axis<0>::coord_t>::value));
1801 // BOOST_STATIC_ASSERT((typename std::iterator_traits< last_it_type>::difference_type, typename point_t::template axis<N-1>::coord_t>::value));
1802 
1803  // point_t must be an N-dimensional point, each dimension of which must have the same type as difference_type of the corresponding iterator
1804  gil_function_requires<PointNDConcept<point_t> >();
1805  BOOST_STATIC_ASSERT(point_t::num_dimensions==N);
1806  BOOST_STATIC_ASSERT((is_same<typename std::iterator_traits<first_it_type>::difference_type, typename point_t::template axis<0>::coord_t>::value));
1807  BOOST_STATIC_ASSERT((is_same<typename std::iterator_traits<last_it_type>::difference_type, typename point_t::template axis<N-1>::coord_t>::value));
1808 
1809  point_t p;
1810  locator lc;
1811  iterator it;
1812  reverse_iterator rit;
1813  difference_type d; detail::initialize_it(d); ignore_unused_variable_warning(d);
1814 
1815  View(p,lc); // view must be constructible from a locator and a point
1816 
1817  p=view.dimensions();
1818  lc=view.pixels();
1819  size_type sz=view.size(); ignore_unused_variable_warning(sz);
1820  bool is_contiguous=view.is_1d_traversable(); ignore_unused_variable_warning(is_contiguous);
1821 
1822  it=view.begin();
1823  it=view.end();
1824  rit=view.rbegin();
1825  rit=view.rend();
1826 
1827  reference r1=view[d]; ignore_unused_variable_warning(r1); // 1D access
1828  reference r2=view(p); ignore_unused_variable_warning(r2); // 2D access
1829 
1830  // get 1-D iterator of any dimension at a given pixel location
1831  first_it_type fi=view.template axis_iterator<0>(p); ignore_unused_variable_warning(fi);
1832  last_it_type li=view.template axis_iterator<N-1>(p); ignore_unused_variable_warning(li);
1833 
1834  typedef PixelDereferenceAdaptorArchetype<typename View::value_type> deref_t;
1835  typedef typename View::template add_deref<deref_t>::type dtype;
1836  }
1837  View view;
1838 };
1839 
1842 
1879 template <typename View>
1881  void constraints() {
1882  gil_function_requires<RandomAccessNDImageViewConcept<View> >();
1883  BOOST_STATIC_ASSERT(View::num_dimensions==2);
1884 
1885  // TODO: This executes the requirements for RandomAccessNDLocatorConcept again. Fix it to improve compile time
1886  gil_function_requires<RandomAccess2DLocatorConcept<typename View::locator> >();
1887 
1888  typedef typename dynamic_x_step_type<View>::type dynamic_x_step_t;
1889  typedef typename dynamic_y_step_type<View>::type dynamic_y_step_t;
1890  typedef typename transposed_type<View>::type transposed_t;
1891 
1892  typedef typename View::x_iterator x_iterator;
1893  typedef typename View::y_iterator y_iterator;
1894  typedef typename View::x_coord_t x_coord_t;
1895  typedef typename View::y_coord_t y_coord_t;
1896  typedef typename View::xy_locator xy_locator;
1897 
1898  x_coord_t xd=0; ignore_unused_variable_warning(xd);
1899  y_coord_t yd=0; ignore_unused_variable_warning(yd);
1900  x_iterator xit;
1901  y_iterator yit;
1902  typename View::point_t d;
1903 
1904  View(xd,yd,xy_locator()); // constructible with width, height, 2d_locator
1905 
1906  xy_locator lc=view.xy_at(xd,yd);
1907  lc=view.xy_at(d);
1908 
1909  typename View::reference r=view(xd,yd); ignore_unused_variable_warning(r);
1910  xd=view.width();
1911  yd=view.height();
1912 
1913  xit=view.x_at(d);
1914  xit=view.x_at(xd,yd);
1915  xit=view.row_begin(xd);
1916  xit=view.row_end(xd);
1917 
1918  yit=view.y_at(d);
1919  yit=view.y_at(xd,yd);
1920  yit=view.col_begin(xd);
1921  yit=view.col_end(xd);
1922  }
1923  View view;
1924 };
1925 
1926 
1929 
1943 template <typename View>
1945  void constraints() {
1946  gil_function_requires<RandomAccess2DImageViewConcept<View> >();
1947 
1948  // TODO: This executes the requirements for RandomAccess2DLocatorConcept again. Fix it to improve compile time
1949  gil_function_requires<PixelLocatorConcept<typename View::xy_locator> >();
1950 
1951  BOOST_STATIC_ASSERT((is_same<typename View::x_coord_t, typename View::y_coord_t>::value));
1952 
1953  typedef typename View::coord_t coord_t; // 1D difference type (same for all dimensions)
1954  std::size_t num_chan = view.num_channels(); ignore_unused_variable_warning(num_chan);
1955  }
1956  View view;
1957 };
1958 
1959 
1960 namespace detail {
1961  template <typename View> // Preconditions: View Models RandomAccessNDImageViewConcept
1962  struct RandomAccessNDImageViewIsMutableConcept {
1963  void constraints() {
1964  gil_function_requires<detail::RandomAccessNDLocatorIsMutableConcept<typename View::locator> >();
1965 
1966  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<typename View::iterator> >();
1967  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<typename View::reverse_iterator> >();
1968  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<typename View::template axis<0>::iterator> >();
1969  gil_function_requires<detail::RandomAccessIteratorIsMutableConcept<typename View::template axis<View::num_dimensions-1>::iterator> >();
1970 
1971  typename View::difference_type diff; initialize_it(diff); ignore_unused_variable_warning(diff);
1972  typename View::point_t pt;
1973  typename View::value_type v; initialize_it(v);
1974 
1975  view[diff]=v;
1976  view(pt)=v;
1977  }
1978  View view;
1979  };
1980 
1981  template <typename View> // preconditions: View Models RandomAccessNDImageViewConcept
1982  struct RandomAccess2DImageViewIsMutableConcept {
1983  void constraints() {
1984  gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View> >();
1985  typename View::x_coord_t xd=0; ignore_unused_variable_warning(xd);
1986  typename View::y_coord_t yd=0; ignore_unused_variable_warning(yd);
1987  typename View::value_type v; initialize_it(v);
1988  view(xd,yd)=v;
1989  }
1990  View view;
1991  };
1992 
1993  template <typename View> // preconditions: View Models ImageViewConcept
1994  struct PixelImageViewIsMutableConcept {
1995  void constraints() {
1996  gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View> >();
1997  }
1998  };
1999 }
2000 
2003 
2010 template <typename View>
2012  void constraints() {
2013  gil_function_requires<RandomAccessNDImageViewConcept<View> >();
2014  gil_function_requires<detail::RandomAccessNDImageViewIsMutableConcept<View> >();
2015  }
2016 };
2017 
2020 
2025 template <typename View>
2027  void constraints() {
2028  gil_function_requires<RandomAccess2DImageViewConcept<View> >();
2029  gil_function_requires<detail::RandomAccess2DImageViewIsMutableConcept<View> >();
2030  }
2031 };
2032 
2035 
2040 template <typename View>
2042  void constraints() {
2043  gil_function_requires<ImageViewConcept<View> >();
2044  gil_function_requires<detail::PixelImageViewIsMutableConcept<View> >();
2045  }
2046 };
2047 
2051 template <typename V1, typename V2> // Model ImageViewConcept
2052 struct views_are_compatible : public pixels_are_compatible<typename V1::value_type, typename V2::value_type> {};
2053 
2056 
2063 template <typename V1, typename V2>
2065  void constraints() {
2066  BOOST_STATIC_ASSERT((views_are_compatible<V1,V2>::value));
2067  }
2068 };
2069 
2070 
2076 
2077 
2080 
2101 template <typename Img>
2103  void constraints() {
2104  gil_function_requires<Regular<Img> >();
2105 
2106  typedef typename Img::view_t view_t;
2107  gil_function_requires<MutableRandomAccessNDImageViewConcept<view_t> >();
2108 
2109  typedef typename Img::const_view_t const_view_t;
2110  typedef typename Img::value_type pixel_t;
2111 
2112  typedef typename Img::point_t point_t;
2113  gil_function_requires<PointNDConcept<point_t> >();
2114 
2115  const_view_t cv = const_view(img); ignore_unused_variable_warning(cv);
2116  view_t v = view(img); ignore_unused_variable_warning(v);
2117 
2118  pixel_t fill_value;
2119  point_t pt=img.dimensions();
2120  Img im1(pt);
2121  Img im2(pt,1);
2122  Img im3(pt,fill_value,1);
2123  img.recreate(pt);
2124  img.recreate(pt,1);
2125  img.recreate(pt,fill_value,1);
2126  }
2127  Img img;
2128 };
2129 
2130 
2133 
2150 template <typename Img>
2152  void constraints() {
2153  gil_function_requires<RandomAccessNDImageConcept<Img> >();
2154  typedef typename Img::x_coord_t x_coord_t;
2155  typedef typename Img::y_coord_t y_coord_t;
2156  typedef typename Img::value_type value_t;
2157 
2158  gil_function_requires<MutableRandomAccess2DImageViewConcept<typename Img::view_t> >();
2159 
2160  x_coord_t w=img.width();
2161  y_coord_t h=img.height();
2162  value_t fill_value;
2163  Img im1(w,h);
2164  Img im2(w,h,1);
2165  Img im3(w,h,fill_value,1);
2166  img.recreate(w,h);
2167  img.recreate(w,h,1);
2168  img.recreate(w,h,fill_value,1);
2169  }
2170  Img img;
2171 };
2172 
2175 
2183 template <typename Img>
2185  void constraints() {
2186  gil_function_requires<RandomAccess2DImageConcept<Img> >();
2187  gil_function_requires<MutableImageViewConcept<typename Img::view_t> >();
2188  typedef typename Img::coord_t coord_t;
2189  BOOST_STATIC_ASSERT(num_channels<Img>::value == mpl::size<typename color_space_type<Img>::type>::value);
2190 
2191  BOOST_STATIC_ASSERT((is_same<coord_t, typename Img::x_coord_t>::value));
2192  BOOST_STATIC_ASSERT((is_same<coord_t, typename Img::y_coord_t>::value));
2193  }
2194  Img img;
2195 };
2196 
2197 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
2198 #pragma warning(pop)
2199 #endif
2200 
2201 #if defined(__GNUC__) && (__GNUC__ >= 4)
2202 #pragma GCC diagnostic pop
2203 #endif
2204 
2205 } } // namespace boost::gil
2206 
2207 #endif
Represents a unary function object that can be invoked upon dereferencing a pixel iterator...
Definition: concept.hpp:1094
Concept for iterators, locators and views that can define a type just like the given iterator/locator...
Definition: concept.hpp:1146
metafunction predicate determining whether the given iterator is a plain one or an adaptor over anoth...
Definition: concept.hpp:72
Homogeneous color base that also has a default constructor. Refines Regular.
Definition: concept.hpp:754
Definition: concept.hpp:181
Homogeneous pixel concept that allows for changing its channels.
Definition: concept.hpp:959
2-dimensional view over mutable values
Definition: concept.hpp:2026
Homogeneous color base that allows for modifying its elements.
Definition: concept.hpp:732
Pixel iterator that allows for changing its pixel.
Definition: concept.hpp:1255
Definition: concept.hpp:195
N-dimensional locator over mutable pixels.
Definition: concept.hpp:1669
Definition: concept.hpp:150
Concept of a random-access iterator that can be advanced in memory units (bytes or bits) ...
Definition: concept.hpp:1296
disable_if< is_const< ColorBase >, typename kth_semantic_element_reference_type< ColorBase, K >::type >::type semantic_at_c(ColorBase &p)
A mutable accessor to the K-th semantic element of a color base.
Definition: color_base_algorithm.hpp:121
2-dimensional locator over mutable pixels
Definition: concept.hpp:1684
returns the base iterator for a given iterator adaptor. Provide an specialization when introducing ne...
Definition: concept.hpp:74
Two color bases are compatible if they have the same color space and their elements are compatible...
Definition: concept.hpp:776
Iterator adaptor is a forward iterator adapting another forward iterator.
Definition: concept.hpp:1372
Concept for pixel compatibility Pixels are compatible if their channels and color space types are com...
Definition: concept.hpp:1038
N-dimensional view over mutable values.
Definition: concept.hpp:2011
Pixel concept that is a Regular type.
Definition: concept.hpp:980
channel_traits< DstChannel >::value_type channel_convert(const SrcChannel &src)
Converting from one channel type to another.
Definition: channel_algorithm.hpp:419
N-dimensional container of values.
Definition: concept.hpp:2102
Step iterator that allows for modifying its current value.
Definition: concept.hpp:1333
Specifies the element type of a homogeneous color base.
Definition: color_base_algorithm.hpp:215
Concept for locators and views that can define a type just like the given locator or view...
Definition: concept.hpp:1163
Definition: concept.hpp:210
A channel is convertible to another one if the channel_convert algorithm is defined for the two chann...
Definition: concept.hpp:554
2-dimensional image whose value type models PixelValueConcept
Definition: concept.hpp:2184
Heterogeneous pixel reference corresponding to non-byte-aligned bit range. Models ColorBaseConcept...
Definition: bit_aligned_pixel_reference.hpp:124
A color base is a container of color elements (such as channels, channel references or channel pointe...
Definition: concept.hpp:617
A channel is the building block of a color. Color is defined as a mixture of primary colors and a cha...
Definition: concept.hpp:449
GIL configuration file.
Concept for homogeneous pixel-based GIL constructs.
Definition: concept.hpp:859
Color base which allows for modifying its elements.
Definition: concept.hpp:660
2-dimensional locator over immutable values
Definition: concept.hpp:1555
Specifies the return type of the mutable semantic_at_c<K>(color_base);.
Definition: color_base_algorithm.hpp:103
Concept for all pixel-based GIL constructs, such as pixels, iterators, locators, views and images who...
Definition: concept.hpp:831
Definition: concept.hpp:135
Returns whether two views are compatible.
Definition: concept.hpp:2052
A channel that supports default construction.
Definition: concept.hpp:503
Concept for locators and views that can define a type just like the given locator or view...
Definition: concept.hpp:1181
Definition: concept.hpp:246
Predicate metafunction returning whether two channels are compatibleChannels are considered compatibl...
Definition: concept.hpp:523
GIL's 2-dimensional locator over immutable GIL pixels.
Definition: concept.hpp:1618
Channel mapping concept.
Definition: concept.hpp:410
Homogeneous pixel concept that is a Regular type.
Definition: concept.hpp:997
Homogeneous pixel concept.
Definition: concept.hpp:939
Pixel concept that allows for changing its channels.
Definition: concept.hpp:923
Color space type concept.
Definition: concept.hpp:375
Definition: concept.hpp:166
Pixel convertible concept.
Definition: concept.hpp:1057
GIL's 2-dimensional view over mutable GIL pixels.
Definition: concept.hpp:2041
Traits for channels. Contains the following members:
Definition: channel.hpp:112
Channels are compatible if their associated value types (ignoring constness and references) are the s...
Definition: concept.hpp:536
2-dimensional container of values
Definition: concept.hpp:2151
void color_convert(const SrcP &src, DstP &dst)
helper function for converting one pixel to another using GIL default color-converters where ScrP mod...
Definition: color_convert.hpp:309
N-dimensional point concept.
Definition: concept.hpp:275
Color base that also has a default-constructor. Refines Regular.
Definition: concept.hpp:684
2-dimensional point concept
Definition: concept.hpp:312
Changes the base iterator of an iterator adaptor. Provide an specialization when introducing new iter...
Definition: concept.hpp:73
Returns whether two pixels are compatible.
Definition: concept.hpp:1021
Iterator adaptor that is mutable.
Definition: concept.hpp:1395
GIL's 2-dimensional view over immutable GIL pixels.
Definition: concept.hpp:1944
const image< Pixel, IsPlanar, Alloc >::view_t & view(image< Pixel, IsPlanar, Alloc > &img)
Returns the non-constant-pixel view of an image.
Definition: image.hpp:479
Two color spaces are compatible if they are the same.
Definition: concept.hpp:394
Metafunction predicate returning whether the given iterator allows for changing its values...
Definition: concept.hpp:71
2-dimensional view over immutable values
Definition: concept.hpp:1880
Heterogeneous pixel value whose channel references can be constructed from the pixel bitfield and the...
Definition: concept.hpp:85
Returns an MPL integral type specifying the number of elements in a color base.
Definition: color_base_algorithm.hpp:60
2D point both axes of which have the same dimension typeModels: Point2DConcept
Definition: concept.hpp:54
An STL random access traversal iterator over a model of PixelConcept.
Definition: concept.hpp:1210
const image< Pixel, IsPlanar, Alloc >::const_view_t const_view(const image< Pixel, IsPlanar, Alloc > &img)
Returns the constant-pixel view of an image.
Definition: image.hpp:483
Views are compatible if they have the same color spaces and compatible channel values. Constness and layout are not important for compatibility.
Definition: concept.hpp:2064
Returns the type of an iterator just like the input iterator, except operating over immutable values...
Definition: concept.hpp:70
Step iterator concept.
Definition: concept.hpp:1315
N-dimensional view over immutable values.
Definition: concept.hpp:1776
Returns the number of channels of a pixel-based GIL construct.
Definition: concept.hpp:68
A channel that allows for modifying its value.
Definition: concept.hpp:488
Specifies the return type of the constant semantic_at_c<K>(color_base);.
Definition: color_base_algorithm.hpp:111
Color base whose elements all have the same type.
Definition: concept.hpp:704
N-dimensional locator over immutable values.
Definition: concept.hpp:1469
Definition: concept.hpp:227
Pixel concept - A color base whose elements are channels.
Definition: concept.hpp:893
GIL's 2-dimensional locator over mutable GIL pixels.
Definition: concept.hpp:1699