34#ifndef CARTOBASE_TYPE_VOXELVALUE_H
35#define CARTOBASE_TYPE_VOXELVALUE_H
43#ifdef CARTO_DEBUG_VOXELVALUE
58 template <
typename T,
unsigned int C>
83 operator bool()
const;
106 template <
typename V>
111 static inline bool less(
const V & lhs,
const V & rhs );
115 template <
typename T,
unsigned C>
136 template <
typename V>
139 constexpr bool operator ()(
const V & lhs,
const V & rhs)
const;
146 template <
typename T,
unsigned int C>
inline
151 for( i=0; i<C-1; ++i )
152 out <<
static_cast<int>( aa[i] ) <<
',';
153 out << static_cast<int>( aa[C-1] ) <<
')';
157 template <
typename T,
unsigned int C>
inline
166 ( in.peek() ==
' ' || in.peek() ==
'\t' || in.peek() ==
'\n' ) )
168 if ( in.peek () ==
'(' )
172 result[0] =
static_cast<T
>( read );
176 result[i] =
static_cast<T
>( read );
179 if( ch != 0 && ch !=
')' )
180 in.setstate (std::ios::failbit);
Base class for any multichannel data (RGB, RGBA, HSV, ...)
const T & operator[](unsigned int i) const
VoxelValue< T, C > & operator=(const VoxelValue< T, C > &)=default
static const unsigned int channelcount
bool operator==(const VoxelValue< T, C > &) const
bool operator!=(const VoxelValue< T, C > &) const
std::ostream & operator<<(std::ostream &out, const VoxelValue< T, C > &aa)
std::istream & operator>>(std::istream &in, VoxelValue< T, C > &aa)
KeyComparatorLess Function object to be used in key comparisons.
constexpr bool operator()(const V &lhs, const V &rhs) const
KeyComparator is used to compare keys of types that do not have comparison operator.
static uint64_t toUnsignedInt(const V &value)
static bool less(const V &lhs, const V &rhs)