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 Block(const Block &other) noexcept = default;
62 Block &operator=(const Block &other) noexcept = default;
63 Block(Block &&other) noexcept = default;
64 Block &operator=(Block &&other) noexcept = default;
65 ~Block() = default;
66
79 auto SubBlock(Cvb::Rect<int> aoi) const -> Block<T, decltype(this->Access().NewMoved(Cvb::Rect<int>{}))>
80 {
81 return Block<T, decltype(this->Access().NewMoved(Cvb::Rect<int>{}))>{*this, aoi};
82 }
83
95 CVB_FORCE_INLINE const PixelType &operator()(int x, int y) const noexcept
96 {
97 return *reinterpret_cast<const PixelType *>(this->Access()(x, y));
98 }
99
111 CVB_FORCE_INLINE PixelType &operator()(int x, int y) noexcept
112 {
113 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()(x, y))>::type>::value,
114 "The underlying access does not support mutable access. Make the Block const.");
115 return *reinterpret_cast<PixelType *>(this->Access()(x, y));
116 }
117
118 private:
119 template <class PTy, size_t... I>
120 CVB_FORCE_INLINE static void SetElements(PixelType &pt, const PTy &value, std::index_sequence<I...>) noexcept
121 {
122 using expander = int[]; // NOLINT(cppcoreguidelines-avoid-c-arrays) fold expression support for pre C++17
123 // standards.. explanation see FillPixelValueElements.
124
125 expander{0, (set<I>(pt, get<I>(value)), 0)...};
126 }
127
128 public:
143 template <class FromPixelType>
144 CVB_FORCE_INLINE auto Set(int x, int y, const FromPixelType &value) noexcept
145 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value, void>
146 {
147 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()(x, y))>::type>::value,
148 "The underlying access does not support mutable access.");
149 static_assert(NumComponentsOfV<FromPixelType> >= NumComponents || NumComponentsOfV<FromPixelType> == -1,
150 "Incoming value must have at least as many components as current value.");
151
152 SetElements(*reinterpret_cast<PixelType *>(this->Access()(x, y)), value,
153 std::make_index_sequence<NumComponents>{});
154 }
155
157 CVB_FORCE_INLINE void Set(int x, int y, const PixelType &value) noexcept
158 {
159 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()(x, y))>::type>::value,
160 "The underlying access does not support mutable access.");
161 *reinterpret_cast<PixelType *>(this->Access()(x, y)) = value;
162 }
163
174 CVB_FORCE_INLINE const PixelType &operator[](int idx) const noexcept
175 {
176 return *reinterpret_cast<const PixelType *>(this->Access()[idx]);
177 }
178
189 CVB_FORCE_INLINE PixelType &operator[](int idx) noexcept
190 {
191 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()[idx])>::type>::value,
192 "The underlying access does not support mutable access. Make the Block const.");
193 return *reinterpret_cast<PixelType *>(this->Access()[idx]);
194 }
195
209 template <class FromPixelType>
210 CVB_FORCE_INLINE auto Set(int idx, const FromPixelType &value) noexcept
211 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value, void>
212 {
213 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()[idx])>::type>::value,
214 "The underlying access does not support mutable access.");
215 static_assert(NumComponentsOfV<FromPixelType> >= NumComponents || NumComponentsOfV<FromPixelType> == -1,
216 "Incoming value must have at least as many components as current value.");
217
218 SetElements(*reinterpret_cast<PixelType *>(this->Access()[idx]), value,
219 std::make_index_sequence<NumComponents>{});
220 }
221
223 CVB_FORCE_INLINE void Set(int idx, const PixelType &value) noexcept
224 {
225 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()[idx])>::type>::value,
226 "The underlying access does not support mutable access.");
227 *reinterpret_cast<PixelType *>(this->Access()[idx]) = value;
228 }
229
231 class Row
232 {
233 friend class Block;
234
235 using AccessRow = typename AccessTrait::Row;
236
237 AccessRow row_;
238
244 explicit Row(AccessRow row) noexcept
245 : row_(row)
246 {
247 }
248
249 public:
251 Row() = default;
252
253 Row(const Row &) noexcept = default;
254 Row &operator=(const Row &) noexcept = default;
255 Row(Row &&other) noexcept = default;
256 Row &operator=(Row &&other) noexcept = default;
257 ~Row() = default;
258
268 CVB_FORCE_INLINE PixelType &operator[](int x) noexcept
269 {
270 static_assert(!std::is_const<typename std::remove_pointer<decltype(row_[x])>::type>::value,
271 "The underlying access does not support mutable access. Make the Row const.");
272 return *reinterpret_cast<PixelType *>(row_[x]);
273 }
274
284 CVB_FORCE_INLINE const PixelType &operator[](int x) const noexcept
285 {
286 return *reinterpret_cast<const PixelType *>(row_[x]);
287 }
288
301 template <class FromPixelType>
302 CVB_FORCE_INLINE auto Set(int x, const FromPixelType &value) noexcept
303 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value,
304 void>
305 {
306 static_assert(!std::is_const<typename std::remove_pointer<decltype(row_[x])>::type>::value,
307 "The underlying access does not support mutable access.");
308 static_assert(NumComponentsOfV<FromPixelType> >= NumComponents || NumComponentsOfV<FromPixelType> == -1,
309 "Incoming value must have at least as many components as current value.");
310
311 SetElements(*reinterpret_cast<PixelType *>(row_[x]), value, std::make_index_sequence<NumComponents>{});
312 }
313
315 CVB_FORCE_INLINE void Set(int x, const PixelType &value) noexcept
316 {
317 static_assert(!std::is_const<typename std::remove_pointer<decltype(row_[0])>::type>::value,
318 "The underlying access does not support mutable access.");
319 *reinterpret_cast<PixelType *>(row_[x]) = value;
320 }
321 };
322
324 class Column
325 {
326 friend class Block;
327
328 using AccessColumn = typename AccessTrait::Column;
329
330 AccessColumn col_;
331
337 explicit Column(AccessColumn col) noexcept
338 : col_(col)
339 {
340 }
341
342 public:
344 Column() = default;
345
346 Column(const Column &) = default;
347 Column &operator=(const Column &) = default;
348 Column(Column &&other) noexcept = default;
349 Column &operator=(Column &&other) noexcept = default;
350 ~Column() = default;
351
361 CVB_FORCE_INLINE PixelType &operator[](int y) noexcept
362 {
363 static_assert(!std::is_const<typename std::remove_pointer<decltype(col_[y])>::type>::value,
364 "The underlying access does not support mutable access. Make the Column const.");
365 return *reinterpret_cast<PixelType *>(col_[y]);
366 }
367
377 CVB_FORCE_INLINE const PixelType &operator[](int y) const noexcept
378 {
379 return *reinterpret_cast<const PixelType *>(col_[y]);
380 }
381
394 template <class FromPixelType>
395 CVB_FORCE_INLINE auto Set(int y, const FromPixelType &value) noexcept
396 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value,
397 void>
398 {
399 static_assert(!std::is_const<typename std::remove_pointer<decltype(col_[y])>::type>::value,
400 "The underlying access does not support mutable access.");
401 static_assert(NumComponentsOfV<FromPixelType> >= NumComponents || NumComponentsOfV<FromPixelType> == -1,
402 "Incoming value must have at least as many components as current value.");
403
404 SetElements(*reinterpret_cast<PixelType *>(col_[y]), value, std::make_index_sequence<NumComponents>{});
405 }
406
408 CVB_FORCE_INLINE void Set(int y, const PixelType &value) noexcept
409 {
410 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->col_[0])>::type>::value,
411 "The underlying access does not support mutable access.");
412 *reinterpret_cast<PixelType *>(col_[y]) = value;
413 }
414 };
415
425 Row RowAt(int y) const noexcept
426 {
427 return Row{this->Access().RowAt(y)};
428 }
429
439 Column ColumnAt(int x) const noexcept
440 {
441 return Column{this->Access().ColumnAt(x)};
442 }
443 };
444
445 // specialization for ScatterAccess
446 template <class T, int K>
447 class Block<T, ScatterAccess<K>> final : public BlockBase<ScatterAccess<K>>
448 {
449 template <class Ty, class OTHER_ACCESSTRAIT>
450 friend class Block;
451
452 public:
453 using ComponentType = ComponentOfT<T>;
454 using AccessTrait = ScatterAccess<K>;
455 using PixelType = T;
456 using ConstPixelType =
458 const ConstRefValue<ComponentType, K>,
459 const PixelType>::type;
460
461 static constexpr const bool IsPixelTypeMutable =
464
465 private:
467 explicit Block(const Block &other, Cvb::Rect<int> aoi)
468 : BlockBase<ScatterAccess<K>>(other, aoi)
469 {
470 }
471
472 public:
474 explicit Block(AccessTrait access, Cvb::Size2D<int> size)
475 : BlockBase<AccessTrait>(std::move(access), std::move(size))
476 {
477 }
478
479 Block(const Block &other) noexcept = default;
480 Block &operator=(const Block &other) noexcept = default;
481 Block(Block &&other) noexcept = default;
482 Block &operator=(Block &&other) noexcept = default;
483 ~Block() = default;
484
497 auto SubBlock(Cvb::Rect<int> aoi) const -> Block<T, decltype(this->Access().NewMoved(Cvb::Rect<int>{}))>
498 {
499 return Block<T, decltype(this->Access().NewMoved(Cvb::Rect<int>{}))>{*this, aoi};
500 }
501
502 private:
510 template <class PTy, class Ty, size_t... I>
511 static CVB_FORCE_INLINE PTy FillPixelValueElements(Ty addresses, std::index_sequence<I...>) noexcept
512 {
513 // JMe: as C++14 does not yet support fold expressions, which would make this a bit more straight forward I had to
514 // go with this weird version As `I` is a template parameter pack, it has to be expanded with the ... operator.
515 // But this is only possible in contexts, where a list of `xxx, yyy, zzz` is allowed, as the ... operator joins
516 // the expression before it with commas. One such context where it is possible to expand the parameter pack, is
517 // array initialization as used here. The array is unnamed, to make clear to the compiler, that the array can be
518 // optimized away. If `set` returned something it could be as short as: int[]{internal_set<I>(value,
519 // reinterpret_cast<const ComponentType*>(addresses[I]))...}; this just calls set<0>, set<1>, set<2>,... with the
520 // corresponding address and "stores" the return values in the array (which will be discarded anyway). As `set`
521 // returns void, we need to utilize the comma operator, which evaluates the expression left of the operator but
522 // discards its value and returns the value on the right of the comma (an int). E.g. after `int i = 200; int x =
523 // i++, 0;` i == 201 and x == 0. Therefore the expression down there just calls set<I> for all I in 0 to K - 1
524 // with the corresponding address.
525
526 using expander =
527 int[]; // NOLINT(cppcoreguidelines-avoid-c-arrays) fold expression support for pre C++17 standards..
528
529 using CType = typename std::conditional<std::is_const<PTy>::value, const ComponentType, ComponentType>::type;
530 typename std::remove_const<PTy>::type value;
531 expander{0, ((void)internal_set<I>(value, reinterpret_cast<CType *>(addresses[I])), 0)...};
532 return value;
533 }
534
536 template <class PTy, class Ty>
537 static CVB_FORCE_INLINE PTy FillPixelValue(Ty addresses) noexcept
538 {
539 return FillPixelValueElements<PTy>(addresses, std::make_index_sequence<K>());
540 }
541
548 template <class Ty, class PTy, size_t... I>
549 CVB_FORCE_INLINE static void SetElements(Ty addresses, const PTy &value, std::index_sequence<I...>) noexcept
550 {
551 // fold expression support for pre C++17 standards.. explanation see FillPixelValueElements.
552 using expander = int[]; // NOLINT(cppcoreguidelines-avoid-c-arrays)
553
554 expander{0, (*reinterpret_cast<ComponentType *>(addresses[I]) = get<I>(value), 0)...};
555 }
556
557 public:
569 CVB_FORCE_INLINE ConstPixelType operator()(int x, int y) const noexcept
570 {
571 auto addresses = this->Access()(x, y);
572 return FillPixelValue<ConstPixelType>(addresses);
573 }
574
586 template <bool ENABLE = IsPixelTypeMutable, std::enable_if_t<ENABLE, int> = 0>
587 CVB_FORCE_INLINE PixelType operator()(int x, int y) noexcept
588 {
589 auto addresses = this->Access()(x, y);
590 return FillPixelValue<PixelType>(addresses);
591 }
592
607 template <class FromPixelType>
608 CVB_FORCE_INLINE auto Set(int x, int y, const FromPixelType &value) noexcept
609 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value, void>
610 {
611 auto addresses = this->Access()(x, y);
612 SetElements(addresses, value, std::make_index_sequence<K>());
613 }
614
616 CVB_FORCE_INLINE void Set(int x, int y, const PixelType &value) noexcept
617 {
618 auto addresses = this->Access()(x, y);
619 SetElements(addresses, value, std::make_index_sequence<K>());
620 }
621
632 CVB_FORCE_INLINE ConstPixelType operator[](int idx) const noexcept
633 {
634 auto addresses = this->Access()[idx];
635 return FillPixelValue<ConstPixelType>(addresses);
636 }
637
648 template <bool ENABLE = IsPixelTypeMutable, std::enable_if_t<ENABLE, int> = 0>
649 CVB_FORCE_INLINE PixelType operator[](int idx) noexcept
650 {
651 auto addresses = this->Access()[idx];
652 return FillPixelValue<PixelType>(addresses);
653 }
654
668 template <class FromPixelType>
669 CVB_FORCE_INLINE auto Set(int idx, const FromPixelType &value) noexcept
670 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value, void>
671 {
672 auto addresses = this->Access()[idx];
673 SetElements(addresses, value, std::make_index_sequence<K>());
674 }
675
677 CVB_FORCE_INLINE void Set(int idx, const PixelType &value) noexcept
678 {
679 auto addresses = this->Access()[idx];
680 SetElements(addresses, value, std::make_index_sequence<K>());
681 }
682
684 class Row
685 {
686 friend class Block;
687
688 using AccessRow = typename AccessTrait::Row;
689
690 AccessRow row_;
691
697 explicit Row(AccessRow row) noexcept
698 : row_(row)
699 {
700 }
701
702 public:
704 Row() = default;
705
706 Row(const Row &other) noexcept = default;
707 Row &operator=(const Row &other) noexcept = default;
708 Row(Row &&other) noexcept = default;
709 Row &operator=(Row &&other) noexcept = default;
710 ~Row() = default;
711
721 template <bool ENABLE = IsPixelTypeMutable, std::enable_if_t<ENABLE, int> = 0>
722 CVB_FORCE_INLINE PixelType operator[](int x) noexcept
723 {
724 auto addresses = row_[x];
725 return FillPixelValue<PixelType>(addresses);
726 }
727
737 CVB_FORCE_INLINE ConstPixelType operator[](int x) const noexcept
738 {
739 auto addresses = row_[x];
740 return FillPixelValue<ConstPixelType>(addresses);
741 }
742
755 template <class FromPixelType>
756 CVB_FORCE_INLINE auto Set(int x, const FromPixelType &value) noexcept
757 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value,
758 void>
759 {
760 auto addresses = row_[x];
761 SetElements(addresses, value, std::make_index_sequence<K>());
762 }
763
765 CVB_FORCE_INLINE void Set(int x, const PixelType &value) noexcept
766 {
767 auto addresses = row_[x];
768 SetElements(addresses, value, std::make_index_sequence<K>());
769 }
770 };
771
773 class Column
774 {
775 friend class Block;
776
777 using AccessColumn = typename AccessTrait::Column;
778
779 AccessColumn col_;
780
786 explicit Column(AccessColumn col) noexcept
787 : col_(col)
788 {
789 }
790
791 public:
793 Column() = default;
794
795 Column(const Column &other) noexcept = default;
796 Column &operator=(const Column &other) noexcept = default;
797 Column(Column &&other) noexcept = default;
798 Column &operator=(Column &&other) noexcept = default;
799 ~Column() = default;
800
810 template <bool ENABLE = IsPixelTypeMutable, std::enable_if_t<ENABLE, int> = 0>
811 CVB_FORCE_INLINE PixelType operator[](int y) noexcept
812 {
813 auto addresses = col_[y];
814 return FillPixelValue<PixelType>(addresses);
815 }
816
826 CVB_FORCE_INLINE ConstPixelType operator[](int y) const noexcept
827 {
828 auto addresses = col_[y];
829 return FillPixelValue<ConstPixelType>(addresses);
830 }
831
844 template <class FromPixelType>
845 CVB_FORCE_INLINE auto Set(int y, const FromPixelType &value) noexcept
846 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value,
847 void>
848 {
849 auto addresses = col_[y];
850 SetElements(addresses, value, std::make_index_sequence<K>());
851 }
852
854 CVB_FORCE_INLINE void Set(int y, const PixelType &value) noexcept
855 {
856 auto addresses = col_[y];
857 SetElements(addresses, value, std::make_index_sequence<K>());
858 }
859 };
860
870 Row RowAt(int y) const noexcept
871 {
872 return Row{this->Access().RowAt(y)};
873 }
874
884 Column ColumnAt(int x) const noexcept
885 {
886 return Column{this->Access().ColumnAt(x)};
887 }
888 };
889
896 template <class T>
897 using ArrayPlaneBlock = Block<T, ArrayAccess>;
898
905 template <class T>
906 using LinearPlaneBlock = Block<T, LinearAccess>;
907
914 template <class T>
915 using VpatPlaneBlock = Block<T, VpatAccess>;
916
923 template <class T, size_t K>
924 using ScatterBlock = Block<T, ScatterAccess<K>>;
925
926 CVB_END_INLINE_NS
927} // namespace Cvb
A single column.
Definition decl_block.hpp:325
Column()=default
Default ctor.
CVB_FORCE_INLINE PixelType & operator[](int y) noexcept
Row access.
Definition decl_block.hpp:361
CVB_FORCE_INLINE const PixelType & operator[](int y) const noexcept
Row access.
Definition decl_block.hpp:377
CVB_FORCE_INLINE void Set(int y, const PixelType &value) noexcept
Row setter.
Definition decl_block.hpp:408
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:395
CVB_FORCE_INLINE PixelType & operator[](int x) noexcept
Column access.
Definition decl_block.hpp:268
CVB_FORCE_INLINE const PixelType & operator[](int x) const noexcept
Column access.
Definition decl_block.hpp:284
Row()=default
Default ctor.
CVB_FORCE_INLINE void Set(int x, const PixelType &value) noexcept
Column setter.
Definition decl_block.hpp:315
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:302
CVB_FORCE_INLINE ConstPixelType operator[](int y) const noexcept
Row access.
Definition decl_block.hpp:826
CVB_FORCE_INLINE void Set(int y, const PixelType &value) noexcept
Row setter.
Definition decl_block.hpp:854
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:845
CVB_FORCE_INLINE PixelType operator[](int y) noexcept
Row access.
Definition decl_block.hpp:811
CVB_FORCE_INLINE void Set(int x, const PixelType &value) noexcept
Column setter.
Definition decl_block.hpp:765
CVB_FORCE_INLINE ConstPixelType operator[](int x) const noexcept
Column access.
Definition decl_block.hpp:737
CVB_FORCE_INLINE PixelType operator[](int x) noexcept
Column access.
Definition decl_block.hpp:722
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:756
CVB_FORCE_INLINE const AccessTrait & Access() const noexcept
Gets the pixel access.
Definition decl_block_base.hpp:87
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:79
Block(ACCESSTRAIT access, Cvb::Size2D< int > size)
Definition decl_block.hpp:53
CVB_FORCE_INLINE PixelType & operator[](int idx) noexcept
Coordinate pixel access operator.
Definition decl_block.hpp:189
CVB_FORCE_INLINE PixelType & operator()(int x, int y) noexcept
Coordinate pixel access operator.
Definition decl_block.hpp:111
Block< T, ScatterAccess< K > > ScatterBlock
Definition decl_block.hpp:924
Block< T, VpatAccess > VpatPlaneBlock
Definition decl_block.hpp:915
CVB_FORCE_INLINE void Set(int idx, const PixelType &value) noexcept
Index setter.
Definition decl_block.hpp:223
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:144
CVB_FORCE_INLINE const PixelType & operator[](int idx) const noexcept
Index pixel access operator.
Definition decl_block.hpp:174
Block< T, LinearAccess > LinearPlaneBlock
Definition decl_block.hpp:906
CVB_FORCE_INLINE void Set(int x, int y, const PixelType &value) noexcept
Coordinate setter.
Definition decl_block.hpp:157
Row RowAt(int y) const noexcept
Gets the Block::Row at y.
Definition decl_block.hpp:425
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:210
Column ColumnAt(int x) const noexcept
Gets the Block::Column at x.
Definition decl_block.hpp:439
Block< T, ArrayAccess > ArrayPlaneBlock
A Cvb::Block of a contiguous plane.
Definition decl_block.hpp:897
static constexpr const bool IsPixelTypeMutable
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:95
Rectangle object.
Definition rect.hpp:24
A single column.
Definition decl_scatter_access.hpp:367
A single row.
Definition decl_scatter_access.hpp:268
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle...
Definition size_2d.hpp:20
T Height() const noexcept
Gets the vertical component of the size.
Definition size_2d.hpp:77
T Width() const noexcept
Gets the horizontal component of the size.
Definition size_2d.hpp:57
T move(T... args)
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17