14
14
#include < boost/gil/image_view.hpp>
15
15
#include < boost/gil/metafunctions.hpp>
16
16
#include < boost/gil/point.hpp>
17
+ #include < boost/gil/typedefs.hpp>
17
18
#include < boost/gil/detail/mp11.hpp>
18
19
19
20
#include < boost/assert.hpp>
@@ -309,7 +310,7 @@ namespace detail {
309
310
struct __nth_channel_view_basic <View,false > {
310
311
using type = typename view_type<typename channel_type<View>::type, gray_layout_t , false , true , view_is_mutable<View>::value>::type;
311
312
312
- static type make (const View& src, std:: size_t n) {
313
+ static type make (const View& src, index_t n) {
313
314
using locator_t = typename type::xy_locator;
314
315
using x_iterator_t = typename type::x_iterator;
315
316
using x_iterator_base_t = typename iterator_adaptor_get_base<x_iterator_t >::type;
@@ -322,7 +323,7 @@ namespace detail {
322
323
template <typename View>
323
324
struct __nth_channel_view_basic <View,true > {
324
325
using type = typename view_type<typename channel_type<View>::type, gray_layout_t , false , false , view_is_mutable<View>::value>::type;
325
- static type make (const View& src, std:: size_t n) {
326
+ static type make (const View& src, index_t n) {
326
327
using x_iterator_t = typename type::x_iterator;
327
328
return interleaved_view (src.width (),src.height (),(x_iterator_t )&(src (0 ,0 )[n]), src.pixels ().row_size ());
328
329
}
@@ -346,7 +347,7 @@ namespace detail {
346
347
public:
347
348
using type = typename __nth_channel_view_basic<View,adjacent>::type;
348
349
349
- static type make (const View& src, std:: size_t n) {
350
+ static type make (const View& src, index_t n) {
350
351
return __nth_channel_view_basic<View,adjacent>::make (src,n);
351
352
}
352
353
};
@@ -374,10 +375,10 @@ namespace detail {
374
375
using reference = mp11::mp_if_c<is_mutable, ref_t , value_type>;
375
376
using result_type = reference;
376
377
377
- nth_channel_deref_fn (std:: size_t n=0 ) : _n(n) {}
378
+ nth_channel_deref_fn (index_t n=0 ) : _n(n) {}
378
379
template <typename P> nth_channel_deref_fn (const nth_channel_deref_fn<P>& d) : _n(d._n) {}
379
380
380
- std:: size_t _n; // the channel to use
381
+ index_t _n; // the channel to use
381
382
382
383
result_type operator ()(argument_type srcP) const {
383
384
return result_type (srcP[_n]);
@@ -390,7 +391,7 @@ namespace detail {
390
391
using AD = typename View::template add_deref<deref_t >;
391
392
public:
392
393
using type = typename AD::type;
393
- static type make (const View& src, std:: size_t n) {
394
+ static type make (const View& src, index_t n) {
394
395
return AD::make (src, deref_t (n));
395
396
}
396
397
};
@@ -409,13 +410,13 @@ struct nth_channel_view_type {
409
410
using VB = detail::__nth_channel_view<View,view_is_basic<View>::value>;
410
411
public:
411
412
using type = typename VB::type;
412
- static type make (const View& src, std:: size_t n) { return VB::make (src,n); }
413
+ static type make (const View& src, index_t n) { return VB::make (src,n); }
413
414
};
414
415
415
416
416
417
// / \ingroup ImageViewTransformationsNthChannel
417
418
template <typename View>
418
- typename nth_channel_view_type<View>::type nth_channel_view (const View& src, std:: size_t n) {
419
+ typename nth_channel_view_type<View>::type nth_channel_view (const View& src, index_t n) {
419
420
return nth_channel_view_type<View>::make (src,n);
420
421
}
421
422
@@ -430,11 +431,11 @@ typename nth_channel_view_type<View>::type nth_channel_view(const View& src, std
430
431
// / \brief single-channel (grayscale) view of the K-th channel of a given image_view. The channel index is a template parameter
431
432
432
433
namespace detail {
433
- template <std:: size_t K, typename View, bool AreChannelsTogether> struct __kth_channel_view_basic ;
434
+ template <index_t K, typename View, bool AreChannelsTogether> struct __kth_channel_view_basic ;
434
435
435
436
// kth_channel_view when the channels are not adjacent in memory. This can happen for multi-channel interleaved images
436
437
// or images with a step
437
- template <std:: size_t K, typename View>
438
+ template <index_t K, typename View>
438
439
struct __kth_channel_view_basic <K,View,false > {
439
440
private:
440
441
using channel_t = typename kth_element_type<typename View::value_type,K>::type;
@@ -451,7 +452,7 @@ namespace detail {
451
452
};
452
453
453
454
// kth_channel_view when the channels are together in memory (true for simple grayscale or planar images)
454
- template <std:: size_t K, typename View>
455
+ template <index_t K, typename View>
455
456
struct __kth_channel_view_basic <K,View,true > {
456
457
private:
457
458
using channel_t = typename kth_element_type<typename View::value_type, K>::type;
@@ -463,10 +464,10 @@ namespace detail {
463
464
}
464
465
};
465
466
466
- template <std:: size_t K, typename View, bool IsBasic> struct __kth_channel_view ;
467
+ template <index_t K, typename View, bool IsBasic> struct __kth_channel_view ;
467
468
468
469
// For basic (memory-based) views dispatch to __kth_channel_view_basic
469
- template <std:: size_t K, typename View> struct __kth_channel_view <K,View,true >
470
+ template <index_t K, typename View> struct __kth_channel_view <K,View,true >
470
471
{
471
472
private:
472
473
using src_x_iterator = typename View::x_iterator;
@@ -491,7 +492,7 @@ namespace detail {
491
492
// / If the input is a pixel value or constant reference, the function object is immutable. Otherwise it is mutable (and returns non-const reference to the k-th channel)
492
493
// / \tparam SrcP reference to PixelConcept (could be pixel value or const/non-const reference)
493
494
// / Examples: pixel<T,L>, pixel<T,L>&, const pixel<T,L>&, planar_pixel_reference<T&,L>, planar_pixel_reference<const T&,L>
494
- template <std:: size_t K, typename SrcP>
495
+ template <index_t K, typename SrcP>
495
496
struct kth_channel_deref_fn
496
497
{
497
498
static constexpr bool is_mutable =
@@ -519,7 +520,7 @@ namespace detail {
519
520
}
520
521
};
521
522
522
- template <std:: size_t K, typename View> struct __kth_channel_view <K,View,false > {
523
+ template <index_t K, typename View> struct __kth_channel_view <K,View,false > {
523
524
private:
524
525
using deref_t = kth_channel_deref_fn<K,typename View::reference>;
525
526
using AD = typename View::template add_deref<deref_t >;
@@ -537,7 +538,7 @@ namespace detail {
537
538
// / If the channels in the source view are adjacent in memory (such as planar non-step view or single-channel view) then the
538
539
// / return view is a single-channel non-step view.
539
540
// / If the channels are non-adjacent (interleaved and/or step view) then the return view is a single-channel step view.
540
- template <std:: size_t K, typename View>
541
+ template <index_t K, typename View>
541
542
struct kth_channel_view_type {
542
543
private:
543
544
BOOST_GIL_CLASS_REQUIRE (View, boost::gil, ImageViewConcept)
@@ -548,7 +549,7 @@ struct kth_channel_view_type {
548
549
};
549
550
550
551
// / \ingroup ImageViewTransformationsKthChannel
551
- template <std:: size_t K, typename View>
552
+ template <index_t K, typename View>
552
553
typename kth_channel_view_type<K,View>::type kth_channel_view (const View& src) {
553
554
return kth_channel_view_type<K,View>::make (src);
554
555
}
0 commit comments