28 #ifndef VISIONCPP_INCLUDE_PIXEL_PIXEL_HPP_
29 #define VISIONCPP_INCLUDE_PIXEL_PIXEL_HPP_
31 #include "../framework/tools/tuple.hpp"
35 template <
bool conds,
size_t K,
typename PixelType,
typename... Params>
38 static void avta(PixelType &dt,
40 dt[K] = visioncpp::internal::tools::tuple::get<K>(t);
42 Params...>::
avta(dt, t);
46 template <
size_t K,
typename PixelType,
typename... Params>
49 static void avta(PixelType &dt,
55 #define REGISTER_OPERATORS(Op, T) \
56 template <typename RHSScalar> \
57 T &operator Op##=(const RHSScalar &val) { \
58 for (int i = 0; i < elements; i++) { \
59 m_data[i] Op## = val; \
63 T &operator Op##=(const T &val) { \
64 for (int i = 0; i < elements; i++) { \
65 m_data[i] Op## = val[i]; \
69 friend T operator Op(T lhs, const T &rhs) { \
70 for (int i = 0; i < elements; i++) { \
71 lhs[i] Op## = rhs[i]; \
84 template <
typename LHSScalar,
size_t Channels>
95 template <
typename... P>
Storage< unsigned char, 2 > U8C2
Storage< float, 2 > F32C2
Storage< float, 4 > F32C4
Storage< float, 1 > F32C1
Storage< unsigned char, 4 > U8C4
Storage< unsigned char, 1 > U8C1
Storage< unsigned char, 3 > U8C3
Storage< float, 3 > F32C3
#define REGISTER_OPERATORS(Op, T)
static void avta(PixelType &dt, visioncpp::internal::tools::tuple::Tuple< Params... > &t)
Assigns Value To Array.
static void avta(PixelType &dt, visioncpp::internal::tools::tuple::Tuple< Params... > &t)
Assigns Value To Array.
LHSScalar m_data[elements]
constexpr static size_t elements
data_type operator[](unsigned int idx) const
data_type & operator[](unsigned int idx)