CVB++ 15.0
Loading...
Searching...
No Matches
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
235 CVB_FORCE_INLINE void Set(int idx, const PixelType &value) noexcept
236 {
237 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->Access()[idx])>::type>::value,
238 "The underlying access does not support mutable access.");
239 *reinterpret_cast<PixelType *>(this->Access()[idx]) = value;
240 }
241
243 class Row
244 {
245 friend class Block;
246
247 using AccessRow = typename AccessTrait::Row;
248
249 AccessRow row_;
250
256 explicit Row(AccessRow row) noexcept
257 : row_(row)
258 {
259 }
260
261 public:
263 Row() = default;
264
265 Row(const Row &) noexcept = default;
266 Row &operator=(const Row &) noexcept = default;
267 Row(Row &&other) noexcept = default;
268 Row &operator=(Row &&other) noexcept = default;
269 ~Row() = default;
270
280 CVB_FORCE_INLINE PixelType &operator[](int x) noexcept
281 {
282 static_assert(!std::is_const<typename std::remove_pointer<decltype(row_[x])>::type>::value,
283 "The underlying access does not support mutable access. Make the Row const.");
284 return *reinterpret_cast<PixelType *>(row_[x]);
285 }
286
296 CVB_FORCE_INLINE const PixelType &operator[](int x) const noexcept
297 {
298 return *reinterpret_cast<const PixelType *>(row_[x]);
299 }
300
313 template <class FromPixelType>
314 CVB_FORCE_INLINE auto Set(int x, const FromPixelType &value) noexcept
315 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value,
316 void>
317 {
318 static_assert(!std::is_const<typename std::remove_pointer<decltype(row_[x])>::type>::value,
319 "The underlying access does not support mutable access.");
320 static_assert(NumComponentsOfV<FromPixelType> >= NumComponents || NumComponentsOfV<FromPixelType> == -1,
321 "Incoming value must have at least as many components as current value.");
322
323 SetElements(*reinterpret_cast<PixelType *>(row_[x]), value, std::make_index_sequence<NumComponents>{});
324 }
325
327 CVB_FORCE_INLINE void Set(int x, const PixelType &value) noexcept
328 {
329 static_assert(!std::is_const<typename std::remove_pointer<decltype(row_[0])>::type>::value,
330 "The underlying access does not support mutable access.");
331 *reinterpret_cast<PixelType *>(row_[x]) = value;
332 }
333 };
334
336 class Column
337 {
338 friend class Block;
339
340 using AccessColumn = typename AccessTrait::Column;
341
342 AccessColumn col_;
343
349 explicit Column(AccessColumn col) noexcept
350 : col_(col)
351 {
352 }
353
354 public:
356 Column() = default;
357
358 Column(const Column &) = default;
359 Column &operator=(const Column &) = default;
360 Column(Column &&other) noexcept = default;
361 Column &operator=(Column &&other) noexcept = default;
362 ~Column() = default;
363
373 CVB_FORCE_INLINE PixelType &operator[](int y) noexcept
374 {
375 static_assert(!std::is_const<typename std::remove_pointer<decltype(col_[y])>::type>::value,
376 "The underlying access does not support mutable access. Make the Column const.");
377 return *reinterpret_cast<PixelType *>(col_[y]);
378 }
379
389 CVB_FORCE_INLINE const PixelType &operator[](int y) const noexcept
390 {
391 return *reinterpret_cast<const PixelType *>(col_[y]);
392 }
393
406 template <class FromPixelType>
407 CVB_FORCE_INLINE auto Set(int y, const FromPixelType &value) noexcept
408 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value,
409 void>
410 {
411 static_assert(!std::is_const<typename std::remove_pointer<decltype(col_[y])>::type>::value,
412 "The underlying access does not support mutable access.");
413 static_assert(NumComponentsOfV<FromPixelType> >= NumComponents || NumComponentsOfV<FromPixelType> == -1,
414 "Incoming value must have at least as many components as current value.");
415
416 SetElements(*reinterpret_cast<PixelType *>(col_[y]), value, std::make_index_sequence<NumComponents>{});
417 }
418
420 CVB_FORCE_INLINE void Set(int y, const PixelType &value) noexcept
421 {
422 static_assert(!std::is_const<typename std::remove_pointer<decltype(this->col_[0])>::type>::value,
423 "The underlying access does not support mutable access.");
424 *reinterpret_cast<PixelType *>(col_[y]) = value;
425 }
426 };
427
437 Row RowAt(int y) const noexcept
438 {
439 return Row{this->Access().RowAt(y)};
440 }
441
451 Column ColumnAt(int x) const noexcept
452 {
453 return Column{this->Access().ColumnAt(x)};
454 }
455 };
456
457 // specialization for ScatterAccess
458 template <class T, int K>
459 class Block<T, ScatterAccess<K>> final : public BlockBase<ScatterAccess<K>>
460 {
461 template <class Ty, class OTHER_ACCESSTRAIT>
462 friend class Block;
463
464 public:
465 using ComponentType = ComponentOfT<T>;
466 using AccessTrait = ScatterAccess<K>;
467 using PixelType = T;
468 using ConstPixelType =
470 const ConstRefValue<ComponentType, K>,
471 const PixelType>::type;
472
473 static constexpr const bool IsPixelTypeMutable =
476
477 private:
479 explicit Block(const Block &other, Cvb::Rect<int> aoi)
480 : BlockBase<ScatterAccess<K>>(other, aoi)
481 {
482 }
483
484 public:
486 explicit Block(AccessTrait access, Cvb::Size2D<int> size)
487 : BlockBase<AccessTrait>(std::move(access), std::move(size))
488 {
489 }
490
491 Block(const Block &other) noexcept = default;
492 Block &operator=(const Block &other) noexcept = default;
493 Block(Block &&other) noexcept = default;
494 Block &operator=(Block &&other) noexcept = default;
495 ~Block() = default;
496
509 auto SubBlock(Cvb::Rect<int> aoi) const -> Block<T, decltype(this->Access().NewMoved(Cvb::Rect<int>{}))>
510 {
511 return Block<T, decltype(this->Access().NewMoved(Cvb::Rect<int>{}))>{*this, aoi};
512 }
513
514 private:
522 template <class PTy, class Ty, size_t... I>
523 static CVB_FORCE_INLINE PTy FillPixelValueElements(Ty addresses, std::index_sequence<I...>) noexcept
524 {
525 // JMe: as C++14 does not yet support fold expressions, which would make this a bit more straight forward I had to
526 // go with this weird version As `I` is a template parameter pack, it has to be expanded with the ... operator.
527 // But this is only possible in contexts, where a list of `xxx, yyy, zzz` is allowed, as the ... operator joins
528 // the expression before it with commas. One such context where it is possible to expand the parameter pack, is
529 // array initialization as used here. The array is unnamed, to make clear to the compiler, that the array can be
530 // optimized away. If `set` returned something it could be as short as: int[]{internal_set<I>(value,
531 // reinterpret_cast<const ComponentType*>(addresses[I]))...}; this just calls set<0>, set<1>, set<2>,... with the
532 // corresponding address and "stores" the return values in the array (which will be discarded anyway). As `set`
533 // returns void, we need to utilize the comma operator, which evaluates the expression left of the operator but
534 // discards its value and returns the value on the right of the comma (an int). E.g. after `int i = 200; int x =
535 // i++, 0;` i == 201 and x == 0. Therefore the expression down there just calls set<I> for all I in 0 to K - 1
536 // with the corresponding address.
537
538 using expander =
539 int[]; // NOLINT(cppcoreguidelines-avoid-c-arrays) fold expression support for pre C++17 standards..
540
541 using CType = typename std::conditional<std::is_const<PTy>::value, const ComponentType, ComponentType>::type;
542 typename std::remove_const<PTy>::type value;
543 expander{0, ((void)internal_set<I>(value, reinterpret_cast<CType *>(addresses[I])), 0)...};
544 return value;
545 }
546
548 template <class PTy, class Ty>
549 static CVB_FORCE_INLINE PTy FillPixelValue(Ty addresses) noexcept
550 {
551 return FillPixelValueElements<PTy>(addresses, std::make_index_sequence<K>());
552 }
553
560 template <class Ty, class PTy, size_t... I>
561 CVB_FORCE_INLINE static void SetElements(Ty addresses, const PTy &value, std::index_sequence<I...>) noexcept
562 {
563 // fold expression support for pre C++17 standards.. explanation see FillPixelValueElements.
564 using expander = int[]; // NOLINT(cppcoreguidelines-avoid-c-arrays)
565
566 expander{0, (*reinterpret_cast<ComponentType *>(addresses[I]) = get<I>(value), 0)...};
567 }
568
569 public:
581 CVB_FORCE_INLINE ConstPixelType operator()(int x, int y) const noexcept
582 {
583 auto addresses = this->Access()(x, y);
584 return FillPixelValue<ConstPixelType>(addresses);
585 }
586
598 template <bool ENABLE = IsPixelTypeMutable, std::enable_if_t<ENABLE, int> = 0>
599 CVB_FORCE_INLINE PixelType operator()(int x, int y) noexcept
600 {
601 auto addresses = this->Access()(x, y);
602 return FillPixelValue<PixelType>(addresses);
603 }
604
619 template <class FromPixelType>
620 CVB_FORCE_INLINE auto Set(int x, int y, const FromPixelType &value) noexcept
621 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value, void>
622 {
623 auto addresses = this->Access()(x, y);
624 SetElements(addresses, value, std::make_index_sequence<K>());
625 }
626
628 CVB_FORCE_INLINE void Set(int x, int y, const PixelType &value) noexcept
629 {
630 auto addresses = this->Access()(x, y);
631 SetElements(addresses, value, std::make_index_sequence<K>());
632 }
633
644 CVB_FORCE_INLINE ConstPixelType operator[](int idx) const noexcept
645 {
646 auto addresses = this->Access()[idx];
647 return FillPixelValue<ConstPixelType>(addresses);
648 }
649
660 template <bool ENABLE = IsPixelTypeMutable, std::enable_if_t<ENABLE, int> = 0>
661 CVB_FORCE_INLINE PixelType operator[](int idx) noexcept
662 {
663 auto addresses = this->Access()[idx];
664 return FillPixelValue<PixelType>(addresses);
665 }
666
680 template <class FromPixelType>
681 CVB_FORCE_INLINE auto Set(int idx, const FromPixelType &value) noexcept
682 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value, void>
683 {
684 auto addresses = this->Access()[idx];
685 SetElements(addresses, value, std::make_index_sequence<K>());
686 }
687
689 CVB_FORCE_INLINE void Set(int idx, const PixelType &value) noexcept
690 {
691 auto addresses = this->Access()[idx];
692 SetElements(addresses, value, std::make_index_sequence<K>());
693 }
694
696 class Row
697 {
698 friend class Block;
699
700 using AccessRow = typename AccessTrait::Row;
701
702 AccessRow row_;
703
709 explicit Row(AccessRow row) noexcept
710 : row_(row)
711 {
712 }
713
714 public:
716 Row() = default;
717
718 Row(const Row &other) noexcept = default;
719 Row &operator=(const Row &other) noexcept = default;
720 Row(Row &&other) noexcept = default;
721 Row &operator=(Row &&other) noexcept = default;
722 ~Row() = default;
723
733 template <bool ENABLE = IsPixelTypeMutable, std::enable_if_t<ENABLE, int> = 0>
734 CVB_FORCE_INLINE PixelType operator[](int x) noexcept
735 {
736 auto addresses = row_[x];
737 return FillPixelValue<PixelType>(addresses);
738 }
739
749 CVB_FORCE_INLINE ConstPixelType operator[](int x) const noexcept
750 {
751 auto addresses = row_[x];
752 return FillPixelValue<ConstPixelType>(addresses);
753 }
754
767 template <class FromPixelType>
768 CVB_FORCE_INLINE auto Set(int x, const FromPixelType &value) noexcept
769 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value,
770 void>
771 {
772 auto addresses = row_[x];
773 SetElements(addresses, value, std::make_index_sequence<K>());
774 }
775
777 CVB_FORCE_INLINE void Set(int x, const PixelType &value) noexcept
778 {
779 auto addresses = row_[x];
780 SetElements(addresses, value, std::make_index_sequence<K>());
781 }
782 };
783
785 class Column
786 {
787 friend class Block;
788
789 using AccessColumn = typename AccessTrait::Column;
790
791 AccessColumn col_;
792
798 explicit Column(AccessColumn col) noexcept
799 : col_(col)
800 {
801 }
802
803 public:
805 Column() = default;
806
807 Column(const Column &other) noexcept = default;
808 Column &operator=(const Column &other) noexcept = default;
809 Column(Column &&other) noexcept = default;
810 Column &operator=(Column &&other) noexcept = default;
811 ~Column() = default;
812
822 template <bool ENABLE = IsPixelTypeMutable, std::enable_if_t<ENABLE, int> = 0>
823 CVB_FORCE_INLINE PixelType operator[](int y) noexcept
824 {
825 auto addresses = col_[y];
826 return FillPixelValue<PixelType>(addresses);
827 }
828
838 CVB_FORCE_INLINE ConstPixelType operator[](int y) const noexcept
839 {
840 auto addresses = col_[y];
841 return FillPixelValue<ConstPixelType>(addresses);
842 }
843
856 template <class FromPixelType>
857 CVB_FORCE_INLINE auto Set(int y, const FromPixelType &value) noexcept
858 -> std::enable_if_t<!std::is_convertible<remove_cvref_t<FromPixelType>, remove_cvref_t<PixelType>>::value,
859 void>
860 {
861 auto addresses = col_[y];
862 SetElements(addresses, value, std::make_index_sequence<K>());
863 }
864
866 CVB_FORCE_INLINE void Set(int y, const PixelType &value) noexcept
867 {
868 auto addresses = col_[y];
869 SetElements(addresses, value, std::make_index_sequence<K>());
870 }
871 };
872
882 Row RowAt(int y) const noexcept
883 {
884 return Row{this->Access().RowAt(y)};
885 }
886
896 Column ColumnAt(int x) const noexcept
897 {
898 return Column{this->Access().ColumnAt(x)};
899 }
900 };
901
908 template <class T>
909 using ArrayPlaneBlock = Block<T, ArrayAccess>;
910
917 template <class T>
918 using LinearPlaneBlock = Block<T, LinearAccess>;
919
926 template <class T>
927 using VpatPlaneBlock = Block<T, VpatAccess>;
928
935 template <class T, size_t K>
936 using ScatterBlock = Block<T, ScatterAccess<K>>;
937
938 CVB_END_INLINE_NS
939} // namespace Cvb
A single column.
Definition decl_block.hpp:337
Column()=default
Default ctor.
CVB_FORCE_INLINE PixelType & operator[](int y) noexcept
Row access.
Definition decl_block.hpp:373
CVB_FORCE_INLINE const PixelType & operator[](int y) const noexcept
Row access.
Definition decl_block.hpp:389
CVB_FORCE_INLINE void Set(int y, const PixelType &value) noexcept
Row setter.
Definition decl_block.hpp:420
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:407
CVB_FORCE_INLINE PixelType & operator[](int x) noexcept
Column access.
Definition decl_block.hpp:280
CVB_FORCE_INLINE const PixelType & operator[](int x) const noexcept
Column access.
Definition decl_block.hpp:296
Row()=default
Default ctor.
CVB_FORCE_INLINE void Set(int x, const PixelType &value) noexcept
Column setter.
Definition decl_block.hpp:327
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:314
CVB_FORCE_INLINE ConstPixelType operator[](int y) const noexcept
Row access.
Definition decl_block.hpp:838
CVB_FORCE_INLINE void Set(int y, const PixelType &value) noexcept
Row setter.
Definition decl_block.hpp:866
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:857
CVB_FORCE_INLINE PixelType operator[](int y) noexcept
Row access.
Definition decl_block.hpp:823
CVB_FORCE_INLINE void Set(int x, const PixelType &value) noexcept
Column setter.
Definition decl_block.hpp:777
CVB_FORCE_INLINE ConstPixelType operator[](int x) const noexcept
Column access.
Definition decl_block.hpp:749
CVB_FORCE_INLINE PixelType operator[](int x) noexcept
Column access.
Definition decl_block.hpp:734
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:768
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:936
Block< T, VpatAccess > VpatPlaneBlock
Definition decl_block.hpp:927
CVB_FORCE_INLINE void Set(int idx, const PixelType &value) noexcept
Index setter.
Definition decl_block.hpp:235
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:918
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:437
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:451
Block< T, ArrayAccess > ArrayPlaneBlock
A Cvb::Block of a contiguous plane.
Definition decl_block.hpp:909
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
T Height() const noexcept
Gets the height of the rectangle.
Definition rect.hpp:184
T Width() const noexcept
Gets the width of the rectangle.
Definition rect.hpp:164
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 version.hpp:11