CVB++ 15.0
decl_access_base.hpp
1#pragma once
2
3#include "../global.hpp"
4#include "../point_2d.hpp"
5
6namespace Cvb
7{
8
9 CVB_BEGIN_INLINE_NS
10
21 template <class DERIVED>
23 {
24 public:
26
34 template <class Type>
35 const Type &Value(int x, int y) const noexcept
36 {
37 return *reinterpret_cast<Type *>((*static_cast<DERIVED *>(this))(x, y));
38 }
39
41
49 template <class Type>
50 Type &Value(int x, int y) noexcept
51 {
52 return *reinterpret_cast<Type *>((*static_cast<DERIVED *>(this))(x, y));
53 }
54
56
63 template <class Type>
64 const Type &Value(Point2D<int> position) const noexcept
65 {
66 return Value<Type>(position.X(), position.Y());
67 }
68
70
77 template <class Type>
78 Type &Value(Point2D<int> position) noexcept
79 {
80 return Value<Type>(position.X(), position.Y());
81 }
82 };
83
84 CVB_END_INLINE_NS
85
86} // namespace Cvb
Multi-purpose 2D vector class.
Definition point_2d.hpp:20
Common base class for access traits, providing typed Value access to planes.
Definition decl_access_base.hpp:23
const Type & Value(Point2D< int > position) const noexcept
Gets a pixel value at a given position.
Definition decl_access_base.hpp:64
Type & Value(int x, int y) noexcept
Gets a settable pixel value at a given position.
Definition decl_access_base.hpp:50
Type & Value(Point2D< int > position) noexcept
Gets a settable pixel value at a given position.
Definition decl_access_base.hpp:78
const Type & Value(int x, int y) const noexcept
Gets a pixel value at a given position.
Definition decl_access_base.hpp:35
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17