CVB++ 15.0
decl_block.hpp
1#pragma once
2
3#include "../../global.hpp"
4
5#include "../../_detail/block/block_helper_linear_value.hpp"
6#include "../../_detail/block/block_helper_ref_value.hpp"
7
8#include "decl_block_base.hpp"
9
10namespace Cvb
11{
12 CVB_BEGIN_INLINE_NS
13
21 template <class T, class ACCESSTRAIT>
22 class Block final : public BlockBase<ACCESSTRAIT>
23 {
24 template <class Ty, class OTHER_ACCESSTRAIT>
25 friend class Block;
26
27 public:
28 using ComponentType = ComponentOfT<T>; // Type of one pixel.
29 using AccessTrait = ACCESSTRAIT; // Type of the access trait.
30 using PixelType = T; // Actual type T given as template argument.
31 using ConstPixelType = const T; // Const version of PixelType.
32
34 static constexpr const bool IsPixelTypeMutable = true;
35
36 private:
37 static constexpr const size_t NumComponents = NumComponentsOfV<T>;
38 static_assert(NumComponents > 0, "Cvb: NumComponents must be at least 1");
39
41 template <class OTHER_ACCESSTRAIT>
42 explicit Block(const Block<T, OTHER_ACCESSTRAIT> &other, Cvb::Rect<int> aoi)
43 : BlockBase<ACCESSTRAIT>(other, aoi)
44 {
45 if (!IsAligned<PixelType>(other.Access()(0, 0))
46 || (aoi.Width() > 1 && !IsAligned<PixelType>(other.Access()(1, 0)))
47 || (aoi.Height() > 1 && !IsAligned<PixelType>(other.Access()(0, 1))))
48 throw std::runtime_error("Block-type and pointer must have the same alignment.");
49 }
50
51 public:
53 explicit Block(ACCESSTRAIT access, Cvb::Size2D<int> size)
54 : BlockBase<ACCESSTRAIT>(std::move(access), size)
55 {
56 if (!IsAligned<PixelType>(access(0, 0)) || (size.Width() > 1 && !IsAligned<PixelType>(access(1, 0)))
57 || (size.Height() > 1 && !IsAligned<PixelType>(access(0, 1))))
58 throw std::runtime_error("Block-type and pointer must have the same alignment.");
59 }
60
61
62 Block(const Block &other) noexcept = default;
63 Block &operator=(const Block &other) noexcept = default;
64 Block(Block&& other) noexcept = default;
65 Block& operator=(Block&& other) noexcept = default;
66 ~Block() = default;
67
80 auto SubBlock(Cvb::Rect<int> aoi) const -> Block<T, decltype(this->Access().NewMoved(Cvb::Rect<int>{}))>
81 {
82 return Block<T, decltype(this->Access().NewMoved(Cvb::Rect<int>{}))>{*this, aoi};
83 }
84
96 CVB_FORCE_INLINE const PixelType &operator()(int x, int y) const noexcept
97 {
98 return *reinterpret_cast<const PixelType *>(this->Access()(x, y));
99 }
100
112 CVB_FORCE_INLINE PixelType &operator()(int x, int y) noexcept
113 {
114 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()(x, y))>::type>::value,
115 "The underlying access does not support mutable access. Make the Block const.");
116 return *reinterpret_cast<PixelType *>(this->Access()(x, y));
117 }
118
119 private:
120 template <class PTy, size_t... I>
121 CVB_FORCE_INLINE static void SetElements(PixelType &pt, const PTy &value, std::index_sequence<I...>) noexcept
122 {
123 using expander =
124 int[]; // NOLINT(cppcoreguidelines-avoid-c-arrays) fold expression support for pre C++17 standards.. explanation see FillPixelValueElements.
125
126 expander{0, (set<I>(pt, get<I>(value)), 0)...};
127 }
128
129 public:
144 template <class FromPixelType>
145 CVB_FORCE_INLINE auto Set(int x, int y, const FromPixelType &value) noexcept
146 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value, void>
147 {
148 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()(x, y))>::type>::value,
149 "The underlying access does not support mutable access.");
150 static_assert(NumComponentsOfV<FromPixelType> >= NumComponents || NumComponentsOfV<FromPixelType> == -1,
151 "Incoming value must have at least as many components as current value.");
152
153 SetElements(*reinterpret_cast<PixelType *>(this->Access()(x, y)), value,
154 std::make_index_sequence<NumComponents>{});
155 }
156
158 CVB_FORCE_INLINE void Set(int x, int y, const PixelType &value) noexcept
159 {
160 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()(x, y))>::type>::value,
161 "The underlying access does not support mutable access.");
162 *reinterpret_cast<PixelType *>(this->Access()(x, y)) = value;
163 }
164
175 CVB_FORCE_INLINE const PixelType &operator[](int idx) const noexcept
176 {
177 return *reinterpret_cast<const PixelType *>(this->Access()[idx]);
178 }
179
190 CVB_FORCE_INLINE PixelType &operator[](int idx) noexcept
191 {
192 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()[idx])>::type>::value,
193 "The underlying access does not support mutable access. Make the Block const.");
194 return *reinterpret_cast<PixelType *>(this->Access()[idx]);
195 }
196
210 template <class FromPixelType>
211 CVB_FORCE_INLINE auto Set(int idx, const FromPixelType &value) noexcept
212 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value, void>
213 {
214 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()[idx])>::type>::value,
215 "The underlying access does not support mutable access.");
216 static_assert(NumComponentsOfV<FromPixelType> >= NumComponents || NumComponentsOfV<FromPixelType> == -1,
217 "Incoming value must have at least as many components as current value.");
218
219 SetElements(*reinterpret_cast<PixelType *>(this->Access()[idx]), value,
220 std::make_index_sequence<NumComponents>{});
221 }
222
224 CVB_FORCE_INLINE void Set(int idx, const PixelType &value) noexcept
225 {
226 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()[idx])>::type>::value,
227 "The underlying access does not support mutable access.");
228 *reinterpret_cast<PixelType *>(this->Access()[idx]) = value;
229 }
230
232 class Row
233 {
234 friend class Block;
235
236 using AccessRow = typename AccessTrait::Row;
237
238 AccessRow row_;
239
245 explicit Row(AccessRow row) noexcept
246 : row_(row)
247 {
248 }
249
250 public:
252 Row() = default;
253
254
255 Row(const Row &) noexcept = default;
256 Row &operator=(const Row &) noexcept = default;
257 Row(Row&& other) noexcept = default;
258 Row& operator=(Row&& other) noexcept = default;
259 ~Row() = default;
260
270 CVB_FORCE_INLINE PixelType &operator[](int x) noexcept
271 {
272 static_assert(!std::is_const<typename std::remove_pointer<decltype(row_[x])>::type>::value,
273 "The underlying access does not support mutable access. Make the Row const.");
274 return *reinterpret_cast<PixelType *>(row_[x]);
275 }
276
286 CVB_FORCE_INLINE const PixelType &operator[](int x) const noexcept
287 {
288 return *reinterpret_cast<const PixelType *>(row_[x]);
289 }
290
303 template <class FromPixelType>
304 CVB_FORCE_INLINE auto Set(int x, const FromPixelType &value) noexcept
305 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value,
306 void>
307 {
308 static_assert(!std::is_const<typename std::remove_pointer<decltype(row_[x])>::type>::value,
309 "The underlying access does not support mutable access.");
310 static_assert(NumComponentsOfV<FromPixelType> >= NumComponents || NumComponentsOfV<FromPixelType> == -1,
311 "Incoming value must have at least as many components as current value.");
312
313 SetElements(*reinterpret_cast<PixelType *>(row_[x]), value, std::make_index_sequence<NumComponents>{});
314 }
315
317 CVB_FORCE_INLINE void Set(int x, const PixelType &value) noexcept
318 {
319 static_assert(!std::is_const<typename std::remove_pointer<decltype(row_[0])>::type>::value,
320 "The underlying access does not support mutable access.");
321 *reinterpret_cast<PixelType *>(row_[x]) = value;
322 }
323 };
324
326 class Column
327 {
328 friend class Block;
329
330 using AccessColumn = typename AccessTrait::Column;
331
332 AccessColumn col_;
333
339 explicit Column(AccessColumn col) noexcept
340 : col_(col)
341 {
342 }
343
344 public:
346 Column() = default;
347
348
349 Column(const Column &) = default;
350 Column &operator=(const Column &) = default;
351 Column(Column&& other) noexcept = default;
352 Column& operator=(Column&& other) noexcept = default;
353 ~Column() = default;
354
364 CVB_FORCE_INLINE PixelType &operator[](int y) noexcept
365 {
366 static_assert(!std::is_const<typename std::remove_pointer<decltype(col_[y])>::type>::value,
367 "The underlying access does not support mutable access. Make the Column const.");
368 return *reinterpret_cast<PixelType *>(col_[y]);
369 }
370
380 CVB_FORCE_INLINE const PixelType &operator[](int y) const noexcept
381 {
382 return *reinterpret_cast<const PixelType *>(col_[y]);
383 }
384
397 template <class FromPixelType>
398 CVB_FORCE_INLINE auto Set(int y, const FromPixelType &value) noexcept
399 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value,
400 void>
401 {
402 static_assert(!std::is_const<typename std::remove_pointer<decltype(col_[y])>::type>::value,
403 "The underlying access does not support mutable access.");
404 static_assert(NumComponentsOfV<FromPixelType> >= NumComponents || NumComponentsOfV<FromPixelType> == -1,
405 "Incoming value must have at least as many components as current value.");
406
407 SetElements(*reinterpret_cast<PixelType *>(col_[y]), value, std::make_index_sequence<NumComponents>{});
408 }
409
411 CVB_FORCE_INLINE void Set(int y, const PixelType &value) noexcept
412 {
413 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->row_[0])>::type>::value,
414 "The underlying access does not support mutable access.");
415 *reinterpret_cast<PixelType *>(col_[y]) = value;
416 }
417 };
418
428 Row RowAt(int y) const noexcept
429 {
430 return Row{this->Access().RowAt(y)};
431 }
432
442 Column ColumnAt(int x) const noexcept
443 {
444 return Column{this->Access().ColumnAt(x)};
445 }
446 };
447
448 // specialization for ScatterAccess
449 template <class T, int K>
450 class Block<T, ScatterAccess<K>> final : public BlockBase<ScatterAccess<K>>
451 {
452 template <class Ty, class OTHER_ACCESSTRAIT>
453 friend class Block;
454
455 public:
456 using ComponentType = ComponentOfT<T>;
457 using AccessTrait = ScatterAccess<K>;
458 using PixelType = T;
459 using ConstPixelType =
461 const ConstRefValue<ComponentType, K>,
462 const PixelType>::type;
463
464 static constexpr const bool IsPixelTypeMutable =
467
468 private:
470 explicit Block(const Block &other, Cvb::Rect<int> aoi)
471 : BlockBase<ScatterAccess<K>>(other, aoi)
472 {
473 }
474
475 public:
477 explicit Block(AccessTrait access, Cvb::Size2D<int> size)
478 : BlockBase<AccessTrait>(std::move(access), std::move(size))
479 {
480 }
481
482
483 Block(const Block &other) noexcept = default;
484 Block &operator=(const Block &other) noexcept = default;
485 Block(Block&& other) noexcept = default;
486 Block& operator=(Block&& other) noexcept = default;
487 ~Block() = default;
488
501 auto SubBlock(Cvb::Rect<int> aoi) const -> Block<T, decltype(this->Access().NewMoved(Cvb::Rect<int>{}))>
502 {
503 return Block<T, decltype(this->Access().NewMoved(Cvb::Rect<int>{}))>{*this, aoi};
504 }
505
506 private:
514 template <class PTy, class Ty, size_t... I>
515 static CVB_FORCE_INLINE PTy FillPixelValueElements(Ty addresses, std::index_sequence<I...>) noexcept
516 {
517 // JMe: as C++14 does not yet support fold expressions, which would make this a bit more straight forward I had to
518 // go with this weird version As `I` is a template parameter pack, it has to be expanded with the ... operator.
519 // But this is only possible in contexts, where a list of `xxx, yyy, zzz` is allowed, as the ... operator joins
520 // the expression before it with commas. One such context where it is possible to expand the parameter pack, is
521 // array initialization as used here. The array is unnamed, to make clear to the compiler, that the array can be
522 // optimized away. If `set` returned something it could be as short as: int[]{internal_set<I>(value,
523 // reinterpret_cast<const ComponentType*>(addresses[I]))...}; this just calls set<0>, set<1>, set<2>,... with the
524 // corresponding address and "stores" the return values in the array (which will be discarded anyway). As `set`
525 // returns void, we need to utilize the comma operator, which evaluates the expression left of the operator but
526 // discards its value and returns the value on the right of the comma (an int). E.g. after `int i = 200; int x =
527 // i++, 0;` i == 201 and x == 0. Therefore the expression down there just calls set<I> for all I in 0 to K - 1
528 // with the corresponding address.
529
530 using expander = int[]; // NOLINT(cppcoreguidelines-avoid-c-arrays) fold expression support for pre C++17 standards..
531
532 using CType = typename std::conditional<std::is_const<PTy>::value, const ComponentType, ComponentType>::type;
533 typename std::remove_const<PTy>::type value;
534 expander{0, ((void)internal_set<I>(value, reinterpret_cast<CType *>(addresses[I])), 0)...};
535 return value;
536 }
537
539 template <class PTy, class Ty>
540 static CVB_FORCE_INLINE PTy FillPixelValue(Ty addresses) noexcept
541 {
542 return FillPixelValueElements<PTy>(addresses, std::make_index_sequence<K>());
543 }
544
551 template <class Ty, class PTy, size_t... I>
552 CVB_FORCE_INLINE static void SetElements(Ty addresses, const PTy &value, std::index_sequence<I...>) noexcept
553 {
554 // fold expression support for pre C++17 standards.. explanation see FillPixelValueElements.
555 using expander = int[]; // NOLINT(cppcoreguidelines-avoid-c-arrays)
556
557 expander{0, (*reinterpret_cast<ComponentType *>(addresses[I]) = get<I>(value), 0)...};
558 }
559
560 public:
572 CVB_FORCE_INLINE ConstPixelType operator()(int x, int y) const noexcept
573 {
574 auto addresses = this->Access()(x, y);
575 return FillPixelValue<ConstPixelType>(addresses);
576 }
577
589 template <bool ENABLE = IsPixelTypeMutable, std::enable_if_t<ENABLE, int> = 0>
590 CVB_FORCE_INLINE PixelType operator()(int x, int y) noexcept
591 {
592 auto addresses = this->Access()(x, y);
593 return FillPixelValue<PixelType>(addresses);
594 }
595
610 template <class FromPixelType>
611 CVB_FORCE_INLINE auto Set(int x, int y, const FromPixelType &value) noexcept
612 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value, void>
613 {
614 auto addresses = this->Access()(x, y);
615 SetElements(addresses, value, std::make_index_sequence<K>());
616 }
617
619 CVB_FORCE_INLINE void Set(int x, int y, const PixelType &value) noexcept
620 {
621 auto addresses = this->Access()(x, y);
622 SetElements(addresses, value, std::make_index_sequence<K>());
623 }
624
635 CVB_FORCE_INLINE ConstPixelType operator[](int idx) const noexcept
636 {
637 auto addresses = this->Access()[idx];
638 return FillPixelValue<ConstPixelType>(addresses);
639 }
640
651 template <bool ENABLE = IsPixelTypeMutable, std::enable_if_t<ENABLE, int> = 0>
652 CVB_FORCE_INLINE PixelType operator[](int idx) noexcept
653 {
654 auto addresses = this->Access()[idx];
655 return FillPixelValue<PixelType>(addresses);
656 }
657
671 template <class FromPixelType>
672 CVB_FORCE_INLINE auto Set(int idx, const FromPixelType &value) noexcept
673 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value, void>
674 {
675 auto addresses = this->Access()[idx];
676 SetElements(addresses, value, std::make_index_sequence<K>());
677 }
678
680 CVB_FORCE_INLINE void Set(int idx, const PixelType &value) noexcept
681 {
682 auto addresses = this->Access()[idx];
683 SetElements(addresses, value, std::make_index_sequence<K>());
684 }
685
687 class Row
688 {
689 friend class Block;
690
691 using AccessRow = typename AccessTrait::Row;
692
693 AccessRow row_;
694
700 explicit Row(AccessRow row) noexcept
701 : row_(row)
702 {
703 }
704
705 public:
707 Row() = default;
708
709
710 Row(const Row & other) noexcept = default;
711 Row &operator=(const Row &other) noexcept = default;
712 Row(Row&& other) noexcept = default;
713 Row& operator=(Row && other) noexcept = default;
714 ~Row() = default;
715
725 template <bool ENABLE = IsPixelTypeMutable, std::enable_if_t<ENABLE, int> = 0>
726 CVB_FORCE_INLINE PixelType operator[](int x) noexcept
727 {
728 auto addresses = row_[x];
729 return FillPixelValue<PixelType>(addresses);
730 }
731
741 CVB_FORCE_INLINE ConstPixelType operator[](int x) const noexcept
742 {
743 auto addresses = row_[x];
744 return FillPixelValue<ConstPixelType>(addresses);
745 }
746
759 template <class FromPixelType>
760 CVB_FORCE_INLINE auto Set(int x, const FromPixelType &value) noexcept
761 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value,
762 void>
763 {
764 auto addresses = row_[x];
765 SetElements(addresses, value, std::make_index_sequence<K>());
766 }
767
769 CVB_FORCE_INLINE void Set(int x, const PixelType &value) noexcept
770 {
771 auto addresses = row_[x];
772 SetElements(addresses, value, std::make_index_sequence<K>());
773 }
774 };
775
777 class Column
778 {
779 friend class Block;
780
781 using AccessColumn = typename AccessTrait::Column;
782
783 AccessColumn col_;
784
790 explicit Column(AccessColumn col) noexcept
791 : col_(col)
792 {
793 }
794
795 public:
797 Column() = default;
798
799
800 Column(const Column &other) noexcept = default;
801 Column &operator=(const Column &other) noexcept = default;
802 Column(Column&& other) noexcept = default;
803 Column& operator=(Column&& other) noexcept = default;
804 ~Column() = default;
805
815 template <bool ENABLE = IsPixelTypeMutable, std::enable_if_t<ENABLE, int> = 0>
816 CVB_FORCE_INLINE PixelType operator[](int y) noexcept
817 {
818 auto addresses = col_[y];
819 return FillPixelValue<PixelType>(addresses);
820 }
821
831 CVB_FORCE_INLINE ConstPixelType operator[](int y) const noexcept
832 {
833 auto addresses = col_[y];
834 return FillPixelValue<ConstPixelType>(addresses);
835 }
836
849 template <class FromPixelType>
850 CVB_FORCE_INLINE auto Set(int y, const FromPixelType &value) noexcept
851 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value,
852 void>
853 {
854 auto addresses = col_[y];
855 SetElements(addresses, value, std::make_index_sequence<K>());
856 }
857
859 CVB_FORCE_INLINE void Set(int y, const PixelType &value) noexcept
860 {
861 auto addresses = col_[y];
862 SetElements(addresses, value, std::make_index_sequence<K>());
863 }
864 };
865
875 Row RowAt(int y) const noexcept
876 {
877 return Row{this->Access().RowAt(y)};
878 }
879
889 Column ColumnAt(int x) const noexcept
890 {
891 return Column{this->Access().ColumnAt(x)};
892 }
893 };
894
901 template <class T>
903
910 template <class T>
912
919 template <class T>
921
928 template <class T, size_t K>
930
931 CVB_END_INLINE_NS
932} // namespace Cvb
A single column.
Definition: decl_block.hpp:327
Column()=default
Default ctor.
CVB_FORCE_INLINE PixelType & operator[](int y) noexcept
Row access.
Definition: decl_block.hpp:364
CVB_FORCE_INLINE const PixelType & operator[](int y) const noexcept
Row access.
Definition: decl_block.hpp:380
CVB_FORCE_INLINE void Set(int y, const PixelType &value) noexcept
Row setter.
Definition: decl_block.hpp:411
CVB_FORCE_INLINE auto Set(int y, const FromPixelType &value) noexcept -> std::enable_if_t<!std::is_convertible< remove_cvref_t< FromPixelType >, remove_cvref_t< PixelType > >::value, void >
Row setter.
Definition: decl_block.hpp:398
A single row.
Definition: decl_block.hpp:233
CVB_FORCE_INLINE PixelType & operator[](int x) noexcept
Column access.
Definition: decl_block.hpp:270
CVB_FORCE_INLINE const PixelType & operator[](int x) const noexcept
Column access.
Definition: decl_block.hpp:286
Row()=default
Default ctor.
CVB_FORCE_INLINE void Set(int x, const PixelType &value) noexcept
Column setter.
Definition: decl_block.hpp:317
CVB_FORCE_INLINE auto Set(int x, const FromPixelType &value) noexcept -> std::enable_if_t<!std::is_convertible< remove_cvref_t< FromPixelType >, remove_cvref_t< PixelType > >::value, void >
Column setter.
Definition: decl_block.hpp:304
CVB_FORCE_INLINE ConstPixelType operator[](int y) const noexcept
Row access.
Definition: decl_block.hpp:831
CVB_FORCE_INLINE void Set(int y, const PixelType &value) noexcept
Row setter.
Definition: decl_block.hpp:859
CVB_FORCE_INLINE auto Set(int y, const FromPixelType &value) noexcept -> std::enable_if_t<!std::is_convertible< remove_cvref_t< FromPixelType >, remove_cvref_t< PixelType > >::value, void >
Row setter.
Definition: decl_block.hpp:850
CVB_FORCE_INLINE PixelType operator[](int y) noexcept
Row access.
Definition: decl_block.hpp:816
CVB_FORCE_INLINE void Set(int x, const PixelType &value) noexcept
Column setter.
Definition: decl_block.hpp:769
CVB_FORCE_INLINE ConstPixelType operator[](int x) const noexcept
Column access.
Definition: decl_block.hpp:741
CVB_FORCE_INLINE PixelType operator[](int x) noexcept
Column access.
Definition: decl_block.hpp:726
CVB_FORCE_INLINE auto Set(int x, const FromPixelType &value) noexcept -> std::enable_if_t<!std::is_convertible< remove_cvref_t< FromPixelType >, remove_cvref_t< PixelType > >::value, void >
Column setter.
Definition: decl_block.hpp:760
Base class for all typed Cvb::Block types.
Definition: decl_block_base.hpp:23
CVB_FORCE_INLINE const AccessTrait & Access() const noexcept
Gets the pixel access.
Definition: decl_block_base.hpp:88
Non-owning view on a 2d-plane of data.
Definition: decl_block.hpp:23
auto SubBlock(Cvb::Rect< int > aoi) const -> Block< T, decltype(this->Access().NewMoved(Cvb::Rect< int >{}))>
Creates a new sub Block from this block.
Definition: decl_block.hpp:80
Block(ACCESSTRAIT access, Cvb::Size2D< int > size)
Base class for all typed Cvb::Block types.
Definition: decl_block.hpp:53
CVB_FORCE_INLINE PixelType & operator[](int idx) noexcept
Coordinate pixel access operator.
Definition: decl_block.hpp:190
CVB_FORCE_INLINE PixelType & operator()(int x, int y) noexcept
Coordinate pixel access operator.
Definition: decl_block.hpp:112
Block< T, ScatterAccess< K > > ScatterBlock
A Cvb::Block of variant planes.
Definition: decl_block.hpp:929
CVB_FORCE_INLINE void Set(int idx, const PixelType &value) noexcept
Index setter.
Definition: decl_block.hpp:224
CVB_FORCE_INLINE auto Set(int x, int y, const FromPixelType &value) noexcept -> std::enable_if_t<!std::is_convertible< remove_cvref_t< FromPixelType >, remove_cvref_t< PixelType > >::value, void >
Coordinate setter.
Definition: decl_block.hpp:145
CVB_FORCE_INLINE const PixelType & operator[](int idx) const noexcept
Index pixel access operator.
Definition: decl_block.hpp:175
CVB_FORCE_INLINE void Set(int x, int y, const PixelType &value) noexcept
Coordinate setter.
Definition: decl_block.hpp:158
Row RowAt(int y) const noexcept
Gets the Block::Row at y.
Definition: decl_block.hpp:428
CVB_FORCE_INLINE auto Set(int idx, const FromPixelType &value) noexcept -> std::enable_if_t<!std::is_convertible< remove_cvref_t< FromPixelType >, remove_cvref_t< PixelType > >::value, void >
Index setter.
Definition: decl_block.hpp:211
Column ColumnAt(int x) const noexcept
Gets the Block::Column at x.
Definition: decl_block.hpp:442
static constexpr const bool IsPixelTypeMutable
! Indicates whether the returned values of operator(x,y) or operator[idx] are mutable.
Definition: decl_block.hpp:34
CVB_FORCE_INLINE const PixelType & operator()(int x, int y) const noexcept
Coordinate pixel access operator.
Definition: decl_block.hpp:96
A single column.
Definition: decl_scatter_access.hpp:369
A single row.
Definition: decl_scatter_access.hpp:269
T Height() const noexcept
Gets the vertical component of the size.
Definition: size_2d.hpp:79
T Width() const noexcept
Gets the horizontal component of the size.
Definition: size_2d.hpp:59
T move(T... args)
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24