34 #ifndef CARTOBASE_TYPE_RGB_DEF_H 35 #define CARTOBASE_TYPE_RGB_DEF_H 42 #ifdef CARTO_DEBUG_RGB 64 #ifdef CARTO_DEBUG_RGB 65 std::cout <<
"RGB:: Constructor( RGB )" << std::endl;
72 #ifdef CARTO_DEBUG_RGB 73 std::cout <<
"RGB:: Constructor( RGBA )" << std::endl;
84 #ifdef CARTO_DEBUG_RGB 85 std::cout <<
"RGB:: Constructor( VV<3> )" << std::endl;
92 #ifdef CARTO_DEBUG_RGB 93 std::cout <<
"RGB:: Constructor( r,g,b )" << std::endl;
103 #ifdef CARTO_DEBUG_RGB 104 std::cout <<
"RGB:: Destructor" << std::endl;
113 #ifdef CARTO_DEBUG_RGB 114 std::cout <<
"RGB:: operator = ( RGB )" << std::endl;
125 #ifdef CARTO_DEBUG_RGB 126 std::cout <<
"RGB:: operator = ( RGBA )" << std::endl;
137 #ifdef CARTO_DEBUG_RGB 138 std::cout <<
"RGB:: operator = ( uint8_t )" << std::endl;
151 #ifdef CARTO_DEBUG_RGB 152 std::cout <<
"RGB:: operator += ( RGB )" << std::endl;
163 #ifdef CARTO_DEBUG_RGB 164 std::cout <<
"RGB:: operator += ( RGBA )" << std::endl;
175 #ifdef CARTO_DEBUG_RGB 176 std::cout <<
"RGB:: operator -= ( RGB )" << std::endl;
187 #ifdef CARTO_DEBUG_RGB 188 std::cout <<
"RGB:: operator -= ( RGBA )" << std::endl;
199 #ifdef CARTO_DEBUG_RGB 200 std::cout <<
"RGB:: operator += ( uint8_t )" << std::endl;
211 #ifdef CARTO_DEBUG_RGB 212 std::cout <<
"RGB:: operator -= ( uint8_t )" << std::endl;
223 #ifdef CARTO_DEBUG_RGB 224 std::cout <<
"RGB:: operator *= ( uint8_t )" << std::endl;
226 red() *=
static_cast<uint8_t
>( value );
227 green() *=
static_cast<uint8_t
>( value );
228 blue() *=
static_cast<uint8_t
>( value );
235 #ifdef CARTO_DEBUG_RGB 236 std::cout <<
"RGB:: operator *= ( uint16_t )" << std::endl;
238 red() *=
static_cast<uint8_t
>( value );
239 green() *=
static_cast<uint8_t
>( value );
240 blue() *=
static_cast<uint8_t
>( value );
247 #ifdef CARTO_DEBUG_RGB 248 std::cout <<
"RGB:: operator *= ( uint32_t )" << std::endl;
250 red() *=
static_cast<uint8_t
>( value );
251 green() *=
static_cast<uint8_t
>( value );
252 blue() *=
static_cast<uint8_t
>( value );
259 #ifdef CARTO_DEBUG_RGB 260 std::cout <<
"RGB:: operator *= ( uint64_t )" << std::endl;
262 red() *=
static_cast<uint8_t
>( value );
263 green() *=
static_cast<uint8_t
>( value );
264 blue() *=
static_cast<uint8_t
>( value );
271 #ifdef CARTO_DEBUG_RGB 272 std::cout <<
"RGB:: operator *= ( float )" << std::endl;
275 red() =
static_cast<uint8_t
>(
red() * value );
276 green() =
static_cast<uint8_t
>(
green() * value );
277 blue() =
static_cast<uint8_t
>(
blue() * value );
284 #ifdef CARTO_DEBUG_RGB 285 std::cout <<
"RGB:: operator *= ( double )" << std::endl;
288 red() =
static_cast<uint8_t
>(
red() * value );
289 green() =
static_cast<uint8_t
>(
green() * value );
290 blue() =
static_cast<uint8_t
>(
blue() * value );
297 #ifdef CARTO_DEBUG_RGB 298 std::cout <<
"RGB:: operator /= ( uint8_t )" << std::endl;
301 red() /=
static_cast<uint8_t
>( value );
302 green() /=
static_cast<uint8_t
>( value );
303 blue() /=
static_cast<uint8_t
>( value );
310 #ifdef CARTO_DEBUG_RGB 311 std::cout <<
"RGB:: operator /= ( uint16_t )" << std::endl;
314 red() /=
static_cast<uint8_t
>( value );
315 green() /=
static_cast<uint8_t
>( value );
316 blue() /=
static_cast<uint8_t
>( value );
323 #ifdef CARTO_DEBUG_RGB 324 std::cout <<
"RGB:: operator /= ( uint32_t )" << std::endl;
327 red() /=
static_cast<uint8_t
>( value );
328 green() /=
static_cast<uint8_t
>( value );
329 blue() /=
static_cast<uint8_t
>( value );
336 #ifdef CARTO_DEBUG_RGB 337 std::cout <<
"RGB:: operator /= ( uint64_t )" << std::endl;
340 red() /=
static_cast<uint8_t
>( value );
341 green() /=
static_cast<uint8_t
>( value );
342 blue() /=
static_cast<uint8_t
>( value );
349 #ifdef CARTO_DEBUG_RGB 350 std::cout <<
"RGB:: operator /= ( float )" << std::endl;
354 red() =
static_cast<uint8_t
>(
red() / value );
355 green() =
static_cast<uint8_t
>(
green() / value );
356 blue() =
static_cast<uint8_t
>(
blue() / value );
363 #ifdef CARTO_DEBUG_RGB 364 std::cout <<
"RGB:: operator /= ( double )" << std::endl;
368 red() =
static_cast<uint8_t
>(
red() / value );
369 green() =
static_cast<uint8_t
>(
green() / value );
370 blue() =
static_cast<uint8_t
>(
blue() / value );
379 #ifdef CARTO_DEBUG_RGB 380 std::cout <<
"RGB:: RGB + RGB" << std::endl;
389 #ifdef CARTO_DEBUG_RGB 390 std::cout <<
"RGB:: RGB + uint8_t" << std::endl;
399 #ifdef CARTO_DEBUG_RGB 400 std::cout <<
"RGB:: RGB + uint16_t" << std::endl;
409 #ifdef CARTO_DEBUG_RGB 410 std::cout <<
"RGB:: RGB + uint32_t" << std::endl;
419 #ifdef CARTO_DEBUG_RGB 420 std::cout <<
"RGB:: RGB + uint64_t" << std::endl;
429 #ifdef CARTO_DEBUG_RGB 430 std::cout <<
"RGB:: RGB + float" << std::endl;
433 return result +=
static_cast<uint8_t
>(bb);
439 #ifdef CARTO_DEBUG_RGB 440 std::cout <<
"RGB:: RGB + double" << std::endl;
443 return result +=
static_cast<uint8_t
>(bb);
449 #ifdef CARTO_DEBUG_RGB 450 std::cout <<
"RGB:: uint8_t + RGB" << std::endl;
459 #ifdef CARTO_DEBUG_RGB 460 std::cout <<
"RGB:: uint16_t + RGB" << std::endl;
469 #ifdef CARTO_DEBUG_RGB 470 std::cout <<
"RGB:: uint32_t + RGB" << std::endl;
479 #ifdef CARTO_DEBUG_RGB 480 std::cout <<
"RGB:: uint64_t + RGB" << std::endl;
489 #ifdef CARTO_DEBUG_RGB 490 std::cout <<
"RGB:: float + RGB" << std::endl;
492 VoxelRGB result( static_cast<uint8_t>(aa) );
499 #ifdef CARTO_DEBUG_RGB 500 std::cout <<
"RGB:: double + RGB" << std::endl;
502 VoxelRGB result( static_cast<uint8_t>(aa) );
509 #ifdef CARTO_DEBUG_RGB 510 std::cout <<
"RGB:: RGB - RGB" << std::endl;
519 #ifdef CARTO_DEBUG_RGB 520 std::cout <<
"RGB:: RGB - uint8_t" << std::endl;
529 #ifdef CARTO_DEBUG_RGB 530 std::cout <<
"RGB:: RGB - uint16_t" << std::endl;
539 #ifdef CARTO_DEBUG_RGB 540 std::cout <<
"RGB:: RGB - uint32_t" << std::endl;
549 #ifdef CARTO_DEBUG_RGB 550 std::cout <<
"RGB:: RGB - uint64_t" << std::endl;
559 #ifdef CARTO_DEBUG_RGB 560 std::cout <<
"RGB:: RGB - float" << std::endl;
563 return result -=
static_cast<uint8_t
>(bb);
569 #ifdef CARTO_DEBUG_RGB 570 std::cout <<
"RGB:: RGB - double" << std::endl;
573 return result -=
static_cast<uint8_t
>(bb);
579 #ifdef CARTO_DEBUG_RGB 580 std::cout <<
"RGB:: uint8_t - RGB" << std::endl;
589 #ifdef CARTO_DEBUG_RGB 590 std::cout <<
"RGB:: uint16_t - RGB" << std::endl;
599 #ifdef CARTO_DEBUG_RGB 600 std::cout <<
"RGB:: uint32_t - RGB" << std::endl;
609 #ifdef CARTO_DEBUG_RGB 610 std::cout <<
"RGB:: uint64_t - RGB" << std::endl;
619 #ifdef CARTO_DEBUG_RGB 620 std::cout <<
"RGB:: float - RGB" << std::endl;
622 VoxelRGB result( static_cast<uint8_t>(aa) );
629 #ifdef CARTO_DEBUG_RGB 630 std::cout <<
"RGB:: double - RGB" << std::endl;
632 VoxelRGB result( static_cast<uint8_t>(aa) );
639 #ifdef CARTO_DEBUG_RGB 640 std::cout <<
"RGB:: RGB * uint8_t" << std::endl;
649 #ifdef CARTO_DEBUG_RGB 650 std::cout <<
"RGB:: RGB * uint16_t" << std::endl;
659 #ifdef CARTO_DEBUG_RGB 660 std::cout <<
"RGB:: RGB * uint32_t" << std::endl;
669 #ifdef CARTO_DEBUG_RGB 670 std::cout <<
"RGB:: RGB * uint64_t" << std::endl;
679 #ifdef CARTO_DEBUG_RGB 680 std::cout <<
"RGB:: RGB * float" << std::endl;
689 #ifdef CARTO_DEBUG_RGB 690 std::cout <<
"RGB:: RGB * double" << std::endl;
699 #ifdef CARTO_DEBUG_RGB 700 std::cout <<
"RGB:: uint8_t * RGB" << std::endl;
709 #ifdef CARTO_DEBUG_RGB 710 std::cout <<
"RGB:: uint16_t * RGB" << std::endl;
719 #ifdef CARTO_DEBUG_RGB 720 std::cout <<
"RGB:: uint32_t * RGB" << std::endl;
729 #ifdef CARTO_DEBUG_RGB 730 std::cout <<
"RGB:: uint64_t * RGB" << std::endl;
739 #ifdef CARTO_DEBUG_RGB 740 std::cout <<
"RGB:: float * RGB" << std::endl;
749 #ifdef CARTO_DEBUG_RGB 750 std::cout <<
"RGB:: double * RGB" << std::endl;
759 #ifdef CARTO_DEBUG_RGB 760 std::cout <<
"RGB:: RGB / uint8_t" << std::endl;
769 #ifdef CARTO_DEBUG_RGB 770 std::cout <<
"RGB:: RGB / uint16_t" << std::endl;
779 #ifdef CARTO_DEBUG_RGB 780 std::cout <<
"RGB:: RGB / uint32_t" << std::endl;
789 #ifdef CARTO_DEBUG_RGB 790 std::cout <<
"RGB:: RGB / uint64_t" << std::endl;
799 #ifdef CARTO_DEBUG_RGB 800 std::cout <<
"RGB:: RGB / float" << std::endl;
809 #ifdef CARTO_DEBUG_RGB 810 std::cout <<
"RGB:: RGB / double" << std::endl;
821 #ifdef CARTO_DEBUG_RGB 822 std::cout <<
"RGB:: operator *= ( long )" << std::endl;
824 red() *=
static_cast<uint8_t
>( value );
825 green() *=
static_cast<uint8_t
>( value );
826 blue() *=
static_cast<uint8_t
>( value );
833 #ifdef CARTO_DEBUG_RGB 834 std::cout <<
"RGB:: operator /= ( long )" << std::endl;
837 red() /=
static_cast<uint8_t
>( value );
838 green() /=
static_cast<uint8_t
>( value );
839 blue() /=
static_cast<uint8_t
>( value );
846 #ifdef CARTO_DEBUG_RGB 847 std::cout <<
"RGB:: RGB * long" << std::endl;
856 #ifdef CARTO_DEBUG_RGB 857 std::cout <<
"RGB:: long * RGB" << std::endl;
866 #ifdef CARTO_DEBUG_RGB 867 std::cout <<
"RGB:: RGB / long" << std::endl;
VoxelRGB(const VoxelRGB &other)
VoxelRGB operator/(const VoxelRGB &aa, const uint8_t &bb)
const uint8_t & blue() const
VoxelRGB & operator+=(const VoxelRGB &other)
VoxelRGB & operator=(const VoxelRGB &other)
const uint8_t & red() const
VoxelRGB operator+(const VoxelRGB &aa, const VoxelRGB &bb)
VoxelRGB & operator-=(const VoxelRGB &other)
Base class for any multichannel data (RGB, RGBA, HSV, ...)
VoxelRGB operator*(const VoxelRGB &aa, const uint8_t &bb)
VoxelRGB & operator*=(const uint8_t &value)
VoxelRGB operator-(const VoxelRGB &aa, const VoxelRGB &bb)
const uint8_t & green() const
const uint8_t & blue() const
const uint8_t & green() const
VoxelRGB & operator/=(const uint8_t &value)
const uint8_t & red() const