34#ifndef CARTOBASE_TYPE_HSV_H
35#define CARTOBASE_TYPE_HSV_H
75 const uint8_t &v = 0 );
104 inline const uint8_t&
hue ()
const {
return (*
this)[0]; }
105 inline const uint8_t&
saturation ()
const {
return (*
this)[1]; }
106 inline const uint8_t&
value ()
const {
return (*
this)[2]; }
107 inline uint8_t&
hue () {
return (*
this)[0]; }
109 inline uint8_t&
value () {
return (*
this)[2]; }
112 VoxelHSV
operator + (
const VoxelHSV &aa,
const VoxelHSV &bb);
113 VoxelHSV
operator + (
const VoxelHSV &aa,
const uint8_t &bb);
114 VoxelHSV
operator + (
const uint8_t &aa,
const VoxelHSV &bb);
115 VoxelHSV
operator - (
const VoxelHSV &aa,
const VoxelHSV &bb);
116 VoxelHSV
operator - (
const VoxelHSV &aa,
const uint8_t &bb);
117 VoxelHSV
operator - (
const uint8_t &aa,
const VoxelHSV &bb);
118 VoxelHSV
operator * (
const VoxelHSV &aa,
const uint8_t &bb);
119 VoxelHSV
operator * (
const VoxelHSV &aa,
const uint16_t &bb);
120 VoxelHSV
operator * (
const VoxelHSV &aa,
const uint32_t &bb);
121 VoxelHSV
operator * (
const VoxelHSV &aa,
const uint64_t &bb);
122 VoxelHSV
operator * (
const VoxelHSV &aa,
const float &bb);
123 VoxelHSV
operator * (
const VoxelHSV &aa,
const double &bb);
124 VoxelHSV
operator * (
const uint8_t &aa,
const VoxelHSV &bb);
125 VoxelHSV
operator * (
const uint16_t &aa,
const VoxelHSV &bb);
126 VoxelHSV
operator * (
const uint32_t &aa,
const VoxelHSV &bb);
127 VoxelHSV
operator * (
const uint64_t &aa,
const VoxelHSV &bb);
128 VoxelHSV
operator * (
const float &aa,
const VoxelHSV &bb);
129 VoxelHSV
operator * (
const double &aa,
const VoxelHSV &bb);
130 VoxelHSV
operator / (
const VoxelHSV &aa,
const uint8_t &bb);
131 VoxelHSV
operator / (
const VoxelHSV &aa,
const uint16_t &bb);
132 VoxelHSV
operator / (
const VoxelHSV &aa,
const uint32_t &bb);
133 VoxelHSV
operator / (
const VoxelHSV &aa,
const uint64_t &bb);
134 VoxelHSV
operator / (
const VoxelHSV &aa,
const float &bb);
135 VoxelHSV
operator / (
const VoxelHSV &aa,
const double &bb);
137 VoxelHSV
operator * (
const VoxelHSV &aa,
const long &bb);
138 VoxelHSV
operator * (
const long &aa,
const VoxelHSV &bb);
139 VoxelHSV
operator / (
const VoxelHSV &aa,
const long &bb);
157 #ifdef CARTO_DEBUG_RGB
158 std::cout <<
"HSV:: Constructor( HSV )" << std::endl;
166 #ifdef CARTO_DEBUG_RGB
167 std::cout <<
"HSV:: Constructor( VV<3> )" << std::endl;
174 #ifdef CARTO_DEBUG_RGB
175 std::cout <<
"HSV:: Constructor( h,s,v )" << std::endl;
185 #ifdef CARTO_DEBUG_RGB
186 std::cout <<
"HSV:: Destructor" << std::endl;
195 #ifdef CARTO_DEBUG_RGB
196 std::cout <<
"HSV:: operator = ( HSV )" << std::endl;
207 #ifdef CARTO_DEBUG_RGB
208 std::cout <<
"HSV:: operator = ( uint8_t )" << std::endl;
221 #ifdef CARTO_DEBUG_RGB
222 std::cout <<
"HSV:: operator += ( HSV )" << std::endl;
233 #ifdef CARTO_DEBUG_RGB
234 std::cout <<
"HSV:: operator -= ( HSV )" << std::endl;
245 #ifdef CARTO_DEBUG_RGB
246 std::cout <<
"HSV:: operator += ( uint8_t )" << std::endl;
257 #ifdef CARTO_DEBUG_RGB
258 std::cout <<
"HSV:: operator -= ( uint8_t )" << std::endl;
269 #ifdef CARTO_DEBUG_RGB
270 std::cout <<
"HSV:: operator *= ( uint8_t )" << std::endl;
272 hue() *=
static_cast<uint8_t
>( val );
274 value() *=
static_cast<uint8_t
>( val );
281 #ifdef CARTO_DEBUG_RGB
282 std::cout <<
"HSV:: operator *= ( uint16_t )" << std::endl;
284 hue() *=
static_cast<uint8_t
>( val );
286 value() *=
static_cast<uint8_t
>( val );
293 #ifdef CARTO_DEBUG_RGB
294 std::cout <<
"HSV:: operator *= ( uint32_t )" << std::endl;
296 hue() *=
static_cast<uint8_t
>( val );
298 value() *=
static_cast<uint8_t
>( val );
305 #ifdef CARTO_DEBUG_RGB
306 std::cout <<
"HSV:: operator *= ( uint64_t )" << std::endl;
308 hue() *=
static_cast<uint8_t
>( val );
310 value() *=
static_cast<uint8_t
>( val );
317 #ifdef CARTO_DEBUG_RGB
318 std::cout <<
"HSV:: operator *= ( float )" << std::endl;
320 hue() *=
static_cast<uint8_t
>( val );
322 value() *=
static_cast<uint8_t
>( val );
329 #ifdef CARTO_DEBUG_RGB
330 std::cout <<
"HSV:: operator *= ( double )" << std::endl;
332 hue() *=
static_cast<uint8_t
>( val );
334 value() *=
static_cast<uint8_t
>( val );
341 #ifdef CARTO_DEBUG_RGB
342 std::cout <<
"HSV:: operator /= ( uint8_t )" << std::endl;
345 hue() /=
static_cast<uint8_t
>( val );
347 value() /=
static_cast<uint8_t
>( val );
354 #ifdef CARTO_DEBUG_RGB
355 std::cout <<
"HSV:: operator /= ( uint16_t )" << std::endl;
358 hue() /=
static_cast<uint8_t
>( val );
360 value() /=
static_cast<uint8_t
>( val );
367 #ifdef CARTO_DEBUG_RGB
368 std::cout <<
"HSV:: operator /= ( uint32_t )" << std::endl;
371 hue() /=
static_cast<uint8_t
>( val );
373 value() /=
static_cast<uint8_t
>( val );
380 #ifdef CARTO_DEBUG_RGB
381 std::cout <<
"HSV:: operator /= ( uint64_t )" << std::endl;
384 hue() /=
static_cast<uint8_t
>( val );
386 value() /=
static_cast<uint8_t
>( val );
393 #ifdef CARTO_DEBUG_RGB
394 std::cout <<
"HSV:: operator /= ( float )" << std::endl;
397 hue() /=
static_cast<uint8_t
>( val );
399 value() /=
static_cast<uint8_t
>( val );
406 #ifdef CARTO_DEBUG_RGB
407 std::cout <<
"HSV:: operator /= ( double )" << std::endl;
410 hue() /=
static_cast<uint8_t
>( val );
412 value() /=
static_cast<uint8_t
>( val );
421 #ifdef CARTO_DEBUG_RGB
422 std::cout <<
"HSV:: HSV + HSV" << std::endl;
431 #ifdef CARTO_DEBUG_RGB
432 std::cout <<
"HSV:: HSV + uint8_t" << std::endl;
441 #ifdef CARTO_DEBUG_RGB
442 std::cout <<
"HSV:: HSV + uint16_t" << std::endl;
451 #ifdef CARTO_DEBUG_RGB
452 std::cout <<
"HSV:: HSV + uint32_t" << std::endl;
461 #ifdef CARTO_DEBUG_RGB
462 std::cout <<
"HSV:: HSV + uint64_t" << std::endl;
471 #ifdef CARTO_DEBUG_RGB
472 std::cout <<
"HSV:: HSV + float" << std::endl;
475 return result +=
static_cast<uint8_t
>(bb);
481 #ifdef CARTO_DEBUG_RGB
482 std::cout <<
"HSV:: HSV + double" << std::endl;
485 return result +=
static_cast<uint8_t
>(bb);
491 #ifdef CARTO_DEBUG_RGB
492 std::cout <<
"HSV:: uint8_t + HSV" << std::endl;
501 #ifdef CARTO_DEBUG_RGB
502 std::cout <<
"HSV:: uint16_t + HSV" << std::endl;
511 #ifdef CARTO_DEBUG_RGB
512 std::cout <<
"HSV:: uint32_t + HSV" << std::endl;
521 #ifdef CARTO_DEBUG_RGB
522 std::cout <<
"HSV:: uint64_t + HSV" << std::endl;
531 #ifdef CARTO_DEBUG_RGB
532 std::cout <<
"HSV:: float + HSV" << std::endl;
534 VoxelHSV result(
static_cast<uint8_t
>(aa) );
541 #ifdef CARTO_DEBUG_RGB
542 std::cout <<
"HSV:: double + HSV" << std::endl;
544 VoxelHSV result(
static_cast<uint8_t
>(aa) );
551 #ifdef CARTO_DEBUG_RGB
552 std::cout <<
"HSV:: HSV - HSV" << std::endl;
561 #ifdef CARTO_DEBUG_RGB
562 std::cout <<
"HSV:: HSV - uint8_t" << std::endl;
571 #ifdef CARTO_DEBUG_RGB
572 std::cout <<
"HSV:: HSV - uint16_t" << std::endl;
581 #ifdef CARTO_DEBUG_RGB
582 std::cout <<
"HSV:: HSV - uint32_t" << std::endl;
591 #ifdef CARTO_DEBUG_RGB
592 std::cout <<
"HSV:: HSV - uint64_t" << std::endl;
601 #ifdef CARTO_DEBUG_RGB
602 std::cout <<
"HSV:: HSV - float" << std::endl;
605 return result -=
static_cast<uint8_t
>(bb);
611 #ifdef CARTO_DEBUG_RGB
612 std::cout <<
"HSV:: HSV - double" << std::endl;
615 return result -=
static_cast<uint8_t
>(bb);
621 #ifdef CARTO_DEBUG_RGB
622 std::cout <<
"HSV:: uint8_t - HSV" << std::endl;
631 #ifdef CARTO_DEBUG_RGB
632 std::cout <<
"HSV:: uint16_t - HSV" << std::endl;
641 #ifdef CARTO_DEBUG_RGB
642 std::cout <<
"HSV:: uint32_t - HSV" << std::endl;
651 #ifdef CARTO_DEBUG_RGB
652 std::cout <<
"HSV:: uint64_t - HSV" << std::endl;
661 #ifdef CARTO_DEBUG_RGB
662 std::cout <<
"HSV:: float - HSV" << std::endl;
664 VoxelHSV result(
static_cast<uint8_t
>(aa) );
671 #ifdef CARTO_DEBUG_RGB
672 std::cout <<
"HSV:: double - HSV" << std::endl;
674 VoxelHSV result(
static_cast<uint8_t
>(aa) );
681 #ifdef CARTO_DEBUG_RGB
682 std::cout <<
"HSV:: HSV * uint8_t" << std::endl;
691 #ifdef CARTO_DEBUG_RGB
692 std::cout <<
"HSV:: HSV * uint16_t" << std::endl;
701 #ifdef CARTO_DEBUG_RGB
702 std::cout <<
"HSV:: HSV * uint32_t" << std::endl;
711 #ifdef CARTO_DEBUG_RGB
712 std::cout <<
"HSV:: HSV * uint64_t" << std::endl;
721 #ifdef CARTO_DEBUG_RGB
722 std::cout <<
"HSV:: HSV * float" << std::endl;
731 #ifdef CARTO_DEBUG_RGB
732 std::cout <<
"HSV:: HSV * double" << std::endl;
741 #ifdef CARTO_DEBUG_RGB
742 std::cout <<
"HSV:: uint8_t * HSV" << std::endl;
751 #ifdef CARTO_DEBUG_RGB
752 std::cout <<
"HSV:: uint16_t * HSV" << std::endl;
761 #ifdef CARTO_DEBUG_RGB
762 std::cout <<
"HSV:: uint32_t * HSV" << std::endl;
771 #ifdef CARTO_DEBUG_RGB
772 std::cout <<
"HSV:: uint64_t * HSV" << std::endl;
781 #ifdef CARTO_DEBUG_RGB
782 std::cout <<
"HSV:: float * HSV" << std::endl;
791 #ifdef CARTO_DEBUG_RGB
792 std::cout <<
"HSV:: double * HSV" << std::endl;
801 #ifdef CARTO_DEBUG_RGB
802 std::cout <<
"HSV:: HSV / uint8_t" << std::endl;
811 #ifdef CARTO_DEBUG_RGB
812 std::cout <<
"HSV:: HSV / uint16_t" << std::endl;
821 #ifdef CARTO_DEBUG_RGB
822 std::cout <<
"HSV:: HSV / uint32_t" << std::endl;
831 #ifdef CARTO_DEBUG_RGB
832 std::cout <<
"HSV:: HSV / uint64_t" << std::endl;
841 #ifdef CARTO_DEBUG_RGB
842 std::cout <<
"HSV:: HSV / float" << std::endl;
851 #ifdef CARTO_DEBUG_RGB
852 std::cout <<
"HSV:: HSV / double" << std::endl;
863 #ifdef CARTO_DEBUG_RGB
864 std::cout <<
"HSV:: operator *= ( long )" << std::endl;
866 hue() *=
static_cast<uint8_t
>( val );
868 value() *=
static_cast<uint8_t
>( val );
875 #ifdef CARTO_DEBUG_RGB
876 std::cout <<
"HSV:: operator /= ( long )" << std::endl;
879 hue() /=
static_cast<uint8_t
>( val );
881 value() /=
static_cast<uint8_t
>( val );
888 #ifdef CARTO_DEBUG_RGB
889 std::cout <<
"HSV:: HSV * long" << std::endl;
898 #ifdef CARTO_DEBUG_RGB
899 std::cout <<
"HSV:: long * HSV" << std::endl;
908 #ifdef CARTO_DEBUG_RGB
909 std::cout <<
"HSV:: HSV / long" << std::endl;
919 #ifdef CARTO_DEBUG_RGB
920 std::cout <<
"HSV:: KeyComparator less()" << std::endl;
static std::string dataType()
VoxelHSV & operator=(const VoxelHSV &other)
const uint8_t & saturation() const
VoxelHSV & operator/=(const uint8_t &val)
VoxelHSV & operator+=(const VoxelHSV &other)
const uint8_t & value() const
const uint8_t & hue() const
VoxelHSV & operator-=(const VoxelHSV &other)
VoxelHSV & operator*=(const uint8_t &val)
VoxelHSV(const VoxelHSV &other)
VoxelRGB operator/(const VoxelRGB &aa, const uint8_t &bb)
VoxelRGB operator+(const VoxelRGB &aa, const VoxelRGB &bb)
VoxelRGB operator-(const VoxelRGB &aa, const VoxelRGB &bb)
VoxelRGB operator*(const VoxelRGB &aa, const uint8_t &bb)
static bool less(const carto::VoxelHSV &lhs, const carto::VoxelHSV &rhs)
KeyComparator is used to compare keys of types that do not have comparison operator.
static bool less(const V &lhs, const V &rhs)