Warning, file /include/boost/gil/metafunctions.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_GIL_METAFUNCTIONS_HPP
0010 #define BOOST_GIL_METAFUNCTIONS_HPP
0011
0012 #include <boost/gil/channel.hpp>
0013 #include <boost/gil/dynamic_step.hpp>
0014 #include <boost/gil/concepts.hpp>
0015 #include <boost/gil/concepts/detail/type_traits.hpp>
0016 #include <boost/gil/detail/mp11.hpp>
0017
0018 #include <iterator>
0019 #include <type_traits>
0020
0021 namespace boost { namespace gil {
0022
0023
0024 template <typename T, typename L> struct pixel;
0025 template <typename BitField,typename ChannelRefs,typename Layout> struct packed_pixel;
0026 template <typename T, typename C> struct planar_pixel_reference;
0027 template <typename IC, typename C> struct planar_pixel_iterator;
0028 template <typename I> class memory_based_step_iterator;
0029 template <typename I> class memory_based_2d_locator;
0030 template <typename L> class image_view;
0031 template <typename Pixel, bool IsPlanar = false, typename Alloc=std::allocator<unsigned char> > class image;
0032 template <typename T> struct channel_type;
0033 template <typename T> struct color_space_type;
0034 template <typename T> struct channel_mapping_type;
0035 template <typename It> struct is_iterator_adaptor;
0036 template <typename It> struct iterator_adaptor_get_base;
0037 template <typename BitField, typename ChannelBitSizes, typename Layout, bool IsMutable> struct bit_aligned_pixel_reference;
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 template <typename PixelRef>
0058 struct pixel_reference_is_basic : public std::false_type {};
0059
0060 template <typename T, typename L>
0061 struct pixel_reference_is_basic<pixel<T, L>&> : std::true_type {};
0062
0063 template <typename T, typename L>
0064 struct pixel_reference_is_basic<const pixel<T, L>&> : std::true_type {};
0065
0066 template <typename TR, typename CS>
0067 struct pixel_reference_is_basic<planar_pixel_reference<TR, CS>> : std::true_type {};
0068
0069 template <typename TR, typename CS>
0070 struct pixel_reference_is_basic<const planar_pixel_reference<TR, CS>> : std::true_type {};
0071
0072
0073
0074
0075 template <typename Iterator>
0076 struct iterator_is_basic : std::false_type {};
0077
0078
0079 template <typename T, typename L>
0080 struct iterator_is_basic<pixel<T, L>*> : std::true_type {};
0081
0082
0083 template <typename T, typename L>
0084 struct iterator_is_basic<pixel<T, L> const*> : std::true_type {};
0085
0086
0087 template <typename T, typename CS>
0088 struct iterator_is_basic<planar_pixel_iterator<T*, CS>> : std::true_type {};
0089
0090
0091 template <typename T, typename CS>
0092 struct iterator_is_basic<planar_pixel_iterator<T const*, CS>> : std::true_type {};
0093
0094
0095 template <typename T, typename L>
0096 struct iterator_is_basic<memory_based_step_iterator<pixel<T, L>*>> : std::true_type {};
0097
0098
0099 template <typename T, typename L>
0100 struct iterator_is_basic<memory_based_step_iterator<pixel<T, L> const*>> : std::true_type {};
0101
0102
0103 template <typename T, typename CS>
0104 struct iterator_is_basic<memory_based_step_iterator<planar_pixel_iterator<T*, CS>>>
0105 : std::true_type
0106 {};
0107
0108
0109 template <typename T, typename CS>
0110 struct iterator_is_basic<memory_based_step_iterator<planar_pixel_iterator<T const*, CS>>>
0111 : std::true_type
0112 {};
0113
0114
0115
0116
0117 template <typename Loc>
0118 struct locator_is_basic : std::false_type {};
0119
0120 template <typename Iterator>
0121 struct locator_is_basic
0122 <
0123 memory_based_2d_locator<memory_based_step_iterator<Iterator>>
0124 > : iterator_is_basic<Iterator>
0125 {};
0126
0127
0128
0129 template <typename View>
0130 struct view_is_basic : std::false_type {};
0131
0132 template <typename Loc>
0133 struct view_is_basic<image_view<Loc>> : locator_is_basic<Loc> {};
0134
0135
0136
0137 template <typename Img>
0138 struct image_is_basic : std::false_type {};
0139
0140 template <typename Pixel, bool IsPlanar, typename Alloc>
0141 struct image_is_basic<image<Pixel, IsPlanar, Alloc>> : std::true_type {};
0142
0143
0144
0145
0146
0147
0148 template <typename I>
0149 struct iterator_is_step;
0150
0151 namespace detail {
0152
0153 template <typename It, bool IsBase, bool EqualsStepType>
0154 struct iterator_is_step_impl;
0155
0156
0157 template <typename It, bool IsBase>
0158 struct iterator_is_step_impl<It, IsBase, true> : std::true_type {};
0159
0160
0161 template <typename It>
0162 struct iterator_is_step_impl<It, true, false> : std::false_type {};
0163
0164
0165 template <typename It>
0166 struct iterator_is_step_impl<It, false, false>
0167 : public iterator_is_step<typename iterator_adaptor_get_base<It>::type> {};
0168
0169 }
0170
0171
0172
0173 template <typename I>
0174 struct iterator_is_step
0175 : detail::iterator_is_step_impl
0176 <
0177 I,
0178 !is_iterator_adaptor<I>::value,
0179 std::is_same<I, typename dynamic_x_step_type<I>::type
0180 >::value
0181 >
0182 {};
0183
0184
0185
0186 template <typename L> struct locator_is_step_in_x : public iterator_is_step<typename L::x_iterator> {};
0187
0188
0189
0190 template <typename L> struct locator_is_step_in_y : public iterator_is_step<typename L::y_iterator> {};
0191
0192
0193
0194 template <typename V> struct view_is_step_in_x : public locator_is_step_in_x<typename V::xy_locator> {};
0195
0196
0197
0198 template <typename V> struct view_is_step_in_y : public locator_is_step_in_y<typename V::xy_locator> {};
0199
0200
0201
0202 template <typename PixelReference>
0203 struct pixel_reference_is_proxy
0204 : mp11::mp_not
0205 <
0206 std::is_same
0207 <
0208 typename detail::remove_const_and_reference<PixelReference>::type,
0209 typename detail::remove_const_and_reference<PixelReference>::type::value_type
0210 >
0211 >
0212 {};
0213
0214
0215
0216 template <typename Pixel>
0217 struct pixel_is_reference
0218 : mp11::mp_or<is_reference<Pixel>, pixel_reference_is_proxy<Pixel>> {};
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228 template <typename R>
0229 struct pixel_reference_is_mutable
0230 : std::integral_constant<bool, std::remove_reference<R>::type::is_mutable>
0231 {};
0232
0233 template <typename R>
0234 struct pixel_reference_is_mutable<R const&>
0235 : mp11::mp_and<pixel_reference_is_proxy<R>, pixel_reference_is_mutable<R>>
0236 {};
0237
0238
0239
0240 template <typename L> struct locator_is_mutable : public iterator_is_mutable<typename L::x_iterator> {};
0241
0242
0243 template <typename V> struct view_is_mutable : public iterator_is_mutable<typename V::x_iterator> {};
0244
0245
0246
0247
0248
0249
0250
0251
0252
0253
0254
0255
0256
0257
0258
0259
0260
0261
0262
0263
0264
0265
0266
0267 template <typename T, typename L, bool IsPlanar=false, bool IsMutable=true> struct pixel_reference_type{};
0268 template <typename T, typename L> struct pixel_reference_type<T,L,false,true > { using type = pixel<T,L>&; };
0269 template <typename T, typename L> struct pixel_reference_type<T,L,false,false> { using type = pixel<T,L> const&; };
0270 template <typename T, typename L> struct pixel_reference_type<T,L,true,true> { using type = planar_pixel_reference<typename channel_traits<T>::reference,typename color_space_type<L>::type> const; };
0271 template <typename T, typename L> struct pixel_reference_type<T,L,true,false> { using type = planar_pixel_reference<typename channel_traits<T>::const_reference,typename color_space_type<L>::type> const; };
0272
0273
0274
0275 template <typename Pixel, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true> struct iterator_type_from_pixel{};
0276 template <typename Pixel> struct iterator_type_from_pixel<Pixel,false,false,true > { using type = Pixel *; };
0277 template <typename Pixel> struct iterator_type_from_pixel<Pixel,false,false,false> { using type = const Pixel *; };
0278 template <typename Pixel> struct iterator_type_from_pixel<Pixel,true,false,true> {
0279 using type = planar_pixel_iterator<typename channel_traits<typename channel_type<Pixel>::type>::pointer,typename color_space_type<Pixel>::type>;
0280 };
0281 template <typename Pixel> struct iterator_type_from_pixel<Pixel,true,false,false> {
0282 using type = planar_pixel_iterator<typename channel_traits<typename channel_type<Pixel>::type>::const_pointer,typename color_space_type<Pixel>::type>;
0283 };
0284 template <typename Pixel, bool IsPlanar, bool IsMutable> struct iterator_type_from_pixel<Pixel,IsPlanar,true,IsMutable> {
0285 using type = memory_based_step_iterator<typename iterator_type_from_pixel<Pixel,IsPlanar,false,IsMutable>::type>;
0286 };
0287
0288
0289
0290 template <typename T, typename L, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true> struct iterator_type{};
0291 template <typename T, typename L> struct iterator_type<T,L,false,false,true > { using type = pixel<T,L>*; };
0292 template <typename T, typename L> struct iterator_type<T,L,false,false,false> { using type = pixel<T,L> const*; };
0293 template <typename T, typename L> struct iterator_type<T,L,true,false,true> { using type = planar_pixel_iterator<T*,typename L::color_space_t>; };
0294 template <typename T, typename L> struct iterator_type<T,L,true,false,false> { using type = planar_pixel_iterator<const T*,typename L::color_space_t>; };
0295 template <typename T, typename L, bool IsPlanar, bool IsMutable> struct iterator_type<T,L,IsPlanar,true,IsMutable> {
0296 using type = memory_based_step_iterator<typename iterator_type<T,L,IsPlanar,false,IsMutable>::type>;
0297 };
0298
0299
0300
0301 template <typename XIterator>
0302 struct type_from_x_iterator
0303 {
0304 using step_iterator_t = memory_based_step_iterator<XIterator>;
0305 using xy_locator_t = memory_based_2d_locator<step_iterator_t>;
0306 using view_t = image_view<xy_locator_t>;
0307 };
0308
0309 namespace detail {
0310
0311 template <typename BitField, typename FirstBit, typename NumBits>
0312 struct packed_channel_reference_type
0313 {
0314 using type = packed_channel_reference
0315 <
0316 BitField, FirstBit::value, NumBits::value, true
0317 > const;
0318 };
0319
0320 template <typename BitField, typename ChannelBitSizes>
0321 class packed_channel_references_vector_type
0322 {
0323 template <typename FirstBit, typename NumBits>
0324 using reference_type = typename packed_channel_reference_type<BitField, FirstBit, NumBits>::type;
0325
0326
0327
0328 using first_bit_list = mp11::mp_fold_q
0329 <
0330 ChannelBitSizes,
0331 mp11::mp_list<std::integral_constant<int, 0>>,
0332 mp11::mp_bind
0333 <
0334 mp11::mp_push_back,
0335 mp11::_1,
0336 mp11::mp_bind
0337 <
0338 mp11::mp_plus,
0339 mp11::mp_bind<mp_back, mp11::_1>,
0340 mp11::_2
0341 >
0342 >
0343 >;
0344
0345 static_assert(mp11::mp_at_c<first_bit_list, 0>::value == 0, "packed channel first bit must be 0");
0346
0347 public:
0348 using type = mp11::mp_transform
0349 <
0350 reference_type,
0351 mp_pop_back<first_bit_list>,
0352 ChannelBitSizes
0353 >;
0354 };
0355
0356 }
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366 template <typename BitField, typename ChannelBitSizes, typename Layout>
0367 struct packed_pixel_type
0368 {
0369 using type = packed_pixel
0370 <
0371 BitField,
0372 typename detail::packed_channel_references_vector_type
0373 <
0374 BitField,
0375 ChannelBitSizes
0376 >::type,
0377 Layout>;
0378 };
0379
0380
0381
0382
0383
0384
0385
0386
0387
0388
0389
0390
0391 template <typename BitField, typename ChannelBitSizes, typename Layout, typename Alloc=std::allocator<unsigned char>>
0392 struct packed_image_type
0393 {
0394 using type = image<typename packed_pixel_type<BitField,ChannelBitSizes,Layout>::type,false,Alloc>;
0395 };
0396
0397
0398
0399 template <typename BitField, unsigned Size1, typename Layout, typename Alloc = std::allocator<unsigned char>>
0400 struct packed_image1_type
0401 : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1>, Layout, Alloc>
0402 {};
0403
0404
0405
0406 template <typename BitField, unsigned Size1, unsigned Size2, typename Layout, typename Alloc = std::allocator<unsigned char>>
0407 struct packed_image2_type
0408 : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2>, Layout, Alloc>
0409 {};
0410
0411
0412
0413 template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, typename Layout, typename Alloc = std::allocator<unsigned char>>
0414 struct packed_image3_type
0415 : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3>, Layout, Alloc>
0416 {};
0417
0418
0419
0420 template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, typename Layout, typename Alloc = std::allocator<unsigned char>>
0421 struct packed_image4_type
0422 : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4>, Layout, Alloc>
0423 {};
0424
0425
0426
0427 template <typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5, typename Layout, typename Alloc = std::allocator<unsigned char>>
0428 struct packed_image5_type
0429 : packed_image_type<BitField, mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4, Size5>, Layout, Alloc> {};
0430
0431
0432
0433
0434
0435
0436
0437
0438 template
0439 <
0440 typename ChannelBitSizes,
0441 typename Layout,
0442 typename Alloc = std::allocator<unsigned char>
0443 >
0444 struct bit_aligned_image_type
0445 {
0446 private:
0447
0448 static constexpr int bit_size =
0449 mp11::mp_fold
0450 <
0451 ChannelBitSizes,
0452 std::integral_constant<int, 0>,
0453 mp11::mp_plus
0454 >::value;
0455
0456 using bitfield_t = typename detail::min_fast_uint<bit_size + 7>::type;
0457 using bit_alignedref_t = bit_aligned_pixel_reference<bitfield_t, ChannelBitSizes, Layout, true> const;
0458
0459 public:
0460 using type = image<bit_alignedref_t,false,Alloc>;
0461 };
0462
0463
0464
0465 template <unsigned Size1, typename Layout, typename Alloc = std::allocator<unsigned char>>
0466 struct bit_aligned_image1_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1>, Layout, Alloc> {};
0467
0468
0469
0470 template <unsigned Size1, unsigned Size2, typename Layout, typename Alloc = std::allocator<unsigned char>>
0471 struct bit_aligned_image2_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2>, Layout, Alloc> {};
0472
0473
0474
0475 template <unsigned Size1, unsigned Size2, unsigned Size3, typename Layout, typename Alloc = std::allocator<unsigned char>>
0476 struct bit_aligned_image3_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3>, Layout, Alloc> {};
0477
0478
0479
0480 template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, typename Layout, typename Alloc = std::allocator<unsigned char>>
0481 struct bit_aligned_image4_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4>, Layout, Alloc> {};
0482
0483
0484
0485 template <unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5, typename Layout, typename Alloc = std::allocator<unsigned char>>
0486 struct bit_aligned_image5_type : bit_aligned_image_type<mp11::mp_list_c<unsigned, Size1, Size2, Size3, Size4, Size5>, Layout, Alloc> {};
0487
0488
0489
0490
0491 template <typename Channel, typename Layout>
0492 struct pixel_value_type
0493 {
0494
0495 using type = pixel<Channel, Layout>;
0496 };
0497
0498
0499 template <typename BitField, int NumBits, bool IsMutable, typename Layout>
0500 struct pixel_value_type<packed_dynamic_channel_reference<BitField, NumBits, IsMutable>, Layout>
0501 : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
0502 {};
0503
0504 template <typename BitField, int NumBits, bool IsMutable, typename Layout>
0505 struct pixel_value_type<packed_dynamic_channel_reference<BitField, NumBits, IsMutable> const, Layout>
0506 : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
0507 {};
0508
0509 template <typename BitField, int FirstBit, int NumBits, bool IsMutable, typename Layout>
0510 struct pixel_value_type<packed_channel_reference<BitField, FirstBit, NumBits, IsMutable>, Layout>
0511 : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
0512 {};
0513
0514 template <typename BitField, int FirstBit, int NumBits, bool IsMutable, typename Layout>
0515 struct pixel_value_type<packed_channel_reference<BitField, FirstBit, NumBits, IsMutable> const, Layout>
0516 : packed_pixel_type<BitField, mp11::mp_list_c<unsigned, NumBits>, Layout>
0517 {};
0518
0519 template <int NumBits, typename Layout>
0520 struct pixel_value_type<packed_channel_value<NumBits>, Layout>
0521 : packed_pixel_type<typename detail::min_fast_uint<NumBits>::type, mp11::mp_list_c<unsigned, NumBits>, Layout>
0522 {};
0523
0524
0525
0526 template <typename T, typename L, bool IsPlanar = false, bool IsStepX = false, bool IsMutable = true>
0527 struct locator_type
0528 {
0529 using type = typename type_from_x_iterator
0530 <
0531 typename iterator_type<T, L, IsPlanar, IsStepX, IsMutable>::type
0532 >::xy_locator_type;
0533 };
0534
0535
0536
0537 template <typename T, typename L, bool IsPlanar = false, bool IsStepX = false, bool IsMutable = true>
0538 struct view_type
0539 {
0540 using type = typename type_from_x_iterator
0541 <
0542 typename iterator_type<T, L, IsPlanar, IsStepX, IsMutable>::type
0543 >::view_t;
0544 };
0545
0546
0547
0548 template <typename T, typename L, bool IsPlanar = false, typename Alloc = std::allocator<unsigned char>>
0549 struct image_type
0550 {
0551 using type = image<pixel<T, L>, IsPlanar, Alloc>;
0552 };
0553
0554
0555
0556 template <typename Pixel, bool IsPlanar=false, bool IsStepX=false, bool IsMutable=true>
0557 struct view_type_from_pixel {
0558 using type = typename type_from_x_iterator<typename iterator_type_from_pixel<Pixel,IsPlanar,IsStepX,IsMutable>::type>::view_t;
0559 };
0560
0561
0562
0563
0564
0565 template
0566 <
0567 typename Ref,
0568 typename T = use_default,
0569 typename L = use_default,
0570 typename IsPlanar = use_default,
0571 typename IsMutable = use_default>
0572 class derived_pixel_reference_type
0573 {
0574 using pixel_t = typename std::remove_reference<Ref>::type;
0575
0576 using channel_t = typename mp11::mp_if
0577 <
0578 std::is_same<T, use_default>,
0579 typename channel_type<pixel_t>::type,
0580 T
0581 >::type;
0582
0583 using layout_t = typename mp11::mp_if
0584 <
0585 std::is_same<L, use_default>,
0586 layout
0587 <
0588 typename color_space_type<pixel_t>::type,
0589 typename channel_mapping_type<pixel_t>::type
0590 >,
0591 L
0592 >::type;
0593
0594 static bool const mut = mp11::mp_if
0595 <
0596 std::is_same<IsMutable, use_default>,
0597 pixel_reference_is_mutable<Ref>,
0598 IsMutable
0599 >::value;
0600
0601 static bool const planar = mp11::mp_if
0602 <
0603 std::is_same<IsPlanar, use_default>,
0604 is_planar<pixel_t>,
0605 IsPlanar
0606 >::value;
0607
0608 public:
0609 using type = typename pixel_reference_type<channel_t, layout_t, planar, mut>::type;
0610 };
0611
0612
0613
0614
0615 template
0616 <
0617 typename Iterator,
0618 typename T = use_default,
0619 typename L = use_default,
0620 typename IsPlanar = use_default,
0621 typename IsStep = use_default,
0622 typename IsMutable = use_default
0623 >
0624 class derived_iterator_type
0625 {
0626 using channel_t = typename mp11::mp_if
0627 <
0628 std::is_same<T, use_default>,
0629 typename channel_type<Iterator>::type,
0630 T
0631 >::type;
0632
0633 using layout_t = typename mp11::mp_if
0634 <
0635 std::is_same<L, use_default>,
0636 layout
0637 <
0638 typename color_space_type<Iterator>::type,
0639 typename channel_mapping_type<Iterator>::type
0640 >,
0641 L
0642 >::type;
0643
0644 static const bool mut = mp11::mp_if
0645 <
0646 std::is_same<IsMutable, use_default>,
0647 iterator_is_mutable<Iterator>,
0648 IsMutable
0649 >::value;
0650
0651 static bool const planar = mp11::mp_if
0652 <
0653 std::is_same<IsPlanar, use_default>,
0654 is_planar<Iterator>,
0655 IsPlanar
0656 >::value;
0657
0658 static bool const step = mp11::mp_if
0659 <
0660 std::is_same<IsStep, use_default>,
0661 iterator_is_step<Iterator>,
0662 IsStep
0663 >::type::value;
0664
0665 public:
0666 using type = typename iterator_type<channel_t, layout_t, planar, step, mut>::type;
0667 };
0668
0669
0670
0671
0672 template <typename View, typename T = use_default, typename L = use_default, typename IsPlanar = use_default, typename StepX = use_default, typename IsMutable = use_default>
0673 class derived_view_type
0674 {
0675 using channel_t = typename mp11::mp_if
0676 <
0677 std::is_same<T, use_default>,
0678 typename channel_type<View>::type,
0679 T
0680 >;
0681
0682 using layout_t = typename mp11::mp_if
0683 <
0684 std::is_same<L, use_default>,
0685 layout
0686 <
0687 typename color_space_type<View>::type,
0688 typename channel_mapping_type<View>::type
0689 >,
0690 L
0691 >;
0692
0693 static bool const mut = mp11::mp_if
0694 <
0695 std::is_same<IsMutable, use_default>,
0696 view_is_mutable<View>,
0697 IsMutable
0698 >::value;
0699
0700 static bool const planar = mp11::mp_if
0701 <
0702 std::is_same<IsPlanar, use_default>,
0703 is_planar<View>,
0704 IsPlanar
0705 >::value;
0706
0707 static bool const step = mp11::mp_if
0708 <
0709 std::is_same<StepX, use_default>,
0710 view_is_step_in_x<View>,
0711 StepX
0712 >::value;
0713
0714 public:
0715 using type = typename view_type<channel_t, layout_t, planar, step, mut>::type;
0716 };
0717
0718
0719
0720
0721 template <typename Image, typename T = use_default, typename L = use_default, typename IsPlanar = use_default>
0722 class derived_image_type
0723 {
0724 using channel_t = typename mp11::mp_if
0725 <
0726 std::is_same<T, use_default>,
0727 typename channel_type<Image>::type,
0728 T
0729 >::type;
0730
0731 using layout_t = typename mp11::mp_if
0732 <
0733 std::is_same<L, use_default>,
0734 layout
0735 <
0736 typename color_space_type<Image>::type,
0737 typename channel_mapping_type<Image>::type>,
0738 L
0739 >::type;
0740
0741 static bool const planar = mp11::mp_if
0742 <
0743 std::is_same<IsPlanar, use_default>,
0744 is_planar<Image>,
0745 IsPlanar
0746 >::value;
0747
0748 public:
0749 using type = typename image_type<channel_t, layout_t, planar>::type;
0750 };
0751
0752 }}
0753
0754 #endif