35#define BOOST_TEST_DYN_LINK
36#define BOOST_TEST_MODULE Main
37#include <boost/test/unit_test.hpp>
39#define BOOST_TEST_DYN_LINK
41# define BOOST_TEST_MODULE Main
43#include <boost/test/unit_test.hpp>
45#include "ramCanvas.hpp"
415BOOST_AUTO_TEST_CASE(set_chan_dbl_8) {
417 mjr::color4c8b aColor;
419 BOOST_TEST_CHECK(mjr::color4c8b::maxChanVal == 255);
420 BOOST_TEST_CHECK(mjr::color4c8b::minChanVal == 0);
423 aColor.setChan_dbl(0, 1.0);
424 aColor.setChan_dbl(2, 1.0);
426 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c8b::maxChanVal);
427 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c8b::minChanVal);
428 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c8b::maxChanVal);
429 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c8b::minChanVal);
431 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
432 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
433 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
434 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
436 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
437 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
438 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
439 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
441 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
442 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
443 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
444 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
446 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
447 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.0);
448 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 1.0);
449 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
451 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
452 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
453 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
454 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
456 aColor.setChan_dbl(0, 0.0);
458 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c8b::minChanVal);
459 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c8b::minChanVal);
460 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c8b::maxChanVal);
461 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c8b::minChanVal);
463 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
464 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
465 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
466 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
468 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0);
469 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
470 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
471 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
473 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
474 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
475 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
476 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
478 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 0.0);
479 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.0);
480 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 1.0);
481 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
483 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
484 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
485 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
486 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
488 aColor.setChansRGB_dbl(1.0, 1.0, 0.0);
490 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c8b::maxChanVal);
491 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c8b::maxChanVal);
492 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c8b::minChanVal);
493 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c8b::minChanVal);
495 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
496 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
497 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
498 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
500 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
501 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 255);
502 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0);
503 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
505 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
506 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
507 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
508 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
510 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
511 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 1.0);
512 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 0.0);
513 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
515 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
516 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
517 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
518 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
520 aColor.setChan_dbl(1, 0.5);
522 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c8b::maxChanVal);
523 BOOST_TEST_CHECK(aColor.getChan(1) == 127);
524 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c8b::minChanVal);
525 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c8b::minChanVal);
527 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
528 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
529 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
530 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
532 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
533 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 127);
534 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0);
535 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
537 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
538 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
539 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
540 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
542 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
543 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 127.0/mjr::color4c8b::maxChanVal, boost::test_tools::tolerance(0.005));
544 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 0.0);
545 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
547 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
548 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
549 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
550 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
552 aColor.setChansRGB_dbl(0.0, 0.0, 0.0);
554 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c8b::minChanVal);
555 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c8b::minChanVal);
556 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c8b::minChanVal);
557 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c8b::minChanVal);
559 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
560 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
561 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
562 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
564 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0);
565 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
566 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0);
567 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
569 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
570 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
571 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
572 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
574 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 0.0);
575 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.0);
576 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 0.0);
577 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
579 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
580 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
581 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
582 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
584 aColor.setChans_dbl(1.0);
586 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c8b::maxChanVal);
587 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c8b::maxChanVal);
588 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c8b::maxChanVal);
589 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c8b::maxChanVal);
591 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
592 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
593 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
594 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
596 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
597 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 255);
598 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
599 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 255);
601 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
602 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
603 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
604 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
606 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
607 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 1.0);
608 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 1.0);
609 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 1.0);
611 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
612 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
613 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
614 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
616 aColor.setChansRGBA_dbl(1.0, 0.0, 0.5, 0.5);
618 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c8b::maxChanVal);
619 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c8b::minChanVal);
620 BOOST_TEST_CHECK(aColor.getChan(2) == 127);
621 BOOST_TEST_CHECK(aColor.getChan(3) == 127);
623 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
624 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
625 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
626 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
628 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
629 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
630 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 127);
631 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 127);
633 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
634 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
635 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
636 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
638 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
639 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.0);
640 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 127.0/mjr::color4c8b::maxChanVal, boost::test_tools::tolerance(0.005));
641 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 127.0/mjr::color4c8b::maxChanVal, boost::test_tools::tolerance(0.005));
643 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
644 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
645 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
646 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
648 aColor.setC0_dbl(0.0);
649 aColor.setC1_dbl(1.0);
650 aColor.setC2_dbl(1.0);
651 aColor.setC3_dbl(0.0);
653 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c8b::minChanVal);
654 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c8b::maxChanVal);
655 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c8b::maxChanVal);
656 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c8b::minChanVal);
658 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
659 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
660 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
661 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
663 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0);
664 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 255);
665 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
666 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
668 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
669 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
670 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
671 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
673 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 0.0);
674 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 1.0);
675 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 1.0);
676 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
678 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
679 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
680 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
681 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
686BOOST_AUTO_TEST_CASE(set_chan_dbl_16, * boost::unit_test::tolerance(0.001)) {
688 mjr::color4c16b aColor;
690 BOOST_TEST_CHECK(mjr::color4c16b::maxChanVal == 65535);
691 BOOST_TEST_CHECK(mjr::color4c16b::minChanVal == 0);
694 aColor.setChan_dbl(0, 1.0);
695 aColor.setChan_dbl(2, 1.0);
697 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c16b::maxChanVal);
698 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c16b::minChanVal);
699 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c16b::maxChanVal);
700 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c16b::minChanVal);
702 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
703 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
704 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
705 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
707 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
708 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
709 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
710 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
712 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
713 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
714 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
715 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
717 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
718 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.0);
719 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 1.0);
720 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
722 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
723 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
724 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
725 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
727 aColor.setChan_dbl(0, 0.0);
729 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c16b::minChanVal);
730 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c16b::minChanVal);
731 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c16b::maxChanVal);
732 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c16b::minChanVal);
734 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
735 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
736 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
737 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
739 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0);
740 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
741 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
742 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
744 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
745 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
746 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
747 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
749 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 0.0);
750 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.0);
751 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 1.0);
752 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
754 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
755 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
756 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
757 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
759 aColor.setChansRGB_dbl(1.0, 1.0, 0.0);
761 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c16b::maxChanVal);
762 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c16b::maxChanVal);
763 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c16b::minChanVal);
764 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c16b::minChanVal);
766 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
767 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
768 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
769 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
771 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
772 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 255);
773 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0);
774 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
776 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
777 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
778 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
779 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
781 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
782 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 1.0);
783 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 0.0);
784 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
786 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
787 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
788 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
789 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
791 aColor.setChan_dbl(1, 0.5);
793 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c16b::maxChanVal);
794 BOOST_TEST_CHECK(aColor.getChan(1) == 32767);
795 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c16b::minChanVal);
796 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c16b::minChanVal);
798 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
799 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
800 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
801 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
803 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
804 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 127);
805 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0);
806 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
808 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
809 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
810 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
811 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
813 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
814 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 32767.0/mjr::color4c16b::maxChanVal);
815 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 0.0);
816 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
818 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
819 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
820 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
821 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
823 aColor.setChansRGB_dbl(0.0, 0.0, 0.0);
825 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c16b::minChanVal);
826 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c16b::minChanVal);
827 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c16b::minChanVal);
828 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c16b::minChanVal);
830 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
831 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
832 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
833 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
835 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0);
836 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
837 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0);
838 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
840 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
841 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
842 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
843 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
845 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 0.0);
846 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.0);
847 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 0.0);
848 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
850 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
851 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
852 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
853 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
855 aColor.setChans_dbl(1.0);
857 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c16b::maxChanVal);
858 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c16b::maxChanVal);
859 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c16b::maxChanVal);
860 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c16b::maxChanVal);
862 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
863 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
864 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
865 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
867 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
868 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 255);
869 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
870 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 255);
872 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
873 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
874 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
875 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
877 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
878 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 1.0);
879 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 1.0);
880 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 1.0);
882 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
883 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
884 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
885 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
887 aColor.setChansRGBA_dbl(1.0, 0.0, 0.5, 0.5);
889 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c16b::maxChanVal);
890 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c16b::minChanVal);
891 BOOST_TEST_CHECK(aColor.getChan(2) == 32767);
892 BOOST_TEST_CHECK(aColor.getChan(3) == 32767);
894 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
895 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
896 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
897 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
899 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
900 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
901 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 127);
902 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 127);
904 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
905 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
906 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
907 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
909 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
910 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.0);
911 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 32767.0/mjr::color4c16b::maxChanVal, boost::test_tools::tolerance(0.005));
912 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 32767.0/mjr::color4c16b::maxChanVal, boost::test_tools::tolerance(0.005));
914 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
915 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
916 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
917 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
919 aColor.setC0_dbl(0.0);
920 aColor.setC1_dbl(1.0);
921 aColor.setC2_dbl(1.0);
922 aColor.setC3_dbl(0.0);
924 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c16b::minChanVal);
925 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c16b::maxChanVal);
926 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c16b::maxChanVal);
927 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c16b::minChanVal);
929 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
930 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
931 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
932 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
934 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0);
935 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 255);
936 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
937 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
939 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
940 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
941 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
942 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
944 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 0.0);
945 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 1.0);
946 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 1.0);
947 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
949 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
950 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
951 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
952 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
957BOOST_AUTO_TEST_CASE(set_chan_dbl_64F, * boost::unit_test::tolerance(0.00001)) {
959 mjr::color4c64F aColor;
961 BOOST_TEST_CHECK(mjr::color4c64F::maxChanVal == 1.0);
962 BOOST_TEST_CHECK(mjr::color4c64F::minChanVal == 0.0);
965 aColor.setChan_dbl(0, 1.0);
966 aColor.setChan_dbl(2, 1.0);
968 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c64F::maxChanVal);
969 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c64F::minChanVal);
970 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c64F::maxChanVal);
971 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c64F::minChanVal);
973 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
974 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
975 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
976 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
978 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
979 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
980 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
981 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
983 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
984 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
985 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
986 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
988 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
989 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.0);
990 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 1.0);
991 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
993 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
994 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
995 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
996 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
998 aColor.setChan_dbl(0, 0.0);
1000 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c64F::minChanVal);
1001 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c64F::minChanVal);
1002 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c64F::maxChanVal);
1003 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c64F::minChanVal);
1005 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1006 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1007 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1008 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1010 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0);
1011 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
1012 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
1013 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
1015 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1016 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1017 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1018 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1020 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 0.0);
1021 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.0);
1022 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 1.0);
1023 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
1025 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
1026 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
1027 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
1028 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
1030 aColor.setChansRGB_dbl(1.0, 1.0, 0.0);
1032 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c64F::maxChanVal);
1033 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c64F::maxChanVal);
1034 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c64F::minChanVal);
1035 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c64F::minChanVal);
1037 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1038 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1039 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1040 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1042 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
1043 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 255);
1044 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0);
1045 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
1047 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1048 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1049 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1050 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1052 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
1053 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 1.0);
1054 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 0.0);
1055 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
1057 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
1058 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
1059 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
1060 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
1062 aColor.setChan_dbl(1, 0.5);
1064 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c64F::maxChanVal);
1065 BOOST_TEST_CHECK(aColor.getChan(1) == 0.5);
1066 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c64F::minChanVal);
1067 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c64F::minChanVal);
1069 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1070 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1071 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1072 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1074 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
1075 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 127);
1076 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0);
1077 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
1079 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1080 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1081 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1082 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1084 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
1085 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.5);
1086 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 0.0);
1087 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
1089 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
1090 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
1091 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
1092 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
1094 aColor.setChansRGB_dbl(0.0, 0.0, 0.0);
1096 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c64F::minChanVal);
1097 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c64F::minChanVal);
1098 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c64F::minChanVal);
1099 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c64F::minChanVal);
1101 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1102 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1103 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1104 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1106 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0);
1107 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
1108 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0);
1109 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
1111 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1112 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1113 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1114 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1116 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 0.0);
1117 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.0);
1118 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 0.0);
1119 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
1121 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
1122 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
1123 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
1124 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
1126 aColor.setChans_dbl(1.0);
1128 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c64F::maxChanVal);
1129 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c64F::maxChanVal);
1130 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c64F::maxChanVal);
1131 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c64F::maxChanVal);
1133 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1134 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1135 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1136 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1138 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
1139 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 255);
1140 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
1141 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 255);
1143 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1144 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1145 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1146 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1148 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
1149 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 1.0);
1150 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 1.0);
1151 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 1.0);
1153 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
1154 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
1155 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
1156 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
1158 aColor.setChansRGBA_dbl(1.0, 0.0, 0.5, 0.5);
1160 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c64F::maxChanVal);
1161 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c64F::minChanVal);
1162 BOOST_TEST_CHECK(aColor.getChan(2) == 0.5);
1163 BOOST_TEST_CHECK(aColor.getChan(3) == 0.5);
1165 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1166 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1167 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1168 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1170 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
1171 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
1172 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 127);
1173 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 127);
1175 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1176 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1177 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1178 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1180 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
1181 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 0.0);
1182 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 0.5);
1183 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.5);
1185 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
1186 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
1187 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
1188 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
1190 aColor.setC0_dbl(0.0);
1191 aColor.setC1_dbl(1.0);
1192 aColor.setC2_dbl(1.0);
1193 aColor.setC3_dbl(0.0);
1195 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c64F::minChanVal);
1196 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c64F::maxChanVal);
1197 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c64F::maxChanVal);
1198 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c64F::minChanVal);
1200 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1201 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1202 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1203 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1205 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0);
1206 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 255);
1207 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
1208 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
1210 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1211 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1212 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1213 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1215 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 0.0);
1216 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == 1.0);
1217 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == 1.0);
1218 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == 0.0);
1220 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl(), boost::test_tools::tolerance(0.00001));
1221 BOOST_TEST_CHECK(aColor.getChan_dbl(1) == aColor.getC1_dbl(), boost::test_tools::tolerance(0.00001));
1222 BOOST_TEST_CHECK(aColor.getChan_dbl(2) == aColor.getC2_dbl(), boost::test_tools::tolerance(0.00001));
1223 BOOST_TEST_CHECK(aColor.getChan_dbl(3) == aColor.getC3_dbl(), boost::test_tools::tolerance(0.00001));
1228BOOST_AUTO_TEST_CASE(set_chan_byte_8) {
1230 mjr::color4c8b aColor;
1232 aColor.setToBlack();
1233 aColor.setChan_byte(0, 11);
1234 aColor.setChan_byte(1, 22);
1235 aColor.setChan_byte(2, 33);
1236 aColor.setChan_byte(3, 44);
1238 BOOST_TEST_CHECK(aColor.getChan(0) == 11);
1239 BOOST_TEST_CHECK(aColor.getChan(1) == 22);
1240 BOOST_TEST_CHECK(aColor.getChan(2) == 33);
1241 BOOST_TEST_CHECK(aColor.getChan(3) == 44);
1243 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1244 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1245 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1246 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1248 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 11);
1249 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 22);
1250 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 33);
1251 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 44);
1253 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1254 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1255 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1256 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1258 aColor.setC0_byte(55);
1259 aColor.setC1_byte(66);
1260 aColor.setC2_byte(77);
1261 aColor.setC3_byte(88);
1263 BOOST_TEST_CHECK(aColor.getChan(0) == 55);
1264 BOOST_TEST_CHECK(aColor.getChan(1) == 66);
1265 BOOST_TEST_CHECK(aColor.getChan(2) == 77);
1266 BOOST_TEST_CHECK(aColor.getChan(3) == 88);
1268 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1269 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1270 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1271 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1273 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 55);
1274 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 66);
1275 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 77);
1276 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 88);
1278 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1279 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1280 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1281 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1283 aColor.setChans_byte(99);
1285 BOOST_TEST_CHECK(aColor.getChan(0) == 99);
1286 BOOST_TEST_CHECK(aColor.getChan(1) == 99);
1287 BOOST_TEST_CHECK(aColor.getChan(2) == 99);
1288 BOOST_TEST_CHECK(aColor.getChan(3) == 99);
1290 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1291 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1292 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1293 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1295 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 99);
1296 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 99);
1297 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 99);
1298 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 99);
1300 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1301 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1302 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1303 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1305 aColor.setChansRGB_byte(33, 44, 55);
1307 BOOST_TEST_CHECK(aColor.getChan(0) == 33);
1308 BOOST_TEST_CHECK(aColor.getChan(1) == 44);
1309 BOOST_TEST_CHECK(aColor.getChan(2) == 55);
1310 BOOST_TEST_CHECK(aColor.getChan(3) == 99);
1312 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1313 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1314 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1315 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1317 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 33);
1318 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 44);
1319 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 55);
1320 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 99);
1322 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1323 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1324 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1325 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1327 aColor.setChansRGBA_byte(11, 22, 33, 44);
1329 BOOST_TEST_CHECK(aColor.getChan(0) == 11);
1330 BOOST_TEST_CHECK(aColor.getChan(1) == 22);
1331 BOOST_TEST_CHECK(aColor.getChan(2) == 33);
1332 BOOST_TEST_CHECK(aColor.getChan(3) == 44);
1334 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1335 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1336 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1337 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1339 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 11);
1340 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 22);
1341 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 33);
1342 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 44);
1344 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1345 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1346 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1347 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1350 aColor.setChansRGBA_byte(0, 255, 0, 255);
1352 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c8b::minChanVal);
1353 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c8b::maxChanVal);
1354 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c8b::minChanVal);
1355 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c8b::maxChanVal);
1360BOOST_AUTO_TEST_CASE(set_chan_byte_16) {
1362 mjr::color4c16b aColor;
1364 aColor.setToBlack();
1365 aColor.setChan_byte(0, 11);
1366 aColor.setChan_byte(1, 22);
1367 aColor.setChan_byte(2, 33);
1368 aColor.setChan_byte(3, 44);
1370 BOOST_TEST_CHECK(aColor.getChan(0) == 0xB0B);
1371 BOOST_TEST_CHECK(aColor.getChan(1) == 0x1616);
1372 BOOST_TEST_CHECK(aColor.getChan(2) == 0x2121);
1373 BOOST_TEST_CHECK(aColor.getChan(3) == 0x2C2C);
1375 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1376 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1377 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1378 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1380 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 11);
1381 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 22);
1382 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 33);
1383 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 44);
1385 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1386 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1387 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1388 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1390 aColor.setC0_byte(55);
1391 aColor.setC1_byte(66);
1392 aColor.setC2_byte(77);
1393 aColor.setC3_byte(88);
1395 BOOST_TEST_CHECK(aColor.getChan(0) == 14135);
1396 BOOST_TEST_CHECK(aColor.getChan(1) == 16962);
1397 BOOST_TEST_CHECK(aColor.getChan(2) == 19789);
1398 BOOST_TEST_CHECK(aColor.getChan(3) == 22616);
1400 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1401 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1402 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1403 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1405 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 55);
1406 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 66);
1407 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 77);
1408 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 88);
1410 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1411 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1412 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1413 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1415 aColor.setChans_byte(99);
1417 BOOST_TEST_CHECK(aColor.getChan(0) == 25443);
1418 BOOST_TEST_CHECK(aColor.getChan(1) == 25443);
1419 BOOST_TEST_CHECK(aColor.getChan(2) == 25443);
1420 BOOST_TEST_CHECK(aColor.getChan(3) == 25443);
1422 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1423 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1424 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1425 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1427 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 99);
1428 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 99);
1429 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 99);
1430 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 99);
1432 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1433 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1434 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1435 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1437 aColor.setChansRGB_byte(33, 44, 55);
1439 BOOST_TEST_CHECK(aColor.getChan(0) == 8481);
1440 BOOST_TEST_CHECK(aColor.getChan(1) == 11308);
1441 BOOST_TEST_CHECK(aColor.getChan(2) == 14135);
1442 BOOST_TEST_CHECK(aColor.getChan(3) == 25443);
1444 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1445 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1446 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1447 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1449 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 33);
1450 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 44);
1451 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 55);
1452 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 99);
1454 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1455 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1456 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1457 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1459 aColor.setChansRGBA_byte(11, 22, 33, 44);
1461 BOOST_TEST_CHECK(aColor.getChan(0) == 2827);
1462 BOOST_TEST_CHECK(aColor.getChan(1) == 5654);
1463 BOOST_TEST_CHECK(aColor.getChan(2) == 8481);
1464 BOOST_TEST_CHECK(aColor.getChan(3) == 11308);
1466 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1467 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1468 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1469 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1471 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 11);
1472 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 22);
1473 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 33);
1474 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 44);
1476 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1477 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1478 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1479 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1482 aColor.setChansRGBA_byte(0, 255, 0, 255);
1484 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c16b::minChanVal);
1485 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c16b::maxChanVal);
1486 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c16b::minChanVal);
1487 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c16b::maxChanVal);
1492BOOST_AUTO_TEST_CASE(set_chan_byte_64F, * boost::unit_test::tolerance(0.0001)) {
1494 mjr::color4c64F aColor;
1496 aColor.setToBlack();
1497 aColor.setChan_byte(0, 11);
1498 aColor.setChan_byte(1, 22);
1499 aColor.setChan_byte(2, 34);
1500 aColor.setChan_byte(3, 44);
1502 BOOST_TEST_CHECK(aColor.getChan(0) == 0.043137254902);
1503 BOOST_TEST_CHECK(aColor.getChan(1) == 0.0862745098039);
1504 BOOST_TEST_CHECK(aColor.getChan(2) == 0.133333333333);
1505 BOOST_TEST_CHECK(aColor.getChan(3) == 0.172549019608);
1507 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1508 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1509 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1510 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1512 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 11);
1513 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 22);
1514 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 34);
1515 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 44);
1517 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1518 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1519 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1520 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1522 aColor.setC0_byte(55);
1523 aColor.setC1_byte(65);
1524 aColor.setC2_byte(77);
1525 aColor.setC3_byte(88);
1527 BOOST_TEST_CHECK(aColor.getChan(0) == 0.21568627450980393);
1528 BOOST_TEST_CHECK(aColor.getChan(1) == 0.254901960784);
1529 BOOST_TEST_CHECK(aColor.getChan(2) == 0.30196078431372547);
1530 BOOST_TEST_CHECK(aColor.getChan(3) == 0.34509803921568627);
1532 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1533 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1534 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1535 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1537 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 55);
1538 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 65);
1539 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 77);
1540 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 88);
1542 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1543 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1544 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1545 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1547 aColor.setChans_byte(99);
1549 BOOST_TEST_CHECK(aColor.getChan(0) == 0.38823529411764707);
1550 BOOST_TEST_CHECK(aColor.getChan(1) == 0.38823529411764707);
1551 BOOST_TEST_CHECK(aColor.getChan(2) == 0.38823529411764707);
1552 BOOST_TEST_CHECK(aColor.getChan(3) == 0.38823529411764707);
1554 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1555 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1556 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1557 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1559 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 99);
1560 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 99);
1561 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 99);
1562 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 99);
1564 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1565 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1566 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1567 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1569 aColor.setChansRGB_byte(34, 44, 55);
1571 BOOST_TEST_CHECK(aColor.getChan(0) == 0.133333333333);
1572 BOOST_TEST_CHECK(aColor.getChan(1) == 0.17254901960784313);
1573 BOOST_TEST_CHECK(aColor.getChan(2) == 0.21568627450980393);
1574 BOOST_TEST_CHECK(aColor.getChan(3) == 0.38823529411764707);
1576 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1577 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1578 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1579 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1581 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 34);
1582 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 44);
1583 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 55);
1584 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 99);
1586 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1587 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1588 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1589 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1591 aColor.setChansRGBA_byte(11, 22, 34, 44);
1593 BOOST_TEST_CHECK(aColor.getChan(0) == 0.043137254902);
1594 BOOST_TEST_CHECK(aColor.getChan(1) == 0.08627450980392157);
1595 BOOST_TEST_CHECK(aColor.getChan(2) == 0.133333333333);
1596 BOOST_TEST_CHECK(aColor.getChan(3) == 0.17254901960784313);
1598 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1599 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1600 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1601 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1603 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 11);
1604 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 22);
1605 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 34);
1606 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 44);
1608 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1609 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1610 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1611 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1614 aColor.setChansRGBA_byte(0, 255, 0, 255);
1616 BOOST_TEST_CHECK(aColor.getChan(0) == mjr::color4c64F::minChanVal);
1617 BOOST_TEST_CHECK(aColor.getChan(1) == mjr::color4c64F::maxChanVal);
1618 BOOST_TEST_CHECK(aColor.getChan(2) == mjr::color4c64F::minChanVal);
1619 BOOST_TEST_CHECK(aColor.getChan(3) == mjr::color4c64F::maxChanVal);
1623BOOST_AUTO_TEST_CASE(set_chan_8) {
1625 mjr::color4c8b aColor;
1627 aColor.setToBlack();
1628 aColor.setChan(0, 11);
1629 aColor.setChan(1, 22);
1630 aColor.setChan(2, 33);
1631 aColor.setChan(3, 44);
1633 BOOST_TEST_CHECK(aColor.getChan(0) == 11);
1634 BOOST_TEST_CHECK(aColor.getChan(1) == 22);
1635 BOOST_TEST_CHECK(aColor.getChan(2) == 33);
1636 BOOST_TEST_CHECK(aColor.getChan(3) == 44);
1638 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1639 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1640 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1641 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1643 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 11);
1644 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 22);
1645 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 33);
1646 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 44);
1648 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1649 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1650 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1651 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1658 BOOST_TEST_CHECK(aColor.getChan(0) == 55);
1659 BOOST_TEST_CHECK(aColor.getChan(1) == 66);
1660 BOOST_TEST_CHECK(aColor.getChan(2) == 77);
1661 BOOST_TEST_CHECK(aColor.getChan(3) == 88);
1663 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1664 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1665 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1666 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1668 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 55);
1669 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 66);
1670 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 77);
1671 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 88);
1673 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1674 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1675 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1676 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1678 aColor.setChans(99);
1680 BOOST_TEST_CHECK(aColor.getChan(0) == 99);
1681 BOOST_TEST_CHECK(aColor.getChan(1) == 99);
1682 BOOST_TEST_CHECK(aColor.getChan(2) == 99);
1683 BOOST_TEST_CHECK(aColor.getChan(3) == 99);
1685 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1686 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1687 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1688 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1690 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 99);
1691 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 99);
1692 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 99);
1693 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 99);
1695 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1696 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1697 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1698 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1700 aColor.setChansRGB(33, 44, 55);
1702 BOOST_TEST_CHECK(aColor.getChan(0) == 33);
1703 BOOST_TEST_CHECK(aColor.getChan(1) == 44);
1704 BOOST_TEST_CHECK(aColor.getChan(2) == 55);
1705 BOOST_TEST_CHECK(aColor.getChan(3) == 99);
1707 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1708 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1709 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1710 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1712 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 33);
1713 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 44);
1714 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 55);
1715 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 99);
1717 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1718 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1719 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1720 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1722 aColor.setChansRGBA(11, 22, 33, 44);
1724 BOOST_TEST_CHECK(aColor.getChan(0) == 11);
1725 BOOST_TEST_CHECK(aColor.getChan(1) == 22);
1726 BOOST_TEST_CHECK(aColor.getChan(2) == 33);
1727 BOOST_TEST_CHECK(aColor.getChan(3) == 44);
1729 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1730 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1731 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1732 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1734 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 11);
1735 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 22);
1736 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 33);
1737 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 44);
1739 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1740 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1741 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1742 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1746BOOST_AUTO_TEST_CASE(set_chan_16) {
1748 mjr::color4c16b aColor;
1750 aColor.setToBlack();
1751 aColor.setChan(0, 1024);
1752 aColor.setChan(1, 2048);
1753 aColor.setChan(2, 4096);
1754 aColor.setChan(3, 8192);
1756 BOOST_TEST_CHECK(aColor.getChan(0) == 1024);
1757 BOOST_TEST_CHECK(aColor.getChan(1) == 2048);
1758 BOOST_TEST_CHECK(aColor.getChan(2) == 4096);
1759 BOOST_TEST_CHECK(aColor.getChan(3) == 8192);
1761 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1762 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1763 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1764 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1766 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0x03);
1767 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0x07);
1768 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0x0f);
1769 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0x1f);
1771 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1772 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1773 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1774 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1781 BOOST_TEST_CHECK(aColor.getChan(0) == 8192);
1782 BOOST_TEST_CHECK(aColor.getChan(1) == 4096);
1783 BOOST_TEST_CHECK(aColor.getChan(2) == 2048);
1784 BOOST_TEST_CHECK(aColor.getChan(3) == 1024);
1786 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1787 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1788 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1789 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1791 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0x1f);
1792 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0x0f);
1793 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0x07);
1794 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0x03);
1796 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1797 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1798 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1799 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1801 aColor.setChans(32768);
1803 BOOST_TEST_CHECK(aColor.getChan(0) == 32768);
1804 BOOST_TEST_CHECK(aColor.getChan(1) == 32768);
1805 BOOST_TEST_CHECK(aColor.getChan(2) == 32768);
1806 BOOST_TEST_CHECK(aColor.getChan(3) == 32768);
1808 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1809 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1810 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1811 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1813 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0x7f);
1814 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0x7f);
1815 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0x7f);
1816 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0x7f);
1818 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1819 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1820 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1821 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1823 aColor.setChansRGB(4096, 8192, 16384);
1825 BOOST_TEST_CHECK(aColor.getChan(0) == 4096);
1826 BOOST_TEST_CHECK(aColor.getChan(1) == 8192);
1827 BOOST_TEST_CHECK(aColor.getChan(2) == 16384);
1828 BOOST_TEST_CHECK(aColor.getChan(3) == 32768);
1830 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1831 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1832 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1833 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1835 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0x0f);
1836 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0x1f);
1837 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0x3f);
1838 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0x7f);
1840 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1841 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1842 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1843 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1845 aColor.setChansRGBA(1024, 2048, 4096, 8192);
1847 BOOST_TEST_CHECK(aColor.getChan(0) == 1024);
1848 BOOST_TEST_CHECK(aColor.getChan(1) == 2048);
1849 BOOST_TEST_CHECK(aColor.getChan(2) == 4096);
1850 BOOST_TEST_CHECK(aColor.getChan(3) == 8192);
1852 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1853 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1854 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1855 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1857 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0x03);
1858 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0x07);
1859 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0x0f);
1860 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0x1f);
1862 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1863 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1864 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1865 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1870 BOOST_TEST_CHECK(aColor.getChan(0) == 0);
1871 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1873 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0);
1874 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1876 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 0.0);
1877 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC0_dbl());
1879 aColor.setChans(65535);
1881 BOOST_TEST_CHECK(aColor.getChan(0) == 65535);
1882 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC1());
1884 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
1885 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC1_byte());
1887 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == 1.0);
1888 BOOST_TEST_CHECK(aColor.getChan_dbl(0) == aColor.getC1_dbl());
1893BOOST_AUTO_TEST_CASE(set_chan_64F) {
1895 mjr::color4c64F aColor;
1897 aColor.setToBlack();
1898 aColor.setChan(0, 0.25);
1899 aColor.setChan(1, 0.50);
1900 aColor.setChan(2, 0.75);
1901 aColor.setChan(3, 1.00);
1903 BOOST_TEST_CHECK(aColor.getChan(0) == 0.25);
1904 BOOST_TEST_CHECK(aColor.getChan(1) == 0.50);
1905 BOOST_TEST_CHECK(aColor.getChan(2) == 0.75);
1906 BOOST_TEST_CHECK(aColor.getChan(3) == 1.00);
1908 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1909 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1910 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1911 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1913 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 63);
1914 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 127);
1915 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 191);
1916 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 255);
1918 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1919 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1920 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1921 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1928 BOOST_TEST_CHECK(aColor.getChan(0) == 1.00);
1929 BOOST_TEST_CHECK(aColor.getChan(1) == 0.75);
1930 BOOST_TEST_CHECK(aColor.getChan(2) == 0.50);
1931 BOOST_TEST_CHECK(aColor.getChan(3) == 0.25);
1933 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1934 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1935 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1936 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1938 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 255);
1939 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 191);
1940 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 127);
1941 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 63);
1943 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1944 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1945 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1946 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1948 aColor.setChans(0.0);
1950 BOOST_TEST_CHECK(aColor.getChan(0) == 0.0);
1951 BOOST_TEST_CHECK(aColor.getChan(1) == 0.0);
1952 BOOST_TEST_CHECK(aColor.getChan(2) == 0.0);
1953 BOOST_TEST_CHECK(aColor.getChan(3) == 0.0);
1955 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1956 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1957 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1958 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1960 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 0);
1961 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 0);
1962 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 0);
1963 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
1965 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1966 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1967 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1968 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1970 aColor.setChansRGB(0.75, 0.50, 1.0);
1972 BOOST_TEST_CHECK(aColor.getChan(0) == 0.75);
1973 BOOST_TEST_CHECK(aColor.getChan(1) == 0.50);
1974 BOOST_TEST_CHECK(aColor.getChan(2) == 1.00);
1975 BOOST_TEST_CHECK(aColor.getChan(3) == 0.00);
1977 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
1978 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
1979 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
1980 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
1982 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 191);
1983 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 127);
1984 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 255);
1985 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 0);
1987 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
1988 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
1989 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
1990 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
1992 aColor.setChansRGBA(0.25, 0.50, 0.75, 1.00);
1994 BOOST_TEST_CHECK(aColor.getChan(0) == 0.25);
1995 BOOST_TEST_CHECK(aColor.getChan(1) == 0.50);
1996 BOOST_TEST_CHECK(aColor.getChan(2) == 0.75);
1997 BOOST_TEST_CHECK(aColor.getChan(3) == 1.00);
1999 BOOST_TEST_CHECK(aColor.getChan(0) == aColor.getC0());
2000 BOOST_TEST_CHECK(aColor.getChan(1) == aColor.getC1());
2001 BOOST_TEST_CHECK(aColor.getChan(2) == aColor.getC2());
2002 BOOST_TEST_CHECK(aColor.getChan(3) == aColor.getC3());
2004 BOOST_TEST_CHECK(aColor.getChan_byte(0) == 63);
2005 BOOST_TEST_CHECK(aColor.getChan_byte(1) == 127);
2006 BOOST_TEST_CHECK(aColor.getChan_byte(2) == 191);
2007 BOOST_TEST_CHECK(aColor.getChan_byte(3) == 255);
2009 BOOST_TEST_CHECK(aColor.getChan_byte(0) == aColor.getC0_byte());
2010 BOOST_TEST_CHECK(aColor.getChan_byte(1) == aColor.getC1_byte());
2011 BOOST_TEST_CHECK(aColor.getChan_byte(2) == aColor.getC2_byte());
2012 BOOST_TEST_CHECK(aColor.getChan_byte(3) == aColor.getC3_byte());
2016BOOST_AUTO_TEST_CASE(constr_64F) {
2018 mjr::color4c64F aColor(0.25);
2019 BOOST_TEST_CHECK(aColor.getChan(0) == 0.25);
2020 BOOST_TEST_CHECK(aColor.getChan(1) == 0.25);
2021 BOOST_TEST_CHECK(aColor.getChan(2) == 0.25);
2022 BOOST_TEST_CHECK(aColor.getChan(3) == 0.25);
2024 mjr::color4c64F cColor(0.25, 0.50, 0.75);
2025 BOOST_TEST_CHECK(cColor.getChan(0) == 0.25);
2026 BOOST_TEST_CHECK(cColor.getChan(1) == 0.50);
2027 BOOST_TEST_CHECK(cColor.getChan(2) == 0.75);
2028 BOOST_TEST_CHECK(cColor.getChan(3) == 0.00);
2030 mjr::color4c64F dColor(1.00, 0.75, 0.50, 0.25);
2031 BOOST_TEST_CHECK(dColor.getChan(0) == 1.00);
2032 BOOST_TEST_CHECK(dColor.getChan(1) == 0.75);
2033 BOOST_TEST_CHECK(dColor.getChan(2) == 0.50);
2034 BOOST_TEST_CHECK(dColor.getChan(3) == 0.25);
2036 mjr::color4c64F eColor(dColor);
2037 BOOST_TEST_CHECK(eColor.getChan(0) == 1.00);
2038 BOOST_TEST_CHECK(eColor.getChan(1) == 0.75);
2039 BOOST_TEST_CHECK(eColor.getChan(2) == 0.50);
2040 BOOST_TEST_CHECK(eColor.getChan(3) == 0.25);
2042 mjr::color4c64F f0Color(mjr::color4c64F::cornerColorEnum::BLACK);
2043 mjr::color4c64F fRColor(mjr::color4c64F::cornerColorEnum::RED);
2044 mjr::color4c64F fGColor(mjr::color4c64F::cornerColorEnum::GREEN);
2045 mjr::color4c64F fBColor(mjr::color4c64F::cornerColorEnum::BLUE);
2046 mjr::color4c64F fYColor(mjr::color4c64F::cornerColorEnum::YELLOW);
2047 mjr::color4c64F fCColor(mjr::color4c64F::cornerColorEnum::CYAN);
2048 mjr::color4c64F fMColor(mjr::color4c64F::cornerColorEnum::MAGENTA);
2049 mjr::color4c64F f1Color(mjr::color4c64F::cornerColorEnum::WHITE);
2051 BOOST_TEST_CHECK(f0Color.getC0() == 0.0);
2052 BOOST_TEST_CHECK(fRColor.getC0() == 1.0);
2053 BOOST_TEST_CHECK(fGColor.getC0() == 0.0);
2054 BOOST_TEST_CHECK(fBColor.getC0() == 0.0);
2055 BOOST_TEST_CHECK(fYColor.getC0() == 1.0);
2056 BOOST_TEST_CHECK(fCColor.getC0() == 0.0);
2057 BOOST_TEST_CHECK(fMColor.getC0() == 1.0);
2058 BOOST_TEST_CHECK(f1Color.getC0() == 1.0);
2060 BOOST_TEST_CHECK(f0Color.getC1() == 0.0);
2061 BOOST_TEST_CHECK(fRColor.getC1() == 0.0);
2062 BOOST_TEST_CHECK(fGColor.getC1() == 1.0);
2063 BOOST_TEST_CHECK(fBColor.getC1() == 0.0);
2064 BOOST_TEST_CHECK(fYColor.getC1() == 1.0);
2065 BOOST_TEST_CHECK(fCColor.getC1() == 1.0);
2066 BOOST_TEST_CHECK(fMColor.getC1() == 0.0);
2067 BOOST_TEST_CHECK(f1Color.getC1() == 1.0);
2069 BOOST_TEST_CHECK(f0Color.getC2() == 0.0);
2070 BOOST_TEST_CHECK(fRColor.getC2() == 0.0);
2071 BOOST_TEST_CHECK(fGColor.getC2() == 0.0);
2072 BOOST_TEST_CHECK(fBColor.getC2() == 1.0);
2073 BOOST_TEST_CHECK(fYColor.getC2() == 0.0);
2074 BOOST_TEST_CHECK(fCColor.getC2() == 1.0);
2075 BOOST_TEST_CHECK(fMColor.getC2() == 1.0);
2076 BOOST_TEST_CHECK(f1Color.getC2() == 1.0);
2078 BOOST_TEST_CHECK(f0Color.getC3() == 0.0);
2079 BOOST_TEST_CHECK(fRColor.getC3() == 0.0);
2080 BOOST_TEST_CHECK(fGColor.getC3() == 0.0);
2081 BOOST_TEST_CHECK(fBColor.getC3() == 0.0);
2082 BOOST_TEST_CHECK(fYColor.getC3() == 1.0);
2083 BOOST_TEST_CHECK(fCColor.getC3() == 1.0);
2084 BOOST_TEST_CHECK(fMColor.getC3() == 1.0);
2085 BOOST_TEST_CHECK(f1Color.getC3() == 1.0);
2089 mjr::color4c64F g0Color(
"0");
2090 mjr::color4c64F gRColor(
"R");
2091 mjr::color4c64F gGColor(
"G");
2092 mjr::color4c64F gBColor(
"B");
2093 mjr::color4c64F gYColor(
"Y");
2094 mjr::color4c64F gCColor(
"C");
2095 mjr::color4c64F gMColor(
"M");
2096 mjr::color4c64F g1Color(
"W");
2098 BOOST_TEST_CHECK(g0Color.getC0() == 0.0);
2099 BOOST_TEST_CHECK(gRColor.getC0() == 1.0);
2100 BOOST_TEST_CHECK(gGColor.getC0() == 0.0);
2101 BOOST_TEST_CHECK(gBColor.getC0() == 0.0);
2102 BOOST_TEST_CHECK(gYColor.getC0() == 1.0);
2103 BOOST_TEST_CHECK(gCColor.getC0() == 0.0);
2104 BOOST_TEST_CHECK(gMColor.getC0() == 1.0);
2105 BOOST_TEST_CHECK(g1Color.getC0() == 1.0);
2107 BOOST_TEST_CHECK(g0Color.getC1() == 0.0);
2108 BOOST_TEST_CHECK(gRColor.getC1() == 0.0);
2109 BOOST_TEST_CHECK(gGColor.getC1() == 1.0);
2110 BOOST_TEST_CHECK(gBColor.getC1() == 0.0);
2111 BOOST_TEST_CHECK(gYColor.getC1() == 1.0);
2112 BOOST_TEST_CHECK(gCColor.getC1() == 1.0);
2113 BOOST_TEST_CHECK(gMColor.getC1() == 0.0);
2114 BOOST_TEST_CHECK(g1Color.getC1() == 1.0);
2116 BOOST_TEST_CHECK(g0Color.getC2() == 0.0);
2117 BOOST_TEST_CHECK(gRColor.getC2() == 0.0);
2118 BOOST_TEST_CHECK(gGColor.getC2() == 0.0);
2119 BOOST_TEST_CHECK(gBColor.getC2() == 1.0);
2120 BOOST_TEST_CHECK(gYColor.getC2() == 0.0);
2121 BOOST_TEST_CHECK(gCColor.getC2() == 1.0);
2122 BOOST_TEST_CHECK(gMColor.getC2() == 1.0);
2123 BOOST_TEST_CHECK(g1Color.getC2() == 1.0);
2125 BOOST_TEST_CHECK(g0Color.getC3() == 0.0);
2126 BOOST_TEST_CHECK(gRColor.getC3() == 0.0);
2127 BOOST_TEST_CHECK(gGColor.getC3() == 0.0);
2128 BOOST_TEST_CHECK(gBColor.getC3() == 0.0);
2129 BOOST_TEST_CHECK(gYColor.getC3() == 1.0);
2130 BOOST_TEST_CHECK(gCColor.getC3() == 1.0);
2131 BOOST_TEST_CHECK(gMColor.getC3() == 1.0);
2132 BOOST_TEST_CHECK(g1Color.getC3() == 1.0);
2136 mjr::color4c64F h0Color(
"black");
2137 mjr::color4c64F hRColor(
"Red");
2138 mjr::color4c64F hGColor(
"GREEN");
2139 mjr::color4c64F hBColor(
"blue");
2140 mjr::color4c64F hYColor(
"YeLLoW");
2141 mjr::color4c64F hCColor(
"CYAN");
2142 mjr::color4c64F hMColor(
"MAGENTA");
2143 mjr::color4c64F h1Color(
"White");
2145 BOOST_TEST_CHECK(h0Color.getC0() == 0.0);
2146 BOOST_TEST_CHECK(hRColor.getC0() == 1.0);
2147 BOOST_TEST_CHECK(hGColor.getC0() == 0.0);
2148 BOOST_TEST_CHECK(hBColor.getC0() == 0.0);
2149 BOOST_TEST_CHECK(hYColor.getC0() == 1.0);
2150 BOOST_TEST_CHECK(hCColor.getC0() == 0.0);
2151 BOOST_TEST_CHECK(hMColor.getC0() == 1.0);
2152 BOOST_TEST_CHECK(h1Color.getC0() == 1.0);
2154 BOOST_TEST_CHECK(h0Color.getC1() == 0.0);
2155 BOOST_TEST_CHECK(hRColor.getC1() == 0.0);
2156 BOOST_TEST_CHECK(hGColor.getC1() == 1.0);
2157 BOOST_TEST_CHECK(hBColor.getC1() == 0.0);
2158 BOOST_TEST_CHECK(hYColor.getC1() == 1.0);
2159 BOOST_TEST_CHECK(hCColor.getC1() == 1.0);
2160 BOOST_TEST_CHECK(hMColor.getC1() == 0.0);
2161 BOOST_TEST_CHECK(h1Color.getC1() == 1.0);
2163 BOOST_TEST_CHECK(h0Color.getC2() == 0.0);
2164 BOOST_TEST_CHECK(hRColor.getC2() == 0.0);
2165 BOOST_TEST_CHECK(hGColor.getC2() == 0.0);
2166 BOOST_TEST_CHECK(hBColor.getC2() == 1.0);
2167 BOOST_TEST_CHECK(hYColor.getC2() == 0.0);
2168 BOOST_TEST_CHECK(hCColor.getC2() == 1.0);
2169 BOOST_TEST_CHECK(hMColor.getC2() == 1.0);
2170 BOOST_TEST_CHECK(h1Color.getC2() == 1.0);
2172 BOOST_TEST_CHECK(h0Color.getC3() == 0.0);
2173 BOOST_TEST_CHECK(hRColor.getC3() == 0.0);
2174 BOOST_TEST_CHECK(hGColor.getC3() == 0.0);
2175 BOOST_TEST_CHECK(hBColor.getC3() == 0.0);
2176 BOOST_TEST_CHECK(hYColor.getC3() == 1.0);
2177 BOOST_TEST_CHECK(hCColor.getC3() == 1.0);
2178 BOOST_TEST_CHECK(hMColor.getC3() == 1.0);
2179 BOOST_TEST_CHECK(h1Color.getC3() == 1.0);
2181 mjr::color4c64F iColor(
"zoogo");
2182 BOOST_TEST_CHECK(iColor.getC0() == 0.0);
2183 BOOST_TEST_CHECK(iColor.getC1() == 0.0);
2184 BOOST_TEST_CHECK(iColor.getC2() == 0.0);
2185 BOOST_TEST_CHECK(iColor.getC3() == 0.0);
2187 mjr::color4c64F jColor(
"z");
2188 BOOST_TEST_CHECK(jColor.getC0() == 0.0);
2189 BOOST_TEST_CHECK(jColor.getC1() == 0.0);
2190 BOOST_TEST_CHECK(jColor.getC2() == 0.0);
2191 BOOST_TEST_CHECK(jColor.getC3() == 0.0);
2195 mjr::color4c64F kColor(
"#aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccdddddddddddddddd");
2196 BOOST_TEST_CHECK(kColor.getC0() == 0.66666666666, boost::test_tools::tolerance(0.00001));
2197 BOOST_TEST_CHECK(kColor.getC1() == 0.73333333333, boost::test_tools::tolerance(0.00001));
2198 BOOST_TEST_CHECK(kColor.getC2() == 0.80000000000, boost::test_tools::tolerance(0.00001));
2199 BOOST_TEST_CHECK(kColor.getC3() == 0.86666666666, boost::test_tools::tolerance(0.00001));
2203 mjr::color4c64F oColor({1, 2, 3, 4});
2204 BOOST_TEST_CHECK(oColor.getChan(0) == 1);
2205 BOOST_TEST_CHECK(oColor.getChan(1) == 2);
2206 BOOST_TEST_CHECK(oColor.getChan(2) == 3);
2207 BOOST_TEST_CHECK(oColor.getChan(3) == 4);
2209 mjr::color4c64F pColor({1, 2, 3});
2210 BOOST_TEST_CHECK(pColor.getChan(0) == 1);
2211 BOOST_TEST_CHECK(pColor.getChan(1) == 2);
2212 BOOST_TEST_CHECK(pColor.getChan(2) == 3);
2213 BOOST_TEST_CHECK(pColor.getChan(3) == 0);
2217BOOST_AUTO_TEST_CASE(constr_8b) {
2219 mjr::color4c8b aColor(123);
2220 BOOST_TEST_CHECK(aColor.getChan(0) == 123);
2221 BOOST_TEST_CHECK(aColor.getChan(1) == 123);
2222 BOOST_TEST_CHECK(aColor.getChan(2) == 123);
2223 BOOST_TEST_CHECK(aColor.getChan(3) == 123);
2225 mjr::color4c8b cColor(33, 44, 55);
2226 BOOST_TEST_CHECK(cColor.getChan(0) == 33);
2227 BOOST_TEST_CHECK(cColor.getChan(1) == 44);
2228 BOOST_TEST_CHECK(cColor.getChan(2) == 55);
2229 BOOST_TEST_CHECK(cColor.getChan(3) == 0);
2231 mjr::color4c8b dColor(66, 77, 88, 99);
2232 BOOST_TEST_CHECK(dColor.getChan(0) == 66);
2233 BOOST_TEST_CHECK(dColor.getChan(1) == 77);
2234 BOOST_TEST_CHECK(dColor.getChan(2) == 88);
2235 BOOST_TEST_CHECK(dColor.getChan(3) == 99);
2237 mjr::color4c8b eColor(dColor);
2238 BOOST_TEST_CHECK(eColor.getChan(0) == 66);
2239 BOOST_TEST_CHECK(eColor.getChan(1) == 77);
2240 BOOST_TEST_CHECK(eColor.getChan(2) == 88);
2241 BOOST_TEST_CHECK(eColor.getChan(3) == 99);
2243 mjr::color4c8b f0Color(mjr::color4c8b::cornerColorEnum::BLACK);
2244 mjr::color4c8b fRColor(mjr::color4c8b::cornerColorEnum::RED);
2245 mjr::color4c8b fGColor(mjr::color4c8b::cornerColorEnum::GREEN);
2246 mjr::color4c8b fBColor(mjr::color4c8b::cornerColorEnum::BLUE);
2247 mjr::color4c8b fYColor(mjr::color4c8b::cornerColorEnum::YELLOW);
2248 mjr::color4c8b fCColor(mjr::color4c8b::cornerColorEnum::CYAN);
2249 mjr::color4c8b fMColor(mjr::color4c8b::cornerColorEnum::MAGENTA);
2250 mjr::color4c8b f1Color(mjr::color4c8b::cornerColorEnum::WHITE);
2252 BOOST_TEST_CHECK(f0Color.getC0() == 0);
2253 BOOST_TEST_CHECK(fRColor.getC0() == 255);
2254 BOOST_TEST_CHECK(fGColor.getC0() == 0);
2255 BOOST_TEST_CHECK(fBColor.getC0() == 0);
2256 BOOST_TEST_CHECK(fYColor.getC0() == 255);
2257 BOOST_TEST_CHECK(fCColor.getC0() == 0);
2258 BOOST_TEST_CHECK(fMColor.getC0() == 255);
2259 BOOST_TEST_CHECK(f1Color.getC0() == 255);
2261 BOOST_TEST_CHECK(f0Color.getC1() == 0);
2262 BOOST_TEST_CHECK(fRColor.getC1() == 0);
2263 BOOST_TEST_CHECK(fGColor.getC1() == 255);
2264 BOOST_TEST_CHECK(fBColor.getC1() == 0);
2265 BOOST_TEST_CHECK(fYColor.getC1() == 255);
2266 BOOST_TEST_CHECK(fCColor.getC1() == 255);
2267 BOOST_TEST_CHECK(fMColor.getC1() == 0);
2268 BOOST_TEST_CHECK(f1Color.getC1() == 255);
2270 BOOST_TEST_CHECK(f0Color.getC2() == 0);
2271 BOOST_TEST_CHECK(fRColor.getC2() == 0);
2272 BOOST_TEST_CHECK(fGColor.getC2() == 0);
2273 BOOST_TEST_CHECK(fBColor.getC2() == 255);
2274 BOOST_TEST_CHECK(fYColor.getC2() == 0);
2275 BOOST_TEST_CHECK(fCColor.getC2() == 255);
2276 BOOST_TEST_CHECK(fMColor.getC2() == 255);
2277 BOOST_TEST_CHECK(f1Color.getC2() == 255);
2279 BOOST_TEST_CHECK(f0Color.getC3() == 0);
2280 BOOST_TEST_CHECK(fRColor.getC3() == 0);
2281 BOOST_TEST_CHECK(fGColor.getC3() == 0);
2282 BOOST_TEST_CHECK(fBColor.getC3() == 0);
2283 BOOST_TEST_CHECK(fYColor.getC3() == 255);
2284 BOOST_TEST_CHECK(fCColor.getC3() == 255);
2285 BOOST_TEST_CHECK(fMColor.getC3() == 255);
2286 BOOST_TEST_CHECK(f1Color.getC3() == 255);
2290 mjr::color4c8b g0Color(
"0");
2291 mjr::color4c8b gRColor(
"R");
2292 mjr::color4c8b gGColor(
"G");
2293 mjr::color4c8b gBColor(
"B");
2294 mjr::color4c8b gYColor(
"Y");
2295 mjr::color4c8b gCColor(
"C");
2296 mjr::color4c8b gMColor(
"M");
2297 mjr::color4c8b g1Color(
"W");
2299 BOOST_TEST_CHECK(g0Color.getC0() == 0);
2300 BOOST_TEST_CHECK(gRColor.getC0() == 255);
2301 BOOST_TEST_CHECK(gGColor.getC0() == 0);
2302 BOOST_TEST_CHECK(gBColor.getC0() == 0);
2303 BOOST_TEST_CHECK(gYColor.getC0() == 255);
2304 BOOST_TEST_CHECK(gCColor.getC0() == 0);
2305 BOOST_TEST_CHECK(gMColor.getC0() == 255);
2306 BOOST_TEST_CHECK(g1Color.getC0() == 255);
2308 BOOST_TEST_CHECK(g0Color.getC1() == 0);
2309 BOOST_TEST_CHECK(gRColor.getC1() == 0);
2310 BOOST_TEST_CHECK(gGColor.getC1() == 255);
2311 BOOST_TEST_CHECK(gBColor.getC1() == 0);
2312 BOOST_TEST_CHECK(gYColor.getC1() == 255);
2313 BOOST_TEST_CHECK(gCColor.getC1() == 255);
2314 BOOST_TEST_CHECK(gMColor.getC1() == 0);
2315 BOOST_TEST_CHECK(g1Color.getC1() == 255);
2317 BOOST_TEST_CHECK(g0Color.getC2() == 0);
2318 BOOST_TEST_CHECK(gRColor.getC2() == 0);
2319 BOOST_TEST_CHECK(gGColor.getC2() == 0);
2320 BOOST_TEST_CHECK(gBColor.getC2() == 255);
2321 BOOST_TEST_CHECK(gYColor.getC2() == 0);
2322 BOOST_TEST_CHECK(gCColor.getC2() == 255);
2323 BOOST_TEST_CHECK(gMColor.getC2() == 255);
2324 BOOST_TEST_CHECK(g1Color.getC2() == 255);
2326 BOOST_TEST_CHECK(g0Color.getC3() == 0);
2327 BOOST_TEST_CHECK(gRColor.getC3() == 0);
2328 BOOST_TEST_CHECK(gGColor.getC3() == 0);
2329 BOOST_TEST_CHECK(gBColor.getC3() == 0);
2330 BOOST_TEST_CHECK(gYColor.getC3() == 255);
2331 BOOST_TEST_CHECK(gCColor.getC3() == 255);
2332 BOOST_TEST_CHECK(gMColor.getC3() == 255);
2333 BOOST_TEST_CHECK(g1Color.getC3() == 255);
2337 mjr::color4c8b h0Color(
"black");
2338 mjr::color4c8b hRColor(
"Red");
2339 mjr::color4c8b hGColor(
"GREEN");
2340 mjr::color4c8b hBColor(
"blue");
2341 mjr::color4c8b hYColor(
"YeLLoW");
2342 mjr::color4c8b hCColor(
"CYAN");
2343 mjr::color4c8b hMColor(
"MAGENTA");
2344 mjr::color4c8b h1Color(
"White");
2346 BOOST_TEST_CHECK(h0Color.getC0() == 0);
2347 BOOST_TEST_CHECK(hRColor.getC0() == 255);
2348 BOOST_TEST_CHECK(hGColor.getC0() == 0);
2349 BOOST_TEST_CHECK(hBColor.getC0() == 0);
2350 BOOST_TEST_CHECK(hYColor.getC0() == 255);
2351 BOOST_TEST_CHECK(hCColor.getC0() == 0);
2352 BOOST_TEST_CHECK(hMColor.getC0() == 255);
2353 BOOST_TEST_CHECK(h1Color.getC0() == 255);
2355 BOOST_TEST_CHECK(h0Color.getC1() == 0);
2356 BOOST_TEST_CHECK(hRColor.getC1() == 0);
2357 BOOST_TEST_CHECK(hGColor.getC1() == 255);
2358 BOOST_TEST_CHECK(hBColor.getC1() == 0);
2359 BOOST_TEST_CHECK(hYColor.getC1() == 255);
2360 BOOST_TEST_CHECK(hCColor.getC1() == 255);
2361 BOOST_TEST_CHECK(hMColor.getC1() == 0);
2362 BOOST_TEST_CHECK(h1Color.getC1() == 255);
2364 BOOST_TEST_CHECK(h0Color.getC2() == 0);
2365 BOOST_TEST_CHECK(hRColor.getC2() == 0);
2366 BOOST_TEST_CHECK(hGColor.getC2() == 0);
2367 BOOST_TEST_CHECK(hBColor.getC2() == 255);
2368 BOOST_TEST_CHECK(hYColor.getC2() == 0);
2369 BOOST_TEST_CHECK(hCColor.getC2() == 255);
2370 BOOST_TEST_CHECK(hMColor.getC2() == 255);
2371 BOOST_TEST_CHECK(h1Color.getC2() == 255);
2373 BOOST_TEST_CHECK(h0Color.getC3() == 0);
2374 BOOST_TEST_CHECK(hRColor.getC3() == 0);
2375 BOOST_TEST_CHECK(hGColor.getC3() == 0);
2376 BOOST_TEST_CHECK(hBColor.getC3() == 0);
2377 BOOST_TEST_CHECK(hYColor.getC3() == 255);
2378 BOOST_TEST_CHECK(hCColor.getC3() == 255);
2379 BOOST_TEST_CHECK(hMColor.getC3() == 255);
2380 BOOST_TEST_CHECK(h1Color.getC3() == 255);
2382 mjr::color4c8b iColor(
"zoogo");
2383 BOOST_TEST_CHECK(iColor.getC0() == 0);
2384 BOOST_TEST_CHECK(iColor.getC1() == 0);
2385 BOOST_TEST_CHECK(iColor.getC2() == 0);
2386 BOOST_TEST_CHECK(iColor.getC3() == 0);
2388 mjr::color4c8b jColor(
"z");
2389 BOOST_TEST_CHECK(jColor.getC0() == 0);
2390 BOOST_TEST_CHECK(jColor.getC1() == 0);
2391 BOOST_TEST_CHECK(jColor.getC2() == 0);
2392 BOOST_TEST_CHECK(jColor.getC3() == 0);
2396 mjr::color4c8b kColor(
"#aabbccdd");
2397 BOOST_TEST_CHECK(kColor.getC0() == 0xAA);
2398 BOOST_TEST_CHECK(kColor.getC1() == 0xBB);
2399 BOOST_TEST_CHECK(kColor.getC2() == 0xCC);
2400 BOOST_TEST_CHECK(kColor.getC3() == 0xDD);
2402 mjr::color4c8b lColor(
"#bbccdd");
2403 BOOST_TEST_CHECK(lColor.getC0() == 0xBB);
2404 BOOST_TEST_CHECK(lColor.getC1() == 0xCC);
2405 BOOST_TEST_CHECK(lColor.getC2() == 0xDD);
2406 BOOST_TEST_CHECK(lColor.getC3() == 0x0);
2408 mjr::color4c8b mColor(
"#aa");
2409 BOOST_TEST_CHECK(mColor.getC0() == 0xAA);
2410 BOOST_TEST_CHECK(mColor.getC1() == 0x0);
2411 BOOST_TEST_CHECK(mColor.getC2() == 0x0);
2412 BOOST_TEST_CHECK(mColor.getC3() == 0x0);
2414 mjr::color4c8b nColor(
"#a");
2415 BOOST_TEST_CHECK(nColor.getC0() == 0x0);
2416 BOOST_TEST_CHECK(nColor.getC1() == 0x0);
2417 BOOST_TEST_CHECK(nColor.getC2() == 0x0);
2418 BOOST_TEST_CHECK(nColor.getC3() == 0x0);
2422 mjr::color4c8b oColor({1, 2, 3, 4});
2423 BOOST_TEST_CHECK(oColor.getChan(0) == 1);
2424 BOOST_TEST_CHECK(oColor.getChan(1) == 2);
2425 BOOST_TEST_CHECK(oColor.getChan(2) == 3);
2426 BOOST_TEST_CHECK(oColor.getChan(3) == 4);
2428 mjr::color4c8b pColor({1, 2, 3});
2429 BOOST_TEST_CHECK(pColor.getChan(0) == 1);
2430 BOOST_TEST_CHECK(pColor.getChan(1) == 2);
2431 BOOST_TEST_CHECK(pColor.getChan(2) == 3);
2432 BOOST_TEST_CHECK(pColor.getChan(3) == 0);
2434 mjr::color4c8b qColor({1});
2435 BOOST_TEST_CHECK(qColor.getChan(0) == 1);
2436 BOOST_TEST_CHECK(qColor.getChan(1) == 0);
2437 BOOST_TEST_CHECK(qColor.getChan(2) == 0);
2438 BOOST_TEST_CHECK(qColor.getChan(3) == 0);
2440 mjr::color4c8b rColor({1, 2, 3, 4, 5, 6});
2441 BOOST_TEST_CHECK(rColor.getChan(0) == 1);
2442 BOOST_TEST_CHECK(rColor.getChan(1) == 2);
2443 BOOST_TEST_CHECK(rColor.getChan(2) == 3);
2444 BOOST_TEST_CHECK(rColor.getChan(3) == 4);
2448BOOST_AUTO_TEST_CASE(constr_16b) {
2450 mjr::color4c16b aColor(123);
2451 BOOST_TEST_CHECK(aColor.getChan(0) == 123);
2452 BOOST_TEST_CHECK(aColor.getChan(1) == 123);
2453 BOOST_TEST_CHECK(aColor.getChan(2) == 123);
2454 BOOST_TEST_CHECK(aColor.getChan(3) == 123);
2456 mjr::color4c16b cColor(33, 44, 55);
2457 BOOST_TEST_CHECK(cColor.getChan(0) == 33);
2458 BOOST_TEST_CHECK(cColor.getChan(1) == 44);
2459 BOOST_TEST_CHECK(cColor.getChan(2) == 55);
2460 BOOST_TEST_CHECK(cColor.getChan(3) == 0);
2462 mjr::color4c16b dColor(66, 77, 88, 99);
2463 BOOST_TEST_CHECK(dColor.getChan(0) == 66);
2464 BOOST_TEST_CHECK(dColor.getChan(1) == 77);
2465 BOOST_TEST_CHECK(dColor.getChan(2) == 88);
2466 BOOST_TEST_CHECK(dColor.getChan(3) == 99);
2468 mjr::color4c16b eColor(dColor);
2469 BOOST_TEST_CHECK(eColor.getChan(0) == 66);
2470 BOOST_TEST_CHECK(eColor.getChan(1) == 77);
2471 BOOST_TEST_CHECK(eColor.getChan(2) == 88);
2472 BOOST_TEST_CHECK(eColor.getChan(3) == 99);
2474 mjr::color4c16b f0Color(mjr::color4c16b::cornerColorEnum::BLACK);
2475 mjr::color4c16b fRColor(mjr::color4c16b::cornerColorEnum::RED);
2476 mjr::color4c16b fGColor(mjr::color4c16b::cornerColorEnum::GREEN);
2477 mjr::color4c16b fBColor(mjr::color4c16b::cornerColorEnum::BLUE);
2478 mjr::color4c16b fYColor(mjr::color4c16b::cornerColorEnum::YELLOW);
2479 mjr::color4c16b fCColor(mjr::color4c16b::cornerColorEnum::CYAN);
2480 mjr::color4c16b fMColor(mjr::color4c16b::cornerColorEnum::MAGENTA);
2481 mjr::color4c16b f1Color(mjr::color4c16b::cornerColorEnum::WHITE);
2483 BOOST_TEST_CHECK(f0Color.getC0() == 0);
2484 BOOST_TEST_CHECK(fRColor.getC0() == 65535);
2485 BOOST_TEST_CHECK(fGColor.getC0() == 0);
2486 BOOST_TEST_CHECK(fBColor.getC0() == 0);
2487 BOOST_TEST_CHECK(fYColor.getC0() == 65535);
2488 BOOST_TEST_CHECK(fCColor.getC0() == 0);
2489 BOOST_TEST_CHECK(fMColor.getC0() == 65535);
2490 BOOST_TEST_CHECK(f1Color.getC0() == 65535);
2492 BOOST_TEST_CHECK(f0Color.getC1() == 0);
2493 BOOST_TEST_CHECK(fRColor.getC1() == 0);
2494 BOOST_TEST_CHECK(fGColor.getC1() == 65535);
2495 BOOST_TEST_CHECK(fBColor.getC1() == 0);
2496 BOOST_TEST_CHECK(fYColor.getC1() == 65535);
2497 BOOST_TEST_CHECK(fCColor.getC1() == 65535);
2498 BOOST_TEST_CHECK(fMColor.getC1() == 0);
2499 BOOST_TEST_CHECK(f1Color.getC1() == 65535);
2501 BOOST_TEST_CHECK(f0Color.getC2() == 0);
2502 BOOST_TEST_CHECK(fRColor.getC2() == 0);
2503 BOOST_TEST_CHECK(fGColor.getC2() == 0);
2504 BOOST_TEST_CHECK(fBColor.getC2() == 65535);
2505 BOOST_TEST_CHECK(fYColor.getC2() == 0);
2506 BOOST_TEST_CHECK(fCColor.getC2() == 65535);
2507 BOOST_TEST_CHECK(fMColor.getC2() == 65535);
2508 BOOST_TEST_CHECK(f1Color.getC2() == 65535);
2510 BOOST_TEST_CHECK(f0Color.getC3() == 0);
2511 BOOST_TEST_CHECK(fRColor.getC3() == 0);
2512 BOOST_TEST_CHECK(fGColor.getC3() == 0);
2513 BOOST_TEST_CHECK(fBColor.getC3() == 0);
2514 BOOST_TEST_CHECK(fYColor.getC3() == 65535);
2515 BOOST_TEST_CHECK(fCColor.getC3() == 65535);
2516 BOOST_TEST_CHECK(fMColor.getC3() == 65535);
2517 BOOST_TEST_CHECK(f1Color.getC3() == 65535);
2521 mjr::color4c16b g0Color(
"0");
2522 mjr::color4c16b gRColor(
"R");
2523 mjr::color4c16b gGColor(
"G");
2524 mjr::color4c16b gBColor(
"B");
2525 mjr::color4c16b gYColor(
"Y");
2526 mjr::color4c16b gCColor(
"C");
2527 mjr::color4c16b gMColor(
"M");
2528 mjr::color4c16b g1Color(
"W");
2530 BOOST_TEST_CHECK(g0Color.getC0() == 0);
2531 BOOST_TEST_CHECK(gRColor.getC0() == 65535);
2532 BOOST_TEST_CHECK(gGColor.getC0() == 0);
2533 BOOST_TEST_CHECK(gBColor.getC0() == 0);
2534 BOOST_TEST_CHECK(gYColor.getC0() == 65535);
2535 BOOST_TEST_CHECK(gCColor.getC0() == 0);
2536 BOOST_TEST_CHECK(gMColor.getC0() == 65535);
2537 BOOST_TEST_CHECK(g1Color.getC0() == 65535);
2539 BOOST_TEST_CHECK(g0Color.getC1() == 0);
2540 BOOST_TEST_CHECK(gRColor.getC1() == 0);
2541 BOOST_TEST_CHECK(gGColor.getC1() == 65535);
2542 BOOST_TEST_CHECK(gBColor.getC1() == 0);
2543 BOOST_TEST_CHECK(gYColor.getC1() == 65535);
2544 BOOST_TEST_CHECK(gCColor.getC1() == 65535);
2545 BOOST_TEST_CHECK(gMColor.getC1() == 0);
2546 BOOST_TEST_CHECK(g1Color.getC1() == 65535);
2548 BOOST_TEST_CHECK(g0Color.getC2() == 0);
2549 BOOST_TEST_CHECK(gRColor.getC2() == 0);
2550 BOOST_TEST_CHECK(gGColor.getC2() == 0);
2551 BOOST_TEST_CHECK(gBColor.getC2() == 65535);
2552 BOOST_TEST_CHECK(gYColor.getC2() == 0);
2553 BOOST_TEST_CHECK(gCColor.getC2() == 65535);
2554 BOOST_TEST_CHECK(gMColor.getC2() == 65535);
2555 BOOST_TEST_CHECK(g1Color.getC2() == 65535);
2557 BOOST_TEST_CHECK(g0Color.getC3() == 0);
2558 BOOST_TEST_CHECK(gRColor.getC3() == 0);
2559 BOOST_TEST_CHECK(gGColor.getC3() == 0);
2560 BOOST_TEST_CHECK(gBColor.getC3() == 0);
2561 BOOST_TEST_CHECK(gYColor.getC3() == 65535);
2562 BOOST_TEST_CHECK(gCColor.getC3() == 65535);
2563 BOOST_TEST_CHECK(gMColor.getC3() == 65535);
2564 BOOST_TEST_CHECK(g1Color.getC3() == 65535);
2568 mjr::color4c16b h0Color(
"black");
2569 mjr::color4c16b hRColor(
"Red");
2570 mjr::color4c16b hGColor(
"GREEN");
2571 mjr::color4c16b hBColor(
"blue");
2572 mjr::color4c16b hYColor(
"YeLLoW");
2573 mjr::color4c16b hCColor(
"CYAN");
2574 mjr::color4c16b hMColor(
"MAGENTA");
2575 mjr::color4c16b h1Color(
"White");
2577 BOOST_TEST_CHECK(h0Color.getC0() == 0);
2578 BOOST_TEST_CHECK(hRColor.getC0() == 65535);
2579 BOOST_TEST_CHECK(hGColor.getC0() == 0);
2580 BOOST_TEST_CHECK(hBColor.getC0() == 0);
2581 BOOST_TEST_CHECK(hYColor.getC0() == 65535);
2582 BOOST_TEST_CHECK(hCColor.getC0() == 0);
2583 BOOST_TEST_CHECK(hMColor.getC0() == 65535);
2584 BOOST_TEST_CHECK(h1Color.getC0() == 65535);
2586 BOOST_TEST_CHECK(h0Color.getC1() == 0);
2587 BOOST_TEST_CHECK(hRColor.getC1() == 0);
2588 BOOST_TEST_CHECK(hGColor.getC1() == 65535);
2589 BOOST_TEST_CHECK(hBColor.getC1() == 0);
2590 BOOST_TEST_CHECK(hYColor.getC1() == 65535);
2591 BOOST_TEST_CHECK(hCColor.getC1() == 65535);
2592 BOOST_TEST_CHECK(hMColor.getC1() == 0);
2593 BOOST_TEST_CHECK(h1Color.getC1() == 65535);
2595 BOOST_TEST_CHECK(h0Color.getC2() == 0);
2596 BOOST_TEST_CHECK(hRColor.getC2() == 0);
2597 BOOST_TEST_CHECK(hGColor.getC2() == 0);
2598 BOOST_TEST_CHECK(hBColor.getC2() == 65535);
2599 BOOST_TEST_CHECK(hYColor.getC2() == 0);
2600 BOOST_TEST_CHECK(hCColor.getC2() == 65535);
2601 BOOST_TEST_CHECK(hMColor.getC2() == 65535);
2602 BOOST_TEST_CHECK(h1Color.getC2() == 65535);
2604 BOOST_TEST_CHECK(h0Color.getC3() == 0);
2605 BOOST_TEST_CHECK(hRColor.getC3() == 0);
2606 BOOST_TEST_CHECK(hGColor.getC3() == 0);
2607 BOOST_TEST_CHECK(hBColor.getC3() == 0);
2608 BOOST_TEST_CHECK(hYColor.getC3() == 65535);
2609 BOOST_TEST_CHECK(hCColor.getC3() == 65535);
2610 BOOST_TEST_CHECK(hMColor.getC3() == 65535);
2611 BOOST_TEST_CHECK(h1Color.getC3() == 65535);
2613 mjr::color4c16b iColor(
"zoogo");
2614 BOOST_TEST_CHECK(iColor.getC0() == 0);
2615 BOOST_TEST_CHECK(iColor.getC1() == 0);
2616 BOOST_TEST_CHECK(iColor.getC2() == 0);
2617 BOOST_TEST_CHECK(iColor.getC3() == 0);
2619 mjr::color4c16b jColor(
"z");
2620 BOOST_TEST_CHECK(jColor.getC0() == 0);
2621 BOOST_TEST_CHECK(jColor.getC1() == 0);
2622 BOOST_TEST_CHECK(jColor.getC2() == 0);
2623 BOOST_TEST_CHECK(jColor.getC3() == 0);
2627 mjr::color4c16b kColor(
"#aaaabbbbccccdddd");
2628 BOOST_TEST_CHECK(kColor.getC0() == 0xAAAA);
2629 BOOST_TEST_CHECK(kColor.getC1() == 0xBBBB);
2630 BOOST_TEST_CHECK(kColor.getC2() == 0xCCCC);
2631 BOOST_TEST_CHECK(kColor.getC3() == 0xDDDD);
2633 mjr::color4c16b lColor(
"#bbbbccccdddd");
2634 BOOST_TEST_CHECK(lColor.getC0() == 0xBBBB);
2635 BOOST_TEST_CHECK(lColor.getC1() == 0xCCCC);
2636 BOOST_TEST_CHECK(lColor.getC2() == 0xDDDD);
2637 BOOST_TEST_CHECK(lColor.getC3() == 0x0);
2639 mjr::color4c16b mColor(
"#aaaa");
2640 BOOST_TEST_CHECK(mColor.getC0() == 0xAAAA);
2641 BOOST_TEST_CHECK(mColor.getC1() == 0x0);
2642 BOOST_TEST_CHECK(mColor.getC2() == 0x0);
2643 BOOST_TEST_CHECK(mColor.getC3() == 0x0);
2645 mjr::color4c16b nColor(
"#aaa");
2646 BOOST_TEST_CHECK(nColor.getC0() == 0x0);
2647 BOOST_TEST_CHECK(nColor.getC1() == 0x0);
2648 BOOST_TEST_CHECK(nColor.getC2() == 0x0);
2649 BOOST_TEST_CHECK(nColor.getC3() == 0x0);
2653 mjr::color4c16b oColor({1, 2, 3, 4});
2654 BOOST_TEST_CHECK(oColor.getChan(0) == 1);
2655 BOOST_TEST_CHECK(oColor.getChan(1) == 2);
2656 BOOST_TEST_CHECK(oColor.getChan(2) == 3);
2657 BOOST_TEST_CHECK(oColor.getChan(3) == 4);
2659 mjr::color4c16b pColor({1, 2, 3});
2660 BOOST_TEST_CHECK(pColor.getChan(0) == 1);
2661 BOOST_TEST_CHECK(pColor.getChan(1) == 2);
2662 BOOST_TEST_CHECK(pColor.getChan(2) == 3);
2663 BOOST_TEST_CHECK(pColor.getChan(3) == 0);
2668BOOST_AUTO_TEST_CASE(set_chans_hex_8b) {
2670 mjr::color4c8b aColor(
"0");
2671 aColor.setToWhite();
2672 aColor.setChans(
"#aabbccdd");
2673 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
2674 BOOST_TEST_CHECK(aColor.getC1() == 0xBB);
2675 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
2676 BOOST_TEST_CHECK(aColor.getC3() == 0xDD);
2679 aColor.setToWhite();
2680 aColor.setChans(
"#bbccdd");
2681 BOOST_TEST_CHECK(aColor.getC0() == 0xBB);
2682 BOOST_TEST_CHECK(aColor.getC1() == 0xCC);
2683 BOOST_TEST_CHECK(aColor.getC2() == 0xDD);
2684 BOOST_TEST_CHECK(aColor.getC3() == 0xFF);
2686 aColor.setToWhite();
2687 aColor.setChans(
"#aa");
2688 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
2689 BOOST_TEST_CHECK(aColor.getC1() == 0xFF);
2690 BOOST_TEST_CHECK(aColor.getC2() == 0xFF);
2691 BOOST_TEST_CHECK(aColor.getC3() == 0xFF);
2693 aColor.setToWhite();
2694 aColor.setChans(
"#aaa");
2695 BOOST_TEST_CHECK(aColor.getC0() == 0xFF);
2696 BOOST_TEST_CHECK(aColor.getC1() == 0xFF);
2697 BOOST_TEST_CHECK(aColor.getC2() == 0xFF);
2698 BOOST_TEST_CHECK(aColor.getC3() == 0xFF);
2701 aColor.setToWhite();
2702 aColor.setChans(
"#bbccdd",
true);
2703 BOOST_TEST_CHECK(aColor.getC0() == 0xBB);
2704 BOOST_TEST_CHECK(aColor.getC1() == 0xCC);
2705 BOOST_TEST_CHECK(aColor.getC2() == 0xDD);
2706 BOOST_TEST_CHECK(aColor.getC3() == 0x0000);
2708 aColor.setToWhite();
2709 aColor.setChans(
"#aa",
true);
2710 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
2711 BOOST_TEST_CHECK(aColor.getC1() == 0x0000);
2712 BOOST_TEST_CHECK(aColor.getC2() == 0x0000);
2713 BOOST_TEST_CHECK(aColor.getC3() == 0x0000);
2715 aColor.setToWhite();
2716 aColor.setChans(
"#a",
true);
2717 BOOST_TEST_CHECK(aColor.getC0() == 0x0000);
2718 BOOST_TEST_CHECK(aColor.getC1() == 0x0000);
2719 BOOST_TEST_CHECK(aColor.getC2() == 0x0000);
2720 BOOST_TEST_CHECK(aColor.getC3() == 0x0000);
2724BOOST_AUTO_TEST_CASE(set_chans_hex_16b) {
2726 mjr::color4c16b aColor(
"0");
2727 aColor.setToWhite();
2728 aColor.setChans(
"#aaaabbbbccccdddd");
2729 BOOST_TEST_CHECK(aColor.getC0() == 0xAAAA);
2730 BOOST_TEST_CHECK(aColor.getC1() == 0xBBBB);
2731 BOOST_TEST_CHECK(aColor.getC2() == 0xCCCC);
2732 BOOST_TEST_CHECK(aColor.getC3() == 0xDDDD);
2735 aColor.setToWhite();
2736 aColor.setChans(
"#bbbbccccdddd");
2737 BOOST_TEST_CHECK(aColor.getC0() == 0xBBBB);
2738 BOOST_TEST_CHECK(aColor.getC1() == 0xCCCC);
2739 BOOST_TEST_CHECK(aColor.getC2() == 0xDDDD);
2740 BOOST_TEST_CHECK(aColor.getC3() == 0xFFFF);
2742 aColor.setToWhite();
2743 aColor.setChans(
"#aaaa");
2744 BOOST_TEST_CHECK(aColor.getC0() == 0xAAAA);
2745 BOOST_TEST_CHECK(aColor.getC1() == 0xFFFF);
2746 BOOST_TEST_CHECK(aColor.getC2() == 0xFFFF);
2747 BOOST_TEST_CHECK(aColor.getC3() == 0xFFFF);
2749 aColor.setToWhite();
2750 aColor.setChans(
"#aaa");
2751 BOOST_TEST_CHECK(aColor.getC0() == 0xFFFF);
2752 BOOST_TEST_CHECK(aColor.getC1() == 0xFFFF);
2753 BOOST_TEST_CHECK(aColor.getC2() == 0xFFFF);
2754 BOOST_TEST_CHECK(aColor.getC3() == 0xFFFF);
2757 aColor.setToWhite();
2758 aColor.setChans(
"#bbbbccccdddd",
true);
2759 BOOST_TEST_CHECK(aColor.getC0() == 0xBBBB);
2760 BOOST_TEST_CHECK(aColor.getC1() == 0xCCCC);
2761 BOOST_TEST_CHECK(aColor.getC2() == 0xDDDD);
2762 BOOST_TEST_CHECK(aColor.getC3() == 0x0000);
2764 aColor.setToWhite();
2765 aColor.setChans(
"#aaaa",
true);
2766 BOOST_TEST_CHECK(aColor.getC0() == 0xAAAA);
2767 BOOST_TEST_CHECK(aColor.getC1() == 0x0000);
2768 BOOST_TEST_CHECK(aColor.getC2() == 0x0000);
2769 BOOST_TEST_CHECK(aColor.getC3() == 0x0000);
2771 aColor.setToWhite();
2772 aColor.setChans(
"#aaa",
true);
2773 BOOST_TEST_CHECK(aColor.getC0() == 0x0000);
2774 BOOST_TEST_CHECK(aColor.getC1() == 0x0000);
2775 BOOST_TEST_CHECK(aColor.getC2() == 0x0000);
2776 BOOST_TEST_CHECK(aColor.getC3() == 0x0000);
2780BOOST_AUTO_TEST_CASE(set_chans_hex_64F) {
2782 mjr::color4c64F aColor(
"0");
2783 aColor.setToWhite();
2784 aColor.setChans(
"#aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccdddddddddddddddd");
2785 BOOST_TEST_CHECK(aColor.getC0() == 0.66666666666, boost::test_tools::tolerance(0.00001));
2786 BOOST_TEST_CHECK(aColor.getC1() == 0.73333333333, boost::test_tools::tolerance(0.00001));
2787 BOOST_TEST_CHECK(aColor.getC2() == 0.80000000000, boost::test_tools::tolerance(0.00001));
2788 BOOST_TEST_CHECK(aColor.getC3() == 0.86666666666, boost::test_tools::tolerance(0.00001));
2791 aColor.setToWhite();
2792 aColor.setChans(
"#bbbbbbbbbbbbbbbbccccccccccccccccdddddddddddddddd");
2793 BOOST_TEST_CHECK(aColor.getC0() == 0.73333333333, boost::test_tools::tolerance(0.00001));
2794 BOOST_TEST_CHECK(aColor.getC1() == 0.80000000000, boost::test_tools::tolerance(0.00001));
2795 BOOST_TEST_CHECK(aColor.getC2() == 0.86666666666, boost::test_tools::tolerance(0.00001));
2796 BOOST_TEST_CHECK(aColor.getC3() == 1.00000000000, boost::test_tools::tolerance(0.00001));
2798 aColor.setToWhite();
2799 aColor.setChans(
"#aaaaaaaaaaaaaaaa");
2800 BOOST_TEST_CHECK(aColor.getC0() == 0.66666666666, boost::test_tools::tolerance(0.00001));
2801 BOOST_TEST_CHECK(aColor.getC1() == 1.00000000000, boost::test_tools::tolerance(0.00001));
2802 BOOST_TEST_CHECK(aColor.getC2() == 1.00000000000, boost::test_tools::tolerance(0.00001));
2803 BOOST_TEST_CHECK(aColor.getC3() == 1.00000000000, boost::test_tools::tolerance(0.00001));
2805 aColor.setToWhite();
2806 aColor.setChans(
"#aaa");
2807 BOOST_TEST_CHECK(aColor.getC0() == 1.00000000000, boost::test_tools::tolerance(0.00001));
2808 BOOST_TEST_CHECK(aColor.getC1() == 1.00000000000, boost::test_tools::tolerance(0.00001));
2809 BOOST_TEST_CHECK(aColor.getC2() == 1.00000000000, boost::test_tools::tolerance(0.00001));
2810 BOOST_TEST_CHECK(aColor.getC3() == 1.00000000000, boost::test_tools::tolerance(0.00001));
2813 aColor.setToWhite();
2814 aColor.setChans(
"#bbbbbbbbbbbbbbbbccccccccccccccccdddddddddddddddd",
true);
2815 BOOST_TEST_CHECK(aColor.getC0() == 0.73333333333, boost::test_tools::tolerance(0.00001));
2816 BOOST_TEST_CHECK(aColor.getC1() == 0.80000000000, boost::test_tools::tolerance(0.00001));
2817 BOOST_TEST_CHECK(aColor.getC2() == 0.86666666666, boost::test_tools::tolerance(0.00001));
2818 BOOST_TEST_CHECK(aColor.getC3() == 0.00000000000, boost::test_tools::tolerance(0.00001));
2820 aColor.setToWhite();
2821 aColor.setChans(
"#aaaaaaaaaaaaaaaa",
true);
2822 BOOST_TEST_CHECK(aColor.getC0() == 0.66666666666, boost::test_tools::tolerance(0.00001));
2823 BOOST_TEST_CHECK(aColor.getC1() == 0.00000000000, boost::test_tools::tolerance(0.00001));
2824 BOOST_TEST_CHECK(aColor.getC2() == 0.00000000000, boost::test_tools::tolerance(0.00001));
2825 BOOST_TEST_CHECK(aColor.getC3() == 0.00000000000, boost::test_tools::tolerance(0.00001));
2827 aColor.setToWhite();
2828 aColor.setChans(
"#aaa",
true);
2829 BOOST_TEST_CHECK(aColor.getC0() == 0.00000000000, boost::test_tools::tolerance(0.00001));
2830 BOOST_TEST_CHECK(aColor.getC1() == 0.00000000000, boost::test_tools::tolerance(0.00001));
2831 BOOST_TEST_CHECK(aColor.getC2() == 0.00000000000, boost::test_tools::tolerance(0.00001));
2832 BOOST_TEST_CHECK(aColor.getC3() == 0.00000000000, boost::test_tools::tolerance(0.00001));
2837BOOST_AUTO_TEST_CASE(set_chan_8_RGB) {
2843 typedef mjr::colorTpl<mjr::colChanI8, 4, 1, 2, 3, 0> colorARGB8;
2846 aColor.setToBlack();
2847 aColor.setRed(colorARGB8::maxChanVal);
2849 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
2850 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::maxChanVal);
2851 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
2852 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
2854 aColor.setToBlack();
2855 aColor.setGreen(colorARGB8::maxChanVal);
2857 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
2858 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
2859 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::maxChanVal);
2860 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
2862 aColor.setToBlack();
2863 aColor.setBlue(colorARGB8::maxChanVal);
2865 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
2866 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
2867 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
2868 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::maxChanVal);
2870 aColor.setToBlack();
2871 aColor.setAlpha(colorARGB8::maxChanVal);
2873 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::maxChanVal);
2874 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
2875 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
2876 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
2880 aColor.setToBlack();
2881 aColor.setRed_byte(255);
2883 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
2884 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::maxChanVal);
2885 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
2886 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
2888 aColor.setToBlack();
2889 aColor.setGreen_byte(255);
2891 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
2892 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
2893 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::maxChanVal);
2894 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
2896 aColor.setToBlack();
2897 aColor.setBlue_byte(255);
2899 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
2900 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
2901 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
2902 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::maxChanVal);
2904 aColor.setToBlack();
2905 aColor.setAlpha_byte(255);
2907 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::maxChanVal);
2908 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
2909 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
2910 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
2914 aColor.setToBlack();
2915 aColor.setRed_dbl(1.0);
2917 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
2918 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::maxChanVal);
2919 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
2920 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
2922 aColor.setToBlack();
2923 aColor.setGreen_dbl(1.0);
2925 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
2926 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
2927 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::maxChanVal);
2928 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
2930 aColor.setToBlack();
2931 aColor.setBlue_dbl(1.0);
2933 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
2934 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
2935 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
2936 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::maxChanVal);
2938 aColor.setToBlack();
2939 aColor.setAlpha_dbl(1.0);
2941 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::maxChanVal);
2942 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
2943 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
2944 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
2948 aColor.setToBlack();
2949 aColor.setChansRGBA(1, 2, 3, 4);
2951 BOOST_TEST_CHECK(aColor.getChan(0) == 4);
2952 BOOST_TEST_CHECK(aColor.getChan(1) == 1);
2953 BOOST_TEST_CHECK(aColor.getChan(2) == 2);
2954 BOOST_TEST_CHECK(aColor.getChan(3) == 3);
2958 aColor.setToBlack();
2959 aColor.setChansRGB(1, 2, 3);
2961 BOOST_TEST_CHECK(aColor.getChan(0) == 0);
2962 BOOST_TEST_CHECK(aColor.getChan(1) == 1);
2963 BOOST_TEST_CHECK(aColor.getChan(2) == 2);
2964 BOOST_TEST_CHECK(aColor.getChan(3) == 3);
2968 aColor.setToBlack();
2969 aColor.setChansRGBA_byte(1, 2, 3, 4);
2971 BOOST_TEST_CHECK(aColor.getChan(0) == 4);
2972 BOOST_TEST_CHECK(aColor.getChan(1) == 1);
2973 BOOST_TEST_CHECK(aColor.getChan(2) == 2);
2974 BOOST_TEST_CHECK(aColor.getChan(3) == 3);
2978 aColor.setToBlack();
2979 aColor.setChansRGB_byte(1, 2, 3);
2981 BOOST_TEST_CHECK(aColor.getChan(0) == 0);
2982 BOOST_TEST_CHECK(aColor.getChan(1) == 1);
2983 BOOST_TEST_CHECK(aColor.getChan(2) == 2);
2984 BOOST_TEST_CHECK(aColor.getChan(3) == 3);
2988 aColor.setToBlack();
2989 aColor.setChansRGBA_dbl(0.25, 0.50, 0.75, 1.00);
2991 BOOST_TEST_CHECK(aColor.getChan(0) == 0xFF);
2992 BOOST_TEST_CHECK(aColor.getChan(1) == 0x3F);
2993 BOOST_TEST_CHECK(aColor.getChan(2) == 0x7F);
2994 BOOST_TEST_CHECK(aColor.getChan(3) == 0xBF);
2998 aColor.setToBlack();
2999 aColor.setChansRGB_dbl(1.00, 0.25, 0.50);
3001 BOOST_TEST_CHECK(aColor.getChan(0) == 0x00);
3002 BOOST_TEST_CHECK(aColor.getChan(1) == 0xFF);
3003 BOOST_TEST_CHECK(aColor.getChan(2) == 0x3F);
3004 BOOST_TEST_CHECK(aColor.getChan(3) == 0x7F);
3008 aColor.setToBlack();
3009 aColor.setChansRGBA(colorARGB8::clrChanTup4(1, 2, 3, 4));
3011 BOOST_TEST_CHECK(aColor.getChan(0) == 4);
3012 BOOST_TEST_CHECK(aColor.getChan(1) == 1);
3013 BOOST_TEST_CHECK(aColor.getChan(2) == 2);
3014 BOOST_TEST_CHECK(aColor.getChan(3) == 3);
3018 aColor.setToBlack();
3019 aColor.setChansRGB(colorARGB8::clrChanTup3(1, 2, 3));
3021 BOOST_TEST_CHECK(aColor.getChan(0) == 0);
3022 BOOST_TEST_CHECK(aColor.getChan(1) == 1);
3023 BOOST_TEST_CHECK(aColor.getChan(2) == 2);
3024 BOOST_TEST_CHECK(aColor.getChan(3) == 3);
3029BOOST_AUTO_TEST_CASE(set_chan_16_RGB) {
3031 typedef mjr::colorTpl<mjr::colChanI16, 4, 1, 2, 3, 0> colorARGB8;
3034 aColor.setToBlack();
3035 aColor.setRed(colorARGB8::maxChanVal);
3037 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
3038 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::maxChanVal);
3039 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
3040 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
3042 aColor.setToBlack();
3043 aColor.setGreen(colorARGB8::maxChanVal);
3045 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
3046 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
3047 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::maxChanVal);
3048 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
3050 aColor.setToBlack();
3051 aColor.setBlue(colorARGB8::maxChanVal);
3053 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
3054 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
3055 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
3056 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::maxChanVal);
3058 aColor.setToBlack();
3059 aColor.setAlpha(colorARGB8::maxChanVal);
3061 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::maxChanVal);
3062 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
3063 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
3064 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
3068 aColor.setToBlack();
3069 aColor.setRed_byte(255);
3071 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
3072 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::maxChanVal);
3073 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
3074 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
3076 aColor.setToBlack();
3077 aColor.setGreen_byte(255);
3079 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
3080 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
3081 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::maxChanVal);
3082 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
3084 aColor.setToBlack();
3085 aColor.setBlue_byte(255);
3087 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
3088 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
3089 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
3090 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::maxChanVal);
3092 aColor.setToBlack();
3093 aColor.setAlpha_byte(255);
3095 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::maxChanVal);
3096 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
3097 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
3098 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
3102 aColor.setToBlack();
3103 aColor.setRed_dbl(1.0);
3105 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
3106 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::maxChanVal);
3107 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
3108 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
3110 aColor.setToBlack();
3111 aColor.setGreen_dbl(1.0);
3113 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
3114 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
3115 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::maxChanVal);
3116 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
3118 aColor.setToBlack();
3119 aColor.setBlue_dbl(1.0);
3121 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::minChanVal);
3122 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
3123 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
3124 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::maxChanVal);
3126 aColor.setToBlack();
3127 aColor.setAlpha_dbl(1.0);
3129 BOOST_TEST_CHECK(aColor.getChan(0) == colorARGB8::maxChanVal);
3130 BOOST_TEST_CHECK(aColor.getChan(1) == colorARGB8::minChanVal);
3131 BOOST_TEST_CHECK(aColor.getChan(2) == colorARGB8::minChanVal);
3132 BOOST_TEST_CHECK(aColor.getChan(3) == colorARGB8::minChanVal);
3136 aColor.setToBlack();
3137 aColor.setChansRGBA(1, 2, 3, 4);
3139 BOOST_TEST_CHECK(aColor.getChan(0) == 4);
3140 BOOST_TEST_CHECK(aColor.getChan(1) == 1);
3141 BOOST_TEST_CHECK(aColor.getChan(2) == 2);
3142 BOOST_TEST_CHECK(aColor.getChan(3) == 3);
3146 aColor.setToBlack();
3147 aColor.setChansRGB(1, 2, 3);
3149 BOOST_TEST_CHECK(aColor.getChan(0) == 0);
3150 BOOST_TEST_CHECK(aColor.getChan(1) == 1);
3151 BOOST_TEST_CHECK(aColor.getChan(2) == 2);
3152 BOOST_TEST_CHECK(aColor.getChan(3) == 3);
3156 aColor.setToBlack();
3157 aColor.setChansRGBA_byte(1, 2, 3, 4);
3159 BOOST_TEST_CHECK(aColor.getChan(0) == 1028);
3160 BOOST_TEST_CHECK(aColor.getChan(1) == 257);
3161 BOOST_TEST_CHECK(aColor.getChan(2) == 514);
3162 BOOST_TEST_CHECK(aColor.getChan(3) == 771);
3166 aColor.setToBlack();
3167 aColor.setChansRGB_byte(1, 2, 3);
3169 BOOST_TEST_CHECK(aColor.getChan(0) == 0);
3170 BOOST_TEST_CHECK(aColor.getChan(1) == 257);
3171 BOOST_TEST_CHECK(aColor.getChan(2) == 514);
3172 BOOST_TEST_CHECK(aColor.getChan(3) == 771);
3176 aColor.setToBlack();
3177 aColor.setChansRGBA_dbl(0.25, 0.50, 0.75, 1.00);
3179 BOOST_TEST_CHECK(aColor.getChan(0) == 0xFFFF);
3180 BOOST_TEST_CHECK(aColor.getChan(1) == 0x3FFF);
3181 BOOST_TEST_CHECK(aColor.getChan(2) == 0x7FFF);
3182 BOOST_TEST_CHECK(aColor.getChan(3) == 0xBFFF);
3186 aColor.setToBlack();
3187 aColor.setChansRGB_dbl(1.00, 0.25, 0.50);
3189 BOOST_TEST_CHECK(aColor.getChan(0) == 0x0000);
3190 BOOST_TEST_CHECK(aColor.getChan(1) == 0xFFFF);
3191 BOOST_TEST_CHECK(aColor.getChan(2) == 0x3FFF);
3192 BOOST_TEST_CHECK(aColor.getChan(3) == 0x7FFF);
3196 aColor.setToBlack();
3197 aColor.setChansRGBA(colorARGB8::clrChanTup4(1, 2, 3, 4));
3199 BOOST_TEST_CHECK(aColor.getChan(0) == 4);
3200 BOOST_TEST_CHECK(aColor.getChan(1) == 1);
3201 BOOST_TEST_CHECK(aColor.getChan(2) == 2);
3202 BOOST_TEST_CHECK(aColor.getChan(3) == 3);
3206 aColor.setToBlack();
3207 aColor.setChansRGB(colorARGB8::clrChanTup3(1, 2, 3));
3209 BOOST_TEST_CHECK(aColor.getChan(0) == 0);
3210 BOOST_TEST_CHECK(aColor.getChan(1) == 1);
3211 BOOST_TEST_CHECK(aColor.getChan(2) == 2);
3212 BOOST_TEST_CHECK(aColor.getChan(3) == 3);
3217BOOST_AUTO_TEST_CASE(set8_fromLogPackIntARGB) {
3219 mjr::colorARGB8b aColor;
3220 mjr::colorRGBA8b bColor;
3221 mjr::colorBGRA8b cColor;
3222 mjr::colorABGR8b dColor;
3224 mjr::colorRGB8b eColor;
3225 mjr::colorBGR8b fColor;
3227 aColor.setRGBAfromLogPackIntARGB(0xAABBCCDD);
3229 BOOST_TEST_CHECK(aColor.getRed() == 0xBB);
3230 BOOST_TEST_CHECK(aColor.getGreen() == 0xCC);
3231 BOOST_TEST_CHECK(aColor.getBlue() == 0xDD);
3232 BOOST_TEST_CHECK(aColor.getAlpha() == 0xAA);
3234 BOOST_TEST_CHECK(aColor.getC1() == 0xBB);
3235 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
3236 BOOST_TEST_CHECK(aColor.getC3() == 0xDD);
3237 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
3239 aColor.setRGBfromLogPackIntARGB(0x00DDCCBB);
3241 BOOST_TEST_CHECK(aColor.getRed() == 0xDD);
3242 BOOST_TEST_CHECK(aColor.getGreen() == 0xCC);
3243 BOOST_TEST_CHECK(aColor.getBlue() == 0xBB);
3244 BOOST_TEST_CHECK(aColor.getAlpha() == 0xAA);
3246 BOOST_TEST_CHECK(aColor.getC1() == 0xDD);
3247 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
3248 BOOST_TEST_CHECK(aColor.getC3() == 0xBB);
3249 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
3251 eColor.setRGBfromLogPackIntARGB(0x00DDCCBB);
3253 BOOST_TEST_CHECK(eColor.getRed() == 0xDD);
3254 BOOST_TEST_CHECK(eColor.getGreen() == 0xCC);
3255 BOOST_TEST_CHECK(eColor.getBlue() == 0xBB);
3257 BOOST_TEST_CHECK(eColor.getC0() == 0xDD);
3258 BOOST_TEST_CHECK(eColor.getC1() == 0xCC);
3259 BOOST_TEST_CHECK(eColor.getC2() == 0xBB);
3261 bColor.setRGBAfromLogPackIntARGB(0xAABBCCDD);
3263 BOOST_TEST_CHECK(bColor.getRed() == 0xBB);
3264 BOOST_TEST_CHECK(bColor.getGreen() == 0xCC);
3265 BOOST_TEST_CHECK(bColor.getBlue() == 0xDD);
3266 BOOST_TEST_CHECK(bColor.getAlpha() == 0xAA);
3268 BOOST_TEST_CHECK(bColor.getC0() == 0xBB);
3269 BOOST_TEST_CHECK(bColor.getC1() == 0xCC);
3270 BOOST_TEST_CHECK(bColor.getC2() == 0xDD);
3271 BOOST_TEST_CHECK(bColor.getC3() == 0xAA);
3273 bColor.setRGBfromLogPackIntARGB(0x00DDCCBB);
3275 BOOST_TEST_CHECK(bColor.getRed() == 0xDD);
3276 BOOST_TEST_CHECK(bColor.getGreen() == 0xCC);
3277 BOOST_TEST_CHECK(bColor.getBlue() == 0xBB);
3278 BOOST_TEST_CHECK(bColor.getAlpha() == 0xAA);
3280 BOOST_TEST_CHECK(bColor.getC0() == 0xDD);
3281 BOOST_TEST_CHECK(bColor.getC1() == 0xCC);
3282 BOOST_TEST_CHECK(bColor.getC2() == 0xBB);
3283 BOOST_TEST_CHECK(bColor.getC3() == 0xAA);
3285 fColor.setRGBfromLogPackIntARGB(0x00DDCCBB);
3287 BOOST_TEST_CHECK(fColor.getRed() == 0xDD);
3288 BOOST_TEST_CHECK(fColor.getGreen() == 0xCC);
3289 BOOST_TEST_CHECK(fColor.getBlue() == 0xBB);
3291 BOOST_TEST_CHECK(fColor.getC2() == 0xDD);
3292 BOOST_TEST_CHECK(fColor.getC1() == 0xCC);
3293 BOOST_TEST_CHECK(fColor.getC0() == 0xBB);
3295 cColor.setRGBAfromLogPackIntARGB(0xAABBCCDD);
3297 BOOST_TEST_CHECK(cColor.getRed() == 0xBB);
3298 BOOST_TEST_CHECK(cColor.getGreen() == 0xCC);
3299 BOOST_TEST_CHECK(cColor.getBlue() == 0xDD);
3300 BOOST_TEST_CHECK(cColor.getAlpha() == 0xAA);
3302 BOOST_TEST_CHECK(cColor.getC2() == 0xBB);
3303 BOOST_TEST_CHECK(cColor.getC1() == 0xCC);
3304 BOOST_TEST_CHECK(cColor.getC0() == 0xDD);
3305 BOOST_TEST_CHECK(cColor.getC3() == 0xAA);
3307 cColor.setRGBfromLogPackIntARGB(0x00DDCCBB);
3309 BOOST_TEST_CHECK(cColor.getRed() == 0xDD);
3310 BOOST_TEST_CHECK(cColor.getGreen() == 0xCC);
3311 BOOST_TEST_CHECK(cColor.getBlue() == 0xBB);
3312 BOOST_TEST_CHECK(cColor.getAlpha() == 0xAA);
3314 BOOST_TEST_CHECK(cColor.getC2() == 0xDD);
3315 BOOST_TEST_CHECK(cColor.getC1() == 0xCC);
3316 BOOST_TEST_CHECK(cColor.getC0() == 0xBB);
3317 BOOST_TEST_CHECK(cColor.getC3() == 0xAA);
3319 dColor.setRGBAfromLogPackIntARGB(0xAABBCCDD);
3321 BOOST_TEST_CHECK(dColor.getRed() == 0xBB);
3322 BOOST_TEST_CHECK(dColor.getGreen() == 0xCC);
3323 BOOST_TEST_CHECK(dColor.getBlue() == 0xDD);
3324 BOOST_TEST_CHECK(dColor.getAlpha() == 0xAA);
3326 BOOST_TEST_CHECK(dColor.getC3() == 0xBB);
3327 BOOST_TEST_CHECK(dColor.getC2() == 0xCC);
3328 BOOST_TEST_CHECK(dColor.getC1() == 0xDD);
3329 BOOST_TEST_CHECK(dColor.getC0() == 0xAA);
3331 dColor.setRGBfromLogPackIntARGB(0x00DDCCBB);
3333 BOOST_TEST_CHECK(dColor.getRed() == 0xDD);
3334 BOOST_TEST_CHECK(dColor.getGreen() == 0xCC);
3335 BOOST_TEST_CHECK(dColor.getBlue() == 0xBB);
3336 BOOST_TEST_CHECK(dColor.getAlpha() == 0xAA);
3338 BOOST_TEST_CHECK(dColor.getC3() == 0xDD);
3339 BOOST_TEST_CHECK(dColor.getC2() == 0xCC);
3340 BOOST_TEST_CHECK(dColor.getC1() == 0xBB);
3341 BOOST_TEST_CHECK(dColor.getC0() == 0xAA);
3345BOOST_AUTO_TEST_CASE(set8_fromLogPackIntRGBA) {
3347 mjr::colorARGB8b aColor;
3348 mjr::colorRGBA8b bColor;
3349 mjr::colorBGRA8b cColor;
3350 mjr::colorABGR8b dColor;
3352 mjr::colorRGB8b eColor;
3353 mjr::colorBGR8b fColor;
3355 aColor.setRGBAfromLogPackIntRGBA(0xBBCCDDAA);
3357 BOOST_TEST_CHECK(aColor.getRed() == 0xBB);
3358 BOOST_TEST_CHECK(aColor.getGreen() == 0xCC);
3359 BOOST_TEST_CHECK(aColor.getBlue() == 0xDD);
3360 BOOST_TEST_CHECK(aColor.getAlpha() == 0xAA);
3362 BOOST_TEST_CHECK(aColor.getC1() == 0xBB);
3363 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
3364 BOOST_TEST_CHECK(aColor.getC3() == 0xDD);
3365 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
3367 aColor.setRGBfromLogPackIntRGBA(0xDDCCBB00);
3369 BOOST_TEST_CHECK(aColor.getRed() == 0xDD);
3370 BOOST_TEST_CHECK(aColor.getGreen() == 0xCC);
3371 BOOST_TEST_CHECK(aColor.getBlue() == 0xBB);
3372 BOOST_TEST_CHECK(aColor.getAlpha() == 0xAA);
3374 BOOST_TEST_CHECK(aColor.getC1() == 0xDD);
3375 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
3376 BOOST_TEST_CHECK(aColor.getC3() == 0xBB);
3377 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
3379 eColor.setRGBfromLogPackIntRGBA(0xDDCCBB00);
3381 BOOST_TEST_CHECK(eColor.getRed() == 0xDD);
3382 BOOST_TEST_CHECK(eColor.getGreen() == 0xCC);
3383 BOOST_TEST_CHECK(eColor.getBlue() == 0xBB);
3385 BOOST_TEST_CHECK(eColor.getC0() == 0xDD);
3386 BOOST_TEST_CHECK(eColor.getC1() == 0xCC);
3387 BOOST_TEST_CHECK(eColor.getC2() == 0xBB);
3389 bColor.setRGBAfromLogPackIntRGBA(0xBBCCDDAA);
3391 BOOST_TEST_CHECK(bColor.getRed() == 0xBB);
3392 BOOST_TEST_CHECK(bColor.getGreen() == 0xCC);
3393 BOOST_TEST_CHECK(bColor.getBlue() == 0xDD);
3394 BOOST_TEST_CHECK(bColor.getAlpha() == 0xAA);
3396 BOOST_TEST_CHECK(bColor.getC0() == 0xBB);
3397 BOOST_TEST_CHECK(bColor.getC1() == 0xCC);
3398 BOOST_TEST_CHECK(bColor.getC2() == 0xDD);
3399 BOOST_TEST_CHECK(bColor.getC3() == 0xAA);
3401 bColor.setRGBfromLogPackIntRGBA(0xDDCCBB00);
3403 BOOST_TEST_CHECK(bColor.getRed() == 0xDD);
3404 BOOST_TEST_CHECK(bColor.getGreen() == 0xCC);
3405 BOOST_TEST_CHECK(bColor.getBlue() == 0xBB);
3406 BOOST_TEST_CHECK(bColor.getAlpha() == 0xAA);
3408 BOOST_TEST_CHECK(bColor.getC0() == 0xDD);
3409 BOOST_TEST_CHECK(bColor.getC1() == 0xCC);
3410 BOOST_TEST_CHECK(bColor.getC2() == 0xBB);
3411 BOOST_TEST_CHECK(bColor.getC3() == 0xAA);
3413 fColor.setRGBfromLogPackIntRGBA(0xDDCCBB00);
3415 BOOST_TEST_CHECK(fColor.getRed() == 0xDD);
3416 BOOST_TEST_CHECK(fColor.getGreen() == 0xCC);
3417 BOOST_TEST_CHECK(fColor.getBlue() == 0xBB);
3419 BOOST_TEST_CHECK(fColor.getC2() == 0xDD);
3420 BOOST_TEST_CHECK(fColor.getC1() == 0xCC);
3421 BOOST_TEST_CHECK(fColor.getC0() == 0xBB);
3423 cColor.setRGBAfromLogPackIntRGBA(0xBBCCDDAA);
3425 BOOST_TEST_CHECK(cColor.getRed() == 0xBB);
3426 BOOST_TEST_CHECK(cColor.getGreen() == 0xCC);
3427 BOOST_TEST_CHECK(cColor.getBlue() == 0xDD);
3428 BOOST_TEST_CHECK(cColor.getAlpha() == 0xAA);
3430 BOOST_TEST_CHECK(cColor.getC2() == 0xBB);
3431 BOOST_TEST_CHECK(cColor.getC1() == 0xCC);
3432 BOOST_TEST_CHECK(cColor.getC0() == 0xDD);
3433 BOOST_TEST_CHECK(cColor.getC3() == 0xAA);
3435 cColor.setRGBfromLogPackIntRGBA(0xDDCCBB00);
3437 BOOST_TEST_CHECK(cColor.getRed() == 0xDD);
3438 BOOST_TEST_CHECK(cColor.getGreen() == 0xCC);
3439 BOOST_TEST_CHECK(cColor.getBlue() == 0xBB);
3440 BOOST_TEST_CHECK(cColor.getAlpha() == 0xAA);
3442 BOOST_TEST_CHECK(cColor.getC2() == 0xDD);
3443 BOOST_TEST_CHECK(cColor.getC1() == 0xCC);
3444 BOOST_TEST_CHECK(cColor.getC0() == 0xBB);
3445 BOOST_TEST_CHECK(cColor.getC3() == 0xAA);
3447 dColor.setRGBAfromLogPackIntRGBA(0xBBCCDDAA);
3449 BOOST_TEST_CHECK(dColor.getRed() == 0xBB);
3450 BOOST_TEST_CHECK(dColor.getGreen() == 0xCC);
3451 BOOST_TEST_CHECK(dColor.getBlue() == 0xDD);
3452 BOOST_TEST_CHECK(dColor.getAlpha() == 0xAA);
3454 BOOST_TEST_CHECK(dColor.getC3() == 0xBB);
3455 BOOST_TEST_CHECK(dColor.getC2() == 0xCC);
3456 BOOST_TEST_CHECK(dColor.getC1() == 0xDD);
3457 BOOST_TEST_CHECK(dColor.getC0() == 0xAA);
3459 dColor.setRGBfromLogPackIntRGBA(0xDDCCBB00);
3461 BOOST_TEST_CHECK(dColor.getRed() == 0xDD);
3462 BOOST_TEST_CHECK(dColor.getGreen() == 0xCC);
3463 BOOST_TEST_CHECK(dColor.getBlue() == 0xBB);
3464 BOOST_TEST_CHECK(dColor.getAlpha() == 0xAA);
3466 BOOST_TEST_CHECK(dColor.getC3() == 0xDD);
3467 BOOST_TEST_CHECK(dColor.getC2() == 0xCC);
3468 BOOST_TEST_CHECK(dColor.getC1() == 0xBB);
3469 BOOST_TEST_CHECK(dColor.getC0() == 0xAA);
3473BOOST_AUTO_TEST_CASE(set8_fromLogPackIntABGR) {
3475 mjr::colorARGB8b aColor;
3476 mjr::colorRGBA8b bColor;
3477 mjr::colorBGRA8b cColor;
3478 mjr::colorABGR8b dColor;
3480 mjr::colorRGB8b eColor;
3481 mjr::colorBGR8b fColor;
3483 aColor.setRGBAfromLogPackIntABGR(0xAADDCCBB);
3485 BOOST_TEST_CHECK(aColor.getRed() == 0xBB);
3486 BOOST_TEST_CHECK(aColor.getGreen() == 0xCC);
3487 BOOST_TEST_CHECK(aColor.getBlue() == 0xDD);
3488 BOOST_TEST_CHECK(aColor.getAlpha() == 0xAA);
3490 BOOST_TEST_CHECK(aColor.getC1() == 0xBB);
3491 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
3492 BOOST_TEST_CHECK(aColor.getC3() == 0xDD);
3493 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
3495 aColor.setRGBfromLogPackIntABGR(0x00BBCCDD);
3497 BOOST_TEST_CHECK(aColor.getRed() == 0xDD);
3498 BOOST_TEST_CHECK(aColor.getGreen() == 0xCC);
3499 BOOST_TEST_CHECK(aColor.getBlue() == 0xBB);
3500 BOOST_TEST_CHECK(aColor.getAlpha() == 0xAA);
3502 BOOST_TEST_CHECK(aColor.getC1() == 0xDD);
3503 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
3504 BOOST_TEST_CHECK(aColor.getC3() == 0xBB);
3505 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
3507 eColor.setRGBfromLogPackIntABGR(0x00BBCCDD);
3509 BOOST_TEST_CHECK(eColor.getRed() == 0xDD);
3510 BOOST_TEST_CHECK(eColor.getGreen() == 0xCC);
3511 BOOST_TEST_CHECK(eColor.getBlue() == 0xBB);
3513 BOOST_TEST_CHECK(eColor.getC0() == 0xDD);
3514 BOOST_TEST_CHECK(eColor.getC1() == 0xCC);
3515 BOOST_TEST_CHECK(eColor.getC2() == 0xBB);
3517 bColor.setRGBAfromLogPackIntABGR(0xAADDCCBB);
3519 BOOST_TEST_CHECK(bColor.getRed() == 0xBB);
3520 BOOST_TEST_CHECK(bColor.getGreen() == 0xCC);
3521 BOOST_TEST_CHECK(bColor.getBlue() == 0xDD);
3522 BOOST_TEST_CHECK(bColor.getAlpha() == 0xAA);
3524 BOOST_TEST_CHECK(bColor.getC0() == 0xBB);
3525 BOOST_TEST_CHECK(bColor.getC1() == 0xCC);
3526 BOOST_TEST_CHECK(bColor.getC2() == 0xDD);
3527 BOOST_TEST_CHECK(bColor.getC3() == 0xAA);
3529 bColor.setRGBfromLogPackIntABGR(0x00BBCCDD);
3531 BOOST_TEST_CHECK(bColor.getRed() == 0xDD);
3532 BOOST_TEST_CHECK(bColor.getGreen() == 0xCC);
3533 BOOST_TEST_CHECK(bColor.getBlue() == 0xBB);
3534 BOOST_TEST_CHECK(bColor.getAlpha() == 0xAA);
3536 BOOST_TEST_CHECK(bColor.getC0() == 0xDD);
3537 BOOST_TEST_CHECK(bColor.getC1() == 0xCC);
3538 BOOST_TEST_CHECK(bColor.getC2() == 0xBB);
3539 BOOST_TEST_CHECK(bColor.getC3() == 0xAA);
3541 fColor.setRGBfromLogPackIntABGR(0x00BBCCDD);
3543 BOOST_TEST_CHECK(fColor.getRed() == 0xDD);
3544 BOOST_TEST_CHECK(fColor.getGreen() == 0xCC);
3545 BOOST_TEST_CHECK(fColor.getBlue() == 0xBB);
3547 BOOST_TEST_CHECK(fColor.getC2() == 0xDD);
3548 BOOST_TEST_CHECK(fColor.getC1() == 0xCC);
3549 BOOST_TEST_CHECK(fColor.getC0() == 0xBB);
3551 cColor.setRGBAfromLogPackIntABGR(0xAADDCCBB);
3553 BOOST_TEST_CHECK(cColor.getRed() == 0xBB);
3554 BOOST_TEST_CHECK(cColor.getGreen() == 0xCC);
3555 BOOST_TEST_CHECK(cColor.getBlue() == 0xDD);
3556 BOOST_TEST_CHECK(cColor.getAlpha() == 0xAA);
3558 BOOST_TEST_CHECK(cColor.getC2() == 0xBB);
3559 BOOST_TEST_CHECK(cColor.getC1() == 0xCC);
3560 BOOST_TEST_CHECK(cColor.getC0() == 0xDD);
3561 BOOST_TEST_CHECK(cColor.getC3() == 0xAA);
3563 cColor.setRGBfromLogPackIntABGR(0x00BBCCDD);
3565 BOOST_TEST_CHECK(cColor.getRed() == 0xDD);
3566 BOOST_TEST_CHECK(cColor.getGreen() == 0xCC);
3567 BOOST_TEST_CHECK(cColor.getBlue() == 0xBB);
3568 BOOST_TEST_CHECK(cColor.getAlpha() == 0xAA);
3570 BOOST_TEST_CHECK(cColor.getC2() == 0xDD);
3571 BOOST_TEST_CHECK(cColor.getC1() == 0xCC);
3572 BOOST_TEST_CHECK(cColor.getC0() == 0xBB);
3573 BOOST_TEST_CHECK(cColor.getC3() == 0xAA);
3575 dColor.setRGBAfromLogPackIntABGR(0xAADDCCBB);
3577 BOOST_TEST_CHECK(dColor.getRed() == 0xBB);
3578 BOOST_TEST_CHECK(dColor.getGreen() == 0xCC);
3579 BOOST_TEST_CHECK(dColor.getBlue() == 0xDD);
3580 BOOST_TEST_CHECK(dColor.getAlpha() == 0xAA);
3582 BOOST_TEST_CHECK(dColor.getC3() == 0xBB);
3583 BOOST_TEST_CHECK(dColor.getC2() == 0xCC);
3584 BOOST_TEST_CHECK(dColor.getC1() == 0xDD);
3585 BOOST_TEST_CHECK(dColor.getC0() == 0xAA);
3587 dColor.setRGBfromLogPackIntABGR(0x00BBCCDD);
3589 BOOST_TEST_CHECK(dColor.getRed() == 0xDD);
3590 BOOST_TEST_CHECK(dColor.getGreen() == 0xCC);
3591 BOOST_TEST_CHECK(dColor.getBlue() == 0xBB);
3592 BOOST_TEST_CHECK(dColor.getAlpha() == 0xAA);
3594 BOOST_TEST_CHECK(dColor.getC3() == 0xDD);
3595 BOOST_TEST_CHECK(dColor.getC2() == 0xCC);
3596 BOOST_TEST_CHECK(dColor.getC1() == 0xBB);
3597 BOOST_TEST_CHECK(dColor.getC0() == 0xAA);
3601BOOST_AUTO_TEST_CASE(set8_fromLogPackIntABRG) {
3603 mjr::colorARGB8b aColor;
3604 mjr::colorRGBA8b bColor;
3605 mjr::colorBGRA8b cColor;
3606 mjr::colorABGR8b dColor;
3608 mjr::colorRGB8b eColor;
3609 mjr::colorBGR8b fColor;
3611 aColor.setRGBAfromLogPackIntABRG(0xAADDBBCC);
3613 BOOST_TEST_CHECK(aColor.getRed() == 0xBB);
3614 BOOST_TEST_CHECK(aColor.getGreen() == 0xCC);
3615 BOOST_TEST_CHECK(aColor.getBlue() == 0xDD);
3616 BOOST_TEST_CHECK(aColor.getAlpha() == 0xAA);
3618 BOOST_TEST_CHECK(aColor.getC1() == 0xBB);
3619 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
3620 BOOST_TEST_CHECK(aColor.getC3() == 0xDD);
3621 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
3623 aColor.setRGBfromLogPackIntABRG(0x00BBDDCC);
3625 BOOST_TEST_CHECK(aColor.getRed() == 0xDD);
3626 BOOST_TEST_CHECK(aColor.getGreen() == 0xCC);
3627 BOOST_TEST_CHECK(aColor.getBlue() == 0xBB);
3628 BOOST_TEST_CHECK(aColor.getAlpha() == 0xAA);
3630 BOOST_TEST_CHECK(aColor.getC1() == 0xDD);
3631 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
3632 BOOST_TEST_CHECK(aColor.getC3() == 0xBB);
3633 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
3635 eColor.setRGBfromLogPackIntABRG(0x00BBDDCC);
3637 BOOST_TEST_CHECK(eColor.getRed() == 0xDD);
3638 BOOST_TEST_CHECK(eColor.getGreen() == 0xCC);
3639 BOOST_TEST_CHECK(eColor.getBlue() == 0xBB);
3641 BOOST_TEST_CHECK(eColor.getC0() == 0xDD);
3642 BOOST_TEST_CHECK(eColor.getC1() == 0xCC);
3643 BOOST_TEST_CHECK(eColor.getC2() == 0xBB);
3645 bColor.setRGBAfromLogPackIntABRG(0xAADDBBCC);
3647 BOOST_TEST_CHECK(bColor.getRed() == 0xBB);
3648 BOOST_TEST_CHECK(bColor.getGreen() == 0xCC);
3649 BOOST_TEST_CHECK(bColor.getBlue() == 0xDD);
3650 BOOST_TEST_CHECK(bColor.getAlpha() == 0xAA);
3652 BOOST_TEST_CHECK(bColor.getC0() == 0xBB);
3653 BOOST_TEST_CHECK(bColor.getC1() == 0xCC);
3654 BOOST_TEST_CHECK(bColor.getC2() == 0xDD);
3655 BOOST_TEST_CHECK(bColor.getC3() == 0xAA);
3657 bColor.setRGBfromLogPackIntABRG(0x00BBDDCC);
3659 BOOST_TEST_CHECK(bColor.getRed() == 0xDD);
3660 BOOST_TEST_CHECK(bColor.getGreen() == 0xCC);
3661 BOOST_TEST_CHECK(bColor.getBlue() == 0xBB);
3662 BOOST_TEST_CHECK(bColor.getAlpha() == 0xAA);
3664 BOOST_TEST_CHECK(bColor.getC0() == 0xDD);
3665 BOOST_TEST_CHECK(bColor.getC1() == 0xCC);
3666 BOOST_TEST_CHECK(bColor.getC2() == 0xBB);
3667 BOOST_TEST_CHECK(bColor.getC3() == 0xAA);
3669 fColor.setRGBfromLogPackIntABRG(0x00BBDDCC);
3671 BOOST_TEST_CHECK(fColor.getRed() == 0xDD);
3672 BOOST_TEST_CHECK(fColor.getGreen() == 0xCC);
3673 BOOST_TEST_CHECK(fColor.getBlue() == 0xBB);
3675 BOOST_TEST_CHECK(fColor.getC2() == 0xDD);
3676 BOOST_TEST_CHECK(fColor.getC1() == 0xCC);
3677 BOOST_TEST_CHECK(fColor.getC0() == 0xBB);
3679 cColor.setRGBAfromLogPackIntABRG(0xAADDBBCC);
3681 BOOST_TEST_CHECK(cColor.getRed() == 0xBB);
3682 BOOST_TEST_CHECK(cColor.getGreen() == 0xCC);
3683 BOOST_TEST_CHECK(cColor.getBlue() == 0xDD);
3684 BOOST_TEST_CHECK(cColor.getAlpha() == 0xAA);
3686 BOOST_TEST_CHECK(cColor.getC2() == 0xBB);
3687 BOOST_TEST_CHECK(cColor.getC1() == 0xCC);
3688 BOOST_TEST_CHECK(cColor.getC0() == 0xDD);
3689 BOOST_TEST_CHECK(cColor.getC3() == 0xAA);
3691 cColor.setRGBfromLogPackIntABRG(0x00BBDDCC);
3693 BOOST_TEST_CHECK(cColor.getRed() == 0xDD);
3694 BOOST_TEST_CHECK(cColor.getGreen() == 0xCC);
3695 BOOST_TEST_CHECK(cColor.getBlue() == 0xBB);
3696 BOOST_TEST_CHECK(cColor.getAlpha() == 0xAA);
3698 BOOST_TEST_CHECK(cColor.getC2() == 0xDD);
3699 BOOST_TEST_CHECK(cColor.getC1() == 0xCC);
3700 BOOST_TEST_CHECK(cColor.getC0() == 0xBB);
3701 BOOST_TEST_CHECK(cColor.getC3() == 0xAA);
3703 dColor.setRGBAfromLogPackIntABRG(0xAADDBBCC);
3705 BOOST_TEST_CHECK(dColor.getRed() == 0xBB);
3706 BOOST_TEST_CHECK(dColor.getGreen() == 0xCC);
3707 BOOST_TEST_CHECK(dColor.getBlue() == 0xDD);
3708 BOOST_TEST_CHECK(dColor.getAlpha() == 0xAA);
3710 BOOST_TEST_CHECK(dColor.getC3() == 0xBB);
3711 BOOST_TEST_CHECK(dColor.getC2() == 0xCC);
3712 BOOST_TEST_CHECK(dColor.getC1() == 0xDD);
3713 BOOST_TEST_CHECK(dColor.getC0() == 0xAA);
3715 dColor.setRGBfromLogPackIntABRG(0x00BBDDCC);
3717 BOOST_TEST_CHECK(dColor.getRed() == 0xDD);
3718 BOOST_TEST_CHECK(dColor.getGreen() == 0xCC);
3719 BOOST_TEST_CHECK(dColor.getBlue() == 0xBB);
3720 BOOST_TEST_CHECK(dColor.getAlpha() == 0xAA);
3722 BOOST_TEST_CHECK(dColor.getC3() == 0xDD);
3723 BOOST_TEST_CHECK(dColor.getC2() == 0xCC);
3724 BOOST_TEST_CHECK(dColor.getC1() == 0xBB);
3725 BOOST_TEST_CHECK(dColor.getC0() == 0xAA);
3729BOOST_AUTO_TEST_CASE(set8_fromLogPackIntBGRA) {
3731 mjr::colorARGB8b aColor;
3732 mjr::colorRGBA8b bColor;
3733 mjr::colorBGRA8b cColor;
3734 mjr::colorBGRA8b dColor;
3736 mjr::colorRGB8b eColor;
3737 mjr::colorBGR8b fColor;
3739 aColor.setRGBAfromLogPackIntBGRA(0xDDCCBBAA);
3741 BOOST_TEST_CHECK(aColor.getRed() == 0xBB);
3742 BOOST_TEST_CHECK(aColor.getGreen() == 0xCC);
3743 BOOST_TEST_CHECK(aColor.getBlue() == 0xDD);
3744 BOOST_TEST_CHECK(aColor.getAlpha() == 0xAA);
3746 BOOST_TEST_CHECK(aColor.getC1() == 0xBB);
3747 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
3748 BOOST_TEST_CHECK(aColor.getC3() == 0xDD);
3749 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
3751 aColor.setRGBfromLogPackIntBGRA(0xBBCCDD00);
3753 BOOST_TEST_CHECK(aColor.getRed() == 0xDD);
3754 BOOST_TEST_CHECK(aColor.getGreen() == 0xCC);
3755 BOOST_TEST_CHECK(aColor.getBlue() == 0xBB);
3756 BOOST_TEST_CHECK(aColor.getAlpha() == 0xAA);
3758 BOOST_TEST_CHECK(aColor.getC1() == 0xDD);
3759 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
3760 BOOST_TEST_CHECK(aColor.getC3() == 0xBB);
3761 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
3763 eColor.setRGBfromLogPackIntBGRA(0xBBCCDD00);
3765 BOOST_TEST_CHECK(eColor.getRed() == 0xDD);
3766 BOOST_TEST_CHECK(eColor.getGreen() == 0xCC);
3767 BOOST_TEST_CHECK(eColor.getBlue() == 0xBB);
3769 BOOST_TEST_CHECK(eColor.getC0() == 0xDD);
3770 BOOST_TEST_CHECK(eColor.getC1() == 0xCC);
3771 BOOST_TEST_CHECK(eColor.getC2() == 0xBB);
3773 bColor.setRGBAfromLogPackIntBGRA(0xDDCCBBAA);
3775 BOOST_TEST_CHECK(bColor.getRed() == 0xBB);
3776 BOOST_TEST_CHECK(bColor.getGreen() == 0xCC);
3777 BOOST_TEST_CHECK(bColor.getBlue() == 0xDD);
3778 BOOST_TEST_CHECK(bColor.getAlpha() == 0xAA);
3780 BOOST_TEST_CHECK(bColor.getC0() == 0xBB);
3781 BOOST_TEST_CHECK(bColor.getC1() == 0xCC);
3782 BOOST_TEST_CHECK(bColor.getC2() == 0xDD);
3783 BOOST_TEST_CHECK(bColor.getC3() == 0xAA);
3785 bColor.setRGBfromLogPackIntBGRA(0xBBCCDD00);
3787 BOOST_TEST_CHECK(bColor.getRed() == 0xDD);
3788 BOOST_TEST_CHECK(bColor.getGreen() == 0xCC);
3789 BOOST_TEST_CHECK(bColor.getBlue() == 0xBB);
3790 BOOST_TEST_CHECK(bColor.getAlpha() == 0xAA);
3792 BOOST_TEST_CHECK(bColor.getC0() == 0xDD);
3793 BOOST_TEST_CHECK(bColor.getC1() == 0xCC);
3794 BOOST_TEST_CHECK(bColor.getC2() == 0xBB);
3795 BOOST_TEST_CHECK(bColor.getC3() == 0xAA);
3797 fColor.setRGBfromLogPackIntBGRA(0xBBCCDD00);
3799 BOOST_TEST_CHECK(fColor.getRed() == 0xDD);
3800 BOOST_TEST_CHECK(fColor.getGreen() == 0xCC);
3801 BOOST_TEST_CHECK(fColor.getBlue() == 0xBB);
3803 BOOST_TEST_CHECK(fColor.getC2() == 0xDD);
3804 BOOST_TEST_CHECK(fColor.getC1() == 0xCC);
3805 BOOST_TEST_CHECK(fColor.getC0() == 0xBB);
3807 cColor.setRGBAfromLogPackIntBGRA(0xDDCCBBAA);
3809 BOOST_TEST_CHECK(cColor.getRed() == 0xBB);
3810 BOOST_TEST_CHECK(cColor.getGreen() == 0xCC);
3811 BOOST_TEST_CHECK(cColor.getBlue() == 0xDD);
3812 BOOST_TEST_CHECK(cColor.getAlpha() == 0xAA);
3814 BOOST_TEST_CHECK(cColor.getC2() == 0xBB);
3815 BOOST_TEST_CHECK(cColor.getC1() == 0xCC);
3816 BOOST_TEST_CHECK(cColor.getC0() == 0xDD);
3817 BOOST_TEST_CHECK(cColor.getC3() == 0xAA);
3819 cColor.setRGBfromLogPackIntBGRA(0xBBCCDD00);
3821 BOOST_TEST_CHECK(cColor.getRed() == 0xDD);
3822 BOOST_TEST_CHECK(cColor.getGreen() == 0xCC);
3823 BOOST_TEST_CHECK(cColor.getBlue() == 0xBB);
3824 BOOST_TEST_CHECK(cColor.getAlpha() == 0xAA);
3826 BOOST_TEST_CHECK(cColor.getC2() == 0xDD);
3827 BOOST_TEST_CHECK(cColor.getC1() == 0xCC);
3828 BOOST_TEST_CHECK(cColor.getC0() == 0xBB);
3829 BOOST_TEST_CHECK(cColor.getC3() == 0xAA);
3831 dColor.setRGBAfromLogPackIntBGRA(0xDDCCBBAA);
3833 BOOST_TEST_CHECK(dColor.getRed() == 0xBB);
3834 BOOST_TEST_CHECK(dColor.getGreen() == 0xCC);
3835 BOOST_TEST_CHECK(dColor.getBlue() == 0xDD);
3836 BOOST_TEST_CHECK(dColor.getAlpha() == 0xAA);
3838 BOOST_TEST_CHECK(dColor.getC2() == 0xBB);
3839 BOOST_TEST_CHECK(dColor.getC1() == 0xCC);
3840 BOOST_TEST_CHECK(dColor.getC0() == 0xDD);
3841 BOOST_TEST_CHECK(dColor.getC3() == 0xAA);
3843 dColor.setRGBfromLogPackIntBGRA(0xBBCCDD00);
3845 BOOST_TEST_CHECK(dColor.getRed() == 0xDD);
3846 BOOST_TEST_CHECK(dColor.getGreen() == 0xCC);
3847 BOOST_TEST_CHECK(dColor.getBlue() == 0xBB);
3848 BOOST_TEST_CHECK(dColor.getAlpha() == 0xAA);
3850 BOOST_TEST_CHECK(dColor.getC2() == 0xDD);
3851 BOOST_TEST_CHECK(dColor.getC1() == 0xCC);
3852 BOOST_TEST_CHECK(dColor.getC0() == 0xBB);
3853 BOOST_TEST_CHECK(dColor.getC3() == 0xAA);
3857BOOST_AUTO_TEST_CASE(set16_fromLogPackIntARGB) {
3861 mjr::colorRGBA16b bColor;
3862 mjr::colorRGB16b eColor;
3864 bColor.setRGBAfromLogPackIntARGB(0xFF00FF80);
3866 BOOST_TEST_CHECK(bColor.getRed() == mjr::colorRGBA16b::minChanVal);
3867 BOOST_TEST_CHECK(bColor.getGreen() == mjr::colorRGBA16b::maxChanVal);
3868 BOOST_TEST_CHECK(bColor.getBlue() == 0x8080);
3869 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA16b::maxChanVal);
3871 BOOST_TEST_CHECK(bColor.getC0() == mjr::colorRGBA16b::minChanVal);
3872 BOOST_TEST_CHECK(bColor.getC1() == mjr::colorRGBA16b::maxChanVal);
3873 BOOST_TEST_CHECK(bColor.getC2() == 0x8080);
3874 BOOST_TEST_CHECK(bColor.getC3() == mjr::colorRGBA16b::maxChanVal);
3876 bColor.setRGBfromLogPackIntARGB(0x00FF00FF);
3878 BOOST_TEST_CHECK(bColor.getRed() == mjr::colorRGBA16b::maxChanVal);
3879 BOOST_TEST_CHECK(bColor.getGreen() == mjr::colorRGBA16b::minChanVal);
3880 BOOST_TEST_CHECK(bColor.getBlue() == mjr::colorRGBA16b::maxChanVal);
3881 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA16b::maxChanVal);
3883 BOOST_TEST_CHECK(bColor.getC0() == mjr::colorRGBA16b::maxChanVal);
3884 BOOST_TEST_CHECK(bColor.getC1() == mjr::colorRGBA16b::minChanVal);
3885 BOOST_TEST_CHECK(bColor.getC2() == mjr::colorRGBA16b::maxChanVal);
3886 BOOST_TEST_CHECK(bColor.getC3() == mjr::colorRGBA16b::maxChanVal);
3888 eColor.setRGBfromLogPackIntARGB(0x00FF00FF);
3890 BOOST_TEST_CHECK(eColor.getRed() == mjr::colorRGBA16b::maxChanVal);
3891 BOOST_TEST_CHECK(eColor.getGreen() == mjr::colorRGBA16b::minChanVal);
3892 BOOST_TEST_CHECK(eColor.getBlue() == mjr::colorRGBA16b::maxChanVal);
3894 BOOST_TEST_CHECK(eColor.getC0() == mjr::colorRGBA16b::maxChanVal);
3895 BOOST_TEST_CHECK(eColor.getC1() == mjr::colorRGBA16b::minChanVal);
3896 BOOST_TEST_CHECK(eColor.getC2() == mjr::colorRGBA16b::maxChanVal);
3900BOOST_AUTO_TEST_CASE(set8_saved_fromLogPackIntARGB) {
3904 mjr::colorRGBA8b bColor;
3905 mjr::color5c8b cColor;
3907 bColor.setToWhite();
3908 bColor.setRGBfromLogPackIntARGB(0x00000000);
3910 BOOST_TEST_CHECK(bColor.getRed() == mjr::colorRGBA8b::minChanVal);
3911 BOOST_TEST_CHECK(bColor.getGreen() == mjr::colorRGBA8b::minChanVal);
3912 BOOST_TEST_CHECK(bColor.getBlue() == mjr::colorRGBA8b::minChanVal);
3913 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA8b::maxChanVal);
3915 bColor.setToBlack();
3916 bColor.setRGBfromLogPackIntARGB(0xFFFFFFFF);
3918 BOOST_TEST_CHECK(bColor.getRed() == mjr::colorRGBA8b::maxChanVal);
3919 BOOST_TEST_CHECK(bColor.getGreen() == mjr::colorRGBA8b::maxChanVal);
3920 BOOST_TEST_CHECK(bColor.getBlue() == mjr::colorRGBA8b::maxChanVal);
3921 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA8b::minChanVal);
3923 cColor.setToWhite();
3924 cColor.setRGBAfromLogPackIntARGB(0x00000000);
3926 BOOST_TEST_CHECK(cColor.getRed() == mjr::colorRGBA8b::minChanVal);
3927 BOOST_TEST_CHECK(cColor.getGreen() == mjr::colorRGBA8b::minChanVal);
3928 BOOST_TEST_CHECK(cColor.getBlue() == mjr::colorRGBA8b::minChanVal);
3929 BOOST_TEST_CHECK(cColor.getAlpha() == mjr::colorRGBA8b::minChanVal);
3930 BOOST_TEST_CHECK(cColor.getChan(4) == mjr::colorRGBA8b::maxChanVal);
3932 cColor.setToBlack();
3933 cColor.setRGBAfromLogPackIntARGB(0xFFFFFFFF);
3935 BOOST_TEST_CHECK(cColor.getRed() == mjr::colorRGBA8b::maxChanVal);
3936 BOOST_TEST_CHECK(cColor.getGreen() == mjr::colorRGBA8b::maxChanVal);
3937 BOOST_TEST_CHECK(cColor.getBlue() == mjr::colorRGBA8b::maxChanVal);
3938 BOOST_TEST_CHECK(cColor.getAlpha() == mjr::colorRGBA8b::maxChanVal);
3939 BOOST_TEST_CHECK(cColor.getChan(4) == mjr::colorRGBA8b::minChanVal);
3943BOOST_AUTO_TEST_CASE(setRGBcmpGreyTGA16bit) {
3945 mjr::colorRGBA8b aColor;
3946 mjr::colorRGB8b bColor;
3948 bColor.setToBlack();
3949 bColor.setRGBcmpGreyTGA16bit(0x0000);
3951 BOOST_TEST_CHECK(bColor.getRed() == 0x00);
3952 BOOST_TEST_CHECK(bColor.getGreen() == 0x00);
3953 BOOST_TEST_CHECK(bColor.getBlue() == 0x00);
3955 BOOST_TEST_CHECK(bColor.getC0() == 0x00);
3956 BOOST_TEST_CHECK(bColor.getC1() == 0x00);
3957 BOOST_TEST_CHECK(bColor.getC2() == 0x00);
3959 bColor.setToBlack();
3960 bColor.setRGBcmpGreyTGA16bit(0xFFFF);
3962 BOOST_TEST_CHECK(bColor.getRed() == 0xFF);
3963 BOOST_TEST_CHECK(bColor.getGreen() == 0xFF);
3964 BOOST_TEST_CHECK(bColor.getBlue() == 0x00);
3966 BOOST_TEST_CHECK(bColor.getC0() == 0xFF);
3967 BOOST_TEST_CHECK(bColor.getC1() == 0xFF);
3968 BOOST_TEST_CHECK(bColor.getC2() == 0x00);
3970 bColor.setToBlack();
3971 bColor.setRGBcmpGreyTGA16bit(0xAABB);
3973 BOOST_TEST_CHECK(bColor.getRed() == 0xAA);
3974 BOOST_TEST_CHECK(bColor.getGreen() == 0xBB);
3975 BOOST_TEST_CHECK(bColor.getBlue() == 0x00);
3977 BOOST_TEST_CHECK(bColor.getC0() == 0xAA);
3978 BOOST_TEST_CHECK(bColor.getC1() == 0xBB);
3979 BOOST_TEST_CHECK(bColor.getC2() == 0x00);
3981 bColor.setToWhite();
3982 bColor.setRGBcmpGreyTGA16bit(0x0000);
3984 BOOST_TEST_CHECK(bColor.getRed() == 0x00);
3985 BOOST_TEST_CHECK(bColor.getGreen() == 0x00);
3986 BOOST_TEST_CHECK(bColor.getBlue() == 0x00);
3988 BOOST_TEST_CHECK(bColor.getC0() == 0x00);
3989 BOOST_TEST_CHECK(bColor.getC1() == 0x00);
3990 BOOST_TEST_CHECK(bColor.getC2() == 0x00);
3992 bColor.setToWhite();
3993 bColor.setRGBcmpGreyTGA16bit(0xFFFF);
3995 BOOST_TEST_CHECK(bColor.getRed() == 0xFF);
3996 BOOST_TEST_CHECK(bColor.getGreen() == 0xFF);
3997 BOOST_TEST_CHECK(bColor.getBlue() == 0x00);
3999 BOOST_TEST_CHECK(bColor.getC0() == 0xFF);
4000 BOOST_TEST_CHECK(bColor.getC1() == 0xFF);
4001 BOOST_TEST_CHECK(bColor.getC2() == 0x00);
4003 bColor.setToWhite();
4004 bColor.setRGBcmpGreyTGA16bit(0xAABB);
4006 BOOST_TEST_CHECK(bColor.getRed() == 0xAA);
4007 BOOST_TEST_CHECK(bColor.getGreen() == 0xBB);
4008 BOOST_TEST_CHECK(bColor.getBlue() == 0x00);
4010 BOOST_TEST_CHECK(bColor.getC0() == 0xAA);
4011 BOOST_TEST_CHECK(bColor.getC1() == 0xBB);
4012 BOOST_TEST_CHECK(bColor.getC2() == 0x00);
4016 aColor.setToBlack();
4017 aColor.setRGBcmpGreyTGA16bit(0x0000);
4019 BOOST_TEST_CHECK(aColor.getRed() == 0x00);
4020 BOOST_TEST_CHECK(aColor.getGreen() == 0x00);
4021 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
4022 BOOST_TEST_CHECK(aColor.getAlpha() == 0x00);
4024 BOOST_TEST_CHECK(aColor.getC0() == 0x00);
4025 BOOST_TEST_CHECK(aColor.getC1() == 0x00);
4026 BOOST_TEST_CHECK(aColor.getC2() == 0x00);
4027 BOOST_TEST_CHECK(aColor.getC3() == 0x00);
4029 aColor.setToBlack();
4030 aColor.setRGBcmpGreyTGA16bit(0xFFFF);
4032 BOOST_TEST_CHECK(aColor.getRed() == 0xFF);
4033 BOOST_TEST_CHECK(aColor.getGreen() == 0xFF);
4034 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
4035 BOOST_TEST_CHECK(aColor.getAlpha() == 0x00);
4037 BOOST_TEST_CHECK(aColor.getC0() == 0xFF);
4038 BOOST_TEST_CHECK(aColor.getC1() == 0xFF);
4039 BOOST_TEST_CHECK(aColor.getC2() == 0x00);
4040 BOOST_TEST_CHECK(aColor.getC3() == 0x00);
4042 aColor.setToBlack();
4043 aColor.setRGBcmpGreyTGA16bit(0xAABB);
4045 BOOST_TEST_CHECK(aColor.getRed() == 0xAA);
4046 BOOST_TEST_CHECK(aColor.getGreen() == 0xBB);
4047 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
4048 BOOST_TEST_CHECK(aColor.getAlpha() == 0x00);
4050 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
4051 BOOST_TEST_CHECK(aColor.getC1() == 0xBB);
4052 BOOST_TEST_CHECK(aColor.getC2() == 0x00);
4053 BOOST_TEST_CHECK(aColor.getC3() == 0x00);
4055 aColor.setToWhite();
4056 aColor.setRGBcmpGreyTGA16bit(0x0000);
4058 BOOST_TEST_CHECK(aColor.getRed() == 0x00);
4059 BOOST_TEST_CHECK(aColor.getGreen() == 0x00);
4060 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
4061 BOOST_TEST_CHECK(aColor.getAlpha() == 0xFF);
4063 BOOST_TEST_CHECK(aColor.getC0() == 0x00);
4064 BOOST_TEST_CHECK(aColor.getC1() == 0x00);
4065 BOOST_TEST_CHECK(aColor.getC2() == 0x00);
4066 BOOST_TEST_CHECK(aColor.getC3() == 0xFF);
4068 aColor.setToWhite();
4069 aColor.setRGBcmpGreyTGA16bit(0xFFFF);
4071 BOOST_TEST_CHECK(aColor.getRed() == 0xFF);
4072 BOOST_TEST_CHECK(aColor.getGreen() == 0xFF);
4073 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
4074 BOOST_TEST_CHECK(aColor.getAlpha() == 0xFF);
4076 BOOST_TEST_CHECK(aColor.getC0() == 0xFF);
4077 BOOST_TEST_CHECK(aColor.getC1() == 0xFF);
4078 BOOST_TEST_CHECK(aColor.getC2() == 0x00);
4079 BOOST_TEST_CHECK(aColor.getC3() == 0xFF);
4081 aColor.setToWhite();
4082 aColor.setRGBcmpGreyTGA16bit(0xAABB);
4084 BOOST_TEST_CHECK(aColor.getRed() == 0xAA);
4085 BOOST_TEST_CHECK(aColor.getGreen() == 0xBB);
4086 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
4087 BOOST_TEST_CHECK(aColor.getAlpha() == 0xFF);
4089 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
4090 BOOST_TEST_CHECK(aColor.getC1() == 0xBB);
4091 BOOST_TEST_CHECK(aColor.getC2() == 0x00);
4092 BOOST_TEST_CHECK(aColor.getC3() == 0xFF);
4097BOOST_AUTO_TEST_CASE(setRGBcmpGreyTGA24bit) {
4099 mjr::colorRGBA8b aColor;
4100 mjr::colorRGB8b bColor;
4102 bColor.setToBlack();
4103 bColor.setRGBcmpGreyTGA24bit(0x00000000);
4105 BOOST_TEST_CHECK(bColor.getRed() == 0x00);
4106 BOOST_TEST_CHECK(bColor.getGreen() == 0x00);
4107 BOOST_TEST_CHECK(bColor.getBlue() == 0x00);
4109 BOOST_TEST_CHECK(bColor.getC0() == 0x00);
4110 BOOST_TEST_CHECK(bColor.getC1() == 0x00);
4111 BOOST_TEST_CHECK(bColor.getC2() == 0x00);
4113 bColor.setToBlack();
4114 bColor.setRGBcmpGreyTGA24bit(0x00FFFFFF);
4116 BOOST_TEST_CHECK(bColor.getRed() == 0xFF);
4117 BOOST_TEST_CHECK(bColor.getGreen() == 0xFF);
4118 BOOST_TEST_CHECK(bColor.getBlue() == 0xFF);
4120 BOOST_TEST_CHECK(bColor.getC0() == 0xFF);
4121 BOOST_TEST_CHECK(bColor.getC1() == 0xFF);
4122 BOOST_TEST_CHECK(bColor.getC2() == 0xFF);
4124 bColor.setToBlack();
4125 bColor.setRGBcmpGreyTGA24bit(0x00CCAABB);
4127 BOOST_TEST_CHECK(bColor.getRed() == 0xAA);
4128 BOOST_TEST_CHECK(bColor.getGreen() == 0xBB);
4129 BOOST_TEST_CHECK(bColor.getBlue() == 0xCC);
4131 BOOST_TEST_CHECK(bColor.getC0() == 0xAA);
4132 BOOST_TEST_CHECK(bColor.getC1() == 0xBB);
4133 BOOST_TEST_CHECK(bColor.getC2() == 0xCC);
4135 bColor.setToWhite();
4136 bColor.setRGBcmpGreyTGA24bit(0x00000000);
4138 BOOST_TEST_CHECK(bColor.getRed() == 0x00);
4139 BOOST_TEST_CHECK(bColor.getGreen() == 0x00);
4140 BOOST_TEST_CHECK(bColor.getBlue() == 0x00);
4142 BOOST_TEST_CHECK(bColor.getC0() == 0x00);
4143 BOOST_TEST_CHECK(bColor.getC1() == 0x00);
4144 BOOST_TEST_CHECK(bColor.getC2() == 0x00);
4146 bColor.setToWhite();
4147 bColor.setRGBcmpGreyTGA24bit(0x00FFFFFF);
4149 BOOST_TEST_CHECK(bColor.getRed() == 0xFF);
4150 BOOST_TEST_CHECK(bColor.getGreen() == 0xFF);
4151 BOOST_TEST_CHECK(bColor.getBlue() == 0xFF);
4153 BOOST_TEST_CHECK(bColor.getC0() == 0xFF);
4154 BOOST_TEST_CHECK(bColor.getC1() == 0xFF);
4155 BOOST_TEST_CHECK(bColor.getC2() == 0xFF);
4157 bColor.setToWhite();
4158 bColor.setRGBcmpGreyTGA24bit(0x00CCAABB);
4160 BOOST_TEST_CHECK(bColor.getRed() == 0xAA);
4161 BOOST_TEST_CHECK(bColor.getGreen() == 0xBB);
4162 BOOST_TEST_CHECK(bColor.getBlue() == 0xCC);
4164 BOOST_TEST_CHECK(bColor.getC0() == 0xAA);
4165 BOOST_TEST_CHECK(bColor.getC1() == 0xBB);
4166 BOOST_TEST_CHECK(bColor.getC2() == 0xCC);
4170 aColor.setToBlack();
4171 aColor.setRGBcmpGreyTGA24bit(0x00000000);
4173 BOOST_TEST_CHECK(aColor.getRed() == 0x00);
4174 BOOST_TEST_CHECK(aColor.getGreen() == 0x00);
4175 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
4176 BOOST_TEST_CHECK(aColor.getAlpha() == 0x00);
4178 BOOST_TEST_CHECK(aColor.getC0() == 0x00);
4179 BOOST_TEST_CHECK(aColor.getC1() == 0x00);
4180 BOOST_TEST_CHECK(aColor.getC2() == 0x00);
4181 BOOST_TEST_CHECK(aColor.getC3() == 0x00);
4183 aColor.setToBlack();
4184 aColor.setRGBcmpGreyTGA24bit(0x00FFFFFF);
4186 BOOST_TEST_CHECK(aColor.getRed() == 0xFF);
4187 BOOST_TEST_CHECK(aColor.getGreen() == 0xFF);
4188 BOOST_TEST_CHECK(aColor.getBlue() == 0xFF);
4189 BOOST_TEST_CHECK(aColor.getAlpha() == 0x00);
4191 BOOST_TEST_CHECK(aColor.getC0() == 0xFF);
4192 BOOST_TEST_CHECK(aColor.getC1() == 0xFF);
4193 BOOST_TEST_CHECK(aColor.getC2() == 0xFF);
4194 BOOST_TEST_CHECK(aColor.getC3() == 0x00);
4196 aColor.setToBlack();
4197 aColor.setRGBcmpGreyTGA24bit(0x00CCAABB);
4199 BOOST_TEST_CHECK(aColor.getRed() == 0xAA);
4200 BOOST_TEST_CHECK(aColor.getGreen() == 0xBB);
4201 BOOST_TEST_CHECK(aColor.getBlue() == 0xCC);
4202 BOOST_TEST_CHECK(aColor.getAlpha() == 0x00);
4204 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
4205 BOOST_TEST_CHECK(aColor.getC1() == 0xBB);
4206 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
4207 BOOST_TEST_CHECK(aColor.getC3() == 0x00);
4209 aColor.setToWhite();
4210 aColor.setRGBcmpGreyTGA24bit(0x00000000);
4212 BOOST_TEST_CHECK(aColor.getRed() == 0x00);
4213 BOOST_TEST_CHECK(aColor.getGreen() == 0x00);
4214 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
4215 BOOST_TEST_CHECK(aColor.getAlpha() == 0xFF);
4217 BOOST_TEST_CHECK(aColor.getC0() == 0x00);
4218 BOOST_TEST_CHECK(aColor.getC1() == 0x00);
4219 BOOST_TEST_CHECK(aColor.getC2() == 0x00);
4220 BOOST_TEST_CHECK(aColor.getC3() == 0xFF);
4222 aColor.setToWhite();
4223 aColor.setRGBcmpGreyTGA24bit(0x00FFFFFF);
4225 BOOST_TEST_CHECK(aColor.getRed() == 0xFF);
4226 BOOST_TEST_CHECK(aColor.getGreen() == 0xFF);
4227 BOOST_TEST_CHECK(aColor.getBlue() == 0xFF);
4228 BOOST_TEST_CHECK(aColor.getAlpha() == 0xFF);
4230 BOOST_TEST_CHECK(aColor.getC0() == 0xFF);
4231 BOOST_TEST_CHECK(aColor.getC1() == 0xFF);
4232 BOOST_TEST_CHECK(aColor.getC2() == 0xFF);
4233 BOOST_TEST_CHECK(aColor.getC3() == 0xFF);
4235 aColor.setToWhite();
4236 aColor.setRGBcmpGreyTGA24bit(0x00CCAABB);
4238 BOOST_TEST_CHECK(aColor.getRed() == 0xAA);
4239 BOOST_TEST_CHECK(aColor.getGreen() == 0xBB);
4240 BOOST_TEST_CHECK(aColor.getBlue() == 0xCC);
4241 BOOST_TEST_CHECK(aColor.getAlpha() == 0xFF);
4243 BOOST_TEST_CHECK(aColor.getC0() == 0xAA);
4244 BOOST_TEST_CHECK(aColor.getC1() == 0xBB);
4245 BOOST_TEST_CHECK(aColor.getC2() == 0xCC);
4246 BOOST_TEST_CHECK(aColor.getC3() == 0xFF);
4250BOOST_AUTO_TEST_CASE(tfrm_logic_cover) {
4252 mjr::colorRGBA8b aColor;
4253 mjr::colorRGBA8b bColor;
4254 mjr::colorRGBA8b cColor;
4256 aColor.setRGBAfromLogPackIntRGBA(0xAABBCCDD);
4257 bColor.setRGBAfromLogPackIntRGBA(0x11223344);
4259 BOOST_TEST_CHECK(aColor.getRed() == 0xAA);
4260 BOOST_TEST_CHECK(aColor.getGreen() == 0xBB);
4261 BOOST_TEST_CHECK(aColor.getBlue() == 0xCC);
4262 BOOST_TEST_CHECK(aColor.getAlpha() == 0xDD);
4264 BOOST_TEST_CHECK(bColor.getRed() == 0x11);
4265 BOOST_TEST_CHECK(bColor.getGreen() == 0x22);
4266 BOOST_TEST_CHECK(bColor.getBlue() == 0x33);
4267 BOOST_TEST_CHECK(bColor.getAlpha() == 0x44);
4271 BOOST_TEST_CHECK(cColor.getRed() == 0x55);
4272 BOOST_TEST_CHECK(cColor.getGreen() == 0x44);
4273 BOOST_TEST_CHECK(cColor.getBlue() == 0x33);
4274 BOOST_TEST_CHECK(cColor.getAlpha() == 0x22);
4277 cColor.tfrmOr(bColor);
4278 BOOST_TEST_CHECK(cColor.getRed() == 0xBB);
4279 BOOST_TEST_CHECK(cColor.getGreen() == 0xBB);
4280 BOOST_TEST_CHECK(cColor.getBlue() == 0xFF);
4281 BOOST_TEST_CHECK(cColor.getAlpha() == 0xDD);
4284 cColor.tfrmNor(bColor);
4285 BOOST_TEST_CHECK(cColor.getRed() == 0x44);
4286 BOOST_TEST_CHECK(cColor.getGreen() == 0x44);
4287 BOOST_TEST_CHECK(cColor.getBlue() == 0x00);
4288 BOOST_TEST_CHECK(cColor.getAlpha() == 0x22);
4291 cColor.tfrmAnd(bColor);
4292 BOOST_TEST_CHECK(cColor.getRed() == 0x00);
4293 BOOST_TEST_CHECK(cColor.getGreen() == 0x22);
4294 BOOST_TEST_CHECK(cColor.getBlue() == 0x00);
4295 BOOST_TEST_CHECK(cColor.getAlpha() == 0x44);
4298 cColor.tfrmNand(bColor);
4299 BOOST_TEST_CHECK(cColor.getRed() == 0xFF);
4300 BOOST_TEST_CHECK(cColor.getGreen() == 0xDD);
4301 BOOST_TEST_CHECK(cColor.getBlue() == 0xFF);
4302 BOOST_TEST_CHECK(cColor.getAlpha() == 0xBB);
4305 cColor.tfrmXor(bColor);
4306 BOOST_TEST_CHECK(cColor.getRed() == 0xBB);
4307 BOOST_TEST_CHECK(cColor.getGreen() == 0x99);
4308 BOOST_TEST_CHECK(cColor.getBlue() == 0xFF);
4309 BOOST_TEST_CHECK(cColor.getAlpha() == 0x99);
4312 cColor.tfrmNxor(bColor);
4313 BOOST_TEST_CHECK(cColor.getRed() == 0x44);
4314 BOOST_TEST_CHECK(cColor.getGreen() == 0x66);
4315 BOOST_TEST_CHECK(cColor.getBlue() == 0x00);
4316 BOOST_TEST_CHECK(cColor.getAlpha() == 0x66);
4323BOOST_AUTO_TEST_CASE(tfrm_logic_noCover) {
4325 mjr::colorRGBA64b aColor;
4326 mjr::colorRGBA64b bColor;
4327 mjr::colorRGBA64b cColor;
4329 aColor.setChansRGBA(0xAAAAAAAAAAAAAAAAu, 0xBBBBBBBBBBBBBBBBu, 0xCCCCCCCCCCCCCCCCu, 0xDDDDDDDDDDDDDDDDu);
4330 bColor.setChansRGBA(0x1111111111111111u, 0x2222222222222222u, 0x3333333333333333u, 0x4444444444444444u);
4332 BOOST_TEST_CHECK(aColor.getRed() == 0xAAAAAAAAAAAAAAAAu);
4333 BOOST_TEST_CHECK(aColor.getGreen() == 0xBBBBBBBBBBBBBBBBu);
4334 BOOST_TEST_CHECK(aColor.getBlue() == 0xCCCCCCCCCCCCCCCCu);
4335 BOOST_TEST_CHECK(aColor.getAlpha() == 0xDDDDDDDDDDDDDDDDu);
4337 BOOST_TEST_CHECK(bColor.getRed() == 0x1111111111111111u);
4338 BOOST_TEST_CHECK(bColor.getGreen() == 0x2222222222222222u);
4339 BOOST_TEST_CHECK(bColor.getBlue() == 0x3333333333333333u);
4340 BOOST_TEST_CHECK(bColor.getAlpha() == 0x4444444444444444u);
4344 BOOST_TEST_CHECK(cColor.getRed() == 0x5555555555555555u);
4345 BOOST_TEST_CHECK(cColor.getGreen() == 0x4444444444444444u);
4346 BOOST_TEST_CHECK(cColor.getBlue() == 0x3333333333333333u);
4347 BOOST_TEST_CHECK(cColor.getAlpha() == 0x2222222222222222u);
4350 cColor.tfrmOr(bColor);
4351 BOOST_TEST_CHECK(cColor.getRed() == 0xBBBBBBBBBBBBBBBBu);
4352 BOOST_TEST_CHECK(cColor.getGreen() == 0xBBBBBBBBBBBBBBBBu);
4353 BOOST_TEST_CHECK(cColor.getBlue() == 0xFFFFFFFFFFFFFFFFu);
4354 BOOST_TEST_CHECK(cColor.getAlpha() == 0xDDDDDDDDDDDDDDDDu);
4357 cColor.tfrmNor(bColor);
4358 BOOST_TEST_CHECK(cColor.getRed() == 0x4444444444444444u);
4359 BOOST_TEST_CHECK(cColor.getGreen() == 0x4444444444444444u);
4360 BOOST_TEST_CHECK(cColor.getBlue() == 0x0000000000000000u);
4361 BOOST_TEST_CHECK(cColor.getAlpha() == 0x2222222222222222u);
4364 cColor.tfrmAnd(bColor);
4365 BOOST_TEST_CHECK(cColor.getRed() == 0x0000000000000000u);
4366 BOOST_TEST_CHECK(cColor.getGreen() == 0x2222222222222222u);
4367 BOOST_TEST_CHECK(cColor.getBlue() == 0x0000000000000000u);
4368 BOOST_TEST_CHECK(cColor.getAlpha() == 0x4444444444444444u);
4371 cColor.tfrmNand(bColor);
4372 BOOST_TEST_CHECK(cColor.getRed() == 0xFFFFFFFFFFFFFFFFu);
4373 BOOST_TEST_CHECK(cColor.getGreen() == 0xDDDDDDDDDDDDDDDDu);
4374 BOOST_TEST_CHECK(cColor.getBlue() == 0xFFFFFFFFFFFFFFFFu);
4375 BOOST_TEST_CHECK(cColor.getAlpha() == 0xBBBBBBBBBBBBBBBBu);
4378 cColor.tfrmXor(bColor);
4379 BOOST_TEST_CHECK(cColor.getRed() == 0xBBBBBBBBBBBBBBBBu);
4380 BOOST_TEST_CHECK(cColor.getGreen() == 0x9999999999999999u);
4381 BOOST_TEST_CHECK(cColor.getBlue() == 0xFFFFFFFFFFFFFFFFu);
4382 BOOST_TEST_CHECK(cColor.getAlpha() == 0x9999999999999999u);
4385 cColor.tfrmNxor(bColor);
4386 BOOST_TEST_CHECK(cColor.getRed() == 0x4444444444444444u);
4387 BOOST_TEST_CHECK(cColor.getGreen() == 0x6666666666666666u);
4388 BOOST_TEST_CHECK(cColor.getBlue() == 0x0000000000000000u);
4389 BOOST_TEST_CHECK(cColor.getAlpha() == 0x6666666666666666u);
4396BOOST_AUTO_TEST_CASE(tfrm_arith) {
4398 mjr::colorRGB8b aColor;
4399 mjr::colorRGB8b bColor;
4400 mjr::colorRGB8b dColor;
4401 mjr::colorRGB8b cColor;
4403 aColor.setRGBfromLogPackIntARGB(0xFF00FF);
4404 bColor.setRGBfromLogPackIntARGB(0x00FFFF);
4405 dColor.setRGBfromLogPackIntARGB(0x0100FF);
4407 BOOST_TEST_CHECK(aColor.getRed() == 0xFF);
4408 BOOST_TEST_CHECK(aColor.getGreen() == 0x00);
4409 BOOST_TEST_CHECK(aColor.getBlue() == 0xFF);
4411 BOOST_TEST_CHECK(bColor.getRed() == 0x00);
4412 BOOST_TEST_CHECK(bColor.getGreen() == 0xFF);
4413 BOOST_TEST_CHECK(bColor.getBlue() == 0xFF);
4415 BOOST_TEST_CHECK(dColor.getRed() == 0x01);
4416 BOOST_TEST_CHECK(dColor.getGreen() == 0x00);
4417 BOOST_TEST_CHECK(dColor.getBlue() == 0xFF);
4420 cColor.tfrmMix(0.0, bColor);
4421 BOOST_TEST_CHECK(cColor.getC0() == 0xFF);
4422 BOOST_TEST_CHECK(cColor.getC1() == 0x00);
4423 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
4426 cColor.tfrmMix(0.5, bColor);
4427 BOOST_TEST_CHECK(cColor.getC0() == 0x7F);
4428 BOOST_TEST_CHECK(cColor.getC1() == 0x7F);
4429 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
4432 cColor.tfrmMix(1.0, bColor);
4433 BOOST_TEST_CHECK(cColor.getC0() == 0x00);
4434 BOOST_TEST_CHECK(cColor.getC1() == 0xFF);
4435 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
4438 cColor.tfrmInvert();
4439 BOOST_TEST_CHECK(cColor.getRed() == 0x00);
4440 BOOST_TEST_CHECK(cColor.getGreen() == 0xFF);
4441 BOOST_TEST_CHECK(cColor.getBlue() == 0x00);
4444 cColor.tfrmAdd(bColor);
4445 BOOST_TEST_CHECK(cColor.getRed() == 0xFF);
4446 BOOST_TEST_CHECK(cColor.getGreen() == 0xFF);
4447 BOOST_TEST_CHECK(cColor.getBlue() == 0xFE);
4450 cColor.tfrmAddClamp(bColor);
4451 BOOST_TEST_CHECK(cColor.getRed() == 0xFF);
4452 BOOST_TEST_CHECK(cColor.getGreen() == 0xFF);
4453 BOOST_TEST_CHECK(cColor.getBlue() == 0xFF);
4456 cColor.tfrmMult(bColor);
4457 BOOST_TEST_CHECK(cColor.getRed() == 0x00);
4458 BOOST_TEST_CHECK(cColor.getGreen() == 0x00);
4459 BOOST_TEST_CHECK(cColor.getBlue() == 0x01);
4462 cColor.tfrmMultClamp(bColor);
4463 BOOST_TEST_CHECK(cColor.getRed() == 0x00);
4464 BOOST_TEST_CHECK(cColor.getGreen() == 0x00);
4465 BOOST_TEST_CHECK(cColor.getBlue() == 0xFF);
4468 cColor.tfrmDiv(bColor);
4469 BOOST_TEST_CHECK(cColor.getRed() == 0xFF);
4470 BOOST_TEST_CHECK(cColor.getGreen() == 0x00);
4471 BOOST_TEST_CHECK(cColor.getBlue() == 0x01);
4474 cColor.tfrmMod(bColor);
4475 BOOST_TEST_CHECK(cColor.getRed() == 0xFF);
4476 BOOST_TEST_CHECK(cColor.getGreen() == 0x00);
4477 BOOST_TEST_CHECK(cColor.getBlue() == 0x00);
4480 cColor.tfrmDiff(bColor);
4481 BOOST_TEST_CHECK(cColor.getRed() == 0xFF);
4482 BOOST_TEST_CHECK(cColor.getGreen() == 0x01);
4483 BOOST_TEST_CHECK(cColor.getBlue() == 0x00);
4486 cColor.tfrmDiffClamp(bColor);
4487 BOOST_TEST_CHECK(cColor.getRed() == 0xFF);
4488 BOOST_TEST_CHECK(cColor.getGreen() == 0x00);
4489 BOOST_TEST_CHECK(cColor.getBlue() == 0x00);
4492 cColor.tfrmAbsDiff(bColor);
4493 BOOST_TEST_CHECK(cColor.getRed() == 0xFF);
4494 BOOST_TEST_CHECK(cColor.getGreen() == 0xFF);
4495 BOOST_TEST_CHECK(cColor.getBlue() == 0x00);
4498 cColor.tfrmSqDiff(bColor);
4499 BOOST_TEST_CHECK(cColor.getRed() == 0x01);
4500 BOOST_TEST_CHECK(cColor.getGreen() == 0x01);
4501 BOOST_TEST_CHECK(cColor.getBlue() == 0x00);
4504 cColor.tfrmNegDiffClamp(bColor);
4505 BOOST_TEST_CHECK(cColor.getRed() == 0x00);
4506 BOOST_TEST_CHECK(cColor.getGreen() == 0xFF);
4507 BOOST_TEST_CHECK(cColor.getBlue() == 0x00);
4510 cColor.tfrmAddDivClamp(bColor, dColor);
4511 BOOST_TEST_CHECK(cColor.getRed() == 0xFF);
4512 BOOST_TEST_CHECK(cColor.getGreen() == 0x00);
4513 BOOST_TEST_CHECK(cColor.getBlue() == 0x02);
4516 cColor.tfrmSignDiff(bColor);
4517 BOOST_TEST_CHECK(cColor.getRed() == 0xFF);
4518 BOOST_TEST_CHECK(cColor.getGreen() == 0x00);
4519 BOOST_TEST_CHECK(cColor.getBlue() == 0x7F);
4523BOOST_AUTO_TEST_CASE(tfrm_arith_FLT) {
4525 mjr::colorRGB32F aColor;
4526 mjr::colorRGB32F bColor;
4527 mjr::colorRGB32F dColor;
4528 mjr::colorRGB32F cColor;
4530 aColor.setChansRGB(2.0, 0.0, 2.0);
4531 bColor.setChansRGB(0.0, 2.0, 2.0);
4532 dColor.setChansRGB(0.0, 2.0, 2.0);
4535 cColor.tfrmMix(0.0, bColor);
4536 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
4537 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
4538 BOOST_TEST_CHECK(cColor.getC2() == 2.0);
4541 cColor.tfrmMix(0.5, bColor);
4542 BOOST_TEST_CHECK(cColor.getC0() == 1.0);
4543 BOOST_TEST_CHECK(cColor.getC1() == 1.0);
4544 BOOST_TEST_CHECK(cColor.getC2() == 2.0);
4547 cColor.tfrmMix(1.0, bColor);
4548 BOOST_TEST_CHECK(cColor.getC0() == 0.0);
4549 BOOST_TEST_CHECK(cColor.getC1() == 2.0);
4550 BOOST_TEST_CHECK(cColor.getC2() == 2.0);
4553 cColor.tfrmInvert();
4554 BOOST_TEST_CHECK(cColor.getC0() == -1.0);
4555 BOOST_TEST_CHECK(cColor.getC1() == 1.0);
4556 BOOST_TEST_CHECK(cColor.getC2() == -1.0);
4559 cColor.tfrmAdd(bColor);
4560 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
4561 BOOST_TEST_CHECK(cColor.getC1() == 2.0);
4562 BOOST_TEST_CHECK(cColor.getC2() == 4.0);
4565 cColor.tfrmAddClamp(bColor);
4566 BOOST_TEST_CHECK(cColor.getC0() == 1.0);
4567 BOOST_TEST_CHECK(cColor.getC1() == 1.0);
4568 BOOST_TEST_CHECK(cColor.getC2() == 1.0);
4571 cColor.tfrmMult(bColor);
4572 BOOST_TEST_CHECK(cColor.getC0() == 0.0);
4573 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
4574 BOOST_TEST_CHECK(cColor.getC2() == 4.0);
4577 cColor.tfrmMultClamp(bColor);
4578 BOOST_TEST_CHECK(cColor.getC0() == 0.0);
4579 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
4580 BOOST_TEST_CHECK(cColor.getC2() == 1.0);
4583 cColor.tfrmDiv(bColor);
4584 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
4585 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
4586 BOOST_TEST_CHECK(cColor.getC2() == 1.0);
4589 cColor.tfrmMod(bColor);
4590 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
4591 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
4592 BOOST_TEST_CHECK(cColor.getC2() == 0.0);
4595 cColor.tfrmDiff(bColor);
4596 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
4597 BOOST_TEST_CHECK(cColor.getC1() == -2.0);
4598 BOOST_TEST_CHECK(cColor.getC2() == 0.0);
4601 cColor.tfrmDiffClamp(bColor);
4602 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
4603 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
4604 BOOST_TEST_CHECK(cColor.getC2() == 0.0);
4607 cColor.tfrmAbsDiff(bColor);
4608 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
4609 BOOST_TEST_CHECK(cColor.getC1() == 2.0);
4610 BOOST_TEST_CHECK(cColor.getC2() == 0.0);
4613 cColor.tfrmSqDiff(bColor);
4614 BOOST_TEST_CHECK(cColor.getC0() == 4.0);
4615 BOOST_TEST_CHECK(cColor.getC1() == 4.0);
4616 BOOST_TEST_CHECK(cColor.getC2() == 0.0);
4619 cColor.tfrmNegDiffClamp(bColor);
4620 BOOST_TEST_CHECK(cColor.getC0() == 0.0);
4621 BOOST_TEST_CHECK(cColor.getC1() == 2.0);
4622 BOOST_TEST_CHECK(cColor.getC2() == 0.0);
4625 cColor.tfrmAddDivClamp(bColor, dColor);
4626 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
4627 BOOST_TEST_CHECK(cColor.getC1() == 1.0);
4628 BOOST_TEST_CHECK(cColor.getC2() == 1.0);
4631 cColor.tfrmSignDiff(bColor);
4632 BOOST_TEST_CHECK(cColor.getC0() == 1.0);
4633 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
4634 BOOST_TEST_CHECK(cColor.getC2() == 0.5);
4638BOOST_AUTO_TEST_CASE(isBlack_and_isBlackRGB) {
4640 mjr::colorRGB8b aColor;
4641 mjr::colorRGBA8b bColor;
4642 mjr::colorRGB64b cColor;
4643 mjr::colorRGB32F dColor;
4644 mjr::colorRGBA32F fColor;
4645 mjr::colorRGB64F gColor;
4647 aColor.setToBlack();
4648 bColor.setToBlack();
4649 cColor.setToBlack();
4650 dColor.setToBlack();
4651 fColor.setToBlack();
4652 gColor.setToBlack();
4654 BOOST_TEST_CHECK(aColor.isBlack() ==
true);
4655 BOOST_TEST_CHECK(bColor.isBlack() ==
true);
4656 BOOST_TEST_CHECK(cColor.isBlack() ==
true);
4657 BOOST_TEST_CHECK(dColor.isBlack() ==
true);
4658 BOOST_TEST_CHECK(fColor.isBlack() ==
true);
4659 BOOST_TEST_CHECK(gColor.isBlack() ==
true);
4661 BOOST_TEST_CHECK(aColor.isBlackRGB() ==
true);
4662 BOOST_TEST_CHECK(bColor.isBlackRGB() ==
true);
4663 BOOST_TEST_CHECK(cColor.isBlackRGB() ==
true);
4664 BOOST_TEST_CHECK(dColor.isBlackRGB() ==
true);
4665 BOOST_TEST_CHECK(fColor.isBlackRGB() ==
true);
4666 BOOST_TEST_CHECK(gColor.isBlackRGB() ==
true);
4668 aColor.setChanToMax(0);
4669 bColor.setChanToMax(0);
4670 cColor.setChanToMax(0);
4671 dColor.setChanToMax(0);
4672 fColor.setChanToMax(0);
4673 gColor.setChanToMax(0);
4675 BOOST_TEST_CHECK(aColor.isBlack() ==
false);
4676 BOOST_TEST_CHECK(bColor.isBlack() ==
false);
4677 BOOST_TEST_CHECK(cColor.isBlack() ==
false);
4678 BOOST_TEST_CHECK(dColor.isBlack() ==
false);
4679 BOOST_TEST_CHECK(fColor.isBlack() ==
false);
4680 BOOST_TEST_CHECK(gColor.isBlack() ==
false);
4682 BOOST_TEST_CHECK(aColor.isBlackRGB() ==
false);
4683 BOOST_TEST_CHECK(bColor.isBlackRGB() ==
false);
4684 BOOST_TEST_CHECK(cColor.isBlackRGB() ==
false);
4685 BOOST_TEST_CHECK(dColor.isBlackRGB() ==
false);
4686 BOOST_TEST_CHECK(fColor.isBlackRGB() ==
false);
4687 BOOST_TEST_CHECK(gColor.isBlackRGB() ==
false);
4689 aColor.setToWhite();
4690 bColor.setToWhite();
4691 cColor.setToWhite();
4692 dColor.setToWhite();
4693 fColor.setToWhite();
4694 gColor.setToWhite();
4696 BOOST_TEST_CHECK(aColor.isBlack() ==
false);
4697 BOOST_TEST_CHECK(bColor.isBlack() ==
false);
4698 BOOST_TEST_CHECK(cColor.isBlack() ==
false);
4699 BOOST_TEST_CHECK(dColor.isBlack() ==
false);
4700 BOOST_TEST_CHECK(fColor.isBlack() ==
false);
4701 BOOST_TEST_CHECK(gColor.isBlack() ==
false);
4703 BOOST_TEST_CHECK(aColor.isBlackRGB() ==
false);
4704 BOOST_TEST_CHECK(bColor.isBlackRGB() ==
false);
4705 BOOST_TEST_CHECK(cColor.isBlackRGB() ==
false);
4706 BOOST_TEST_CHECK(dColor.isBlackRGB() ==
false);
4707 BOOST_TEST_CHECK(fColor.isBlackRGB() ==
false);
4708 BOOST_TEST_CHECK(gColor.isBlackRGB() ==
false);
4710 bColor.setChansRGBA(0, 0, 0, 1);
4711 fColor.setChansRGBA(0, 0, 0, 1);
4713 BOOST_TEST_CHECK(bColor.isBlack() ==
false);
4714 BOOST_TEST_CHECK(fColor.isBlack() ==
false);
4716 BOOST_TEST_CHECK(bColor.isBlackRGB() ==
true);
4717 BOOST_TEST_CHECK(fColor.isBlackRGB() ==
true);
4721BOOST_AUTO_TEST_CASE(isEqual_and_isEqualRGB_and_isNotEqual) {
4723 mjr::colorRGB8b aLcolor;
4724 mjr::colorRGBA8b bLcolor;
4725 mjr::colorRGB64b cLcolor;
4726 mjr::colorRGB32F dLcolor;
4727 mjr::colorRGBA32F fLcolor;
4728 mjr::colorRGB64F gLcolor;
4730 mjr::colorRGB8b aRcolor;
4731 mjr::colorRGBA8b bRcolor;
4732 mjr::colorRGB64b cRcolor;
4733 mjr::colorRGB32F dRcolor;
4734 mjr::colorRGBA32F fRcolor;
4735 mjr::colorRGB64F gRcolor;
4737 aLcolor.setToBlack();
4738 bLcolor.setToBlack();
4739 cLcolor.setToBlack();
4740 dLcolor.setToBlack();
4741 fLcolor.setToBlack();
4742 gLcolor.setToBlack();
4744 aRcolor.setToBlack();
4745 bRcolor.setToBlack();
4746 cRcolor.setToBlack();
4747 dRcolor.setToBlack();
4748 fRcolor.setToBlack();
4749 gRcolor.setToBlack();
4751 BOOST_TEST_CHECK(aLcolor.isEqual(aRcolor) ==
true);
4752 BOOST_TEST_CHECK(bLcolor.isEqual(bRcolor) ==
true);
4753 BOOST_TEST_CHECK(cLcolor.isEqual(cRcolor) ==
true);
4754 BOOST_TEST_CHECK(dLcolor.isEqual(dRcolor) ==
true);
4755 BOOST_TEST_CHECK(fLcolor.isEqual(fRcolor) ==
true);
4756 BOOST_TEST_CHECK(gLcolor.isEqual(gRcolor) ==
true);
4758 BOOST_TEST_CHECK(aLcolor.isNotEqual(aRcolor) ==
false);
4759 BOOST_TEST_CHECK(bLcolor.isNotEqual(bRcolor) ==
false);
4760 BOOST_TEST_CHECK(cLcolor.isNotEqual(cRcolor) ==
false);
4761 BOOST_TEST_CHECK(dLcolor.isNotEqual(dRcolor) ==
false);
4762 BOOST_TEST_CHECK(fLcolor.isNotEqual(fRcolor) ==
false);
4763 BOOST_TEST_CHECK(gLcolor.isNotEqual(gRcolor) ==
false);
4765 BOOST_TEST_CHECK(aLcolor.isEqualRGB(aRcolor) ==
true);
4766 BOOST_TEST_CHECK(bLcolor.isEqualRGB(bRcolor) ==
true);
4767 BOOST_TEST_CHECK(cLcolor.isEqualRGB(cRcolor) ==
true);
4768 BOOST_TEST_CHECK(dLcolor.isEqualRGB(dRcolor) ==
true);
4769 BOOST_TEST_CHECK(fLcolor.isEqualRGB(fRcolor) ==
true);
4770 BOOST_TEST_CHECK(gLcolor.isEqualRGB(gRcolor) ==
true);
4772 aLcolor.setChanToMax(0);
4773 bLcolor.setChanToMax(0);
4774 cLcolor.setChanToMax(0);
4775 dLcolor.setChanToMax(0);
4776 fLcolor.setChanToMax(0);
4777 gLcolor.setChanToMax(0);
4779 BOOST_TEST_CHECK(aLcolor.isEqual(aRcolor) ==
false);
4780 BOOST_TEST_CHECK(bLcolor.isEqual(bRcolor) ==
false);
4781 BOOST_TEST_CHECK(cLcolor.isEqual(cRcolor) ==
false);
4782 BOOST_TEST_CHECK(dLcolor.isEqual(dRcolor) ==
false);
4783 BOOST_TEST_CHECK(fLcolor.isEqual(fRcolor) ==
false);
4784 BOOST_TEST_CHECK(gLcolor.isEqual(gRcolor) ==
false);
4786 BOOST_TEST_CHECK(aLcolor.isNotEqual(aRcolor) ==
true);
4787 BOOST_TEST_CHECK(bLcolor.isNotEqual(bRcolor) ==
true);
4788 BOOST_TEST_CHECK(cLcolor.isNotEqual(cRcolor) ==
true);
4789 BOOST_TEST_CHECK(dLcolor.isNotEqual(dRcolor) ==
true);
4790 BOOST_TEST_CHECK(fLcolor.isNotEqual(fRcolor) ==
true);
4791 BOOST_TEST_CHECK(gLcolor.isNotEqual(gRcolor) ==
true);
4793 BOOST_TEST_CHECK(aLcolor.isEqualRGB(aRcolor) ==
false);
4794 BOOST_TEST_CHECK(bLcolor.isEqualRGB(bRcolor) ==
false);
4795 BOOST_TEST_CHECK(cLcolor.isEqualRGB(cRcolor) ==
false);
4796 BOOST_TEST_CHECK(dLcolor.isEqualRGB(dRcolor) ==
false);
4797 BOOST_TEST_CHECK(fLcolor.isEqualRGB(fRcolor) ==
false);
4798 BOOST_TEST_CHECK(gLcolor.isEqualRGB(gRcolor) ==
false);
4800 aRcolor.setChanToMax(0);
4801 bRcolor.setChanToMax(0);
4802 cRcolor.setChanToMax(0);
4803 dRcolor.setChanToMax(0);
4804 fRcolor.setChanToMax(0);
4805 gRcolor.setChanToMax(0);
4807 BOOST_TEST_CHECK(aLcolor.isEqual(aRcolor) ==
true);
4808 BOOST_TEST_CHECK(bLcolor.isEqual(bRcolor) ==
true);
4809 BOOST_TEST_CHECK(cLcolor.isEqual(cRcolor) ==
true);
4810 BOOST_TEST_CHECK(dLcolor.isEqual(dRcolor) ==
true);
4811 BOOST_TEST_CHECK(fLcolor.isEqual(fRcolor) ==
true);
4812 BOOST_TEST_CHECK(gLcolor.isEqual(gRcolor) ==
true);
4814 BOOST_TEST_CHECK(aLcolor.isNotEqual(aRcolor) ==
false);
4815 BOOST_TEST_CHECK(bLcolor.isNotEqual(bRcolor) ==
false);
4816 BOOST_TEST_CHECK(cLcolor.isNotEqual(cRcolor) ==
false);
4817 BOOST_TEST_CHECK(dLcolor.isNotEqual(dRcolor) ==
false);
4818 BOOST_TEST_CHECK(fLcolor.isNotEqual(fRcolor) ==
false);
4819 BOOST_TEST_CHECK(gLcolor.isNotEqual(gRcolor) ==
false);
4821 BOOST_TEST_CHECK(aLcolor.isEqualRGB(aRcolor) ==
true);
4822 BOOST_TEST_CHECK(bLcolor.isEqualRGB(bRcolor) ==
true);
4823 BOOST_TEST_CHECK(cLcolor.isEqualRGB(cRcolor) ==
true);
4824 BOOST_TEST_CHECK(dLcolor.isEqualRGB(dRcolor) ==
true);
4825 BOOST_TEST_CHECK(fLcolor.isEqualRGB(fRcolor) ==
true);
4826 BOOST_TEST_CHECK(gLcolor.isEqualRGB(gRcolor) ==
true);
4828 aLcolor.setToWhite();
4829 bLcolor.setToWhite();
4830 cLcolor.setToWhite();
4831 dLcolor.setToWhite();
4832 fLcolor.setToWhite();
4833 gLcolor.setToWhite();
4835 BOOST_TEST_CHECK(aLcolor.isEqual(aRcolor) ==
false);
4836 BOOST_TEST_CHECK(bLcolor.isEqual(bRcolor) ==
false);
4837 BOOST_TEST_CHECK(cLcolor.isEqual(cRcolor) ==
false);
4838 BOOST_TEST_CHECK(dLcolor.isEqual(dRcolor) ==
false);
4839 BOOST_TEST_CHECK(fLcolor.isEqual(fRcolor) ==
false);
4840 BOOST_TEST_CHECK(gLcolor.isEqual(gRcolor) ==
false);
4842 BOOST_TEST_CHECK(aLcolor.isNotEqual(aRcolor) ==
true);
4843 BOOST_TEST_CHECK(bLcolor.isNotEqual(bRcolor) ==
true);
4844 BOOST_TEST_CHECK(cLcolor.isNotEqual(cRcolor) ==
true);
4845 BOOST_TEST_CHECK(dLcolor.isNotEqual(dRcolor) ==
true);
4846 BOOST_TEST_CHECK(fLcolor.isNotEqual(fRcolor) ==
true);
4847 BOOST_TEST_CHECK(gLcolor.isNotEqual(gRcolor) ==
true);
4849 BOOST_TEST_CHECK(aLcolor.isEqualRGB(aRcolor) ==
false);
4850 BOOST_TEST_CHECK(bLcolor.isEqualRGB(bRcolor) ==
false);
4851 BOOST_TEST_CHECK(cLcolor.isEqualRGB(cRcolor) ==
false);
4852 BOOST_TEST_CHECK(dLcolor.isEqualRGB(dRcolor) ==
false);
4853 BOOST_TEST_CHECK(fLcolor.isEqualRGB(fRcolor) ==
false);
4854 BOOST_TEST_CHECK(gLcolor.isEqualRGB(gRcolor) ==
false);
4856 bLcolor.setChansRGBA(1, 2, 3, 4);
4857 fLcolor.setChansRGBA(1, 2, 3, 4);
4859 bRcolor.setChansRGBA(1, 2, 3, 5);
4860 fRcolor.setChansRGBA(1, 2, 3, 5);
4862 BOOST_TEST_CHECK(bLcolor.isEqual(bRcolor) ==
false);
4863 BOOST_TEST_CHECK(fLcolor.isEqual(fRcolor) ==
false);
4865 BOOST_TEST_CHECK(bLcolor.isEqualRGB(bRcolor) ==
true);
4866 BOOST_TEST_CHECK(fLcolor.isEqualRGB(fRcolor) ==
true);
4870BOOST_AUTO_TEST_CASE(dist_int) {
4872 mjr::colorRGBA8b aColor;
4873 mjr::colorRGBA8b bColor;
4876 aColor.setToWhite();
4877 bColor.setToBlack();
4879 BOOST_TEST_CHECK(aColor.distHypot( bColor) == std::sqrt(mjr::colorRGBA8b::maxChanVal*mjr::colorRGBA8b::maxChanVal*4));
4880 BOOST_TEST_CHECK(aColor.distSumAbs(bColor) == mjr::colorRGBA8b::maxChanVal*4);
4881 BOOST_TEST_CHECK(aColor.distMaxAbs(bColor) == mjr::colorRGBA8b::maxChanVal);
4883 BOOST_TEST_CHECK(bColor.distHypot( aColor) == std::sqrt(mjr::colorRGBA8b::maxChanVal*mjr::colorRGBA8b::maxChanVal*4));
4884 BOOST_TEST_CHECK(bColor.distSumAbs(aColor) == mjr::colorRGBA8b::maxChanVal*4);
4885 BOOST_TEST_CHECK(bColor.distMaxAbs(aColor) == mjr::colorRGBA8b::maxChanVal);
4888 aColor.setToWhite();
4889 bColor.setToWhite();
4891 BOOST_TEST_CHECK(aColor.distHypot( bColor) == 0);
4892 BOOST_TEST_CHECK(aColor.distSumAbs(bColor) == 0);
4893 BOOST_TEST_CHECK(aColor.distMaxAbs(bColor) == 0);
4895 BOOST_TEST_CHECK(bColor.distHypot( aColor) == 0);
4896 BOOST_TEST_CHECK(bColor.distSumAbs(aColor) == 0);
4897 BOOST_TEST_CHECK(bColor.distMaxAbs(aColor) == 0);
4901 bColor.setToBlack();
4903 BOOST_TEST_CHECK(aColor.distHypot( bColor) == std::sqrt(mjr::colorRGBA8b::maxChanVal*mjr::colorRGBA8b::maxChanVal*3), boost::test_tools::tolerance(0.00001));
4904 BOOST_TEST_CHECK(aColor.distSumAbs(bColor) == mjr::colorRGBA8b::maxChanVal*3);
4905 BOOST_TEST_CHECK(aColor.distMaxAbs(bColor) == mjr::colorRGBA8b::maxChanVal);
4907 BOOST_TEST_CHECK(bColor.distHypot( aColor) == std::sqrt(mjr::colorRGBA8b::maxChanVal*mjr::colorRGBA8b::maxChanVal*3), boost::test_tools::tolerance(0.00001));
4908 BOOST_TEST_CHECK(bColor.distSumAbs(aColor) == mjr::colorRGBA8b::maxChanVal*3);
4909 BOOST_TEST_CHECK(bColor.distMaxAbs(aColor) == mjr::colorRGBA8b::maxChanVal);
4913BOOST_AUTO_TEST_CASE(dist_flt) {
4915 mjr::colorRGBA32F aColor;
4916 mjr::colorRGBA32F bColor;
4919 aColor.setToWhite();
4920 bColor.setToBlack();
4922 BOOST_TEST_CHECK(aColor.distHypot( bColor) == std::sqrt(mjr::colorRGBA32F::maxChanVal*mjr::colorRGBA32F::maxChanVal*4), boost::test_tools::tolerance(0.00001));
4923 BOOST_TEST_CHECK(aColor.distSumAbs(bColor) == mjr::colorRGBA32F::maxChanVal*4);
4924 BOOST_TEST_CHECK(aColor.distMaxAbs(bColor) == mjr::colorRGBA32F::maxChanVal);
4926 BOOST_TEST_CHECK(bColor.distHypot( aColor) == std::sqrt(mjr::colorRGBA32F::maxChanVal*mjr::colorRGBA32F::maxChanVal*4), boost::test_tools::tolerance(0.00001));
4927 BOOST_TEST_CHECK(bColor.distSumAbs(aColor) == mjr::colorRGBA32F::maxChanVal*4);
4928 BOOST_TEST_CHECK(bColor.distMaxAbs(aColor) == mjr::colorRGBA32F::maxChanVal);
4931 aColor.setToWhite();
4932 bColor.setToWhite();
4934 BOOST_TEST_CHECK(aColor.distHypot( bColor) == 0);
4935 BOOST_TEST_CHECK(aColor.distSumAbs(bColor) == 0);
4936 BOOST_TEST_CHECK(aColor.distMaxAbs(bColor) == 0);
4938 BOOST_TEST_CHECK(bColor.distHypot( aColor) == 0);
4939 BOOST_TEST_CHECK(bColor.distSumAbs(aColor) == 0);
4940 BOOST_TEST_CHECK(bColor.distMaxAbs(aColor) == 0);
4944 bColor.setToBlack();
4946 BOOST_TEST_CHECK(aColor.distHypot( bColor) == std::sqrt(mjr::colorRGBA32F::maxChanVal*mjr::colorRGBA32F::maxChanVal*3), boost::test_tools::tolerance(0.00001));
4947 BOOST_TEST_CHECK(aColor.distSumAbs(bColor) == mjr::colorRGBA32F::maxChanVal*3);
4948 BOOST_TEST_CHECK(aColor.distMaxAbs(bColor) == mjr::colorRGBA32F::maxChanVal);
4950 BOOST_TEST_CHECK(bColor.distHypot( aColor) == std::sqrt(mjr::colorRGBA32F::maxChanVal*mjr::colorRGBA32F::maxChanVal*3), boost::test_tools::tolerance(0.00001));
4951 BOOST_TEST_CHECK(bColor.distSumAbs(aColor) == mjr::colorRGBA32F::maxChanVal*3);
4952 BOOST_TEST_CHECK(bColor.distMaxAbs(aColor) == mjr::colorRGBA32F::maxChanVal);
4955 aColor.setChansRGBA(0.5, 0.5, 0.5, 0.5);
4956 bColor.setToBlack();
4958 BOOST_TEST_CHECK(aColor.distHypot( bColor) == std::sqrt(0.5*0.5*4), boost::test_tools::tolerance(0.00001));
4959 BOOST_TEST_CHECK(aColor.distSumAbs(bColor) == 0.5*4);
4960 BOOST_TEST_CHECK(aColor.distMaxAbs(bColor) == 0.5);
4962 BOOST_TEST_CHECK(bColor.distHypot( aColor) == std::sqrt(0.5*0.5*4), boost::test_tools::tolerance(0.00001));
4963 BOOST_TEST_CHECK(bColor.distSumAbs(aColor) == 0.5*4);
4964 BOOST_TEST_CHECK(bColor.distMaxAbs(aColor) == 0.5);
4968BOOST_AUTO_TEST_CASE(lum_int) {
4970 BOOST_TEST_CHECK(mjr::colorRGBA8b( 2, 5, 7, 11).rgb2GreyDotProd(13, 17, 23) == 272);
4971 BOOST_TEST_CHECK(mjr::colorRGBA32F(2, 5, 7, 11).rgb2GreyDotProd(13, 17, 23) == 272);
4973 BOOST_TEST_CHECK(mjr::colorRGBA8b(255, 255, 255, 255).rgb2GreyDotProd(255, 255, 255) == 195075);
4975 BOOST_TEST_CHECK(mjr::colorRGBA8b( 2, 5, 7, 11).luminanceRGB() == 0.0176729411765, boost::test_tools::tolerance(0.00001));
4976 BOOST_TEST_CHECK(mjr::colorRGBA32F(2, 5, 7, 11).luminanceRGB() == 4.5066, boost::test_tools::tolerance(0.00001));
4978 BOOST_TEST_CHECK(mjr::colorRGBA8b( 2, 5, 7, 11).intensityRGB() == 14);
4979 BOOST_TEST_CHECK(mjr::colorRGBA32F(2, 5, 7, 11).intensityRGB() == 14);
4981 BOOST_TEST_CHECK(mjr::colorRGBA8b( 2, 5, 7, 11).intensity() == 25);
4982 BOOST_TEST_CHECK(mjr::colorRGBA32F(2, 5, 7, 11).intensity() == 25);
4984 BOOST_TEST_CHECK(mjr::colorRGBA8b( 2, 5, 7, 11).intensityScaledRGB() == 0.0183006562, boost::test_tools::tolerance(0.00001));
4985 BOOST_TEST_CHECK(mjr::colorRGBA32F(2, 5, 7, 11).intensityScaledRGB() == 4.66666698, boost::test_tools::tolerance(0.00001));
4987 BOOST_TEST_CHECK(mjr::colorRGBA8b( 2, 5, 7, 11).intensityScaled() == 0.0245098039216, boost::test_tools::tolerance(0.00001));
4988 BOOST_TEST_CHECK(mjr::colorRGBA32F(2, 5, 7, 11).intensityScaled() == 6.25, boost::test_tools::tolerance(0.00001));
4992BOOST_AUTO_TEST_CASE(dotProd_getMax_getMin) {
4994 BOOST_TEST_CHECK(mjr::colorRGBA8b(2, 5, 7, 11).dotProd(mjr::colorRGBA8b(13, 17, 23, 27)) == 569);
4995 BOOST_TEST_CHECK(mjr::colorRGBA32F(2, 5, 7, 11).dotProd(mjr::colorRGBA32F(13, 17, 23, 27)) == 569);
4997 BOOST_TEST_CHECK(mjr::colorRGBA8b(255, 255, 255, 255).dotProd(mjr::colorRGBA8b(255, 255, 255, 255)) == 260100);
4999 BOOST_TEST_CHECK(mjr::colorRGBA8b(2, 5, 7, 11).getMaxC() == 11);
5000 BOOST_TEST_CHECK(mjr::colorRGBA8b(2, 5, 7, 11).getMaxRGB() == 7);
5001 BOOST_TEST_CHECK(mjr::colorRGBA32F(2, 5, 7, 11).getMaxC() == 11);
5002 BOOST_TEST_CHECK(mjr::colorRGBA32F(2, 5, 7, 11).getMaxRGB() == 7);
5004 BOOST_TEST_CHECK(mjr::colorRGBA8b(2, 5, 7, 1).getMinC() == 1);
5005 BOOST_TEST_CHECK(mjr::colorRGBA8b(2, 5, 7, 1).getMinRGB() == 2);
5006 BOOST_TEST_CHECK(mjr::colorRGBA32F(2, 5, 7, 1).getMinC() == 1);
5007 BOOST_TEST_CHECK(mjr::colorRGBA32F(2, 5, 7, 1).getMinRGB() == 2);
5009 BOOST_TEST_CHECK(mjr::colorRGB8b(2, 5, 7).getMaxC() == 7);
5010 BOOST_TEST_CHECK(mjr::colorRGB32F(2, 5, 7).getMaxC() == 7);
5012 BOOST_TEST_CHECK(mjr::colorRGB8b(2, 5, 7).getMinC() == 2);
5013 BOOST_TEST_CHECK(mjr::colorRGB32F(2, 5, 7).getMinC() == 2);
5015 mjr::color2c8b aColor; aColor.setC0(5); aColor.setC1(2);
5016 mjr::color2c8b bColor; bColor.setC0(5); bColor.setC1(2);
5018 BOOST_TEST_CHECK(aColor.getMaxC() == 5);
5019 BOOST_TEST_CHECK(bColor.getMaxC() == 5);
5021 BOOST_TEST_CHECK(aColor.getMinC() == 2);
5022 BOOST_TEST_CHECK(bColor.getMinC() == 2);
5024 BOOST_TEST_CHECK(mjr::colorRGBA8b(2).getMaxC() == 2);
5025 BOOST_TEST_CHECK(mjr::colorRGBA32F(2).getMaxC() == 2);
5027 BOOST_TEST_CHECK(mjr::colorRGBA8b(2).getMinC() == 2);
5028 BOOST_TEST_CHECK(mjr::colorRGBA32F(2).getMinC() == 2);
5032BOOST_AUTO_TEST_CASE(WavelengthCM) {
5034 mjr::colorRGBA8b aColor;
5035 mjr::colorRGBA8b bColor;
5037 mjr::colorRGBA32F cColor;
5038 mjr::colorRGBA32F dColor;
5040 aColor.setToBlack();
5041 aColor.setRGBfromWavelengthCM(570);
5042 BOOST_TEST_CHECK(aColor.getRed() == 173);
5043 BOOST_TEST_CHECK(aColor.getGreen() == 189);
5044 BOOST_TEST_CHECK(aColor.getBlue() == 2);
5045 BOOST_TEST_CHECK(aColor.getAlpha() == aColor.minChanVal);
5047 aColor.setToWhite();
5048 aColor.setRGBfromWavelengthCM(570);
5049 BOOST_TEST_CHECK(aColor.getRed() == 173);
5050 BOOST_TEST_CHECK(aColor.getGreen() == 189);
5051 BOOST_TEST_CHECK(aColor.getBlue() == 2);
5052 BOOST_TEST_CHECK(aColor.getAlpha() == aColor.maxChanVal);
5054 aColor.setRGBfromWavelengthCM(571, mjr::colorRGBA8b::cmfInterpolationEnum::FLOOR);
5055 bColor.setRGBfromWavelengthCM(570);
5056 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5057 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5058 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5060 aColor.setRGBfromWavelengthCM(571, mjr::colorRGBA8b::cmfInterpolationEnum::CEILING);
5061 bColor.setRGBfromWavelengthCM(575);
5062 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5063 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5064 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5066 aColor.setRGBfromWavelengthCM(571, mjr::colorRGBA8b::cmfInterpolationEnum::NEAREST);
5067 bColor.setRGBfromWavelengthCM(570);
5068 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5069 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5070 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5072 aColor.setRGBfromWavelengthCM(574, mjr::colorRGBA8b::cmfInterpolationEnum::NEAREST);
5073 bColor.setRGBfromWavelengthCM(575);
5074 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5075 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5076 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5078 aColor.setRGBfromWavelengthCM(572, mjr::colorRGBA8b::cmfInterpolationEnum::LINEAR);
5079 BOOST_TEST_CHECK(aColor.getRed() == 182);
5080 BOOST_TEST_CHECK(aColor.getGreen() == 181);
5081 BOOST_TEST_CHECK(aColor.getBlue() == 0);
5083 aColor.setRGBfromWavelengthCM(572, mjr::colorRGBA8b::cmfInterpolationEnum::BUMP);
5084 BOOST_TEST_CHECK(aColor.getRed() == 167);
5085 BOOST_TEST_CHECK(aColor.getGreen() == 169);
5086 BOOST_TEST_CHECK(aColor.getBlue() == 0);
5090 cColor.setToBlack();
5091 cColor.setRGBfromWavelengthCM(570);
5092 BOOST_TEST_CHECK(cColor.getRed() == 0.679159, boost::test_tools::tolerance(0.00001));
5093 BOOST_TEST_CHECK(cColor.getGreen() == 0.743843, boost::test_tools::tolerance(0.00001));
5094 BOOST_TEST_CHECK(cColor.getBlue() == 0.00798483, boost::test_tools::tolerance(0.00001));
5095 BOOST_TEST_CHECK(cColor.getAlpha() == cColor.minChanVal);
5097 cColor.setToWhite();
5098 cColor.setRGBfromWavelengthCM(570);
5099 BOOST_TEST_CHECK(cColor.getRed() == 0.679159, boost::test_tools::tolerance(0.00001));
5100 BOOST_TEST_CHECK(cColor.getGreen() == 0.743843, boost::test_tools::tolerance(0.00001));
5101 BOOST_TEST_CHECK(cColor.getBlue() == 0.00798483, boost::test_tools::tolerance(0.00001));
5102 BOOST_TEST_CHECK(cColor.getAlpha() == cColor.maxChanVal);
5104 cColor.setRGBfromWavelengthCM(571, mjr::colorRGBA32F::cmfInterpolationEnum::FLOOR);
5105 dColor.setRGBfromWavelengthCM(570);
5106 BOOST_TEST_CHECK(cColor.getRed() == dColor.getRed());
5107 BOOST_TEST_CHECK(cColor.getGreen() == dColor.getGreen());
5108 BOOST_TEST_CHECK(cColor.getBlue() == dColor.getBlue());
5110 cColor.setRGBfromWavelengthCM(571, mjr::colorRGBA32F::cmfInterpolationEnum::CEILING);
5111 dColor.setRGBfromWavelengthCM(575);
5112 BOOST_TEST_CHECK(cColor.getRed() == dColor.getRed());
5113 BOOST_TEST_CHECK(cColor.getGreen() == dColor.getGreen());
5114 BOOST_TEST_CHECK(cColor.getBlue() == dColor.getBlue());
5116 cColor.setRGBfromWavelengthCM(571, mjr::colorRGBA32F::cmfInterpolationEnum::NEAREST);
5117 dColor.setRGBfromWavelengthCM(570);
5118 BOOST_TEST_CHECK(cColor.getRed() == dColor.getRed());
5119 BOOST_TEST_CHECK(cColor.getGreen() == dColor.getGreen());
5120 BOOST_TEST_CHECK(cColor.getBlue() == dColor.getBlue());
5122 cColor.setRGBfromWavelengthCM(574, mjr::colorRGBA32F::cmfInterpolationEnum::NEAREST);
5123 dColor.setRGBfromWavelengthCM(575);
5124 BOOST_TEST_CHECK(cColor.getRed() == dColor.getRed());
5125 BOOST_TEST_CHECK(cColor.getGreen() == dColor.getGreen());
5126 BOOST_TEST_CHECK(cColor.getBlue() == dColor.getBlue());
5128 cColor.setRGBfromWavelengthCM(572, mjr::colorRGBA32F::cmfInterpolationEnum::LINEAR);
5129 BOOST_TEST_CHECK(cColor.getRed() == 0.713749886, boost::test_tools::tolerance(0.00001));
5130 BOOST_TEST_CHECK(cColor.getGreen() == 0.710754037, boost::test_tools::tolerance(0.00001));
5131 BOOST_TEST_CHECK(cColor.getBlue() == 0.00187643478, boost::test_tools::tolerance(0.00001));
5133 cColor.setRGBfromWavelengthCM(572, mjr::colorRGBA32F::cmfInterpolationEnum::BUMP);
5134 BOOST_TEST_CHECK(cColor.getRed() == 0.654946387, boost::test_tools::tolerance(0.00001));
5135 BOOST_TEST_CHECK(cColor.getGreen() == 0.662842572, boost::test_tools::tolerance(0.00001));
5136 BOOST_TEST_CHECK(cColor.getBlue() == 3.4287558e-07, boost::test_tools::tolerance(0.00001));
5141BOOST_AUTO_TEST_CASE(WavelengthLA) {
5143 mjr::colorRGBA8b aColor;
5144 mjr::colorRGBA8b bColor;
5146 mjr::colorRGBA32F cColor;
5147 mjr::colorRGBA32F dColor;
5149 aColor.setToBlack();
5150 aColor.setRGBfromWavelengthLA(570);
5151 BOOST_TEST_CHECK(aColor.getRed() == 0xda);
5152 BOOST_TEST_CHECK(aColor.getGreen() == 0xff);
5153 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
5154 BOOST_TEST_CHECK(aColor.getAlpha() == aColor.minChanVal);
5156 aColor.setToWhite();
5157 aColor.setRGBfromWavelengthLA(570);
5158 BOOST_TEST_CHECK(aColor.getRed() == 0xda);
5159 BOOST_TEST_CHECK(aColor.getGreen() == 0xff);
5160 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
5161 BOOST_TEST_CHECK(aColor.getAlpha() == aColor.maxChanVal);
5165 cColor.setToBlack();
5166 cColor.setRGBfromWavelengthLA(570);
5167 BOOST_TEST_CHECK(cColor.getRed() == 0.857142866, boost::test_tools::tolerance(0.00001));
5168 BOOST_TEST_CHECK(cColor.getGreen() == 1.000000000, boost::test_tools::tolerance(0.00001));
5169 BOOST_TEST_CHECK(cColor.getBlue() == 0.000000000, boost::test_tools::tolerance(0.00001));
5170 BOOST_TEST_CHECK(cColor.getAlpha() == cColor.minChanVal);
5172 cColor.setToWhite();
5173 cColor.setRGBfromWavelengthLA(570);
5174 BOOST_TEST_CHECK(cColor.getRed() == 0.857142866, boost::test_tools::tolerance(0.00001));
5175 BOOST_TEST_CHECK(cColor.getGreen() == 1.000000000, boost::test_tools::tolerance(0.00001));
5176 BOOST_TEST_CHECK(cColor.getBlue() == 0.000000000, boost::test_tools::tolerance(0.00001));
5177 BOOST_TEST_CHECK(cColor.getAlpha() == cColor.maxChanVal);
5181#if !(MISSING_P1907R1)
5183BOOST_AUTO_TEST_CASE(csCubeHelix_tpl, * boost::unit_test::tolerance(0.01)) {
5185 BOOST_TEST_CHECK(mjr::color3c64F::csCHstd::c(0.25).getC0() == 0.085);
5186 BOOST_TEST_CHECK(mjr::color3c64F::csCHstd::c(0.25).getC1() == 0.325);
5187 BOOST_TEST_CHECK(mjr::color3c64F::csCHstd::c(0.25).getC2() == 0.298);
5189 BOOST_TEST_CHECK(mjr::color3c64F::csCHstd::c(0.50).getC0() == 0.628);
5190 BOOST_TEST_CHECK(mjr::color3c64F::csCHstd::c(0.50).getC1() == 0.475);
5191 BOOST_TEST_CHECK(mjr::color3c64F::csCHstd::c(0.50).getC2() == 0.286);
5193 BOOST_TEST_CHECK(mjr::color3c64F::csCHstd::c(0.75).getC0() == 0.780);
5194 BOOST_TEST_CHECK(mjr::color3c64F::csCHstd::c(0.75).getC1() == 0.702);
5195 BOOST_TEST_CHECK(mjr::color3c64F::csCHstd::c(0.75).getC2() == 0.929);
5198 BOOST_TEST_CHECK(mjr::color3c64F::csCHblu::c(0.25).getC0() == 0.280);
5199 BOOST_TEST_CHECK(mjr::color3c64F::csCHblu::c(0.25).getC1() == 0.202);
5200 BOOST_TEST_CHECK(mjr::color3c64F::csCHblu::c(0.25).getC2() == 0.429);
5202 BOOST_TEST_CHECK(mjr::color3c64F::csCHblu::c(0.50).getC0() == 0.372);
5203 BOOST_TEST_CHECK(mjr::color3c64F::csCHblu::c(0.50).getC1() == 0.525);
5204 BOOST_TEST_CHECK(mjr::color3c64F::csCHblu::c(0.50).getC2() == 0.714);
5206 BOOST_TEST_CHECK(mjr::color3c64F::csCHblu::c(0.75).getC0() == 0.585);
5207 BOOST_TEST_CHECK(mjr::color3c64F::csCHblu::c(0.75).getC1() == 0.825);
5208 BOOST_TEST_CHECK(mjr::color3c64F::csCHblu::c(0.75).getC2() == 0.798);
5211 BOOST_TEST_CHECK(mjr::color3c64F::csCHvio::c(0.25).getC0() == 0.388);
5212 BOOST_TEST_CHECK(mjr::color3c64F::csCHvio::c(0.25).getC1() == 0.163);
5213 BOOST_TEST_CHECK(mjr::color3c64F::csCHvio::c(0.25).getC2() == 0.342);
5215 BOOST_TEST_CHECK(mjr::color3c64F::csCHvio::c(0.50).getC0() == 0.684);
5216 BOOST_TEST_CHECK(mjr::color3c64F::csCHvio::c(0.50).getC1() == 0.384);
5217 BOOST_TEST_CHECK(mjr::color3c64F::csCHvio::c(0.50).getC2() == 0.623);
5219 BOOST_TEST_CHECK(mjr::color3c64F::csCHvio::c(0.75).getC0() == 0.888);
5220 BOOST_TEST_CHECK(mjr::color3c64F::csCHvio::c(0.75).getC1() == 0.663);
5221 BOOST_TEST_CHECK(mjr::color3c64F::csCHvio::c(0.75).getC2() == 0.842);
5223 typedef mjr::colorTpl<double, 3, 2, 1, 0> permcolor3c64F;
5225 BOOST_TEST_CHECK(permcolor3c64F::csCHstd::c(0.25).getC2() == 0.085);
5226 BOOST_TEST_CHECK(permcolor3c64F::csCHstd::c(0.25).getC1() == 0.325);
5227 BOOST_TEST_CHECK(permcolor3c64F::csCHstd::c(0.25).getC0() == 0.298);
5233BOOST_AUTO_TEST_CASE(tfrm_misc) {
5235 mjr::colorRGB8b aColor;
5236 mjr::colorRGB8b bColor;
5237 mjr::colorRGB8b dColor;
5238 mjr::colorRGB8b cColor;
5240 aColor.setRGBfromLogPackIntARGB(0xFF00FF);
5241 bColor.setRGBfromLogPackIntARGB(0x00FFFF);
5242 dColor.setRGBfromLogPackIntARGB(0x0100FF);
5245 cColor.setToBlack();
5246 cColor.tfrmCopy(aColor);
5247 BOOST_TEST_CHECK(cColor.getC0() == 0xFF);
5248 BOOST_TEST_CHECK(cColor.getC1() == 0x00);
5249 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
5252 cColor.tfrmMaxI(bColor);
5253 BOOST_TEST_CHECK(cColor.getC0() == 0xFF);
5254 BOOST_TEST_CHECK(cColor.getC1() == 0x00);
5255 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
5258 cColor.tfrmMinI(bColor);
5259 BOOST_TEST_CHECK(cColor.getC0() == 0xFF);
5260 BOOST_TEST_CHECK(cColor.getC1() == 0x00);
5261 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
5264 cColor.tfrmMaxI(aColor);
5265 BOOST_TEST_CHECK(cColor.getC0() == 0xFF);
5266 BOOST_TEST_CHECK(cColor.getC1() == 0x00);
5267 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
5270 cColor.tfrmMaxI(aColor);
5271 BOOST_TEST_CHECK(cColor.getC0() == 0xFF);
5272 BOOST_TEST_CHECK(cColor.getC1() == 0x00);
5273 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
5276 cColor.tfrmMax(bColor);
5277 BOOST_TEST_CHECK(cColor.getC0() == 0xFF);
5278 BOOST_TEST_CHECK(cColor.getC1() == 0xFF);
5279 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
5282 cColor.tfrmMin(bColor);
5283 BOOST_TEST_CHECK(cColor.getC0() == 0x00);
5284 BOOST_TEST_CHECK(cColor.getC1() == 0x00);
5285 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
5288 cColor.tfrmSaw(mjr::colorRGB8b().setRGBfromLogPackIntARGB(0x00000100), mjr::colorRGB8b().setRGBfromLogPackIntARGB(0x00FFFFFF));
5289 BOOST_TEST_CHECK(cColor.getC0() == 0x01);
5290 BOOST_TEST_CHECK(cColor.getC1() == 0x00);
5291 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
5294 cColor.tfrmStep(mjr::colorRGB8b().setRGBfromLogPackIntARGB(0x00000100), mjr::colorRGB8b().setRGBfromLogPackIntARGB(0x00FFFFFF));
5295 BOOST_TEST_CHECK(cColor.getC0() == 0xFF);
5296 BOOST_TEST_CHECK(cColor.getC1() == 0x00);
5297 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
5300 cColor.tfrmDirac(bColor);
5301 BOOST_TEST_CHECK(cColor.getC0() == 0x00);
5302 BOOST_TEST_CHECK(cColor.getC1() == 0x00);
5303 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
5306 cColor.tfrmDiracTot(bColor);
5307 BOOST_TEST_CHECK(cColor.getC0() == 0x00);
5308 BOOST_TEST_CHECK(cColor.getC1() == 0x00);
5309 BOOST_TEST_CHECK(cColor.getC2() == 0x00);
5312 cColor.tfrmDiracTot(aColor);
5313 BOOST_TEST_CHECK(cColor.getC0() == 0xFF);
5314 BOOST_TEST_CHECK(cColor.getC1() == 0xFF);
5315 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
5318 cColor.tfrmFuzzyDirac(mjr::colorRGB8b().setRGBfromLogPackIntARGB(0x00FE01F0), mjr::colorRGB8b().setRGBfromLogPackIntARGB(0x00010101));
5319 BOOST_TEST_CHECK(cColor.getC0() == 0xFF);
5320 BOOST_TEST_CHECK(cColor.getC1() == 0xFF);
5321 BOOST_TEST_CHECK(cColor.getC2() == 0x00);
5324 cColor.tfrmMean(bColor);
5325 BOOST_TEST_CHECK(cColor.getC0() == 0x7f);
5326 BOOST_TEST_CHECK(cColor.getC1() == 0x7f);
5327 BOOST_TEST_CHECK(cColor.getC2() == 0xFF);
5330 cColor.tfrmGmean(mjr::colorRGB8b().setRGBfromLogPackIntARGB(0x00030102));
5331 BOOST_TEST_CHECK(cColor.getC0() == 0x01);
5332 BOOST_TEST_CHECK(cColor.getC1() == 0x00);
5333 BOOST_TEST_CHECK(cColor.getC2() == 0x16);
5336 cColor.tfrmGreyScaleRGB();
5337 BOOST_TEST_CHECK(cColor.getC0() == 0x48);
5338 BOOST_TEST_CHECK(cColor.getC1() == 0x48);
5339 BOOST_TEST_CHECK(cColor.getC2() == 0x48);
5342 cColor.tfrmGreyScaleRGB();
5343 BOOST_TEST_CHECK(cColor.getC0() == 0xC8);
5344 BOOST_TEST_CHECK(cColor.getC1() == 0xC8);
5345 BOOST_TEST_CHECK(cColor.getC2() == 0xC8);
5350BOOST_AUTO_TEST_CASE(tfrm_misc_FLT, * boost::unit_test::tolerance(0.00001)) {
5352 mjr::colorRGB32F aColor;
5353 mjr::colorRGB32F bColor;
5354 mjr::colorRGB32F dColor;
5355 mjr::colorRGB32F cColor;
5357 aColor.setChansRGB(2.0, 0.0, 2.0);
5358 bColor.setChansRGB(0.0, 2.0, 2.0);
5359 dColor.setChansRGB(0.0, 1.0, 2.0);
5361 cColor.setToBlack();
5362 cColor.tfrmCopy(aColor);
5363 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
5364 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
5365 BOOST_TEST_CHECK(cColor.getC2() == 2.0);
5368 cColor.tfrmMaxI(bColor);
5369 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
5370 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
5371 BOOST_TEST_CHECK(cColor.getC2() == 2.0);
5374 cColor.tfrmMinI(bColor);
5375 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
5376 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
5377 BOOST_TEST_CHECK(cColor.getC2() == 2.0);
5380 cColor.tfrmMaxI(aColor);
5381 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
5382 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
5383 BOOST_TEST_CHECK(cColor.getC2() == 2.0);
5386 cColor.tfrmMaxI(aColor);
5387 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
5388 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
5389 BOOST_TEST_CHECK(cColor.getC2() == 2.0);
5392 cColor.tfrmMax(bColor);
5393 BOOST_TEST_CHECK(cColor.getC0() == 2.0);
5394 BOOST_TEST_CHECK(cColor.getC1() == 2.0);
5395 BOOST_TEST_CHECK(cColor.getC2() == 2.0);
5398 cColor.tfrmMin(bColor);
5399 BOOST_TEST_CHECK(cColor.getC0() == 0.0);
5400 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
5401 BOOST_TEST_CHECK(cColor.getC2() == 2.0);
5416 cColor.tfrmDirac(bColor);
5417 BOOST_TEST_CHECK(cColor.getC0() == 0.0);
5418 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
5419 BOOST_TEST_CHECK(cColor.getC2() == 1.0);
5422 cColor.tfrmDiracTot(bColor);
5423 BOOST_TEST_CHECK(cColor.getC0() == 0.0);
5424 BOOST_TEST_CHECK(cColor.getC1() == 0.0);
5425 BOOST_TEST_CHECK(cColor.getC2() == 0.0);
5428 cColor.tfrmDiracTot(aColor);
5429 BOOST_TEST_CHECK(cColor.getC0() == 1.0);
5430 BOOST_TEST_CHECK(cColor.getC1() == 1.0);
5431 BOOST_TEST_CHECK(cColor.getC2() == 1.0);
5440 cColor.tfrmMean(bColor);
5441 BOOST_TEST_CHECK(cColor.getC0() == 1.0);
5442 BOOST_TEST_CHECK(cColor.getC1() == 1.0);
5443 BOOST_TEST_CHECK(cColor.getC2() == 2.0);
5446 cColor.tfrmGmean(mjr::colorRGB32F().setChansRGB(8.0, 25.0, 2.0));
5447 BOOST_TEST_CHECK(cColor.getC0() == 0.0);
5448 BOOST_TEST_CHECK(cColor.getC1() == 5.0);
5449 BOOST_TEST_CHECK(cColor.getC2() == 2.0);
5452 cColor.tfrmGreyScaleRGB();
5453 BOOST_TEST_CHECK(cColor.getC0() == 0.569599986);
5454 BOOST_TEST_CHECK(cColor.getC1() == 0.569599986);
5455 BOOST_TEST_CHECK(cColor.getC2() == 0.569599986);
5458 cColor.tfrmGreyScaleRGB();
5459 BOOST_TEST_CHECK(cColor.getC0() == 1.57480001);
5460 BOOST_TEST_CHECK(cColor.getC1() == 1.57480001);
5461 BOOST_TEST_CHECK(cColor.getC2() == 1.57480001);
5466BOOST_AUTO_TEST_CASE(tfrm_websafe) {
5468 mjr::colorRGB8b aColor;
5469 mjr::colorRGB8b bColor;
5470 mjr::colorRGB32F cColor;
5471 mjr::colorRGBA8b dColor;
5473 aColor.setChansRGB(0x00, 0x33, 0x66);
5474 bColor.setChansRGB(0x00, 0x33, 0x66);
5475 aColor.tfrmWebSafeRGB();
5476 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5477 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5478 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5480 aColor.setChansRGB(0x99, 0xCC, 0xFF);
5481 bColor.setChansRGB(0x99, 0xCC, 0xFF);
5482 aColor.tfrmWebSafeRGB();
5483 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5484 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5485 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5487 aColor.setChansRGB(0x01, 0x34, 0x67);
5488 bColor.setChansRGB(0x00, 0x33, 0x66);
5489 aColor.tfrmWebSafeRGB();
5490 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5491 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5492 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5494 aColor.setChansRGB(0x98, 0xCB, 0xFE);
5495 bColor.setChansRGB(0x99, 0xCC, 0xFF);
5496 aColor.tfrmWebSafeRGB();
5497 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5498 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5499 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5501 cColor.setChansRGB(0.05F, 0.15F, 0.35F);
5502 cColor.tfrmWebSafeRGB();
5503 BOOST_TEST_CHECK(cColor.getRed() == 0.0, boost::test_tools::tolerance(0.0001));
5504 BOOST_TEST_CHECK(cColor.getGreen() == 0.2, boost::test_tools::tolerance(0.0001));
5505 BOOST_TEST_CHECK(cColor.getBlue() == 0.4, boost::test_tools::tolerance(0.0001));
5507 cColor.setChansRGB(0.55F, 0.75F, 0.95F);
5508 cColor.tfrmWebSafeRGB();
5509 BOOST_TEST_CHECK(cColor.getRed() == 0.6, boost::test_tools::tolerance(0.0001));
5510 BOOST_TEST_CHECK(cColor.getGreen() == 0.8, boost::test_tools::tolerance(0.0001));
5511 BOOST_TEST_CHECK(cColor.getBlue() == 1.0, boost::test_tools::tolerance(0.0001));
5513 dColor.setChans(0xCB);
5514 dColor.tfrmWebSafeRGB();
5515 BOOST_TEST_CHECK(dColor.getRed() == 0xCC);
5516 BOOST_TEST_CHECK(dColor.getGreen() == 0xCC);
5517 BOOST_TEST_CHECK(dColor.getBlue() == 0xCC);
5518 BOOST_TEST_CHECK(dColor.getAlpha() == 0xCB);
5522BOOST_AUTO_TEST_CASE(tfrm_PowPow_int) {
5524 mjr::colorRGB8b aColor;
5525 mjr::colorRGBA8b bColor;
5527 aColor.setChansRGB(0, 50, 100);
5529 BOOST_TEST_CHECK(aColor.getRed() == 0);
5530 BOOST_TEST_CHECK(aColor.getGreen() == 3);
5531 BOOST_TEST_CHECK(aColor.getBlue() == 4);
5533 aColor.setChansRGB(0, 50, 100);
5534 aColor.tfrmStdPowSqr();
5535 BOOST_TEST_CHECK(aColor.getRed() == 0);
5536 BOOST_TEST_CHECK(aColor.getGreen() == 9);
5537 BOOST_TEST_CHECK(aColor.getBlue() == 39);
5539 aColor.setChansRGB(0, 50, 100);
5540 aColor.tfrmStdPowSqrt();
5541 BOOST_TEST_CHECK(aColor.getRed() == 0);
5542 BOOST_TEST_CHECK(aColor.getGreen() == 112);
5543 BOOST_TEST_CHECK(aColor.getBlue() == 159);
5545 aColor.setChansRGB(0, 50, 100);
5546 aColor.tfrmStdPow(2.0);
5547 BOOST_TEST_CHECK(aColor.getRed() == 0);
5548 BOOST_TEST_CHECK(aColor.getGreen() == 9);
5549 BOOST_TEST_CHECK(aColor.getBlue() == 39);
5551 aColor.setChansRGB(0, 50, 100);
5552 aColor.tfrmStdPow(0.5);
5553 BOOST_TEST_CHECK(aColor.getRed() == 0);
5554 BOOST_TEST_CHECK(aColor.getGreen() == 112);
5555 BOOST_TEST_CHECK(aColor.getBlue() == 159);
5557 aColor.setChansRGB(0, 50, 100);
5558 aColor.tfrmStdPowRGB(1, 2.0, 0.5);
5559 BOOST_TEST_CHECK(aColor.getRed() == 0);
5560 BOOST_TEST_CHECK(aColor.getGreen() == 9);
5561 BOOST_TEST_CHECK(aColor.getBlue() == 159);
5563 bColor.setToWhite();
5564 bColor.setChansRGB(0, 50, 100);
5565 bColor.tfrmStdPowRGB(1, 2.0, 0.5);
5566 BOOST_TEST_CHECK(bColor.getRed() == 0);
5567 BOOST_TEST_CHECK(bColor.getGreen() == 9);
5568 BOOST_TEST_CHECK(bColor.getBlue() == 159);
5569 BOOST_TEST_CHECK(bColor.getAlpha() == 0xff);
5571 bColor.setToBlack();
5572 bColor.setChansRGB(0, 50, 100);
5573 bColor.tfrmStdPowRGB(1, 2.0, 0.5);
5574 BOOST_TEST_CHECK(bColor.getRed() == 0);
5575 BOOST_TEST_CHECK(bColor.getGreen() == 9);
5576 BOOST_TEST_CHECK(bColor.getBlue() == 159);
5577 BOOST_TEST_CHECK(bColor.getAlpha() == 0x00);
5581BOOST_AUTO_TEST_CASE(tfrm_PowPow_flt, * boost::unit_test::tolerance(0.00001)) {
5583 mjr::colorRGB32F aColor;
5585 aColor.setChansRGB(0, 50, 100);
5587 BOOST_TEST_CHECK(aColor.getRed() == 0);
5588 BOOST_TEST_CHECK(aColor.getGreen() == 3.93182563272);
5589 BOOST_TEST_CHECK(aColor.getBlue() == 4.61512051684);
5591 aColor.setChansRGB(0, 50, 100);
5592 aColor.tfrmStdPowSqr();
5593 BOOST_TEST_CHECK(aColor.getRed() == 0);
5594 BOOST_TEST_CHECK(aColor.getGreen() == 2500);
5595 BOOST_TEST_CHECK(aColor.getBlue() == 10000);
5597 aColor.setChansRGB(0, 50, 100);
5598 aColor.tfrmStdPowSqrt();
5599 BOOST_TEST_CHECK(aColor.getRed() == 0);
5600 BOOST_TEST_CHECK(aColor.getGreen() == 7.07106781);
5601 BOOST_TEST_CHECK(aColor.getBlue() == 10);
5603 aColor.setChansRGB(0, 50, 100);
5604 aColor.tfrmStdPow(2.0);
5605 BOOST_TEST_CHECK(aColor.getRed() == 0);
5606 BOOST_TEST_CHECK(aColor.getGreen() == 2500);
5607 BOOST_TEST_CHECK(aColor.getBlue() == 10000);
5609 aColor.setChansRGB(0, 50, 100);
5610 aColor.tfrmStdPow(0.5);
5611 BOOST_TEST_CHECK(aColor.getRed() == 0);
5612 BOOST_TEST_CHECK(aColor.getGreen() == 7.07106781);
5613 BOOST_TEST_CHECK(aColor.getBlue() == 10);
5615 aColor.setChansRGB(0, 50, 100);
5616 aColor.tfrmStdPowRGB(1, 2.0, 0.5);
5617 BOOST_TEST_CHECK(aColor.getRed() == 0);
5618 BOOST_TEST_CHECK(aColor.getGreen() == 2500);
5619 BOOST_TEST_CHECK(aColor.getBlue() == 10);
5623BOOST_AUTO_TEST_CASE(tfrm_GryLevScl_int) {
5625 mjr::colorRGB8b aColor;
5626 mjr::colorRGBA8b cColor;
5628 aColor.setChansRGB(10, 20, 25);
5629 aColor.tfrmLinearGreyLevelScale(2, 4);
5630 BOOST_TEST_CHECK(aColor.getRed() == 24);
5631 BOOST_TEST_CHECK(aColor.getGreen() == 44);
5632 BOOST_TEST_CHECK(aColor.getBlue() == 54);
5634 aColor.setChansRGB(10, 20, 25);
5635 aColor.tfrmLinearGreyLevelScale(2.5, 4);
5636 BOOST_TEST_CHECK(aColor.getRed() == 29);
5637 BOOST_TEST_CHECK(aColor.getGreen() == 54);
5638 BOOST_TEST_CHECK(aColor.getBlue() == 66);
5640 aColor.setChansRGB(10, 20, 25);
5641 aColor.tfrmLinearGreyLevelScaleRGB(2, 4, 2.5, 4, 3, 2);
5642 BOOST_TEST_CHECK(aColor.getRed() == 24);
5643 BOOST_TEST_CHECK(aColor.getGreen() == 54);
5644 BOOST_TEST_CHECK(aColor.getBlue() == 77);
5646 cColor.setToWhite();
5647 cColor.setChansRGB(10, 20, 25);
5648 cColor.tfrmLinearGreyLevelScaleRGB(2, 4, 2.5, 4, 3, 2);
5649 BOOST_TEST_CHECK(cColor.getRed() == 24);
5650 BOOST_TEST_CHECK(cColor.getGreen() == 54);
5651 BOOST_TEST_CHECK(cColor.getBlue() == 77);
5652 BOOST_TEST_CHECK(cColor.getAlpha() == 0xff);
5654 cColor.setToBlack();
5655 cColor.setChansRGB(10, 20, 25);
5656 cColor.tfrmLinearGreyLevelScaleRGB(2, 4, 2.5, 4, 3, 2);
5657 BOOST_TEST_CHECK(cColor.getRed() == 24);
5658 BOOST_TEST_CHECK(cColor.getGreen() == 54);
5659 BOOST_TEST_CHECK(cColor.getBlue() == 77);
5660 BOOST_TEST_CHECK(cColor.getAlpha() == 0x00);
5664BOOST_AUTO_TEST_CASE(tfrm_GryLevSclflt, * boost::unit_test::tolerance(0.00001)) {
5666 mjr::colorRGB32F aColor;
5667 mjr::colorRGBA32F cColor;
5669 aColor.setChansRGB(10, 20, 25);
5670 aColor.tfrmLinearGreyLevelScale(2, 4);
5671 BOOST_TEST_CHECK(aColor.getRed() == 24.0);
5672 BOOST_TEST_CHECK(aColor.getGreen() == 44.0);
5673 BOOST_TEST_CHECK(aColor.getBlue() == 54.0);
5675 aColor.setChansRGB(10, 20, 25);
5676 aColor.tfrmLinearGreyLevelScale(2.5, 4);
5677 BOOST_TEST_CHECK(aColor.getRed() == 29.0);
5678 BOOST_TEST_CHECK(aColor.getGreen() == 54.0);
5679 BOOST_TEST_CHECK(aColor.getBlue() == 66.5);
5681 aColor.setChansRGB(10, 20, 25);
5682 aColor.tfrmLinearGreyLevelScaleRGB(2, 4, 2.5, 4, 3, 2);
5683 BOOST_TEST_CHECK(aColor.getRed() == 24.0);
5684 BOOST_TEST_CHECK(aColor.getGreen() == 54.0);
5685 BOOST_TEST_CHECK(aColor.getBlue() == 77.0);
5687 cColor.setToWhite();
5688 cColor.setChansRGB(10, 20, 25);
5689 cColor.tfrmLinearGreyLevelScaleRGB(2, 4, 2.5, 4, 3, 2);
5690 BOOST_TEST_CHECK(cColor.getRed() == 24.0);
5691 BOOST_TEST_CHECK(cColor.getGreen() == 54.0);
5692 BOOST_TEST_CHECK(cColor.getBlue() == 77.0);
5693 BOOST_TEST_CHECK(cColor.getAlpha() == 1.0);
5695 cColor.setToBlack();
5696 cColor.setChansRGB(10, 20, 25);
5697 cColor.tfrmLinearGreyLevelScaleRGB(2, 4, 2.5, 4, 3, 2);
5698 BOOST_TEST_CHECK(cColor.getRed() == 24.0);
5699 BOOST_TEST_CHECK(cColor.getGreen() == 54.0);
5700 BOOST_TEST_CHECK(cColor.getBlue() == 77.0);
5701 BOOST_TEST_CHECK(cColor.getAlpha() == 0.0);
5705BOOST_AUTO_TEST_CASE(wmean, * boost::unit_test::tolerance(0.01)) {
5707 mjr::colorRGBA8b a1Color(10, 20, 30, 40);
5708 mjr::colorRGBA8b a2Color(10, 30, 20, 40);
5709 mjr::colorRGBA8b a3Color(40, 20, 30, 10);
5710 mjr::colorRGBA8b a4Color(90, 70, 10, 20);
5712 mjr::colorRGBA8b aColor;
5713 mjr::colorRGBA8b cColor;
5715 mjr::colorRGBA32F b1Color(10, 20, 30, 40);
5716 mjr::colorRGBA32F b2Color(10, 30, 20, 40);
5717 mjr::colorRGBA32F b3Color(40, 20, 30, 10);
5718 mjr::colorRGBA32F b4Color(90, 70, 10, 20);
5720 mjr::colorRGBA32F bColor;
5724 aColor.wMean(1.0F, 1.0F, a1Color, a2Color);
5725 BOOST_TEST_CHECK(aColor.getC0() == 20);
5726 BOOST_TEST_CHECK(aColor.getC1() == 50);
5727 BOOST_TEST_CHECK(aColor.getC2() == 50);
5728 BOOST_TEST_CHECK(aColor.getC3() == 80);
5730 aColor.wMean(1.0F, 1.0F, 1.0F, a1Color, a2Color, a3Color);
5731 BOOST_TEST_CHECK(aColor.getC0() == 60);
5732 BOOST_TEST_CHECK(aColor.getC1() == 70);
5733 BOOST_TEST_CHECK(aColor.getC2() == 80);
5734 BOOST_TEST_CHECK(aColor.getC3() == 90);
5736 aColor.wMean(1.0F, 1.0F, 1.0F, 1.0F, a1Color, a2Color, a3Color, a4Color);
5737 BOOST_TEST_CHECK(aColor.getC0() == 150);
5738 BOOST_TEST_CHECK(aColor.getC1() == 140);
5739 BOOST_TEST_CHECK(aColor.getC2() == 90);
5740 BOOST_TEST_CHECK(aColor.getC3() == 110);
5742 aColor.wMean(0.1F, 1.0F, a1Color, a2Color);
5743 BOOST_TEST_CHECK(aColor.getC0() == 11);
5744 BOOST_TEST_CHECK(aColor.getC1() == 32);
5745 BOOST_TEST_CHECK(aColor.getC2() == 23);
5746 BOOST_TEST_CHECK(aColor.getC3() == 44);
5748 aColor.wMean(0.1F, 1.0F, 1.0F, a1Color, a2Color, a3Color);
5749 BOOST_TEST_CHECK(aColor.getC0() == 51);
5750 BOOST_TEST_CHECK(aColor.getC1() == 52);
5751 BOOST_TEST_CHECK(aColor.getC2() == 53);
5752 BOOST_TEST_CHECK(aColor.getC3() == 54);
5754 aColor.wMean(0.1F, 1.0F, 1.0F, 1.0F, a1Color, a2Color, a3Color, a4Color);
5755 BOOST_TEST_CHECK(aColor.getC0() == 141);
5756 BOOST_TEST_CHECK(aColor.getC1() == 122);
5757 BOOST_TEST_CHECK(aColor.getC2() == 63);
5758 BOOST_TEST_CHECK(aColor.getC3() == 74);
5762 bColor.wMean(1.0F, 1.0F, b1Color, b2Color);
5763 BOOST_TEST_CHECK(bColor.getC0() == 20);
5764 BOOST_TEST_CHECK(bColor.getC1() == 50);
5765 BOOST_TEST_CHECK(bColor.getC2() == 50);
5766 BOOST_TEST_CHECK(bColor.getC3() == 80);
5768 bColor.wMean(1.0F, 1.0F, 1.0F, b1Color, b2Color, b3Color);
5769 BOOST_TEST_CHECK(bColor.getC0() == 60);
5770 BOOST_TEST_CHECK(bColor.getC1() == 70);
5771 BOOST_TEST_CHECK(bColor.getC2() == 80);
5772 BOOST_TEST_CHECK(bColor.getC3() == 90);
5774 bColor.wMean(1.0F, 1.0F, 1.0F, 1.0F, b1Color, b2Color, b3Color, b4Color);
5775 BOOST_TEST_CHECK(bColor.getC0() == 150);
5776 BOOST_TEST_CHECK(bColor.getC1() == 140);
5777 BOOST_TEST_CHECK(bColor.getC2() == 90);
5778 BOOST_TEST_CHECK(bColor.getC3() == 110);
5780 bColor.wMean(0.1F, 1.0F, b1Color, b2Color);
5781 BOOST_TEST_CHECK(bColor.getC0() == 11);
5782 BOOST_TEST_CHECK(bColor.getC1() == 32);
5783 BOOST_TEST_CHECK(bColor.getC2() == 23);
5784 BOOST_TEST_CHECK(bColor.getC3() == 44);
5786 bColor.wMean(0.1F, 1.0F, 1.0F, b1Color, b2Color, b3Color);
5787 BOOST_TEST_CHECK(bColor.getC0() == 51);
5788 BOOST_TEST_CHECK(bColor.getC1() == 52);
5789 BOOST_TEST_CHECK(bColor.getC2() == 53);
5790 BOOST_TEST_CHECK(bColor.getC3() == 54);
5792 bColor.wMean(0.1F, 1.0F, 1.0F, 1.0F, b1Color, b2Color, b3Color, b4Color);
5793 BOOST_TEST_CHECK(bColor.getC0() == 141);
5794 BOOST_TEST_CHECK(bColor.getC1() == 122);
5795 BOOST_TEST_CHECK(bColor.getC2() == 63);
5796 BOOST_TEST_CHECK(bColor.getC3() == 74);
5801 aColor.linearInterpolate(0.0, a1Color, a2Color);
5802 BOOST_TEST_CHECK(aColor.getC0() == a1Color.getC0());
5803 BOOST_TEST_CHECK(aColor.getC1() == a1Color.getC1());
5804 BOOST_TEST_CHECK(aColor.getC2() == a1Color.getC2());
5805 BOOST_TEST_CHECK(aColor.getC3() == a1Color.getC3());
5807 aColor.linearInterpolate(1.0, a1Color, a2Color);
5808 BOOST_TEST_CHECK(aColor.getC0() == a2Color.getC0());
5809 BOOST_TEST_CHECK(aColor.getC1() == a2Color.getC1());
5810 BOOST_TEST_CHECK(aColor.getC2() == a2Color.getC2());
5811 BOOST_TEST_CHECK(aColor.getC3() == a2Color.getC3());
5813 aColor.linearInterpolate(0.5, a1Color, a2Color);
5814 cColor.uMean(0.5F, a1Color, a2Color);
5815 BOOST_TEST_CHECK(aColor.getC0() == cColor.getC0());
5816 BOOST_TEST_CHECK(aColor.getC1() == cColor.getC1());
5817 BOOST_TEST_CHECK(aColor.getC2() == cColor.getC2());
5818 BOOST_TEST_CHECK(aColor.getC3() == cColor.getC3());
5820 aColor.linearInterpolate(0.25, a1Color, a2Color);
5821 cColor.uMean(0.75F, a1Color, a2Color);
5822 BOOST_TEST_CHECK(aColor.getC0() == cColor.getC0());
5823 BOOST_TEST_CHECK(aColor.getC1() == cColor.getC1());
5824 BOOST_TEST_CHECK(aColor.getC2() == cColor.getC2());
5825 BOOST_TEST_CHECK(aColor.getC3() == cColor.getC3());
5827 aColor.linearInterpolate(0.75, a1Color, a2Color);
5828 cColor.uMean(0.25F, a1Color, a2Color);
5829 BOOST_TEST_CHECK(aColor.getC0() == cColor.getC0());
5830 BOOST_TEST_CHECK(aColor.getC1() == cColor.getC1());
5831 BOOST_TEST_CHECK(aColor.getC2() == cColor.getC2());
5832 BOOST_TEST_CHECK(aColor.getC3() == cColor.getC3());
5835 aColor.uMean(0.2F, a1Color, a2Color);
5836 BOOST_TEST_CHECK(aColor.getC0() == .2*10+.8*10);
5837 BOOST_TEST_CHECK(aColor.getC1() == .2*20+.8*30);
5838 BOOST_TEST_CHECK(aColor.getC2() == .2*30+.8*20);
5839 BOOST_TEST_CHECK(aColor.getC3() == .2*40+.8*40);
5841 aColor.uMean(0.1F, 0.3F, a1Color, a2Color, a3Color);
5842 BOOST_TEST_CHECK(aColor.getC0() == .1*10+.3*10+0.6*40);
5843 BOOST_TEST_CHECK(aColor.getC1() == .1*20+.3*30+0.6*20);
5844 BOOST_TEST_CHECK(aColor.getC2() == .1*30+.3*20+0.6*30);
5845 BOOST_TEST_CHECK(aColor.getC3() == .1*40+.3*40+0.6*10);
5847 aColor.uMean(0.1F, 0.3F, 0.4F, a1Color, a2Color, a3Color, a4Color);
5848 BOOST_TEST_CHECK(aColor.getC0() == .1*10+.3*10+0.4*40+0.2*90);
5849 BOOST_TEST_CHECK(aColor.getC1() == .1*20+.3*30+0.4*20+0.2*70);
5850 BOOST_TEST_CHECK(aColor.getC2() == .1*30+.3*20+0.4*30+0.2*10);
5851 BOOST_TEST_CHECK(aColor.getC3() == .1*40+.3*40+0.4*10+0.2*20);
5855 bColor.uMean(0.2F, b1Color, b2Color);
5856 BOOST_TEST_CHECK(bColor.getC0() == .2*10+.8*10);
5857 BOOST_TEST_CHECK(bColor.getC1() == .2*20+.8*30);
5858 BOOST_TEST_CHECK(bColor.getC2() == .2*30+.8*20);
5859 BOOST_TEST_CHECK(bColor.getC3() == .2*40+.8*40);
5861 bColor.uMean(0.1F, 0.3F, b1Color, b2Color, b3Color);
5862 BOOST_TEST_CHECK(bColor.getC0() == .1*10+.3*10+0.6*40);
5863 BOOST_TEST_CHECK(bColor.getC1() == .1*20+.3*30+0.6*20);
5864 BOOST_TEST_CHECK(bColor.getC2() == .1*30+.3*20+0.6*30);
5865 BOOST_TEST_CHECK(bColor.getC3() == .1*40+.3*40+0.6*10);
5867 bColor.uMean(0.1F, 0.3F, 0.4F, b1Color, b2Color, b3Color, b4Color);
5868 BOOST_TEST_CHECK(bColor.getC0() == .1*10+.3*10+0.4*40+0.2*90);
5869 BOOST_TEST_CHECK(bColor.getC1() == .1*20+.3*30+0.4*20+0.2*70);
5870 BOOST_TEST_CHECK(bColor.getC2() == .1*30+.3*20+0.4*30+0.2*10);
5871 BOOST_TEST_CHECK(bColor.getC3() == .1*40+.3*40+0.4*10+0.2*20);
5875BOOST_AUTO_TEST_CASE(hsl_hsv_int) {
5877 mjr::colorRGB8b aColor;
5878 mjr::colorRGB8b bColor;
5880 aColor.setRGBfromUnitHSL( 0/360.0, 1, 0.5);
5882 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5883 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5884 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5886 aColor.setRGBfromUnitHSL( 60/360.0, 1, 0.5);
5887 bColor.setToYellow();
5888 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5889 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5890 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5892 aColor.setRGBfromUnitHSL(120/360.0, 1, 0.5);
5893 bColor.setToGreen();
5894 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5895 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5896 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5898 aColor.setRGBfromUnitHSL(180/360.0, 1, 0.5);
5900 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5901 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5902 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5904 aColor.setRGBfromUnitHSL(240/360.0, 1, 0.5);
5906 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5907 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5908 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5910 aColor.setRGBfromUnitHSL(300/360.0, 1, 0.5);
5911 bColor.setToMagenta();
5912 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5913 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5914 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5918 aColor.setRGBfromUnitHSV( 0/360.0, 1, 1.0);
5920 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5921 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5922 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5924 aColor.setRGBfromUnitHSV( 60/360.0, 1, 1.0);
5925 bColor.setToYellow();
5926 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5927 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5928 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5930 aColor.setRGBfromUnitHSV( 420/360.0, 1, 1.0);
5931 bColor.setToYellow();
5932 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5933 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5934 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5936 aColor.setRGBfromUnitHSV(120/360.0, 1, 1.0);
5937 bColor.setToGreen();
5938 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5939 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5940 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5942 aColor.setRGBfromUnitHSV(180/360.0, 1, 1.0);
5944 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5945 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5946 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5948 aColor.setRGBfromUnitHSV(240/360.0, 1, 1.0);
5950 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5951 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5952 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5954 aColor.setRGBfromUnitHSV(300/360.0, 1, 1.0);
5955 bColor.setToMagenta();
5956 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5957 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5958 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5962 aColor.setRGBfromUnitHSL( 0/360.0, 1, 0);
5963 bColor.setToBlack();
5964 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5965 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5966 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5968 aColor.setRGBfromUnitHSL(180/360.0, 1, 0);
5969 bColor.setToBlack();
5970 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5971 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5972 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5974 aColor.setRGBfromUnitHSL( 0/360.0, 1, 1);
5975 bColor.setToWhite();
5976 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5977 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5978 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5980 aColor.setRGBfromUnitHSL(180/360.0, 1, 1);
5981 bColor.setToWhite();
5982 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5983 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5984 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5988 aColor.setRGBfromUnitHSV( 0/360.0, 0, 1);
5989 bColor.setToWhite();
5990 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5991 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5992 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
5994 aColor.setRGBfromUnitHSV(180/360.0, 0, 1);
5995 bColor.setToWhite();
5996 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
5997 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
5998 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6000 aColor.setRGBfromUnitHSV( 0/360.0, 0, 0);
6001 bColor.setToBlack();
6002 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6003 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6004 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6006 aColor.setRGBfromUnitHSV(180/360.0, 0, 0);
6007 bColor.setToBlack();
6008 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6009 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6010 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6012 aColor.setRGBfromUnitHSV( 0/360.0, 1, 0);
6013 bColor.setToBlack();
6014 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6015 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6016 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6018 aColor.setRGBfromUnitHSV(180/360.0, 1, 0);
6019 bColor.setToBlack();
6020 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6021 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6022 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6026BOOST_AUTO_TEST_CASE(hsl_hsv_flt, * boost::unit_test::tolerance(0.01)) {
6028 mjr::colorRGB32F aColor;
6029 mjr::colorRGB32F bColor;
6031 aColor.setRGBfromUnitHSL( 0/360.0, 1, 0.5);
6033 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6034 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6035 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6037 aColor.setRGBfromUnitHSL( 60/360.0, 1, 0.5);
6038 bColor.setToYellow();
6039 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6040 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6041 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6043 aColor.setRGBfromUnitHSL( 420/360.0, 1, 0.5);
6044 bColor.setToYellow();
6045 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6046 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6047 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6049 aColor.setRGBfromUnitHSL(120/360.0, 1, 0.5);
6050 bColor.setToGreen();
6051 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6052 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6053 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6055 aColor.setRGBfromUnitHSL(180/360.0, 1, 0.5);
6057 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6058 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6059 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6061 aColor.setRGBfromUnitHSL(240/360.0, 1, 0.5);
6063 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6064 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6065 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6067 aColor.setRGBfromUnitHSL(300/360.0, 1, 0.5);
6068 bColor.setToMagenta();
6069 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6070 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6071 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6075 aColor.setRGBfromUnitHSV( 0/360.0, 1, 1.0);
6077 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6078 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6079 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6081 aColor.setRGBfromUnitHSV( 60/360.0, 1, 1.0);
6082 bColor.setToYellow();
6083 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6084 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6085 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6087 aColor.setRGBfromUnitHSV(120/360.0, 1, 1.0);
6088 bColor.setToGreen();
6089 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6090 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6091 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6093 aColor.setRGBfromUnitHSV(180/360.0, 1, 1.0);
6095 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6096 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6097 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6099 aColor.setRGBfromUnitHSV(240/360.0, 1, 1.0);
6101 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6102 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6103 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6105 aColor.setRGBfromUnitHSV(300/360.0, 1, 1.0);
6106 bColor.setToMagenta();
6107 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6108 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6109 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6113 aColor.setRGBfromUnitHSL( 0/360.0, 1, 0);
6114 bColor.setToBlack();
6115 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6116 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6117 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6119 aColor.setRGBfromUnitHSL(180/360.0, 1, 0);
6120 bColor.setToBlack();
6121 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6122 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6123 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6125 aColor.setRGBfromUnitHSL( 0/360.0, 1, 1);
6126 bColor.setToWhite();
6127 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6128 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6129 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6131 aColor.setRGBfromUnitHSL(180/360.0, 1, 1);
6132 bColor.setToWhite();
6133 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6134 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6135 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6139 aColor.setRGBfromUnitHSV( 0/360.0, 0, 1);
6140 bColor.setToWhite();
6141 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6142 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6143 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6145 aColor.setRGBfromUnitHSV(180/360.0, 0, 1);
6146 bColor.setToWhite();
6147 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6148 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6149 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6151 aColor.setRGBfromUnitHSV( 0/360.0, 0, 0);
6152 bColor.setToBlack();
6153 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6154 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6155 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6157 aColor.setRGBfromUnitHSV(180/360.0, 0, 0);
6158 bColor.setToBlack();
6159 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6160 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6161 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6163 aColor.setRGBfromUnitHSV( 0/360.0, 1, 0);
6164 bColor.setToBlack();
6165 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6166 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6167 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6169 aColor.setRGBfromUnitHSV(180/360.0, 1, 0);
6170 bColor.setToBlack();
6171 BOOST_TEST_CHECK(aColor.getRed() == bColor.getRed());
6172 BOOST_TEST_CHECK(aColor.getGreen() == bColor.getGreen());
6173 BOOST_TEST_CHECK(aColor.getBlue() == bColor.getBlue());
6177BOOST_AUTO_TEST_CASE(csCBSpectral_int) {
6179 mjr::colorRGBA8b aColor;
6180 mjr::colorRGBA32F bColor;
6184 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 0, 3).isEqualRGB(aColor.setChansRGB(252, 141, 89)));
6185 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 1, 3).isEqualRGB(aColor.setChansRGB(255, 255, 191)));
6186 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 2, 3).isEqualRGB(aColor.setChansRGB(153, 213, 148)));
6188 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 0, 11).isEqualRGB(aColor.setChansRGB(158, 1, 66)));
6189 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 1, 11).isEqualRGB(aColor.setChansRGB(213, 62, 79)));
6190 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 2, 11).isEqualRGB(aColor.setChansRGB(244, 109, 67)));
6191 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 3, 11).isEqualRGB(aColor.setChansRGB(253, 174, 97)));
6192 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 4, 11).isEqualRGB(aColor.setChansRGB(254, 224, 139)));
6193 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 5, 11).isEqualRGB(aColor.setChansRGB(255, 255, 191)));
6194 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 6, 11).isEqualRGB(aColor.setChansRGB(230, 245, 152)));
6195 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 7, 11).isEqualRGB(aColor.setChansRGB(171, 221, 164)));
6196 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 8, 11).isEqualRGB(aColor.setChansRGB(102, 194, 165)));
6197 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 9, 11).isEqualRGB(aColor.setChansRGB( 50, 136, 189)));
6198 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(10, 11).isEqualRGB(aColor.setChansRGB( 94, 79, 162)));
6202 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 3, 3).isEqualRGB(aColor.setChansRGB(252, 141, 89)));
6203 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 4, 3).isEqualRGB(aColor.setChansRGB(255, 255, 191)));
6204 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 5, 3).isEqualRGB(aColor.setChansRGB(153, 213, 148)));
6206 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(11, 11).isEqualRGB(aColor.setChansRGB(158, 1, 66)));
6207 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(12, 11).isEqualRGB(aColor.setChansRGB(213, 62, 79)));
6208 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(13, 11).isEqualRGB(aColor.setChansRGB(244, 109, 67)));
6209 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(14, 11).isEqualRGB(aColor.setChansRGB(253, 174, 97)));
6210 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(15, 11).isEqualRGB(aColor.setChansRGB(254, 224, 139)));
6211 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(16, 11).isEqualRGB(aColor.setChansRGB(255, 255, 191)));
6212 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(17, 11).isEqualRGB(aColor.setChansRGB(230, 245, 152)));
6213 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(18, 11).isEqualRGB(aColor.setChansRGB(171, 221, 164)));
6214 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(19, 11).isEqualRGB(aColor.setChansRGB(102, 194, 165)));
6215 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(20, 11).isEqualRGB(aColor.setChansRGB( 50, 136, 189)));
6216 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(21, 11).isEqualRGB(aColor.setChansRGB( 94, 79, 162)));
6220 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 0 ).isEqualRGB(aColor.setChansRGB(158, 1, 66)));
6221 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 1 ).isEqualRGB(aColor.setChansRGB(213, 62, 79)));
6222 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 2 ).isEqualRGB(aColor.setChansRGB(244, 109, 67)));
6223 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 3 ).isEqualRGB(aColor.setChansRGB(253, 174, 97)));
6224 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 4 ).isEqualRGB(aColor.setChansRGB(254, 224, 139)));
6225 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 5 ).isEqualRGB(aColor.setChansRGB(255, 255, 191)));
6226 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 6 ).isEqualRGB(aColor.setChansRGB(230, 245, 152)));
6227 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 7 ).isEqualRGB(aColor.setChansRGB(171, 221, 164)));
6228 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 8 ).isEqualRGB(aColor.setChansRGB(102, 194, 165)));
6229 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 9 ).isEqualRGB(aColor.setChansRGB( 50, 136, 189)));
6230 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(10 ).isEqualRGB(aColor.setChansRGB( 94, 79, 162)));
6232 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 0, 1).isEqualRGB(aColor.setChansRGB(252, 141, 89)));
6233 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 1, 1).isEqualRGB(aColor.setChansRGB(255, 255, 191)));
6234 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 2, 1).isEqualRGB(aColor.setChansRGB(153, 213, 148)));
6236 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 0, 50).isEqualRGB(aColor.setChansRGB(158, 1, 66)));
6237 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 1, 50).isEqualRGB(aColor.setChansRGB(213, 62, 79)));
6238 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 2, 50).isEqualRGB(aColor.setChansRGB(244, 109, 67)));
6239 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 3, 50).isEqualRGB(aColor.setChansRGB(253, 174, 97)));
6240 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 4, 50).isEqualRGB(aColor.setChansRGB(254, 224, 139)));
6241 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 5, 50).isEqualRGB(aColor.setChansRGB(255, 255, 191)));
6242 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 6, 50).isEqualRGB(aColor.setChansRGB(230, 245, 152)));
6243 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 7, 50).isEqualRGB(aColor.setChansRGB(171, 221, 164)));
6244 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 8, 50).isEqualRGB(aColor.setChansRGB(102, 194, 165)));
6245 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 9, 50).isEqualRGB(aColor.setChansRGB( 50, 136, 189)));
6246 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(10, 50).isEqualRGB(aColor.setChansRGB( 94, 79, 162)));
6250 aColor.setToBlack();
6251 mjr::colorRGBA8b::csCBSpectral::c(aColor, 0, 3);
6252 BOOST_TEST_CHECK(aColor.getRed() == 252);
6253 BOOST_TEST_CHECK(aColor.getGreen() == 141);
6254 BOOST_TEST_CHECK(aColor.getBlue() == 89);
6255 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGBA8b::minChanVal);
6257 aColor.setToWhite();
6258 mjr::colorRGBA8b::csCBSpectral::c(aColor, 0, 3);
6259 BOOST_TEST_CHECK(aColor.getRed() == 252);
6260 BOOST_TEST_CHECK(aColor.getGreen() == 141);
6261 BOOST_TEST_CHECK(aColor.getBlue() == 89);
6262 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGBA8b::maxChanVal);
6266 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 0, 3).isCloseRGB(bColor.setChansRGB(252/255.0F, 141/255.0F, 89/255.0F), 0.00001F));
6267 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 1, 3).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6268 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 2, 3).isCloseRGB(bColor.setChansRGB(153/255.0F, 213/255.0F, 148/255.0F), 0.00001F));
6270 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 0, 11).isCloseRGB(bColor.setChansRGB(158/255.0F, 1/255.0F, 66/255.0F), 0.00001F));
6271 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 1, 11).isCloseRGB(bColor.setChansRGB(213/255.0F, 62/255.0F, 79/255.0F), 0.00001F));
6272 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 2, 11).isCloseRGB(bColor.setChansRGB(244/255.0F, 109/255.0F, 67/255.0F), 0.00001F));
6273 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 3, 11).isCloseRGB(bColor.setChansRGB(253/255.0F, 174/255.0F, 97/255.0F), 0.00001F));
6274 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 4, 11).isCloseRGB(bColor.setChansRGB(254/255.0F, 224/255.0F, 139/255.0F), 0.00001F));
6275 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 5, 11).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6276 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 6, 11).isCloseRGB(bColor.setChansRGB(230/255.0F, 245/255.0F, 152/255.0F), 0.00001F));
6277 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 7, 11).isCloseRGB(bColor.setChansRGB(171/255.0F, 221/255.0F, 164/255.0F), 0.00001F));
6278 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 8, 11).isCloseRGB(bColor.setChansRGB(102/255.0F, 194/255.0F, 165/255.0F), 0.00001F));
6279 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 9, 11).isCloseRGB(bColor.setChansRGB( 50/255.0F, 136/255.0F, 189/255.0F), 0.00001F));
6280 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(10, 11).isCloseRGB(bColor.setChansRGB( 94/255.0F, 79/255.0F, 162/255.0F), 0.00001F));
6284 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 3, 3).isCloseRGB(bColor.setChansRGB(252/255.0F, 141/255.0F, 89/255.0F), 0.00001F));
6285 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 4, 3).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6286 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 5, 3).isCloseRGB(bColor.setChansRGB(153/255.0F, 213/255.0F, 148/255.0F), 0.00001F));
6288 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(11, 11).isCloseRGB(bColor.setChansRGB(158/255.0F, 1/255.0F, 66/255.0F), 0.00001F));
6289 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(12, 11).isCloseRGB(bColor.setChansRGB(213/255.0F, 62/255.0F, 79/255.0F), 0.00001F));
6290 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(13, 11).isCloseRGB(bColor.setChansRGB(244/255.0F, 109/255.0F, 67/255.0F), 0.00001F));
6291 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(14, 11).isCloseRGB(bColor.setChansRGB(253/255.0F, 174/255.0F, 97/255.0F), 0.00001F));
6292 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(15, 11).isCloseRGB(bColor.setChansRGB(254/255.0F, 224/255.0F, 139/255.0F), 0.00001F));
6293 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(16, 11).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6294 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(17, 11).isCloseRGB(bColor.setChansRGB(230/255.0F, 245/255.0F, 152/255.0F), 0.00001F));
6295 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(18, 11).isCloseRGB(bColor.setChansRGB(171/255.0F, 221/255.0F, 164/255.0F), 0.00001F));
6296 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(19, 11).isCloseRGB(bColor.setChansRGB(102/255.0F, 194/255.0F, 165/255.0F), 0.00001F));
6297 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(20, 11).isCloseRGB(bColor.setChansRGB( 50/255.0F, 136/255.0F, 189/255.0F), 0.00001F));
6298 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(21, 11).isCloseRGB(bColor.setChansRGB( 94/255.0F, 79/255.0F, 162/255.0F), 0.00001F));
6302 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 0 ).isCloseRGB(bColor.setChansRGB(158/255.0F, 1/255.0F, 66/255.0F), 0.00001F));
6303 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 1 ).isCloseRGB(bColor.setChansRGB(213/255.0F, 62/255.0F, 79/255.0F), 0.00001F));
6304 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 2 ).isCloseRGB(bColor.setChansRGB(244/255.0F, 109/255.0F, 67/255.0F), 0.00001F));
6305 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 3 ).isCloseRGB(bColor.setChansRGB(253/255.0F, 174/255.0F, 97/255.0F), 0.00001F));
6306 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 4 ).isCloseRGB(bColor.setChansRGB(254/255.0F, 224/255.0F, 139/255.0F), 0.00001F));
6307 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 5 ).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6308 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 6 ).isCloseRGB(bColor.setChansRGB(230/255.0F, 245/255.0F, 152/255.0F), 0.00001F));
6309 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 7 ).isCloseRGB(bColor.setChansRGB(171/255.0F, 221/255.0F, 164/255.0F), 0.00001F));
6310 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 8 ).isCloseRGB(bColor.setChansRGB(102/255.0F, 194/255.0F, 165/255.0F), 0.00001F));
6311 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 9 ).isCloseRGB(bColor.setChansRGB( 50/255.0F, 136/255.0F, 189/255.0F), 0.00001F));
6312 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(10 ).isCloseRGB(bColor.setChansRGB( 94/255.0F, 79/255.0F, 162/255.0F), 0.00001F));
6314 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 0, 1).isCloseRGB(bColor.setChansRGB(252/255.0F, 141/255.0F, 89/255.0F), 0.00001F));
6315 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 1, 1).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6316 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 2, 1).isCloseRGB(bColor.setChansRGB(153/255.0F, 213/255.0F, 148/255.0F), 0.00001F));
6318 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 0, 50).isCloseRGB(bColor.setChansRGB(158/255.0F, 1/255.0F, 66/255.0F), 0.00001F));
6319 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 1, 50).isCloseRGB(bColor.setChansRGB(213/255.0F, 62/255.0F, 79/255.0F), 0.00001F));
6320 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 2, 50).isCloseRGB(bColor.setChansRGB(244/255.0F, 109/255.0F, 67/255.0F), 0.00001F));
6321 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 3, 50).isCloseRGB(bColor.setChansRGB(253/255.0F, 174/255.0F, 97/255.0F), 0.00001F));
6322 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 4, 50).isCloseRGB(bColor.setChansRGB(254/255.0F, 224/255.0F, 139/255.0F), 0.00001F));
6323 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 5, 50).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6324 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 6, 50).isCloseRGB(bColor.setChansRGB(230/255.0F, 245/255.0F, 152/255.0F), 0.00001F));
6325 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 7, 50).isCloseRGB(bColor.setChansRGB(171/255.0F, 221/255.0F, 164/255.0F), 0.00001F));
6326 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 8, 50).isCloseRGB(bColor.setChansRGB(102/255.0F, 194/255.0F, 165/255.0F), 0.00001F));
6327 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 9, 50).isCloseRGB(bColor.setChansRGB( 50/255.0F, 136/255.0F, 189/255.0F), 0.00001F));
6328 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(10, 50).isCloseRGB(bColor.setChansRGB( 94/255.0F, 79/255.0F, 162/255.0F), 0.00001F));
6332 bColor.setToBlack();
6333 mjr::colorRGBA32F::csCBSpectral::c(bColor, 0, 3);
6334 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA32F::minChanVal);
6336 bColor.setToWhite();
6337 mjr::colorRGBA32F::csCBSpectral::c(bColor, 0, 3);
6338 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA32F::maxChanVal);
6343BOOST_AUTO_TEST_CASE(csCBSpectral_flt) {
6345 mjr::colorRGBA8b aColor;
6346 mjr::colorRGBA32F bColor;
6350 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 0/2.0F, 3).isCloseRGB(aColor.setChansRGB(252, 141, 89), 2));
6351 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 1/2.0F, 3).isCloseRGB(aColor.setChansRGB(255, 255, 191), 2));
6352 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 2/2.0F, 3).isCloseRGB(aColor.setChansRGB(153, 213, 148), 2));
6354 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 0/10.0F, 11).isCloseRGB(aColor.setChansRGB(158, 1, 66), 2));
6355 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 1/10.0F, 11).isCloseRGB(aColor.setChansRGB(213, 62, 79), 2));
6356 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 2/10.0F, 11).isCloseRGB(aColor.setChansRGB(244, 109, 67), 2));
6357 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 3/10.0F, 11).isCloseRGB(aColor.setChansRGB(253, 174, 97), 2));
6358 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 4/10.0F, 11).isCloseRGB(aColor.setChansRGB(254, 224, 139), 2));
6359 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 5/10.0F, 11).isCloseRGB(aColor.setChansRGB(255, 255, 191), 2));
6360 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 6/10.0F, 11).isCloseRGB(aColor.setChansRGB(230, 245, 152), 2));
6361 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 7/10.0F, 11).isCloseRGB(aColor.setChansRGB(171, 221, 164), 2));
6362 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 8/10.0F, 11).isCloseRGB(aColor.setChansRGB(102, 194, 165), 2));
6363 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 9/10.0F, 11).isCloseRGB(aColor.setChansRGB( 50, 136, 189), 2));
6364 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(10/10.0F, 11).isCloseRGB(aColor.setChansRGB( 94, 79, 162), 2));
6368 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 3/2.0F, 3).isCloseRGB(aColor.setChansRGB(255, 255, 191), 2));
6370 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(1+ 1/10.0F, 11).isCloseRGB(aColor.setChansRGB(213, 62, 79), 2));
6371 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(1+ 2/10.0F, 11).isCloseRGB(aColor.setChansRGB(244, 109, 67), 2));
6372 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(1+ 3/10.0F, 11).isCloseRGB(aColor.setChansRGB(253, 174, 97), 2));
6373 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(1+ 4/10.0F, 11).isCloseRGB(aColor.setChansRGB(254, 224, 139), 2));
6374 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(1+ 5/10.0F, 11).isCloseRGB(aColor.setChansRGB(255, 255, 191), 2));
6375 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(1+ 6/10.0F, 11).isCloseRGB(aColor.setChansRGB(230, 245, 152), 2));
6376 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(1+ 7/10.0F, 11).isCloseRGB(aColor.setChansRGB(171, 221, 164), 2));
6377 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(1+ 8/10.0F, 11).isCloseRGB(aColor.setChansRGB(102, 194, 165), 2));
6378 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(1+ 9/10.0F, 11).isCloseRGB(aColor.setChansRGB( 50, 136, 189), 2));
6382 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 0/10.0F ).isCloseRGB(aColor.setChansRGB(158, 1, 66), 2));
6383 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 1/10.0F ).isCloseRGB(aColor.setChansRGB(213, 62, 79), 2));
6384 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 2/10.0F ).isCloseRGB(aColor.setChansRGB(244, 109, 67), 2));
6385 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 3/10.0F ).isCloseRGB(aColor.setChansRGB(253, 174, 97), 2));
6386 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 4/10.0F ).isCloseRGB(aColor.setChansRGB(254, 224, 139), 2));
6387 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 5/10.0F ).isCloseRGB(aColor.setChansRGB(255, 255, 191), 2));
6388 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 6/10.0F ).isCloseRGB(aColor.setChansRGB(230, 245, 152), 2));
6389 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 7/10.0F ).isCloseRGB(aColor.setChansRGB(171, 221, 164), 2));
6390 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 8/10.0F ).isCloseRGB(aColor.setChansRGB(102, 194, 165), 2));
6391 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 9/10.0F ).isCloseRGB(aColor.setChansRGB( 50, 136, 189), 2));
6392 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(10/10.0F ).isCloseRGB(aColor.setChansRGB( 94, 79, 162), 2));
6394 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 0/2.0F, 1).isCloseRGB(aColor.setChansRGB(252, 141, 89), 2));
6395 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 1/2.0F, 1).isCloseRGB(aColor.setChansRGB(255, 255, 191), 2));
6396 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 2/2.0F, 1).isCloseRGB(aColor.setChansRGB(153, 213, 148), 2));
6398 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 0/10.0F, 50).isCloseRGB(aColor.setChansRGB(158, 1, 66), 2));
6399 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 1/10.0F, 50).isCloseRGB(aColor.setChansRGB(213, 62, 79), 2));
6400 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 2/10.0F, 50).isCloseRGB(aColor.setChansRGB(244, 109, 67), 2));
6401 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 3/10.0F, 50).isCloseRGB(aColor.setChansRGB(253, 174, 97), 2));
6402 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 4/10.0F, 50).isCloseRGB(aColor.setChansRGB(254, 224, 139), 2));
6403 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 5/10.0F, 50).isCloseRGB(aColor.setChansRGB(255, 255, 191), 2));
6404 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 6/10.0F, 50).isCloseRGB(aColor.setChansRGB(230, 245, 152), 2));
6405 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 7/10.0F, 50).isCloseRGB(aColor.setChansRGB(171, 221, 164), 2));
6406 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 8/10.0F, 50).isCloseRGB(aColor.setChansRGB(102, 194, 165), 2));
6407 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c( 9/10.0F, 50).isCloseRGB(aColor.setChansRGB( 50, 136, 189), 2));
6408 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCBSpectral::c(10/10.0F, 50).isCloseRGB(aColor.setChansRGB( 94, 79, 162), 2));
6412 aColor.setToBlack();
6413 mjr::colorRGBA8b::csCBSpectral::c(aColor, 0/2.0F, 3);
6414 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGBA8b::minChanVal);
6416 aColor.setToWhite();
6417 mjr::colorRGBA8b::csCBSpectral::c(aColor, 0/2.0F, 3);
6418 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGBA8b::maxChanVal);
6422 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 0/2.0F, 3).isCloseRGB(bColor.setChansRGB(252/255.0F, 141/255.0F, 89/255.0F), 0.00001F));
6423 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 1/2.0F, 3).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6424 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 2/2.0F, 3).isCloseRGB(bColor.setChansRGB(153/255.0F, 213/255.0F, 148/255.0F), 0.00001F));
6426 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 0/10.0F, 11).isCloseRGB(bColor.setChansRGB(158/255.0F, 1/255.0F, 66/255.0F), 0.00001F));
6427 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 1/10.0F, 11).isCloseRGB(bColor.setChansRGB(213/255.0F, 62/255.0F, 79/255.0F), 0.00001F));
6428 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 2/10.0F, 11).isCloseRGB(bColor.setChansRGB(244/255.0F, 109/255.0F, 67/255.0F), 0.00001F));
6429 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 3/10.0F, 11).isCloseRGB(bColor.setChansRGB(253/255.0F, 174/255.0F, 97/255.0F), 0.00001F));
6430 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 4/10.0F, 11).isCloseRGB(bColor.setChansRGB(254/255.0F, 224/255.0F, 139/255.0F), 0.00001F));
6431 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 5/10.0F, 11).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6432 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 6/10.0F, 11).isCloseRGB(bColor.setChansRGB(230/255.0F, 245/255.0F, 152/255.0F), 0.00001F));
6433 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 7/10.0F, 11).isCloseRGB(bColor.setChansRGB(171/255.0F, 221/255.0F, 164/255.0F), 0.00001F));
6434 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 8/10.0F, 11).isCloseRGB(bColor.setChansRGB(102/255.0F, 194/255.0F, 165/255.0F), 0.00001F));
6435 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 9/10.0F, 11).isCloseRGB(bColor.setChansRGB( 50/255.0F, 136/255.0F, 189/255.0F), 0.00001F));
6436 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(10/10.0F, 11).isCloseRGB(bColor.setChansRGB( 94/255.0F, 79/255.0F, 162/255.0F), 0.00001F));
6440 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 3/2.0F, 3).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6442 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(1+1/10.0F, 11).isCloseRGB(bColor.setChansRGB(213/255.0F, 62/255.0F, 79/255.0F), 0.00001F));
6443 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(1+2/10.0F, 11).isCloseRGB(bColor.setChansRGB(244/255.0F, 109/255.0F, 67/255.0F), 0.00001F));
6444 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(1+3/10.0F, 11).isCloseRGB(bColor.setChansRGB(253/255.0F, 174/255.0F, 97/255.0F), 0.00001F));
6445 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(1+4/10.0F, 11).isCloseRGB(bColor.setChansRGB(254/255.0F, 224/255.0F, 139/255.0F), 0.00001F));
6446 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(1+5/10.0F, 11).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6447 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(1+6/10.0F, 11).isCloseRGB(bColor.setChansRGB(230/255.0F, 245/255.0F, 152/255.0F), 0.00001F));
6448 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(1+7/10.0F, 11).isCloseRGB(bColor.setChansRGB(171/255.0F, 221/255.0F, 164/255.0F), 0.00001F));
6449 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(1+8/10.0F, 11).isCloseRGB(bColor.setChansRGB(102/255.0F, 194/255.0F, 165/255.0F), 0.00001F));
6450 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(1+9/10.0F, 11).isCloseRGB(bColor.setChansRGB( 50/255.0F, 136/255.0F, 189/255.0F), 0.00001F));
6454 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 0/10.0F ).isCloseRGB(bColor.setChansRGB(158/255.0F, 1/255.0F, 66/255.0F), 0.00001F));
6455 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 1/10.0F ).isCloseRGB(bColor.setChansRGB(213/255.0F, 62/255.0F, 79/255.0F), 0.00001F));
6456 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 2/10.0F ).isCloseRGB(bColor.setChansRGB(244/255.0F, 109/255.0F, 67/255.0F), 0.00001F));
6457 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 3/10.0F ).isCloseRGB(bColor.setChansRGB(253/255.0F, 174/255.0F, 97/255.0F), 0.00001F));
6458 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 4/10.0F ).isCloseRGB(bColor.setChansRGB(254/255.0F, 224/255.0F, 139/255.0F), 0.00001F));
6459 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 5/10.0F ).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6460 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 6/10.0F ).isCloseRGB(bColor.setChansRGB(230/255.0F, 245/255.0F, 152/255.0F), 0.00001F));
6461 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 7/10.0F ).isCloseRGB(bColor.setChansRGB(171/255.0F, 221/255.0F, 164/255.0F), 0.00001F));
6462 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 8/10.0F ).isCloseRGB(bColor.setChansRGB(102/255.0F, 194/255.0F, 165/255.0F), 0.00001F));
6463 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 9/10.0F ).isCloseRGB(bColor.setChansRGB( 50/255.0F, 136/255.0F, 189/255.0F), 0.00001F));
6464 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(10/10.0F ).isCloseRGB(bColor.setChansRGB( 94/255.0F, 79/255.0F, 162/255.0F), 0.00001F));
6466 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 0/2.0F, 1).isCloseRGB(bColor.setChansRGB(252/255.0F, 141/255.0F, 89/255.0F), 0.00001F));
6467 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 1/2.0F, 1).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6468 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 2/2.0F, 1).isCloseRGB(bColor.setChansRGB(153/255.0F, 213/255.0F, 148/255.0F), 0.00001F));
6470 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 0/10.0F, 50).isCloseRGB(bColor.setChansRGB(158/255.0F, 1/255.0F, 66/255.0F), 0.00001F));
6471 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 1/10.0F, 50).isCloseRGB(bColor.setChansRGB(213/255.0F, 62/255.0F, 79/255.0F), 0.00001F));
6472 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 2/10.0F, 50).isCloseRGB(bColor.setChansRGB(244/255.0F, 109/255.0F, 67/255.0F), 0.00001F));
6473 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 3/10.0F, 50).isCloseRGB(bColor.setChansRGB(253/255.0F, 174/255.0F, 97/255.0F), 0.00001F));
6474 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 4/10.0F, 50).isCloseRGB(bColor.setChansRGB(254/255.0F, 224/255.0F, 139/255.0F), 0.00001F));
6475 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 5/10.0F, 50).isCloseRGB(bColor.setChansRGB(255/255.0F, 255/255.0F, 191/255.0F), 0.00001F));
6476 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 6/10.0F, 50).isCloseRGB(bColor.setChansRGB(230/255.0F, 245/255.0F, 152/255.0F), 0.00001F));
6477 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 7/10.0F, 50).isCloseRGB(bColor.setChansRGB(171/255.0F, 221/255.0F, 164/255.0F), 0.00001F));
6478 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 8/10.0F, 50).isCloseRGB(bColor.setChansRGB(102/255.0F, 194/255.0F, 165/255.0F), 0.00001F));
6479 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c( 9/10.0F, 50).isCloseRGB(bColor.setChansRGB( 50/255.0F, 136/255.0F, 189/255.0F), 0.00001F));
6480 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCBSpectral::c(10/10.0F, 50).isCloseRGB(bColor.setChansRGB( 94/255.0F, 79/255.0F, 162/255.0F), 0.00001F));
6484 bColor.setToBlack();
6485 mjr::colorRGBA32F::csCBSpectral::c(bColor, 0/2.0F, 3);
6486 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA32F::minChanVal);
6488 bColor.setToWhite();
6489 mjr::colorRGBA32F::csCBSpectral::c(bColor, 0/2.0F, 3);
6490 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA32F::maxChanVal);
6494BOOST_AUTO_TEST_CASE(isClose_and_isCloseRGB) {
6496 mjr::colorRGB8b aLcolor;
6497 mjr::colorRGBA8b bLcolor;
6498 mjr::colorRGB32F cLcolor;
6499 mjr::colorRGBA32F dLcolor;
6501 mjr::colorRGB8b aRcolor;
6502 mjr::colorRGBA8b bRcolor;
6503 mjr::colorRGB32F cRcolor;
6504 mjr::colorRGBA32F dRcolor;
6506 aLcolor.setToBlack();
6507 bLcolor.setToBlack();
6508 cLcolor.setToBlack();
6509 dLcolor.setToBlack();
6511 aRcolor.setToBlack();
6512 bRcolor.setToBlack();
6513 cRcolor.setToBlack();
6514 dRcolor.setToBlack();
6516 BOOST_TEST_CHECK(aLcolor.isClose(aRcolor, 0) ==
true);
6517 BOOST_TEST_CHECK(bLcolor.isClose(bRcolor, 0) ==
true);
6518 BOOST_TEST_CHECK(cLcolor.isClose(cRcolor, 0) ==
true);
6519 BOOST_TEST_CHECK(dLcolor.isClose(dRcolor, 0) ==
true);
6521 BOOST_TEST_CHECK(aLcolor.isCloseRGB(aRcolor, 0) ==
true);
6522 BOOST_TEST_CHECK(bLcolor.isCloseRGB(bRcolor, 0) ==
true);
6523 BOOST_TEST_CHECK(cLcolor.isCloseRGB(cRcolor, 0) ==
true);
6524 BOOST_TEST_CHECK(dLcolor.isCloseRGB(dRcolor, 0) ==
true);
6526 aLcolor.setChanToMax(0);
6527 bLcolor.setChanToMax(0);
6528 cLcolor.setChanToMax(0);
6529 dLcolor.setChanToMax(0);
6531 BOOST_TEST_CHECK(aLcolor.isClose(aRcolor, 0) ==
false);
6532 BOOST_TEST_CHECK(bLcolor.isClose(bRcolor, 0) ==
false);
6533 BOOST_TEST_CHECK(cLcolor.isClose(cRcolor, 0) ==
false);
6534 BOOST_TEST_CHECK(dLcolor.isClose(dRcolor, 0) ==
false);
6536 BOOST_TEST_CHECK(aLcolor.isCloseRGB(aRcolor, 0) ==
false);
6537 BOOST_TEST_CHECK(bLcolor.isCloseRGB(bRcolor, 0) ==
false);
6538 BOOST_TEST_CHECK(cLcolor.isCloseRGB(cRcolor, 0) ==
false);
6539 BOOST_TEST_CHECK(dLcolor.isCloseRGB(dRcolor, 0) ==
false);
6541 aRcolor.setChanToMax(0);
6542 bRcolor.setChanToMax(0);
6543 cRcolor.setChanToMax(0);
6544 dRcolor.setChanToMax(0);
6546 BOOST_TEST_CHECK(aLcolor.isClose(aRcolor, 0) ==
true);
6547 BOOST_TEST_CHECK(bLcolor.isClose(bRcolor, 0) ==
true);
6548 BOOST_TEST_CHECK(cLcolor.isClose(cRcolor, 0) ==
true);
6549 BOOST_TEST_CHECK(dLcolor.isClose(dRcolor, 0) ==
true);
6551 BOOST_TEST_CHECK(aLcolor.isCloseRGB(aRcolor, 0) ==
true);
6552 BOOST_TEST_CHECK(bLcolor.isCloseRGB(bRcolor, 0) ==
true);
6553 BOOST_TEST_CHECK(cLcolor.isCloseRGB(cRcolor, 0) ==
true);
6554 BOOST_TEST_CHECK(dLcolor.isCloseRGB(dRcolor, 0) ==
true);
6556 bRcolor.setChanToMax(3);
6557 dRcolor.setChanToMax(3);
6559 BOOST_TEST_CHECK(bLcolor.isClose(bRcolor, 0) ==
false);
6560 BOOST_TEST_CHECK(dLcolor.isClose(dRcolor, 0) ==
false);
6562 BOOST_TEST_CHECK(bLcolor.isCloseRGB(bRcolor, 0) ==
true);
6563 BOOST_TEST_CHECK(dLcolor.isCloseRGB(dRcolor, 0) ==
true);
6565 aLcolor.setChansRGB(1, 2, 3);
6566 aRcolor.setChansRGB(1, 3, 4);
6568 BOOST_TEST_CHECK(aLcolor.isClose(aRcolor, 0) ==
false);
6569 BOOST_TEST_CHECK(aRcolor.isClose(aLcolor, 0) ==
false);
6571 BOOST_TEST_CHECK(aLcolor.isClose(aRcolor, 1) ==
true);
6572 BOOST_TEST_CHECK(aRcolor.isClose(aLcolor, 1) ==
true);
6574 BOOST_TEST_CHECK(aLcolor.isClose(aRcolor, 2) ==
true);
6575 BOOST_TEST_CHECK(aRcolor.isClose(aLcolor, 2) ==
true);
6577 cLcolor.setChansRGB(1, 2, 3);
6578 cRcolor.setChansRGB(1, 3, 4);
6580 BOOST_TEST_CHECK(cLcolor.isClose(cRcolor, 0.0F) ==
false);
6581 BOOST_TEST_CHECK(cRcolor.isClose(cLcolor, 0.0F) ==
false);
6583 BOOST_TEST_CHECK(cLcolor.isClose(cRcolor, 0.9999F) ==
false);
6584 BOOST_TEST_CHECK(cRcolor.isClose(cLcolor, 0.9999F) ==
false);
6586 BOOST_TEST_CHECK(cLcolor.isClose(cRcolor, 1.0F) ==
true);
6587 BOOST_TEST_CHECK(cRcolor.isClose(cLcolor, 1.0F) ==
true);
6589 BOOST_TEST_CHECK(cLcolor.isClose(cRcolor, 1.0001F) ==
true);
6590 BOOST_TEST_CHECK(cRcolor.isClose(cLcolor, 1.0001F) ==
true);
6592 BOOST_TEST_CHECK(cLcolor.isClose(cRcolor, 2.0F) ==
true);
6593 BOOST_TEST_CHECK(cRcolor.isClose(cLcolor, 2.0F) ==
true);
6597BOOST_AUTO_TEST_CASE(setRGBfromColorSpace) {
6599 mjr::colorRGB8b aColor, bColor;
6600 mjr::colorRGBA8b cColor, dColor;
6601 mjr::colorRGB32F eColor, fColor;
6602 mjr::colorRGB16b gColor, hColor;
6606 aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::RGB, 0, 0.5, 1);
6607 BOOST_TEST_CHECK(aColor.getRed() == mjr::colorRGB8b::minChanVal);
6608 BOOST_TEST_CHECK(aColor.getGreen() == mjr::colorRGB8b::meanChanVal);
6609 BOOST_TEST_CHECK(aColor.getBlue() == mjr::colorRGB8b::maxChanVal);
6611 eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::RGB, 0, 0.5, 1);
6612 BOOST_TEST_CHECK(eColor.getRed() == mjr::colorRGB32F::minChanVal);
6613 BOOST_TEST_CHECK(eColor.getGreen() == mjr::colorRGB32F::meanChanVal);
6614 BOOST_TEST_CHECK(eColor.getBlue() == mjr::colorRGB32F::maxChanVal);
6616 gColor.setRGBfromColorSpace(mjr::colorRGB16b::colorSpaceEnum::RGB, 0, 0.5, 1);
6617 BOOST_TEST_CHECK(gColor.getRed() == mjr::colorRGB16b::minChanVal);
6618 BOOST_TEST_CHECK(gColor.getGreen() == mjr::colorRGB16b::meanChanVal);
6619 BOOST_TEST_CHECK(gColor.getBlue() == mjr::colorRGB16b::maxChanVal);
6621 cColor.setToWhite();
6622 cColor.setRGBfromColorSpace(mjr::colorRGBA8b::colorSpaceEnum::RGB, 0, 0.5, 1);
6623 BOOST_TEST_CHECK(cColor.getRed() == mjr::colorRGBA8b::minChanVal);
6624 BOOST_TEST_CHECK(cColor.getGreen() == mjr::colorRGBA8b::meanChanVal);
6625 BOOST_TEST_CHECK(cColor.getBlue() == mjr::colorRGBA8b::maxChanVal);
6626 BOOST_TEST_CHECK(cColor.getAlpha() == 0xFF);
6628 cColor.setToBlack();
6629 cColor.setRGBfromColorSpace(mjr::colorRGBA8b::colorSpaceEnum::RGB, 0, 0.5, 1);
6630 BOOST_TEST_CHECK(cColor.getRed() == mjr::colorRGBA8b::minChanVal);
6631 BOOST_TEST_CHECK(cColor.getGreen() == mjr::colorRGBA8b::meanChanVal);
6632 BOOST_TEST_CHECK(cColor.getBlue() == mjr::colorRGBA8b::maxChanVal);
6633 BOOST_TEST_CHECK(cColor.getAlpha() == 0x00);
6635 for(
double r=0; r<1.0; r=r+0.1)
6636 for(
double g=0; g<1.0; g=g+0.1)
6637 for(
double b=0; b<1.0; b=b+0.1)
6638 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::RGB, r, g, b).isEqualRGB(bColor.setChansRGB_dbl(r, g, b)) ==
true);
6657 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LAB, 0.0, 0.0, 0.0).isEqualRGB(bColor.setChansRGB( 0, 0, 0)) ==
true);
6658 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LAB, 0.0, -100.0, 0.0).isEqualRGB(bColor.setChansRGB( 0, 42, 0)) ==
true);
6659 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LAB, 0.0, 100.0, 0.0).isEqualRGB(bColor.setChansRGB( 96, 0, 6)) ==
true);
6660 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LAB, 0.0, 0.0, -100.0).isEqualRGB(bColor.setChansRGB( 0, 28, 148)) ==
true);
6661 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LAB, 0.0, 0.0, 100.0).isEqualRGB(bColor.setChansRGB( 52, 0, 0)) ==
true);
6662 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LAB, 100.0, 0.0, 0.0).isEqualRGB(bColor.setChansRGB(255, 255, 254)) ==
true);
6663 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LAB, 50.0, 50.0, 50.0).isEqualRGB(bColor.setChansRGB(206, 75, 33)) ==
true);
6664 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LAB, 50.0, -50.0, 50.0).isEqualRGB(bColor.setChansRGB( 35, 137, 16)) ==
true);
6665 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LAB, 50.0, -50.0, -50.0).isEqualRGB(bColor.setChansRGB( 0, 143, 203)) ==
true);
6666 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LAB, 50.0, 50.0, -50.0).isEqualRGB(bColor.setChansRGB(157, 86, 204)) ==
true);
6668 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LAB, 0.0, 0.0, 0.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 0.00000000000000F/255.0F, 0.00000000000000F/255.0F), 0.00001F) ==
true);
6669 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LAB, 0.0, -100.0, 0.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 42.50011693400831F/255.0F, 0.00000000000000F/255.0F), 0.00001F) ==
true);
6670 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LAB, 0.0, 100.0, 0.0).isCloseRGB(fColor.setChansRGB( 96.73833014676526F/255.0F, 0.00000000000000F/255.0F, 6.73101465756404F/255.0F), 0.00001F) ==
true);
6671 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LAB, 0.0, 0.0, -100.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 28.17831280013103F/255.0F, 148.60141206787873F/255.0F), 0.00001F) ==
true);
6672 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LAB, 0.0, 0.0, 100.0).isCloseRGB(fColor.setChansRGB( 52.41394321977139F/255.0F, 0.00000000000000F/255.0F, 0.00000000000000F/255.0F), 0.00001F) ==
true);
6673 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LAB, 100.0, 0.0, 0.0).isCloseRGB(fColor.setChansRGB(255.00000000000000F/255.0F, 255.00000000000000F/255.0F, 254.98144635564927F/255.0F), 0.00001F) ==
true);
6674 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LAB, 50.0, 50.0, 50.0).isCloseRGB(fColor.setChansRGB(206.61345904246030F/255.0F, 75.47718797538901F/255.0F, 33.52976908891374F/255.0F), 0.00001F) ==
true);
6675 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LAB, 50.0, -50.0, 50.0).isCloseRGB(fColor.setChansRGB( 35.14702068347071F/255.0F, 137.45770493758675F/255.0F, 16.12671766273848F/255.0F), 0.00001F) ==
true);
6676 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LAB, 50.0, -50.0, -50.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 143.15667349842120F/255.0F, 203.43118280505934F/255.0F), 0.00001F) ==
true);
6677 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LAB, 50.0, 50.0, -50.0).isCloseRGB(fColor.setChansRGB(157.75797959913612F/255.0F, 86.69682271747450F/255.0F, 204.99202043092524F/255.0F), 0.00001F) ==
true);
6689 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::XYZ, 0.0, 0.0, 0.0).isEqualRGB(bColor.setChansRGB( 0, 0, 0)) ==
true);
6690 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::XYZ, 1.0, 0.0, 0.0).isEqualRGB(bColor.setChansRGB(50, 0, 1)) ==
true);
6691 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::XYZ, 0.0, 1.0, 0.0).isEqualRGB(bColor.setChansRGB( 0, 37, 0)) ==
true);
6692 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::XYZ, 0.0, 0.0, 1.0).isEqualRGB(bColor.setChansRGB( 0, 1, 26)) ==
true);
6693 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::XYZ, 1.0, 1.0, 0.0).isEqualRGB(bColor.setChansRGB(35, 23, 0)) ==
true);
6694 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::XYZ, 1.0, 0.0, 1.0).isEqualRGB(bColor.setChansRGB(46, 0, 27)) ==
true);
6695 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::XYZ, 0.0, 1.0, 1.0).isEqualRGB(bColor.setChansRGB( 0, 37, 22)) ==
true);
6697 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::XYZ, 0.0, 0.0, 0.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 0.00000000000000F/255.0F, 0.00000000000000F/255.0F), 0.00001F) ==
true);
6698 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::XYZ, 1.0, 0.0, 0.0).isCloseRGB(fColor.setChansRGB(50.42455181463890F/255.0F, 0.00000000000000F/255.0F, 1.83509220000000F/255.0F), 0.00001F) ==
true);
6699 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::XYZ, 0.0, 1.0, 0.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 37.29504496314512F/255.0F, 0.00000000000000F/255.0F), 0.00001F) ==
true);
6700 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::XYZ, 0.0, 0.0, 1.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 1.36725900000000F/255.0F, 26.38515827433519F/255.0F), 0.00001F) ==
true);
6701 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::XYZ, 1.0, 1.0, 0.0).isCloseRGB(fColor.setChansRGB(35.27435545247001F/255.0F, 23.88691519243730F/255.0F, 0.00000000000000F/255.0F), 0.00001F) ==
true);
6702 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::XYZ, 1.0, 0.0, 1.0).isCloseRGB(fColor.setChansRGB(46.09063114907088F/255.0F, 0.00000000000000F/255.0F, 27.25916547197178F/255.0F), 0.00001F) ==
true);
6703 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::XYZ, 0.0, 1.0, 1.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 37.76511040594671F/255.0F, 22.93126475355600F/255.0F), 0.00001F) ==
true);
6717 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LCH, 0.0, 0.0, 0.0).isEqualRGB(bColor.setChansRGB( 0, 0, 0)) ==
true);
6718 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LCH, 0.0, 100.0, 0.0).isEqualRGB(bColor.setChansRGB( 96, 0, 6)) ==
true);
6719 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LCH, 0.0, 50.0, 0.0).isEqualRGB(bColor.setChansRGB( 57, 0, 2)) ==
true);
6720 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LCH, 0.0, 0.0, 180.0).isEqualRGB(bColor.setChansRGB( 0, 0, 0)) ==
true);
6721 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LCH, 0.0, 50.0, 180.0).isEqualRGB(bColor.setChansRGB( 0, 28, 0)) ==
true);
6722 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LCH, 50.0, 50.0, 180.0).isEqualRGB(bColor.setChansRGB( 0, 139, 117)) ==
true);
6723 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LCH, 100.0, 100.0, 360.0).isEqualRGB(bColor.setChansRGB(255, 155, 255)) ==
true);
6724 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LCH, 100.0, 100.0, 180.0).isEqualRGB(bColor.setChansRGB( 0, 255, 252)) ==
true);
6725 BOOST_TEST_CHECK(aColor.setRGBfromColorSpace(mjr::colorRGB8b::colorSpaceEnum::LCH, 100.0, 100.0, 60.0).isEqualRGB(bColor.setChansRGB(255, 211, 78)) ==
true);
6727 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LCH, 0.0, 0.0, 0.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 0.00000000000000F/255.0F, 0.00000000000000F/255.0F), 0.00001F) ==
true);
6728 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LCH, 0.0, 100.0, 0.0).isCloseRGB(fColor.setChansRGB( 96.73833014676526F/255.0F, 0.00000000000000F/255.0F, 6.73101465756404F/255.0F), 0.00001F) ==
true);
6729 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LCH, 0.0, 50.0, 0.0).isCloseRGB(fColor.setChansRGB( 57.41225747257089F/255.0F, 0.00000000000000F/255.0F, 2.34936006058456F/255.0F), 0.00001F) ==
true);
6730 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LCH, 0.0, 0.0, 180.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 0.00000000000000F/255.0F, 0.00000000000000F/255.0F), 0.00001F) ==
true);
6731 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LCH, 0.0, 50.0, 180.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 28.32099136175329F/255.0F, 0.00000000000000F/255.0F), 0.00001F) ==
true);
6732 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LCH, 50.0, 50.0, 180.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 139.16169169667540F/255.0F, 117.60474230139480F/255.0F), 0.00001F) ==
true);
6733 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LCH, 100.0, 100.0, 360.0).isCloseRGB(fColor.setChansRGB(255.00000000000000F/255.0F, 155.40224018978810F/255.0F, 255.00000000000000F/255.0F), 0.00001F) ==
true);
6734 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LCH, 100.0, 100.0, 180.0).isCloseRGB(fColor.setChansRGB( 0.00000000000000F/255.0F, 255.00000000000000F/255.0F, 252.06306109593692F/255.0F), 0.00001F) ==
true);
6735 BOOST_TEST_CHECK(eColor.setRGBfromColorSpace(mjr::colorRGB32F::colorSpaceEnum::LCH, 100.0, 100.0, 60.0).isCloseRGB(fColor.setChansRGB(255.00000000000000F/255.0F, 211.98994181103800F/255.0F, 78.02765922273178F/255.0F), 0.00001F) ==
true);
6739BOOST_AUTO_TEST_CASE(csFPcircular12_int) {
6741 mjr::colorRGBA8b aColor;
6742 mjr::colorRGBA32F bColor;
6746 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 0).isEqualRGB(aColor.setChansRGB(0xFF, 0x00, 0x00)));
6747 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 1).isEqualRGB(aColor.setChansRGB(0xFF, 0x7D, 0x00)));
6748 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 2).isEqualRGB(aColor.setChansRGB(0xFF, 0xFF, 0x00)));
6749 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 3).isEqualRGB(aColor.setChansRGB(0x7D, 0xFF, 0x00)));
6750 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 4).isEqualRGB(aColor.setChansRGB(0x66, 0xCC, 0x00)));
6751 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 5).isEqualRGB(aColor.setChansRGB(0x66, 0xFF, 0xB2)));
6752 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 6).isEqualRGB(aColor.setChansRGB(0x00, 0xFF, 0xFF)));
6753 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 7).isEqualRGB(aColor.setChansRGB(0x00, 0x7D, 0xFF)));
6754 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 8).isEqualRGB(aColor.setChansRGB(0x00, 0x00, 0xFF)));
6755 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 9).isEqualRGB(aColor.setChansRGB(0x7D, 0x00, 0xFF)));
6756 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(10).isEqualRGB(aColor.setChansRGB(0xFF, 0x00, 0xFF)));
6757 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(11).isEqualRGB(aColor.setChansRGB(0xFF, 0x00, 0x7D)));
6761 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(12).isEqualRGB(aColor.setChansRGB(0xFF, 0x00, 0x00)));
6762 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(13).isEqualRGB(aColor.setChansRGB(0xFF, 0x7D, 0x00)));
6763 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(14).isEqualRGB(aColor.setChansRGB(0xFF, 0xFF, 0x00)));
6764 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(15).isEqualRGB(aColor.setChansRGB(0x7D, 0xFF, 0x00)));
6765 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(16).isEqualRGB(aColor.setChansRGB(0x66, 0xCC, 0x00)));
6766 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(17).isEqualRGB(aColor.setChansRGB(0x66, 0xFF, 0xB2)));
6767 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(18).isEqualRGB(aColor.setChansRGB(0x00, 0xFF, 0xFF)));
6768 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(19).isEqualRGB(aColor.setChansRGB(0x00, 0x7D, 0xFF)));
6769 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(20).isEqualRGB(aColor.setChansRGB(0x00, 0x00, 0xFF)));
6770 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(21).isEqualRGB(aColor.setChansRGB(0x7D, 0x00, 0xFF)));
6771 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(22).isEqualRGB(aColor.setChansRGB(0xFF, 0x00, 0xFF)));
6772 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(23).isEqualRGB(aColor.setChansRGB(0xFF, 0x00, 0x7D)));
6776 aColor.setToBlack();
6777 mjr::colorRGBA8b::csFPcircular12::c(aColor, 0);
6778 BOOST_TEST_CHECK(aColor.getRed() == 0xFF);
6779 BOOST_TEST_CHECK(aColor.getGreen() == 0x00);
6780 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
6781 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGBA8b::minChanVal);
6783 aColor.setToWhite();
6784 mjr::colorRGBA8b::csFPcircular12::c(aColor, 0);
6785 BOOST_TEST_CHECK(aColor.getRed() == 0xFF);
6786 BOOST_TEST_CHECK(aColor.getGreen() == 0x00);
6787 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
6788 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGBA8b::maxChanVal);
6792 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 0).isCloseRGB(bColor.setChansRGB(0xFF/255.0F, 0x00/255.0F, 0x00/255.0F), 0.00001F));
6793 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 1).isCloseRGB(bColor.setChansRGB(0xFF/255.0F, 0x7D/255.0F, 0x00/255.0F), 0.00001F));
6794 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 2).isCloseRGB(bColor.setChansRGB(0xFF/255.0F, 0xFF/255.0F, 0x00/255.0F), 0.00001F));
6795 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 3).isCloseRGB(bColor.setChansRGB(0x7D/255.0F, 0xFF/255.0F, 0x00/255.0F), 0.00001F));
6796 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 4).isCloseRGB(bColor.setChansRGB(0x66/255.0F, 0xCC/255.0F, 0x00/255.0F), 0.00001F));
6797 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 5).isCloseRGB(bColor.setChansRGB(0x66/255.0F, 0xFF/255.0F, 0xB2/255.0F), 0.00001F));
6798 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 6).isCloseRGB(bColor.setChansRGB(0x00/255.0F, 0xFF/255.0F, 0xFF/255.0F), 0.00001F));
6799 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 7).isCloseRGB(bColor.setChansRGB(0x00/255.0F, 0x7D/255.0F, 0xFF/255.0F), 0.00001F));
6800 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 8).isCloseRGB(bColor.setChansRGB(0x00/255.0F, 0x00/255.0F, 0xFF/255.0F), 0.00001F));
6801 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 9).isCloseRGB(bColor.setChansRGB(0x7D/255.0F, 0x00/255.0F, 0xFF/255.0F), 0.00001F));
6802 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c(10).isCloseRGB(bColor.setChansRGB(0xFF/255.0F, 0x00/255.0F, 0xFF/255.0F), 0.00001F));
6803 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c(11).isCloseRGB(bColor.setChansRGB(0xFF/255.0F, 0x00/255.0F, 0x7D/255.0F), 0.00001F));
6807 bColor.setToBlack();
6808 mjr::colorRGBA32F::csCBSpectral::c(bColor, 0);
6809 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA32F::minChanVal);
6811 bColor.setToWhite();
6812 mjr::colorRGBA32F::csCBSpectral::c(bColor, 0);
6813 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA32F::maxChanVal);
6818BOOST_AUTO_TEST_CASE(csFPcircular12_flt) {
6820 mjr::colorRGBA8b aColor;
6821 mjr::colorRGBA32F bColor;
6825 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 0/11.0F).isCloseRGB(aColor.setChansRGB(0xFF, 0x00, 0x00), 2));
6826 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 1/11.0F).isCloseRGB(aColor.setChansRGB(0xFF, 0x7D, 0x00), 2));
6827 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 2/11.0F).isCloseRGB(aColor.setChansRGB(0xFF, 0xFF, 0x00), 2));
6828 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 3/11.0F).isCloseRGB(aColor.setChansRGB(0x7D, 0xFF, 0x00), 2));
6829 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 4/11.0F).isCloseRGB(aColor.setChansRGB(0x66, 0xCC, 0x00), 2));
6830 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 5/11.0F).isCloseRGB(aColor.setChansRGB(0x66, 0xFF, 0xB2), 2));
6831 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 6/11.0F).isCloseRGB(aColor.setChansRGB(0x00, 0xFF, 0xFF), 2));
6832 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 7/11.0F).isCloseRGB(aColor.setChansRGB(0x00, 0x7D, 0xFF), 2));
6833 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 8/11.0F).isCloseRGB(aColor.setChansRGB(0x00, 0x00, 0xFF), 2));
6834 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c( 9/11.0F).isCloseRGB(aColor.setChansRGB(0x7D, 0x00, 0xFF), 2));
6835 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(10/11.0F).isCloseRGB(aColor.setChansRGB(0xFF, 0x00, 0xFF), 2));
6836 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(11/11.0F).isCloseRGB(aColor.setChansRGB(0xFF, 0x00, 0x7D), 2));
6840 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(1+ 1/11.0F).isCloseRGB(aColor.setChansRGB(0xFF, 0x7D, 0x00), 2));
6841 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(1+ 2/11.0F).isCloseRGB(aColor.setChansRGB(0xFF, 0xFF, 0x00), 2));
6842 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(1+ 3/11.0F).isCloseRGB(aColor.setChansRGB(0x7D, 0xFF, 0x00), 2));
6843 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(1+ 4/11.0F).isCloseRGB(aColor.setChansRGB(0x66, 0xCC, 0x00), 2));
6844 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(1+ 5/11.0F).isCloseRGB(aColor.setChansRGB(0x66, 0xFF, 0xB2), 2));
6845 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(1+ 6/11.0F).isCloseRGB(aColor.setChansRGB(0x00, 0xFF, 0xFF), 2));
6846 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(1+ 7/11.0F).isCloseRGB(aColor.setChansRGB(0x00, 0x7D, 0xFF), 2));
6847 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(1+ 8/11.0F).isCloseRGB(aColor.setChansRGB(0x00, 0x00, 0xFF), 2));
6848 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(1+ 9/11.0F).isCloseRGB(aColor.setChansRGB(0x7D, 0x00, 0xFF), 2));
6849 BOOST_TEST_CHECK(mjr::colorRGBA8b::csFPcircular12::c(1+10/11.0F).isCloseRGB(aColor.setChansRGB(0xFF, 0x00, 0xFF), 2));
6853 aColor.setToBlack();
6854 mjr::colorRGBA8b::csFPcircular12::c(aColor, 0.0F);
6855 BOOST_TEST_CHECK(aColor.getRed() == 0xFF);
6856 BOOST_TEST_CHECK(aColor.getGreen() == 0x00);
6857 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
6858 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGBA8b::minChanVal);
6860 aColor.setToWhite();
6861 mjr::colorRGBA8b::csFPcircular12::c(aColor, 0.0F);
6862 BOOST_TEST_CHECK(aColor.getRed() == 0xFF);
6863 BOOST_TEST_CHECK(aColor.getGreen() == 0x00);
6864 BOOST_TEST_CHECK(aColor.getBlue() == 0x00);
6865 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGBA8b::maxChanVal);
6869 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 0/11.0F).isCloseRGB(bColor.setChansRGB(0xFF/255.0F, 0x00/255.0F, 0x00/255.0F), 0.00001F));
6870 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 1/11.0F).isCloseRGB(bColor.setChansRGB(0xFF/255.0F, 0x7D/255.0F, 0x00/255.0F), 0.00001F));
6871 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 2/11.0F).isCloseRGB(bColor.setChansRGB(0xFF/255.0F, 0xFF/255.0F, 0x00/255.0F), 0.00001F));
6872 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 3/11.0F).isCloseRGB(bColor.setChansRGB(0x7D/255.0F, 0xFF/255.0F, 0x00/255.0F), 0.00001F));
6873 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 4/11.0F).isCloseRGB(bColor.setChansRGB(0x66/255.0F, 0xCC/255.0F, 0x00/255.0F), 0.00001F));
6874 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 5/11.0F).isCloseRGB(bColor.setChansRGB(0x66/255.0F, 0xFF/255.0F, 0xB2/255.0F), 0.00001F));
6875 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 6/11.0F).isCloseRGB(bColor.setChansRGB(0x00/255.0F, 0xFF/255.0F, 0xFF/255.0F), 0.00001F));
6876 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 7/11.0F).isCloseRGB(bColor.setChansRGB(0x00/255.0F, 0x7D/255.0F, 0xFF/255.0F), 0.00001F));
6877 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 8/11.0F).isCloseRGB(bColor.setChansRGB(0x00/255.0F, 0x00/255.0F, 0xFF/255.0F), 0.00001F));
6878 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c( 9/11.0F).isCloseRGB(bColor.setChansRGB(0x7D/255.0F, 0x00/255.0F, 0xFF/255.0F), 0.00001F));
6879 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c(10/11.0F).isCloseRGB(bColor.setChansRGB(0xFF/255.0F, 0x00/255.0F, 0xFF/255.0F), 0.00001F));
6880 BOOST_TEST_CHECK(mjr::colorRGBA32F::csFPcircular12::c(11/11.0F).isCloseRGB(bColor.setChansRGB(0xFF/255.0F, 0x00/255.0F, 0x7D/255.0F), 0.00001F));
6884 bColor.setToBlack();
6885 mjr::colorRGBA32F::csCBSpectral::c(bColor, 0.0F);
6886 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA32F::minChanVal);
6888 bColor.setToWhite();
6889 mjr::colorRGBA32F::csCBSpectral::c(bColor, 0.0F);
6890 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA32F::maxChanVal);
6894BOOST_AUTO_TEST_CASE(rgb2colorSpace) {
6896 mjr::colorRGB8b aColor;
6897 mjr::colorRGB8b::colConDbl3 bColor;
6898 mjr::colorRGB32F cColor;
6899 mjr::colorRGB32F::colConDbl3 dColor;
6900 mjr::colorRGB16b eColor;
6901 mjr::colorRGB16b::colConDbl3 fColor;
6902 mjr::colorRGB32b gColor;
6903 mjr::colorRGB32b::colConDbl3 hColor;
6907 aColor.setChansRGB(mjr::colorRGB8b::minChanVal, mjr::colorRGB8b::meanChanVal, mjr::colorRGB8b::maxChanVal);
6908 bColor = aColor.rgb2colorSpace(mjr::colorRGB8b::colorSpaceEnum::RGB);
6909 BOOST_TEST_CHECK(bColor.getC0() == 0.0, boost::test_tools::tolerance(0.00001));
6910 BOOST_TEST_CHECK(bColor.getC1() == 0.5, boost::test_tools::tolerance(0.01));
6911 BOOST_TEST_CHECK(bColor.getC2() == 1.0, boost::test_tools::tolerance(0.00001));
6913 eColor.setChansRGB(mjr::colorRGB16b::minChanVal, mjr::colorRGB16b::meanChanVal, mjr::colorRGB16b::maxChanVal);
6914 fColor = eColor.rgb2colorSpace(mjr::colorRGB16b::colorSpaceEnum::RGB);
6915 BOOST_TEST_CHECK(fColor.getC0() == 0.0, boost::test_tools::tolerance(0.00001));
6916 BOOST_TEST_CHECK(fColor.getC1() == 0.5, boost::test_tools::tolerance(0.0001));
6917 BOOST_TEST_CHECK(fColor.getC2() == 1.0, boost::test_tools::tolerance(0.00001));
6919 gColor.setChansRGB(mjr::colorRGB32b::minChanVal, mjr::colorRGB32b::meanChanVal, mjr::colorRGB32b::maxChanVal);
6920 hColor = gColor.rgb2colorSpace(mjr::colorRGB32b::colorSpaceEnum::RGB);
6921 BOOST_TEST_CHECK(hColor.getC0() == 0.0, boost::test_tools::tolerance(0.00001));
6922 BOOST_TEST_CHECK(hColor.getC1() == 0.5, boost::test_tools::tolerance(0.00001));
6923 BOOST_TEST_CHECK(hColor.getC2() == 1.0, boost::test_tools::tolerance(0.00001));
6934 cColor.setChansRGB(mjr::colorRGB32F::minChanVal, mjr::colorRGB32F::meanChanVal, mjr::colorRGB32F::maxChanVal);
6936 dColor = cColor.rgb2colorSpace(mjr::colorRGB32F::colorSpaceEnum::RGB);
6937 BOOST_TEST_CHECK(dColor.getC0() == 0.000000000000000, boost::test_tools::tolerance(0.00001));
6938 BOOST_TEST_CHECK(dColor.getC1() == 0.500000000000000, boost::test_tools::tolerance(0.00001));
6939 BOOST_TEST_CHECK(dColor.getC2() == 1.000000000000000, boost::test_tools::tolerance(0.00001));
6941 dColor = cColor.rgb2colorSpace(mjr::colorRGB32F::colorSpaceEnum::HSL);
6942 BOOST_TEST_CHECK(dColor.getC0() == 210.000000000000000, boost::test_tools::tolerance(0.00001));
6943 BOOST_TEST_CHECK(dColor.getC1() == 1.000000000000000, boost::test_tools::tolerance(0.00001));
6944 BOOST_TEST_CHECK(dColor.getC2() == 0.500000000000000, boost::test_tools::tolerance(0.00001));
6946 dColor = cColor.rgb2colorSpace(mjr::colorRGB32F::colorSpaceEnum::HSV);
6947 BOOST_TEST_CHECK(dColor.getC0() == 210.000000000000000, boost::test_tools::tolerance(0.00001));
6948 BOOST_TEST_CHECK(dColor.getC1() == 1.000000000000000, boost::test_tools::tolerance(0.00001));
6949 BOOST_TEST_CHECK(dColor.getC2() == 1.000000000000000, boost::test_tools::tolerance(0.00001));
6951 dColor = cColor.rgb2colorSpace(mjr::colorRGB32F::colorSpaceEnum::LAB);
6952 BOOST_TEST_CHECK(dColor.getC0() == 54.583029905007749, boost::test_tools::tolerance(0.00001));
6953 BOOST_TEST_CHECK(dColor.getC1() == 19.106431157445371, boost::test_tools::tolerance(0.00001));
6954 BOOST_TEST_CHECK(dColor.getC2() == -71.140167945193781, boost::test_tools::tolerance(0.00001));
6956 dColor = cColor.rgb2colorSpace(mjr::colorRGB32F::colorSpaceEnum::XYZ);
6957 BOOST_TEST_CHECK(dColor.getC0() == 25.704111183644635, boost::test_tools::tolerance(0.00001));
6958 BOOST_TEST_CHECK(dColor.getC1() == 22.528222367289271, boost::test_tools::tolerance(0.00001));
6959 BOOST_TEST_CHECK(dColor.getC2() == 97.601370394548212, boost::test_tools::tolerance(0.00001));
6961 dColor = cColor.rgb2colorSpace(mjr::colorRGB32F::colorSpaceEnum::LCH);
6962 BOOST_TEST_CHECK(dColor.getC0() == 54.583029905007749, boost::test_tools::tolerance(0.00001));
6963 BOOST_TEST_CHECK(dColor.getC1() == 73.661246302547553, boost::test_tools::tolerance(0.00001));
6964 BOOST_TEST_CHECK(dColor.getC2() == 285.033419356169360, boost::test_tools::tolerance(0.00001));
6975 cColor.setChansRGB_dbl(0.4, 0.6, 0.8);
6977 dColor = cColor.rgb2colorSpace(mjr::colorRGB32F::colorSpaceEnum::RGB);
6978 BOOST_TEST_CHECK(dColor.getC0() == 0.400000000000000, boost::test_tools::tolerance(0.00001));
6979 BOOST_TEST_CHECK(dColor.getC1() == 0.6000000000000000, boost::test_tools::tolerance(0.00001));
6980 BOOST_TEST_CHECK(dColor.getC2() == 0.800000000000000, boost::test_tools::tolerance(0.00001));
6982 dColor = cColor.rgb2colorSpace(mjr::colorRGB32F::colorSpaceEnum::HSL);
6983 BOOST_TEST_CHECK(dColor.getC0() == 209.999996870756100, boost::test_tools::tolerance(0.00001));
6984 BOOST_TEST_CHECK(dColor.getC1() == 0.4999999962747098, boost::test_tools::tolerance(0.00001));
6985 BOOST_TEST_CHECK(dColor.getC2() == 0.600000002980232, boost::test_tools::tolerance(0.00001));
6987 dColor = cColor.rgb2colorSpace(mjr::colorRGB32F::colorSpaceEnum::HSV);
6988 BOOST_TEST_CHECK(dColor.getC0() == 209.999996870756100, boost::test_tools::tolerance(0.00001));
6989 BOOST_TEST_CHECK(dColor.getC1() == 0.5000000000000000, boost::test_tools::tolerance(0.00001));
6990 BOOST_TEST_CHECK(dColor.getC2() == 0.800000000000000, boost::test_tools::tolerance(0.00001));
6992 dColor = cColor.rgb2colorSpace(mjr::colorRGB32F::colorSpaceEnum::LAB);
6993 BOOST_TEST_CHECK(dColor.getC0() == 61.625634479116870, boost::test_tools::tolerance(0.00001));
6994 BOOST_TEST_CHECK(dColor.getC1() == -2.8148222106305076, boost::test_tools::tolerance(0.01));
6995 BOOST_TEST_CHECK(dColor.getC2() == -31.439123763222420, boost::test_tools::tolerance(0.01));
6997 dColor = cColor.rgb2colorSpace(mjr::colorRGB32F::colorSpaceEnum::XYZ);
6998 BOOST_TEST_CHECK(dColor.getC0() == 27.769805832971585, boost::test_tools::tolerance(0.00001));
6999 BOOST_TEST_CHECK(dColor.getC1() == 29.9668794742762760, boost::test_tools::tolerance(0.00001));
7000 BOOST_TEST_CHECK(dColor.getC2() == 61.447302014049825, boost::test_tools::tolerance(0.00001));
7002 dColor = cColor.rgb2colorSpace(mjr::colorRGB32F::colorSpaceEnum::LCH);
7003 BOOST_TEST_CHECK(dColor.getC0() == 61.625634479116870, boost::test_tools::tolerance(0.00001));
7004 BOOST_TEST_CHECK(dColor.getC1() == 31.5648812302006830, boost::test_tools::tolerance(0.01));
7005 BOOST_TEST_CHECK(dColor.getC2() == 264.883809161551100, boost::test_tools::tolerance(0.01));
7009BOOST_AUTO_TEST_CASE(csBin) {
7011 mjr::colorRGB8b a0Color, a1Color;
7012 mjr::colorRGB32F b0Color, b1Color;
7014 a0Color.setToBlack();
7015 a1Color.setToWhite();
7017 b0Color.setToBlack();
7018 b1Color.setToWhite();
7022 BOOST_TEST_CHECK(mjr::colorRGB8b::csBin01::c(0).isEqualRGB(a0Color) ==
true);
7023 BOOST_TEST_CHECK(mjr::colorRGB8b::csBin01::c(2).isEqualRGB(a0Color) ==
true);
7024 BOOST_TEST_CHECK(mjr::colorRGB8b::csBin01::c(4).isEqualRGB(a0Color) ==
true);
7025 BOOST_TEST_CHECK(mjr::colorRGB8b::csBin01::c(6).isEqualRGB(a0Color) ==
true);
7026 BOOST_TEST_CHECK(mjr::colorRGB8b::csBin01::c(8).isEqualRGB(a0Color) ==
true);
7028 BOOST_TEST_CHECK(mjr::colorRGB8b::csBin01::c(1).isEqualRGB(a1Color) ==
true);
7029 BOOST_TEST_CHECK(mjr::colorRGB8b::csBin01::c(3).isEqualRGB(a1Color) ==
true);
7030 BOOST_TEST_CHECK(mjr::colorRGB8b::csBin01::c(5).isEqualRGB(a1Color) ==
true);
7031 BOOST_TEST_CHECK(mjr::colorRGB8b::csBin01::c(7).isEqualRGB(a1Color) ==
true);
7032 BOOST_TEST_CHECK(mjr::colorRGB8b::csBin01::c(9).isEqualRGB(a1Color) ==
true);
7036 BOOST_TEST_CHECK(mjr::colorRGB32F::csBin01::c(0).isEqualRGB(b0Color) ==
true);
7037 BOOST_TEST_CHECK(mjr::colorRGB32F::csBin01::c(2).isEqualRGB(b0Color) ==
true);
7038 BOOST_TEST_CHECK(mjr::colorRGB32F::csBin01::c(4).isEqualRGB(b0Color) ==
true);
7039 BOOST_TEST_CHECK(mjr::colorRGB32F::csBin01::c(6).isEqualRGB(b0Color) ==
true);
7040 BOOST_TEST_CHECK(mjr::colorRGB32F::csBin01::c(8).isEqualRGB(b0Color) ==
true);
7042 BOOST_TEST_CHECK(mjr::colorRGB32F::csBin01::c(1).isEqualRGB(b1Color) ==
true);
7043 BOOST_TEST_CHECK(mjr::colorRGB32F::csBin01::c(3).isEqualRGB(b1Color) ==
true);
7044 BOOST_TEST_CHECK(mjr::colorRGB32F::csBin01::c(5).isEqualRGB(b1Color) ==
true);
7045 BOOST_TEST_CHECK(mjr::colorRGB32F::csBin01::c(7).isEqualRGB(b1Color) ==
true);
7046 BOOST_TEST_CHECK(mjr::colorRGB32F::csBin01::c(9).isEqualRGB(b1Color) ==
true);
7050BOOST_AUTO_TEST_CASE(setColorCons) {
7052 mjr::colorRGBA8b aColor;
7053 mjr::colorRGBA64b bColor;
7054 mjr::colorRGBA32F cColor;
7055 mjr::colorRGBA64F dColor;
7058 aColor.setToWhite();
7059 aColor.setToBlack();
7060 BOOST_TEST_CHECK(aColor.getC0() == aColor.minChanVal);
7061 BOOST_TEST_CHECK(aColor.getC1() == aColor.minChanVal);
7062 BOOST_TEST_CHECK(aColor.getC2() == aColor.minChanVal);
7063 BOOST_TEST_CHECK(aColor.getC3() == aColor.minChanVal);
7065 bColor.setToWhite();
7066 bColor.setToBlack();
7067 BOOST_TEST_CHECK(bColor.getC0() == bColor.minChanVal);
7068 BOOST_TEST_CHECK(bColor.getC1() == bColor.minChanVal);
7069 BOOST_TEST_CHECK(bColor.getC2() == bColor.minChanVal);
7070 BOOST_TEST_CHECK(bColor.getC3() == bColor.minChanVal);
7072 cColor.setToWhite();
7073 cColor.setToBlack();
7074 BOOST_TEST_CHECK(cColor.getC0() == cColor.minChanVal);
7075 BOOST_TEST_CHECK(cColor.getC1() == cColor.minChanVal);
7076 BOOST_TEST_CHECK(cColor.getC2() == cColor.minChanVal);
7077 BOOST_TEST_CHECK(cColor.getC3() == cColor.minChanVal);
7079 dColor.setToWhite();
7080 dColor.setToBlack();
7081 BOOST_TEST_CHECK(dColor.getC0() == dColor.minChanVal);
7082 BOOST_TEST_CHECK(dColor.getC1() == dColor.minChanVal);
7083 BOOST_TEST_CHECK(dColor.getC2() == dColor.minChanVal);
7084 BOOST_TEST_CHECK(dColor.getC3() == dColor.minChanVal);
7087 aColor.setToBlack();
7088 aColor.setToWhite();
7089 BOOST_TEST_CHECK(aColor.getC0() == aColor.maxChanVal);
7090 BOOST_TEST_CHECK(aColor.getC1() == aColor.maxChanVal);
7091 BOOST_TEST_CHECK(aColor.getC2() == aColor.maxChanVal);
7092 BOOST_TEST_CHECK(aColor.getC3() == aColor.maxChanVal);
7094 bColor.setToBlack();
7095 bColor.setToWhite();
7096 BOOST_TEST_CHECK(bColor.getC0() == bColor.maxChanVal);
7097 BOOST_TEST_CHECK(bColor.getC1() == bColor.maxChanVal);
7098 BOOST_TEST_CHECK(bColor.getC2() == bColor.maxChanVal);
7099 BOOST_TEST_CHECK(bColor.getC3() == bColor.maxChanVal);
7101 cColor.setToBlack();
7102 cColor.setToWhite();
7103 BOOST_TEST_CHECK(cColor.getC0() == cColor.maxChanVal);
7104 BOOST_TEST_CHECK(cColor.getC1() == cColor.maxChanVal);
7105 BOOST_TEST_CHECK(cColor.getC2() == cColor.maxChanVal);
7106 BOOST_TEST_CHECK(cColor.getC3() == cColor.maxChanVal);
7108 dColor.setToBlack();
7109 dColor.setToWhite();
7110 BOOST_TEST_CHECK(dColor.getC0() == dColor.maxChanVal);
7111 BOOST_TEST_CHECK(dColor.getC1() == dColor.maxChanVal);
7112 BOOST_TEST_CHECK(dColor.getC2() == dColor.maxChanVal);
7113 BOOST_TEST_CHECK(dColor.getC3() == dColor.maxChanVal);
7116 aColor.setToBlack();
7118 BOOST_TEST_CHECK(aColor.getC0() == aColor.maxChanVal);
7119 BOOST_TEST_CHECK(aColor.getC1() == aColor.minChanVal);
7120 BOOST_TEST_CHECK(aColor.getC2() == aColor.minChanVal);
7121 BOOST_TEST_CHECK(aColor.getC3() == aColor.minChanVal);
7123 bColor.setToBlack();
7125 BOOST_TEST_CHECK(bColor.getC0() == bColor.maxChanVal);
7126 BOOST_TEST_CHECK(bColor.getC1() == bColor.minChanVal);
7127 BOOST_TEST_CHECK(bColor.getC2() == bColor.minChanVal);
7128 BOOST_TEST_CHECK(bColor.getC3() == bColor.minChanVal);
7130 cColor.setToBlack();
7132 BOOST_TEST_CHECK(cColor.getC0() == cColor.maxChanVal);
7133 BOOST_TEST_CHECK(cColor.getC1() == cColor.minChanVal);
7134 BOOST_TEST_CHECK(cColor.getC2() == cColor.minChanVal);
7135 BOOST_TEST_CHECK(cColor.getC3() == cColor.minChanVal);
7137 dColor.setToBlack();
7139 BOOST_TEST_CHECK(dColor.getC0() == dColor.maxChanVal);
7140 BOOST_TEST_CHECK(dColor.getC1() == dColor.minChanVal);
7141 BOOST_TEST_CHECK(dColor.getC2() == dColor.minChanVal);
7142 BOOST_TEST_CHECK(dColor.getC3() == dColor.minChanVal);
7145 aColor.setToWhite();
7147 BOOST_TEST_CHECK(aColor.getC0() == aColor.maxChanVal);
7148 BOOST_TEST_CHECK(aColor.getC1() == aColor.minChanVal);
7149 BOOST_TEST_CHECK(aColor.getC2() == aColor.minChanVal);
7150 BOOST_TEST_CHECK(aColor.getC3() == aColor.minChanVal);
7152 bColor.setToWhite();
7154 BOOST_TEST_CHECK(bColor.getC0() == bColor.maxChanVal);
7155 BOOST_TEST_CHECK(bColor.getC1() == bColor.minChanVal);
7156 BOOST_TEST_CHECK(bColor.getC2() == bColor.minChanVal);
7157 BOOST_TEST_CHECK(bColor.getC3() == bColor.minChanVal);
7159 cColor.setToWhite();
7161 BOOST_TEST_CHECK(cColor.getC0() == cColor.maxChanVal);
7162 BOOST_TEST_CHECK(cColor.getC1() == cColor.minChanVal);
7163 BOOST_TEST_CHECK(cColor.getC2() == cColor.minChanVal);
7164 BOOST_TEST_CHECK(cColor.getC3() == cColor.minChanVal);
7166 dColor.setToWhite();
7168 BOOST_TEST_CHECK(dColor.getC0() == dColor.maxChanVal);
7169 BOOST_TEST_CHECK(dColor.getC1() == dColor.minChanVal);
7170 BOOST_TEST_CHECK(dColor.getC2() == dColor.minChanVal);
7171 BOOST_TEST_CHECK(dColor.getC3() == dColor.minChanVal);
7174 aColor.setToBlack();
7175 aColor.setToGreen();
7176 BOOST_TEST_CHECK(aColor.getC0() == aColor.minChanVal);
7177 BOOST_TEST_CHECK(aColor.getC1() == aColor.maxChanVal);
7178 BOOST_TEST_CHECK(aColor.getC2() == aColor.minChanVal);
7179 BOOST_TEST_CHECK(aColor.getC3() == aColor.minChanVal);
7181 bColor.setToBlack();
7182 bColor.setToGreen();
7183 BOOST_TEST_CHECK(bColor.getC0() == bColor.minChanVal);
7184 BOOST_TEST_CHECK(bColor.getC1() == bColor.maxChanVal);
7185 BOOST_TEST_CHECK(bColor.getC2() == bColor.minChanVal);
7186 BOOST_TEST_CHECK(bColor.getC3() == bColor.minChanVal);
7188 cColor.setToBlack();
7189 cColor.setToGreen();
7190 BOOST_TEST_CHECK(cColor.getC0() == cColor.minChanVal);
7191 BOOST_TEST_CHECK(cColor.getC1() == cColor.maxChanVal);
7192 BOOST_TEST_CHECK(cColor.getC2() == cColor.minChanVal);
7193 BOOST_TEST_CHECK(cColor.getC3() == cColor.minChanVal);
7195 dColor.setToBlack();
7196 dColor.setToGreen();
7197 BOOST_TEST_CHECK(dColor.getC0() == dColor.minChanVal);
7198 BOOST_TEST_CHECK(dColor.getC1() == dColor.maxChanVal);
7199 BOOST_TEST_CHECK(dColor.getC2() == dColor.minChanVal);
7200 BOOST_TEST_CHECK(dColor.getC3() == dColor.minChanVal);
7203 aColor.setToWhite();
7204 aColor.setToGreen();
7205 BOOST_TEST_CHECK(aColor.getC0() == aColor.minChanVal);
7206 BOOST_TEST_CHECK(aColor.getC1() == aColor.maxChanVal);
7207 BOOST_TEST_CHECK(aColor.getC2() == aColor.minChanVal);
7208 BOOST_TEST_CHECK(aColor.getC3() == aColor.minChanVal);
7210 bColor.setToWhite();
7211 bColor.setToGreen();
7212 BOOST_TEST_CHECK(bColor.getC0() == bColor.minChanVal);
7213 BOOST_TEST_CHECK(bColor.getC1() == bColor.maxChanVal);
7214 BOOST_TEST_CHECK(bColor.getC2() == bColor.minChanVal);
7215 BOOST_TEST_CHECK(bColor.getC3() == bColor.minChanVal);
7217 cColor.setToWhite();
7218 cColor.setToGreen();
7219 BOOST_TEST_CHECK(cColor.getC0() == cColor.minChanVal);
7220 BOOST_TEST_CHECK(cColor.getC1() == cColor.maxChanVal);
7221 BOOST_TEST_CHECK(cColor.getC2() == cColor.minChanVal);
7222 BOOST_TEST_CHECK(cColor.getC3() == cColor.minChanVal);
7224 dColor.setToWhite();
7225 dColor.setToGreen();
7226 BOOST_TEST_CHECK(dColor.getC0() == dColor.minChanVal);
7227 BOOST_TEST_CHECK(dColor.getC1() == dColor.maxChanVal);
7228 BOOST_TEST_CHECK(dColor.getC2() == dColor.minChanVal);
7229 BOOST_TEST_CHECK(dColor.getC3() == dColor.minChanVal);
7232 aColor.setToBlack();
7234 BOOST_TEST_CHECK(aColor.getC0() == aColor.minChanVal);
7235 BOOST_TEST_CHECK(aColor.getC1() == aColor.minChanVal);
7236 BOOST_TEST_CHECK(aColor.getC2() == aColor.maxChanVal);
7237 BOOST_TEST_CHECK(aColor.getC3() == aColor.minChanVal);
7239 bColor.setToBlack();
7241 BOOST_TEST_CHECK(bColor.getC0() == bColor.minChanVal);
7242 BOOST_TEST_CHECK(bColor.getC1() == bColor.minChanVal);
7243 BOOST_TEST_CHECK(bColor.getC2() == bColor.maxChanVal);
7244 BOOST_TEST_CHECK(bColor.getC3() == bColor.minChanVal);
7246 cColor.setToBlack();
7248 BOOST_TEST_CHECK(cColor.getC0() == cColor.minChanVal);
7249 BOOST_TEST_CHECK(cColor.getC1() == cColor.minChanVal);
7250 BOOST_TEST_CHECK(cColor.getC2() == cColor.maxChanVal);
7251 BOOST_TEST_CHECK(cColor.getC3() == cColor.minChanVal);
7253 dColor.setToBlack();
7255 BOOST_TEST_CHECK(dColor.getC0() == dColor.minChanVal);
7256 BOOST_TEST_CHECK(dColor.getC1() == dColor.minChanVal);
7257 BOOST_TEST_CHECK(dColor.getC2() == dColor.maxChanVal);
7258 BOOST_TEST_CHECK(dColor.getC3() == dColor.minChanVal);
7261 aColor.setToWhite();
7263 BOOST_TEST_CHECK(aColor.getC0() == aColor.minChanVal);
7264 BOOST_TEST_CHECK(aColor.getC1() == aColor.minChanVal);
7265 BOOST_TEST_CHECK(aColor.getC2() == aColor.maxChanVal);
7266 BOOST_TEST_CHECK(aColor.getC3() == aColor.minChanVal);
7268 bColor.setToWhite();
7270 BOOST_TEST_CHECK(bColor.getC0() == bColor.minChanVal);
7271 BOOST_TEST_CHECK(bColor.getC1() == bColor.minChanVal);
7272 BOOST_TEST_CHECK(bColor.getC2() == bColor.maxChanVal);
7273 BOOST_TEST_CHECK(bColor.getC3() == bColor.minChanVal);
7275 cColor.setToWhite();
7277 BOOST_TEST_CHECK(cColor.getC0() == cColor.minChanVal);
7278 BOOST_TEST_CHECK(cColor.getC1() == cColor.minChanVal);
7279 BOOST_TEST_CHECK(cColor.getC2() == cColor.maxChanVal);
7280 BOOST_TEST_CHECK(cColor.getC3() == cColor.minChanVal);
7282 dColor.setToWhite();
7284 BOOST_TEST_CHECK(dColor.getC0() == dColor.minChanVal);
7285 BOOST_TEST_CHECK(dColor.getC1() == dColor.minChanVal);
7286 BOOST_TEST_CHECK(dColor.getC2() == dColor.maxChanVal);
7287 BOOST_TEST_CHECK(dColor.getC3() == dColor.minChanVal);
7290 aColor.setToBlack();
7292 BOOST_TEST_CHECK(aColor.getC0() == aColor.minChanVal);
7293 BOOST_TEST_CHECK(aColor.getC1() == aColor.maxChanVal);
7294 BOOST_TEST_CHECK(aColor.getC2() == aColor.maxChanVal);
7295 BOOST_TEST_CHECK(aColor.getC3() == aColor.maxChanVal);
7297 bColor.setToBlack();
7299 BOOST_TEST_CHECK(bColor.getC0() == bColor.minChanVal);
7300 BOOST_TEST_CHECK(bColor.getC1() == bColor.maxChanVal);
7301 BOOST_TEST_CHECK(bColor.getC2() == bColor.maxChanVal);
7302 BOOST_TEST_CHECK(bColor.getC3() == bColor.maxChanVal);
7304 cColor.setToBlack();
7306 BOOST_TEST_CHECK(cColor.getC0() == cColor.minChanVal);
7307 BOOST_TEST_CHECK(cColor.getC1() == cColor.maxChanVal);
7308 BOOST_TEST_CHECK(cColor.getC2() == cColor.maxChanVal);
7309 BOOST_TEST_CHECK(cColor.getC3() == cColor.maxChanVal);
7311 dColor.setToBlack();
7313 BOOST_TEST_CHECK(dColor.getC0() == dColor.minChanVal);
7314 BOOST_TEST_CHECK(dColor.getC1() == dColor.maxChanVal);
7315 BOOST_TEST_CHECK(dColor.getC2() == dColor.maxChanVal);
7316 BOOST_TEST_CHECK(dColor.getC3() == dColor.maxChanVal);
7319 aColor.setToWhite();
7321 BOOST_TEST_CHECK(aColor.getC0() == aColor.minChanVal);
7322 BOOST_TEST_CHECK(aColor.getC1() == aColor.maxChanVal);
7323 BOOST_TEST_CHECK(aColor.getC2() == aColor.maxChanVal);
7324 BOOST_TEST_CHECK(aColor.getC3() == aColor.maxChanVal);
7326 bColor.setToWhite();
7328 BOOST_TEST_CHECK(bColor.getC0() == bColor.minChanVal);
7329 BOOST_TEST_CHECK(bColor.getC1() == bColor.maxChanVal);
7330 BOOST_TEST_CHECK(bColor.getC2() == bColor.maxChanVal);
7331 BOOST_TEST_CHECK(bColor.getC3() == bColor.maxChanVal);
7333 cColor.setToWhite();
7335 BOOST_TEST_CHECK(cColor.getC0() == cColor.minChanVal);
7336 BOOST_TEST_CHECK(cColor.getC1() == cColor.maxChanVal);
7337 BOOST_TEST_CHECK(cColor.getC2() == cColor.maxChanVal);
7338 BOOST_TEST_CHECK(cColor.getC3() == cColor.maxChanVal);
7340 dColor.setToWhite();
7342 BOOST_TEST_CHECK(dColor.getC0() == dColor.minChanVal);
7343 BOOST_TEST_CHECK(dColor.getC1() == dColor.maxChanVal);
7344 BOOST_TEST_CHECK(dColor.getC2() == dColor.maxChanVal);
7345 BOOST_TEST_CHECK(dColor.getC3() == dColor.maxChanVal);
7348 aColor.setToBlack();
7349 aColor.setToMagenta();
7350 BOOST_TEST_CHECK(aColor.getC0() == aColor.maxChanVal);
7351 BOOST_TEST_CHECK(aColor.getC1() == aColor.minChanVal);
7352 BOOST_TEST_CHECK(aColor.getC2() == aColor.maxChanVal);
7353 BOOST_TEST_CHECK(aColor.getC3() == aColor.maxChanVal);
7355 bColor.setToBlack();
7356 bColor.setToMagenta();
7357 BOOST_TEST_CHECK(bColor.getC0() == bColor.maxChanVal);
7358 BOOST_TEST_CHECK(bColor.getC1() == bColor.minChanVal);
7359 BOOST_TEST_CHECK(bColor.getC2() == bColor.maxChanVal);
7360 BOOST_TEST_CHECK(bColor.getC3() == bColor.maxChanVal);
7362 cColor.setToBlack();
7363 cColor.setToMagenta();
7364 BOOST_TEST_CHECK(cColor.getC0() == cColor.maxChanVal);
7365 BOOST_TEST_CHECK(cColor.getC1() == cColor.minChanVal);
7366 BOOST_TEST_CHECK(cColor.getC2() == cColor.maxChanVal);
7367 BOOST_TEST_CHECK(cColor.getC3() == cColor.maxChanVal);
7369 dColor.setToBlack();
7370 dColor.setToMagenta();
7371 BOOST_TEST_CHECK(dColor.getC0() == dColor.maxChanVal);
7372 BOOST_TEST_CHECK(dColor.getC1() == dColor.minChanVal);
7373 BOOST_TEST_CHECK(dColor.getC2() == dColor.maxChanVal);
7374 BOOST_TEST_CHECK(dColor.getC3() == dColor.maxChanVal);
7377 aColor.setToWhite();
7378 aColor.setToMagenta();
7379 BOOST_TEST_CHECK(aColor.getC0() == aColor.maxChanVal);
7380 BOOST_TEST_CHECK(aColor.getC1() == aColor.minChanVal);
7381 BOOST_TEST_CHECK(aColor.getC2() == aColor.maxChanVal);
7382 BOOST_TEST_CHECK(aColor.getC3() == aColor.maxChanVal);
7384 bColor.setToWhite();
7385 bColor.setToMagenta();
7386 BOOST_TEST_CHECK(bColor.getC0() == bColor.maxChanVal);
7387 BOOST_TEST_CHECK(bColor.getC1() == bColor.minChanVal);
7388 BOOST_TEST_CHECK(bColor.getC2() == bColor.maxChanVal);
7389 BOOST_TEST_CHECK(bColor.getC3() == bColor.maxChanVal);
7391 cColor.setToWhite();
7392 cColor.setToMagenta();
7393 BOOST_TEST_CHECK(cColor.getC0() == cColor.maxChanVal);
7394 BOOST_TEST_CHECK(cColor.getC1() == cColor.minChanVal);
7395 BOOST_TEST_CHECK(cColor.getC2() == cColor.maxChanVal);
7396 BOOST_TEST_CHECK(cColor.getC3() == cColor.maxChanVal);
7398 dColor.setToWhite();
7399 dColor.setToMagenta();
7400 BOOST_TEST_CHECK(dColor.getC0() == dColor.maxChanVal);
7401 BOOST_TEST_CHECK(dColor.getC1() == dColor.minChanVal);
7402 BOOST_TEST_CHECK(dColor.getC2() == dColor.maxChanVal);
7403 BOOST_TEST_CHECK(dColor.getC3() == dColor.maxChanVal);
7406 aColor.setToBlack();
7407 aColor.setToYellow();
7408 BOOST_TEST_CHECK(aColor.getC0() == aColor.maxChanVal);
7409 BOOST_TEST_CHECK(aColor.getC1() == aColor.maxChanVal);
7410 BOOST_TEST_CHECK(aColor.getC2() == aColor.minChanVal);
7411 BOOST_TEST_CHECK(aColor.getC3() == aColor.maxChanVal);
7413 bColor.setToBlack();
7414 bColor.setToYellow();
7415 BOOST_TEST_CHECK(bColor.getC0() == bColor.maxChanVal);
7416 BOOST_TEST_CHECK(bColor.getC1() == bColor.maxChanVal);
7417 BOOST_TEST_CHECK(bColor.getC2() == bColor.minChanVal);
7418 BOOST_TEST_CHECK(bColor.getC3() == bColor.maxChanVal);
7420 cColor.setToBlack();
7421 cColor.setToYellow();
7422 BOOST_TEST_CHECK(cColor.getC0() == cColor.maxChanVal);
7423 BOOST_TEST_CHECK(cColor.getC1() == cColor.maxChanVal);
7424 BOOST_TEST_CHECK(cColor.getC2() == cColor.minChanVal);
7425 BOOST_TEST_CHECK(cColor.getC3() == cColor.maxChanVal);
7427 dColor.setToBlack();
7428 dColor.setToYellow();
7429 BOOST_TEST_CHECK(dColor.getC0() == dColor.maxChanVal);
7430 BOOST_TEST_CHECK(dColor.getC1() == dColor.maxChanVal);
7431 BOOST_TEST_CHECK(dColor.getC2() == dColor.minChanVal);
7432 BOOST_TEST_CHECK(dColor.getC3() == dColor.maxChanVal);
7435 aColor.setToWhite();
7436 aColor.setToYellow();
7437 BOOST_TEST_CHECK(aColor.getC0() == aColor.maxChanVal);
7438 BOOST_TEST_CHECK(aColor.getC1() == aColor.maxChanVal);
7439 BOOST_TEST_CHECK(aColor.getC2() == aColor.minChanVal);
7440 BOOST_TEST_CHECK(aColor.getC3() == aColor.maxChanVal);
7442 bColor.setToWhite();
7443 bColor.setToYellow();
7444 BOOST_TEST_CHECK(bColor.getC0() == bColor.maxChanVal);
7445 BOOST_TEST_CHECK(bColor.getC1() == bColor.maxChanVal);
7446 BOOST_TEST_CHECK(bColor.getC2() == bColor.minChanVal);
7447 BOOST_TEST_CHECK(bColor.getC3() == bColor.maxChanVal);
7449 cColor.setToWhite();
7450 cColor.setToYellow();
7451 BOOST_TEST_CHECK(cColor.getC0() == cColor.maxChanVal);
7452 BOOST_TEST_CHECK(cColor.getC1() == cColor.maxChanVal);
7453 BOOST_TEST_CHECK(cColor.getC2() == cColor.minChanVal);
7454 BOOST_TEST_CHECK(cColor.getC3() == cColor.maxChanVal);
7456 dColor.setToWhite();
7457 dColor.setToYellow();
7458 BOOST_TEST_CHECK(dColor.getC0() == dColor.maxChanVal);
7459 BOOST_TEST_CHECK(dColor.getC1() == dColor.maxChanVal);
7460 BOOST_TEST_CHECK(dColor.getC2() == dColor.minChanVal);
7461 BOOST_TEST_CHECK(dColor.getC3() == dColor.maxChanVal);
7464 aColor.setToBlack();
7466 BOOST_TEST_CHECK(aColor.getC0() == aColor.meanChanVal);
7467 BOOST_TEST_CHECK(aColor.getC1() == aColor.meanChanVal);
7468 BOOST_TEST_CHECK(aColor.getC2() == aColor.meanChanVal);
7469 BOOST_TEST_CHECK(aColor.getC3() == aColor.meanChanVal);
7471 bColor.setToBlack();
7473 BOOST_TEST_CHECK(bColor.getC0() == bColor.meanChanVal);
7474 BOOST_TEST_CHECK(bColor.getC1() == bColor.meanChanVal);
7475 BOOST_TEST_CHECK(bColor.getC2() == bColor.meanChanVal);
7476 BOOST_TEST_CHECK(bColor.getC3() == bColor.meanChanVal);
7478 cColor.setToBlack();
7480 BOOST_TEST_CHECK(cColor.getC0() == cColor.meanChanVal);
7481 BOOST_TEST_CHECK(cColor.getC1() == cColor.meanChanVal);
7482 BOOST_TEST_CHECK(cColor.getC2() == cColor.meanChanVal);
7483 BOOST_TEST_CHECK(cColor.getC3() == cColor.meanChanVal);
7485 dColor.setToBlack();
7487 BOOST_TEST_CHECK(dColor.getC0() == dColor.meanChanVal);
7488 BOOST_TEST_CHECK(dColor.getC1() == dColor.meanChanVal);
7489 BOOST_TEST_CHECK(dColor.getC2() == dColor.meanChanVal);
7490 BOOST_TEST_CHECK(dColor.getC3() == dColor.meanChanVal);
7493 aColor.setToWhite();
7495 BOOST_TEST_CHECK(aColor.getC0() == aColor.meanChanVal);
7496 BOOST_TEST_CHECK(aColor.getC1() == aColor.meanChanVal);
7497 BOOST_TEST_CHECK(aColor.getC2() == aColor.meanChanVal);
7498 BOOST_TEST_CHECK(aColor.getC3() == aColor.meanChanVal);
7500 bColor.setToWhite();
7502 BOOST_TEST_CHECK(bColor.getC0() == bColor.meanChanVal);
7503 BOOST_TEST_CHECK(bColor.getC1() == bColor.meanChanVal);
7504 BOOST_TEST_CHECK(bColor.getC2() == bColor.meanChanVal);
7505 BOOST_TEST_CHECK(bColor.getC3() == bColor.meanChanVal);
7507 cColor.setToWhite();
7509 BOOST_TEST_CHECK(cColor.getC0() == cColor.meanChanVal);
7510 BOOST_TEST_CHECK(cColor.getC1() == cColor.meanChanVal);
7511 BOOST_TEST_CHECK(cColor.getC2() == cColor.meanChanVal);
7512 BOOST_TEST_CHECK(cColor.getC3() == cColor.meanChanVal);
7514 dColor.setToWhite();
7516 BOOST_TEST_CHECK(dColor.getC0() == dColor.meanChanVal);
7517 BOOST_TEST_CHECK(dColor.getC1() == dColor.meanChanVal);
7518 BOOST_TEST_CHECK(dColor.getC2() == dColor.meanChanVal);
7519 BOOST_TEST_CHECK(dColor.getC3() == dColor.meanChanVal);
7524BOOST_AUTO_TEST_CASE(csHSLh) {
7528 mjr::colorRGBA8b aColor;
7530 aColor.setToWhite();
7531 mjr::colorRGBA8b::csHSLhB::c(aColor, mjr::colorRGB8b::meanChanVal);
7532 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGB8b::maxChanVal);
7534 aColor.setToBlack();
7535 mjr::colorRGBA8b::csHSLhB::c(aColor, mjr::colorRGB8b::meanChanVal);
7536 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGB8b::minChanVal);
7540 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhB::c(mjr::colorRGB8b::minChanVal).getRed() == mjr::colorRGB8b::meanChanVal);
7541 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhB::c(mjr::colorRGB8b::minChanVal).getGreen() == mjr::colorRGB8b::meanChanVal);
7542 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhB::c(mjr::colorRGB8b::minChanVal).getBlue() == mjr::colorRGB8b::meanChanVal);
7544 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhC::c(mjr::colorRGB8b::minChanVal).getRed() == mjr::colorRGB8b::meanChanVal);
7545 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhC::c(mjr::colorRGB8b::minChanVal).getGreen() == mjr::colorRGB8b::meanChanVal);
7546 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhC::c(mjr::colorRGB8b::minChanVal).getBlue() == mjr::colorRGB8b::meanChanVal);
7548 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhG::c(mjr::colorRGB8b::minChanVal).getRed() == mjr::colorRGB8b::meanChanVal);
7549 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhG::c(mjr::colorRGB8b::minChanVal).getGreen() == mjr::colorRGB8b::meanChanVal);
7550 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhG::c(mjr::colorRGB8b::minChanVal).getBlue() == mjr::colorRGB8b::meanChanVal);
7552 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhM::c(mjr::colorRGB8b::minChanVal).getRed() == mjr::colorRGB8b::meanChanVal);
7553 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhM::c(mjr::colorRGB8b::minChanVal).getGreen() == mjr::colorRGB8b::meanChanVal);
7554 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhM::c(mjr::colorRGB8b::minChanVal).getBlue() == mjr::colorRGB8b::meanChanVal);
7556 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhR::c(mjr::colorRGB8b::minChanVal).getRed() == mjr::colorRGB8b::meanChanVal);
7557 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhR::c(mjr::colorRGB8b::minChanVal).getGreen() == mjr::colorRGB8b::meanChanVal);
7558 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhR::c(mjr::colorRGB8b::minChanVal).getBlue() == mjr::colorRGB8b::meanChanVal);
7560 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhY::c(mjr::colorRGB8b::minChanVal).getRed() == mjr::colorRGB8b::meanChanVal);
7561 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhY::c(mjr::colorRGB8b::minChanVal).getGreen() == mjr::colorRGB8b::meanChanVal);
7562 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhY::c(mjr::colorRGB8b::minChanVal).getBlue() == mjr::colorRGB8b::meanChanVal);
7566 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhB::c(mjr::colorRGB8b::meanChanVal).getRed() == mjr::colorRGB8b::minChanVal);
7567 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhB::c(mjr::colorRGB8b::meanChanVal).getGreen() == mjr::colorRGB8b::minChanVal);
7568 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhB::c(mjr::colorRGB8b::meanChanVal).getBlue() == mjr::colorRGB8b::maxChanVal - 1);
7570 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhC::c(mjr::colorRGB8b::meanChanVal).getRed() == mjr::colorRGB8b::minChanVal);
7571 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhC::c(mjr::colorRGB8b::meanChanVal).getGreen() == mjr::colorRGB8b::maxChanVal - 1);
7572 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhC::c(mjr::colorRGB8b::meanChanVal).getBlue() == mjr::colorRGB8b::maxChanVal - 1);
7574 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhG::c(mjr::colorRGB8b::meanChanVal).getRed() == mjr::colorRGB8b::minChanVal);
7575 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhG::c(mjr::colorRGB8b::meanChanVal).getGreen() == mjr::colorRGB8b::maxChanVal - 1);
7576 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhG::c(mjr::colorRGB8b::meanChanVal).getBlue() == mjr::colorRGB8b::minChanVal);
7578 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhM::c(mjr::colorRGB8b::meanChanVal).getRed() == mjr::colorRGB8b::maxChanVal - 1);
7579 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhM::c(mjr::colorRGB8b::meanChanVal).getGreen() == mjr::colorRGB8b::minChanVal);
7580 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhM::c(mjr::colorRGB8b::meanChanVal).getBlue() == mjr::colorRGB8b::maxChanVal - 1);
7582 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhR::c(mjr::colorRGB8b::meanChanVal).getRed() == mjr::colorRGB8b::maxChanVal - 1);
7583 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhR::c(mjr::colorRGB8b::meanChanVal).getGreen() == mjr::colorRGB8b::minChanVal);
7584 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhR::c(mjr::colorRGB8b::meanChanVal).getBlue() == mjr::colorRGB8b::minChanVal);
7586 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhY::c(mjr::colorRGB8b::meanChanVal).getRed() == mjr::colorRGB8b::maxChanVal - 1);
7587 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhY::c(mjr::colorRGB8b::meanChanVal).getGreen() == mjr::colorRGB8b::maxChanVal - 1);
7588 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhY::c(mjr::colorRGB8b::meanChanVal).getBlue() == mjr::colorRGB8b::minChanVal);
7592 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhB::c(mjr::colorRGB8b::meanChanVal + 1).getRed() == mjr::colorRGB8b::meanChanVal);
7593 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhB::c(mjr::colorRGB8b::meanChanVal + 1).getGreen() == mjr::colorRGB8b::meanChanVal);
7594 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhB::c(mjr::colorRGB8b::meanChanVal + 1).getBlue() == mjr::colorRGB8b::meanChanVal);
7596 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhC::c(mjr::colorRGB8b::meanChanVal + 1).getRed() == mjr::colorRGB8b::meanChanVal);
7597 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhC::c(mjr::colorRGB8b::meanChanVal + 1).getGreen() == mjr::colorRGB8b::meanChanVal);
7598 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhC::c(mjr::colorRGB8b::meanChanVal + 1).getBlue() == mjr::colorRGB8b::meanChanVal);
7600 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhG::c(mjr::colorRGB8b::meanChanVal + 1).getRed() == mjr::colorRGB8b::meanChanVal);
7601 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhG::c(mjr::colorRGB8b::meanChanVal + 1).getGreen() == mjr::colorRGB8b::meanChanVal);
7602 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhG::c(mjr::colorRGB8b::meanChanVal + 1).getBlue() == mjr::colorRGB8b::meanChanVal);
7604 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhM::c(mjr::colorRGB8b::meanChanVal + 1).getRed() == mjr::colorRGB8b::meanChanVal);
7605 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhM::c(mjr::colorRGB8b::meanChanVal + 1).getGreen() == mjr::colorRGB8b::meanChanVal);
7606 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhM::c(mjr::colorRGB8b::meanChanVal + 1).getBlue() == mjr::colorRGB8b::meanChanVal);
7608 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhR::c(mjr::colorRGB8b::meanChanVal + 1).getRed() == mjr::colorRGB8b::meanChanVal);
7609 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhR::c(mjr::colorRGB8b::meanChanVal + 1).getGreen() == mjr::colorRGB8b::meanChanVal);
7610 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhR::c(mjr::colorRGB8b::meanChanVal + 1).getBlue() == mjr::colorRGB8b::meanChanVal);
7612 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhY::c(mjr::colorRGB8b::meanChanVal + 1).getRed() == mjr::colorRGB8b::meanChanVal);
7613 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhY::c(mjr::colorRGB8b::meanChanVal + 1).getGreen() == mjr::colorRGB8b::meanChanVal);
7614 BOOST_TEST_CHECK(mjr::colorRGB8b::csHSLhY::c(mjr::colorRGB8b::meanChanVal + 1).getBlue() == mjr::colorRGB8b::meanChanVal);
7618 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhB::c(mjr::colorRGB16b::minChanVal).getRed() == mjr::colorRGB16b::meanChanVal);
7619 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhB::c(mjr::colorRGB16b::minChanVal).getGreen() == mjr::colorRGB16b::meanChanVal);
7620 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhB::c(mjr::colorRGB16b::minChanVal).getBlue() == mjr::colorRGB16b::meanChanVal);
7622 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhC::c(mjr::colorRGB16b::minChanVal).getRed() == mjr::colorRGB16b::meanChanVal);
7623 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhC::c(mjr::colorRGB16b::minChanVal).getGreen() == mjr::colorRGB16b::meanChanVal);
7624 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhC::c(mjr::colorRGB16b::minChanVal).getBlue() == mjr::colorRGB16b::meanChanVal);
7626 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhG::c(mjr::colorRGB16b::minChanVal).getRed() == mjr::colorRGB16b::meanChanVal);
7627 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhG::c(mjr::colorRGB16b::minChanVal).getGreen() == mjr::colorRGB16b::meanChanVal);
7628 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhG::c(mjr::colorRGB16b::minChanVal).getBlue() == mjr::colorRGB16b::meanChanVal);
7630 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhM::c(mjr::colorRGB16b::minChanVal).getRed() == mjr::colorRGB16b::meanChanVal);
7631 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhM::c(mjr::colorRGB16b::minChanVal).getGreen() == mjr::colorRGB16b::meanChanVal);
7632 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhM::c(mjr::colorRGB16b::minChanVal).getBlue() == mjr::colorRGB16b::meanChanVal);
7634 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhR::c(mjr::colorRGB16b::minChanVal).getRed() == mjr::colorRGB16b::meanChanVal);
7635 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhR::c(mjr::colorRGB16b::minChanVal).getGreen() == mjr::colorRGB16b::meanChanVal);
7636 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhR::c(mjr::colorRGB16b::minChanVal).getBlue() == mjr::colorRGB16b::meanChanVal);
7638 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhY::c(mjr::colorRGB16b::minChanVal).getRed() == mjr::colorRGB16b::meanChanVal);
7639 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhY::c(mjr::colorRGB16b::minChanVal).getGreen() == mjr::colorRGB16b::meanChanVal);
7640 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhY::c(mjr::colorRGB16b::minChanVal).getBlue() == mjr::colorRGB16b::meanChanVal);
7644 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhB::c(mjr::colorRGB16b::meanChanVal).getRed() == mjr::colorRGB16b::minChanVal);
7645 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhB::c(mjr::colorRGB16b::meanChanVal).getGreen() == mjr::colorRGB16b::minChanVal);
7646 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhB::c(mjr::colorRGB16b::meanChanVal).getBlue() == mjr::colorRGB16b::maxChanVal - 1);
7648 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhC::c(mjr::colorRGB16b::meanChanVal).getRed() == mjr::colorRGB16b::minChanVal);
7649 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhC::c(mjr::colorRGB16b::meanChanVal).getGreen() == mjr::colorRGB16b::maxChanVal - 1);
7650 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhC::c(mjr::colorRGB16b::meanChanVal).getBlue() == mjr::colorRGB16b::maxChanVal - 1);
7652 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhG::c(mjr::colorRGB16b::meanChanVal).getRed() == mjr::colorRGB16b::minChanVal);
7653 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhG::c(mjr::colorRGB16b::meanChanVal).getGreen() == mjr::colorRGB16b::maxChanVal - 1);
7654 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhG::c(mjr::colorRGB16b::meanChanVal).getBlue() == mjr::colorRGB16b::minChanVal);
7656 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhM::c(mjr::colorRGB16b::meanChanVal).getRed() == mjr::colorRGB16b::maxChanVal - 1);
7657 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhM::c(mjr::colorRGB16b::meanChanVal).getGreen() == mjr::colorRGB16b::minChanVal);
7658 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhM::c(mjr::colorRGB16b::meanChanVal).getBlue() == mjr::colorRGB16b::maxChanVal - 1);
7660 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhR::c(mjr::colorRGB16b::meanChanVal).getRed() == mjr::colorRGB16b::maxChanVal - 1);
7661 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhR::c(mjr::colorRGB16b::meanChanVal).getGreen() == mjr::colorRGB16b::minChanVal);
7662 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhR::c(mjr::colorRGB16b::meanChanVal).getBlue() == mjr::colorRGB16b::minChanVal);
7664 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhY::c(mjr::colorRGB16b::meanChanVal).getRed() == mjr::colorRGB16b::maxChanVal - 1);
7665 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhY::c(mjr::colorRGB16b::meanChanVal).getGreen() == mjr::colorRGB16b::maxChanVal - 1);
7666 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhY::c(mjr::colorRGB16b::meanChanVal).getBlue() == mjr::colorRGB16b::minChanVal);
7670 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhB::c(mjr::colorRGB16b::meanChanVal + 1).getRed() == mjr::colorRGB16b::meanChanVal);
7671 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhB::c(mjr::colorRGB16b::meanChanVal + 1).getGreen() == mjr::colorRGB16b::meanChanVal);
7672 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhB::c(mjr::colorRGB16b::meanChanVal + 1).getBlue() == mjr::colorRGB16b::meanChanVal);
7674 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhC::c(mjr::colorRGB16b::meanChanVal + 1).getRed() == mjr::colorRGB16b::meanChanVal);
7675 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhC::c(mjr::colorRGB16b::meanChanVal + 1).getGreen() == mjr::colorRGB16b::meanChanVal);
7676 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhC::c(mjr::colorRGB16b::meanChanVal + 1).getBlue() == mjr::colorRGB16b::meanChanVal);
7678 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhG::c(mjr::colorRGB16b::meanChanVal + 1).getRed() == mjr::colorRGB16b::meanChanVal);
7679 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhG::c(mjr::colorRGB16b::meanChanVal + 1).getGreen() == mjr::colorRGB16b::meanChanVal);
7680 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhG::c(mjr::colorRGB16b::meanChanVal + 1).getBlue() == mjr::colorRGB16b::meanChanVal);
7682 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhM::c(mjr::colorRGB16b::meanChanVal + 1).getRed() == mjr::colorRGB16b::meanChanVal);
7683 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhM::c(mjr::colorRGB16b::meanChanVal + 1).getGreen() == mjr::colorRGB16b::meanChanVal);
7684 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhM::c(mjr::colorRGB16b::meanChanVal + 1).getBlue() == mjr::colorRGB16b::meanChanVal);
7686 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhR::c(mjr::colorRGB16b::meanChanVal + 1).getRed() == mjr::colorRGB16b::meanChanVal);
7687 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhR::c(mjr::colorRGB16b::meanChanVal + 1).getGreen() == mjr::colorRGB16b::meanChanVal);
7688 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhR::c(mjr::colorRGB16b::meanChanVal + 1).getBlue() == mjr::colorRGB16b::meanChanVal);
7690 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhY::c(mjr::colorRGB16b::meanChanVal + 1).getRed() == mjr::colorRGB16b::meanChanVal);
7691 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhY::c(mjr::colorRGB16b::meanChanVal + 1).getGreen() == mjr::colorRGB16b::meanChanVal);
7692 BOOST_TEST_CHECK(mjr::colorRGB16b::csHSLhY::c(mjr::colorRGB16b::meanChanVal + 1).getBlue() == mjr::colorRGB16b::meanChanVal);
7697 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhB::c(0.0).getRed() == mjr::colorRGB32F::meanChanVal);
7698 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhB::c(0.0).getGreen() == mjr::colorRGB32F::meanChanVal);
7699 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhB::c(0.0).getBlue() == mjr::colorRGB32F::meanChanVal);
7701 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhC::c(0.0).getRed() == mjr::colorRGB32F::meanChanVal);
7702 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhC::c(0.0).getGreen() == mjr::colorRGB32F::meanChanVal);
7703 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhC::c(0.0).getBlue() == mjr::colorRGB32F::meanChanVal);
7705 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhG::c(0.0).getRed() == mjr::colorRGB32F::meanChanVal);
7706 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhG::c(0.0).getGreen() == mjr::colorRGB32F::meanChanVal);
7707 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhG::c(0.0).getBlue() == mjr::colorRGB32F::meanChanVal);
7709 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhM::c(0.0).getRed() == mjr::colorRGB32F::meanChanVal);
7710 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhM::c(0.0).getGreen() == mjr::colorRGB32F::meanChanVal);
7711 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhM::c(0.0).getBlue() == mjr::colorRGB32F::meanChanVal);
7713 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhR::c(0.0).getRed() == mjr::colorRGB32F::meanChanVal);
7714 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhR::c(0.0).getGreen() == mjr::colorRGB32F::meanChanVal);
7715 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhR::c(0.0).getBlue() == mjr::colorRGB32F::meanChanVal);
7717 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhY::c(0.0).getRed() == mjr::colorRGB32F::meanChanVal);
7718 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhY::c(0.0).getGreen() == mjr::colorRGB32F::meanChanVal);
7719 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhY::c(0.0).getBlue() == mjr::colorRGB32F::meanChanVal);
7723 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhB::c(mjr::colorRGBA32F::meanChanVal).getRed() == mjr::colorRGB32F::minChanVal);
7724 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhB::c(mjr::colorRGBA32F::meanChanVal).getGreen() == mjr::colorRGB32F::minChanVal);
7725 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhB::c(mjr::colorRGBA32F::meanChanVal).getBlue() == mjr::colorRGB32F::maxChanVal);
7727 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhC::c(mjr::colorRGBA32F::meanChanVal).getRed() == mjr::colorRGB32F::minChanVal);
7728 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhC::c(mjr::colorRGBA32F::meanChanVal).getGreen() == mjr::colorRGB32F::maxChanVal);
7729 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhC::c(mjr::colorRGBA32F::meanChanVal).getBlue() == mjr::colorRGB32F::maxChanVal);
7731 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhG::c(mjr::colorRGBA32F::meanChanVal).getRed() == mjr::colorRGB32F::minChanVal);
7732 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhG::c(mjr::colorRGBA32F::meanChanVal).getGreen() == mjr::colorRGB32F::maxChanVal);
7733 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhG::c(mjr::colorRGBA32F::meanChanVal).getBlue() == mjr::colorRGB32F::minChanVal);
7735 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhM::c(mjr::colorRGBA32F::meanChanVal).getRed() == mjr::colorRGB32F::maxChanVal);
7736 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhM::c(mjr::colorRGBA32F::meanChanVal).getGreen() == mjr::colorRGB32F::minChanVal);
7737 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhM::c(mjr::colorRGBA32F::meanChanVal).getBlue() == mjr::colorRGB32F::maxChanVal);
7739 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhR::c(mjr::colorRGBA32F::meanChanVal).getRed() == mjr::colorRGB32F::maxChanVal);
7740 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhR::c(mjr::colorRGBA32F::meanChanVal).getGreen() == mjr::colorRGB32F::minChanVal);
7741 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhR::c(mjr::colorRGBA32F::meanChanVal).getBlue() == mjr::colorRGB32F::minChanVal);
7743 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhY::c(mjr::colorRGBA32F::meanChanVal).getRed() == mjr::colorRGB32F::maxChanVal);
7744 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhY::c(mjr::colorRGBA32F::meanChanVal).getGreen() == mjr::colorRGB32F::maxChanVal);
7745 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhY::c(mjr::colorRGBA32F::meanChanVal).getBlue() == mjr::colorRGB32F::minChanVal);
7749 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhB::c(mjr::colorRGBA32F::meanChanVal + 1).getRed() == mjr::colorRGB32F::meanChanVal);
7750 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhB::c(mjr::colorRGBA32F::meanChanVal + 1).getGreen() == mjr::colorRGB32F::meanChanVal);
7751 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhB::c(mjr::colorRGBA32F::meanChanVal + 1).getBlue() == mjr::colorRGB32F::meanChanVal);
7753 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhC::c(mjr::colorRGBA32F::meanChanVal + 1).getRed() == mjr::colorRGB32F::meanChanVal);
7754 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhC::c(mjr::colorRGBA32F::meanChanVal + 1).getGreen() == mjr::colorRGB32F::meanChanVal);
7755 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhC::c(mjr::colorRGBA32F::meanChanVal + 1).getBlue() == mjr::colorRGB32F::meanChanVal);
7757 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhG::c(mjr::colorRGBA32F::meanChanVal + 1).getRed() == mjr::colorRGB32F::meanChanVal);
7758 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhG::c(mjr::colorRGBA32F::meanChanVal + 1).getGreen() == mjr::colorRGB32F::meanChanVal);
7759 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhG::c(mjr::colorRGBA32F::meanChanVal + 1).getBlue() == mjr::colorRGB32F::meanChanVal);
7761 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhM::c(mjr::colorRGBA32F::meanChanVal + 1).getRed() == mjr::colorRGB32F::meanChanVal);
7762 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhM::c(mjr::colorRGBA32F::meanChanVal + 1).getGreen() == mjr::colorRGB32F::meanChanVal);
7763 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhM::c(mjr::colorRGBA32F::meanChanVal + 1).getBlue() == mjr::colorRGB32F::meanChanVal);
7765 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhR::c(mjr::colorRGBA32F::meanChanVal + 1).getRed() == mjr::colorRGB32F::meanChanVal);
7766 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhR::c(mjr::colorRGBA32F::meanChanVal + 1).getGreen() == mjr::colorRGB32F::meanChanVal);
7767 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhR::c(mjr::colorRGBA32F::meanChanVal + 1).getBlue() == mjr::colorRGB32F::meanChanVal);
7769 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhY::c(mjr::colorRGBA32F::meanChanVal + 1).getRed() == mjr::colorRGB32F::meanChanVal);
7770 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhY::c(mjr::colorRGBA32F::meanChanVal + 1).getGreen() == mjr::colorRGB32F::meanChanVal);
7771 BOOST_TEST_CHECK(mjr::colorRGB32F::csHSLhY::c(mjr::colorRGBA32F::meanChanVal + 1).getBlue() == mjr::colorRGB32F::meanChanVal);
7774#if !(MISSING_P1907R1)
7776BOOST_AUTO_TEST_CASE(csPLY) {
7780 mjr::colorRGBA8b aColor;
7782 aColor.setToWhite();
7783 mjr::colorRGBA8b::csPLYgrey::c(aColor, 0.0);
7784 BOOST_TEST_CHECK(aColor.getRed() == mjr::colorRGB8b::minChanVal);
7785 BOOST_TEST_CHECK(aColor.getBlue() == mjr::colorRGB8b::minChanVal);
7786 BOOST_TEST_CHECK(aColor.getGreen() == mjr::colorRGB8b::minChanVal);
7787 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGB8b::maxChanVal);
7789 aColor.setToBlack();
7790 mjr::colorRGBA8b::csPLYgrey::c(aColor, 0.0);
7791 BOOST_TEST_CHECK(aColor.getRed() == mjr::colorRGB8b::minChanVal);
7792 BOOST_TEST_CHECK(aColor.getBlue() == mjr::colorRGB8b::minChanVal);
7793 BOOST_TEST_CHECK(aColor.getGreen() == mjr::colorRGB8b::minChanVal);
7794 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGB8b::minChanVal);
7798 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYgrey::c(0.0).getRed() == mjr::colorRGB8b::minChanVal);
7799 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYgrey::c(0.0).getGreen() == mjr::colorRGB8b::minChanVal);
7800 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYgrey::c(0.0).getBlue() == mjr::colorRGB8b::minChanVal);
7802 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYgrey::c(0.5).getRed() == mjr::colorRGB8b::meanChanVal);
7803 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYgrey::c(0.5).getGreen() == mjr::colorRGB8b::meanChanVal);
7804 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYgrey::c(0.5).getBlue() == mjr::colorRGB8b::meanChanVal);
7806 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYgrey::c(1.0).getRed() == mjr::colorRGB8b::maxChanVal);
7807 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYgrey::c(1.0).getGreen() == mjr::colorRGB8b::maxChanVal);
7808 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYgrey::c(1.0).getBlue() == mjr::colorRGB8b::maxChanVal);
7812 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYquad::c(0.0).getRed() == mjr::colorRGB8b::minChanVal);
7813 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYquad::c(0.0).getGreen() == mjr::colorRGB8b::minChanVal);
7814 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYquad::c(0.0).getBlue() == mjr::colorRGB8b::minChanVal);
7816 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYquad::c(0.5).getRed() == 0x3F);
7817 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYquad::c(0.5).getGreen() == 0x3F);
7818 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYquad::c(0.5).getBlue() == 0x3F);
7820 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYquad::c(1.0).getRed() == mjr::colorRGB8b::maxChanVal);
7821 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYquad::c(1.0).getGreen() == mjr::colorRGB8b::maxChanVal);
7822 BOOST_TEST_CHECK(mjr::colorRGB8b::csPLYquad::c(1.0).getBlue() == mjr::colorRGB8b::maxChanVal);
7826 typedef mjr::colorRGB64F::csPLY_tpl< 10.6666666666667, -16.000000000000, 6.3333333333333, 0.00000000000000,
7827 -9.3333333333333, 13.000000000000, -4.6666666666666, 1.00000000000000,
7828 4.4117333333333, -5.902400000000, 1.9936666666666, 0.28480000000000> csPLYfoo;
7830 BOOST_TEST_CHECK(csPLYfoo::c(0.00).getRed() == 0.000000, boost::test_tools::tolerance(0.00001));
7831 BOOST_TEST_CHECK(csPLYfoo::c(0.00).getGreen() == 1.000000, boost::test_tools::tolerance(0.00001));
7832 BOOST_TEST_CHECK(csPLYfoo::c(0.00).getBlue() == 0.284800, boost::test_tools::tolerance(0.00001));
7834 BOOST_TEST_CHECK(csPLYfoo::c(0.25).getRed() == 0.750000, boost::test_tools::tolerance(0.00001));
7835 BOOST_TEST_CHECK(csPLYfoo::c(0.25).getGreen() == 0.500000, boost::test_tools::tolerance(0.00001));
7836 BOOST_TEST_CHECK(csPLYfoo::c(0.25).getBlue() == 0.483250, boost::test_tools::tolerance(0.00001));
7838 BOOST_TEST_CHECK(csPLYfoo::c(0.50).getRed() == 0.500000, boost::test_tools::tolerance(0.00001));
7839 BOOST_TEST_CHECK(csPLYfoo::c(0.50).getGreen() == 0.750000, boost::test_tools::tolerance(0.00001));
7840 BOOST_TEST_CHECK(csPLYfoo::c(0.50).getBlue() == 0.357500, boost::test_tools::tolerance(0.00001));
7842 BOOST_TEST_CHECK(csPLYfoo::c(1.00).getRed() == 1.000000, boost::test_tools::tolerance(0.00001));
7843 BOOST_TEST_CHECK(csPLYfoo::c(1.00).getGreen() == 0.000000, boost::test_tools::tolerance(0.00001));
7844 BOOST_TEST_CHECK(csPLYfoo::c(1.00).getBlue() == 0.787800, boost::test_tools::tolerance(0.00001));
7849BOOST_AUTO_TEST_CASE(csCColdeRainbow_flt) {
7851 mjr::colorRGBA8b aColor;
7852 mjr::colorRGBA32F bColor;
7854 aColor.setToWhite();
7855 mjr::colorRGBA8b::csCColdeRainbow::c(aColor, 0.0);
7856 BOOST_TEST_CHECK(aColor.getRed() == mjr::colorRGBA8b::maxChanVal);
7857 BOOST_TEST_CHECK(aColor.getGreen() == mjr::colorRGBA8b::minChanVal);
7858 BOOST_TEST_CHECK(aColor.getBlue() == mjr::colorRGBA8b::minChanVal);
7859 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGBA8b::minChanVal);
7861 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c( 0/1530.0).isEqualRGB(aColor.setToRed()) ==
true);
7862 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c( 255/1530.0).isEqualRGB(aColor.setToYellow()) ==
true);
7863 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c( 510/1530.0).isEqualRGB(aColor.setToGreen()) ==
true);
7864 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c( 765/1530.0).isEqualRGB(aColor.setToCyan()) ==
true);
7865 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c(1020/1530.0).isEqualRGB(aColor.setToBlue()) ==
true);
7866 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c(1275/1530.0).isEqualRGB(aColor.setToMagenta()) ==
true);
7867 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c(1530/1530.0).isEqualRGB(aColor.setToRed()) ==
true);
7869 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c(2.0).isEqualRGB(aColor.setToRed()) ==
true);
7870 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c(3.0).isEqualRGB(aColor.setToRed()) ==
true);
7872 for(
double i=0.0; i<1.0; i=i+0.001)
7873 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c(i).isEqualRGB(aColor.cmpRGBcornerCGradiant(i,
"RYGCBMR")) ==
true);
7875 aColor.cmpRGBcornerCGradiant(10/1530.0,
"RYGCBMR");
7876 BOOST_TEST_CHECK(aColor.getRed() == 0xff);
7877 BOOST_TEST_CHECK(aColor.getGreen() == 10);
7878 BOOST_TEST_CHECK(aColor.getBlue() == 0);
7882 bColor.setToWhite();
7883 mjr::colorRGBA32F::csCColdeRainbow::c(bColor, 0.0F);
7884 BOOST_TEST_CHECK(bColor.getRed() == mjr::colorRGBA32F::maxChanVal);
7885 BOOST_TEST_CHECK(bColor.getGreen() == mjr::colorRGBA32F::minChanVal);
7886 BOOST_TEST_CHECK(bColor.getBlue() == mjr::colorRGBA32F::minChanVal);
7887 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA32F::minChanVal);
7889 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c( 0/1530.0).isCloseRGB(bColor.setToRed(), 0.000001F) ==
true);
7890 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c( 255/1530.0).isCloseRGB(bColor.setToYellow(), 0.000001F) ==
true);
7891 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c( 510/1530.0).isCloseRGB(bColor.setToGreen(), 0.000001F) ==
true);
7892 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c( 765/1530.0).isCloseRGB(bColor.setToCyan(), 0.000001F) ==
true);
7893 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(1020/1530.0).isCloseRGB(bColor.setToBlue(), 0.000001F) ==
true);
7894 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(1275/1530.0).isCloseRGB(bColor.setToMagenta(), 0.000001F) ==
true);
7895 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(1530/1530.0).isCloseRGB(bColor.setToRed(), 0.000001F) ==
true);
7897 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(2.0).isCloseRGB(bColor.setToRed(), 0.000001F) ==
true);
7898 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(3.0).isCloseRGB(bColor.setToRed(), 0.000001F) ==
true);
7900 for(
double i=0.0; i<1.0; i=i+0.001)
7901 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(i).isCloseRGB(bColor.cmpRGBcornerCGradiant(i,
"RYGCBMR"), 0.000001F) ==
true);
7903 bColor.cmpRGBcornerCGradiant(10/1530.0,
"RYGCBMR");
7904 BOOST_TEST_CHECK(bColor.getRed() == 1, boost::test_tools::tolerance(0.00001));
7905 BOOST_TEST_CHECK(bColor.getGreen() == 0.0392156862745, boost::test_tools::tolerance(0.00001));
7906 BOOST_TEST_CHECK(bColor.getBlue() == 0, boost::test_tools::tolerance(0.00001));
7910BOOST_AUTO_TEST_CASE(csCColdeRainbow_int) {
7912 mjr::colorRGBA8b aColor;
7913 mjr::colorRGBA32F bColor;
7915 aColor.setToWhite();
7916 mjr::colorRGBA8b::csCColdeRainbow::c(aColor, 0u);
7917 BOOST_TEST_CHECK(aColor.getRed() == mjr::colorRGBA8b::maxChanVal);
7918 BOOST_TEST_CHECK(aColor.getGreen() == mjr::colorRGBA8b::minChanVal);
7919 BOOST_TEST_CHECK(aColor.getBlue() == mjr::colorRGBA8b::minChanVal);
7920 BOOST_TEST_CHECK(aColor.getAlpha() == mjr::colorRGBA8b::maxChanVal);
7922 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c( 0u).isEqualRGB(aColor.setToRed()) ==
true);
7923 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c( 255u).isEqualRGB(aColor.setToYellow()) ==
true);
7924 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c( 510u).isEqualRGB(aColor.setToGreen()) ==
true);
7925 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c( 765u).isEqualRGB(aColor.setToCyan()) ==
true);
7926 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c(1020u).isEqualRGB(aColor.setToBlue()) ==
true);
7927 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c(1275u).isEqualRGB(aColor.setToMagenta()) ==
true);
7928 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c(1530u).isEqualRGB(aColor.setToRed()) ==
true);
7930 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c(1531u).isEqualRGB(aColor.setToRed()) ==
true);
7931 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c(1786u).isEqualRGB(aColor.setToYellow()) ==
true);
7933 for(
unsigned int i=0; i<1531; i++)
7934 BOOST_TEST_CHECK(mjr::colorRGBA8b::csCColdeRainbow::c(i).isEqualRGB(aColor.cmpRGBcornerDGradiant(i,
"RYGCBMR")) ==
true);
7936 aColor.cmpRGBcornerDGradiant(10u,
"RYGCBMR");
7937 BOOST_TEST_CHECK(aColor.getRed() == 0xff);
7938 BOOST_TEST_CHECK(aColor.getGreen() == 10);
7939 BOOST_TEST_CHECK(aColor.getBlue() == 0);
7943 bColor.setToWhite();
7944 mjr::colorRGBA32F::csCColdeRainbow::c(bColor, 0u);
7945 BOOST_TEST_CHECK(bColor.getRed() == mjr::colorRGBA32F::maxChanVal);
7946 BOOST_TEST_CHECK(bColor.getGreen() == mjr::colorRGBA32F::minChanVal);
7947 BOOST_TEST_CHECK(bColor.getBlue() == mjr::colorRGBA32F::minChanVal);
7948 BOOST_TEST_CHECK(bColor.getAlpha() == mjr::colorRGBA32F::maxChanVal);
7950 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(0*0x100000000ul).isCloseRGB(bColor.setToRed(), 0.000001F) ==
true);
7951 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(1*0x100000000ul).isCloseRGB(bColor.setToYellow(), 0.000001F) ==
true);
7952 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(2*0x100000000ul).isCloseRGB(bColor.setToGreen(), 0.000001F) ==
true);
7953 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(3*0x100000000ul).isCloseRGB(bColor.setToCyan(), 0.000001F) ==
true);
7954 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(4*0x100000000ul).isCloseRGB(bColor.setToBlue(), 0.000001F) ==
true);
7955 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(5*0x100000000ul).isCloseRGB(bColor.setToMagenta(), 0.000001F) ==
true);
7956 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(6*0x100000000ul).isCloseRGB(bColor.setToRed(), 0.000001F) ==
true);
7958 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(6*0x100000000ul+1).isCloseRGB(bColor.setToRed(), 0.000001F) ==
true);
7959 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(7*0x100000000ul+1).isCloseRGB(bColor.setToYellow(), 0.000001F) ==
true);
7961 for(uint64_t i=0; i<0x600000000; i=i+0x600000)
7962 BOOST_TEST_CHECK(mjr::colorRGBA32F::csCColdeRainbow::c(i).isCloseRGB(bColor.cmpRGBcornerDGradiant(i,
"RYGCBMR"), 0.000001F) ==
true);
7964 bColor.cmpRGBcornerDGradiant(168430090,
"RYGCBMR");
7965 BOOST_TEST_CHECK(bColor.getRed() == 1, boost::test_tools::tolerance(0.00001));
7966 BOOST_TEST_CHECK(bColor.getGreen() == 0.0392156862745, boost::test_tools::tolerance(0.00001));
7967 BOOST_TEST_CHECK(bColor.getBlue() == 0, boost::test_tools::tolerance(0.00001));
7971BOOST_AUTO_TEST_CASE(conCol) {
7974 mjr::color8c16b aColor {mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal};
7975 mjr::color8c16b bColor {mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal};
7977 BOOST_TEST_CHECK(aColor.getColConRGB_byte().isEqual( mjr::color8c16b::colConRGBbyte { 0, 255, 0 }) ==
true);
7978 BOOST_TEST_CHECK(bColor.getColConRGB_byte().isEqual( mjr::color8c16b::colConRGBbyte { 255, 0, 255 }) ==
true);
7979 BOOST_TEST_CHECK(aColor.getColConRGBA_byte().isEqual(mjr::color8c16b::colConRGBAbyte{ 0, 255, 0, 255 }) ==
true);
7980 BOOST_TEST_CHECK(bColor.getColConRGBA_byte().isEqual(mjr::color8c16b::colConRGBAbyte{ 255, 0, 255, 0 }) ==
true);
7981 BOOST_TEST_CHECK(aColor.getColConRGB_dbl().isEqual( mjr::color8c16b::colConRGBdbl { 0.0, 1.0, 0.0 }) ==
true);
7982 BOOST_TEST_CHECK(bColor.getColConRGB_dbl().isEqual( mjr::color8c16b::colConRGBdbl { 1.0, 0.0, 1.0 }) ==
true);
7983 BOOST_TEST_CHECK(aColor.getColConRGBA_dbl().isEqual( mjr::color8c16b::colConRGBAdbl { 0.0, 1.0, 0.0, 1.0 }) ==
true);
7984 BOOST_TEST_CHECK(bColor.getColConRGBA_dbl().isEqual( mjr::color8c16b::colConRGBAdbl { 1.0, 0.0, 1.0, 0.0 }) ==
true);
7985 BOOST_TEST_CHECK(aColor.getColCon_byte().isEqual( mjr::color8c16b::colConALLbyte { 0, 255, 0, 255, 0, 255, 0, 255 }) ==
true);
7986 BOOST_TEST_CHECK(bColor.getColCon_byte().isEqual( mjr::color8c16b::colConALLbyte { 255, 0, 255, 0, 255, 0, 255, 0 }) ==
true);
7987 BOOST_TEST_CHECK(aColor.getColCon_dbl().isEqual( mjr::color8c16b::colConALLdbl { 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 }) ==
true);
7988 BOOST_TEST_CHECK(bColor.getColCon_dbl().isEqual( mjr::color8c16b::colConALLdbl { 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 }) ==
true);
7990 mjr::color8c16b cColor;
7991 mjr::color8c16b dColor;
7993 mjr::color8c16b a3nColor {mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::minChanVal};
7994 mjr::color8c16b b3xColor {mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::maxChanVal};
7995 mjr::color8c16b a4nColor {mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::minChanVal};
7996 mjr::color8c16b b4xColor {mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::minChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::maxChanVal, mjr::colorRGBA16b::maxChanVal};
7998 cColor.setToCorner(mjr::color8c16b::cornerColorEnum::BLACK);
7999 BOOST_TEST_CHECK(a3nColor.isEqual(cColor.setChansRGB_byte( mjr::color8c16b::colConRGBbyte { 0, 255, 0 })) ==
true);
8000 dColor.setToCorner(mjr::color8c16b::cornerColorEnum::WHITE);
8001 BOOST_TEST_CHECK(b3xColor.isEqual(dColor.setChansRGB_byte( mjr::color8c16b::colConRGBbyte { 255, 0, 255 })) ==
true);
8002 cColor.setToCorner(mjr::color8c16b::cornerColorEnum::BLACK);
8003 BOOST_TEST_CHECK(a4nColor.isEqual(cColor.setChansRGBA_byte(mjr::color8c16b::colConRGBAbyte{ 0, 255, 0, 255 })) ==
true);
8004 dColor.setToCorner(mjr::color8c16b::cornerColorEnum::WHITE);
8005 BOOST_TEST_CHECK(b4xColor.isEqual(dColor.setChansRGBA_byte(mjr::color8c16b::colConRGBAbyte{ 255, 0, 255, 0 })) ==
true);
8006 cColor.setToCorner(mjr::color8c16b::cornerColorEnum::BLACK);
8007 BOOST_TEST_CHECK(a3nColor.isEqual(cColor.setChansRGB_dbl( mjr::color8c16b::colConRGBdbl { 0.0, 1.0, 0.0 })) ==
true);
8008 dColor.setToCorner(mjr::color8c16b::cornerColorEnum::WHITE);
8009 BOOST_TEST_CHECK(b3xColor.isEqual(dColor.setChansRGB_dbl( mjr::color8c16b::colConRGBdbl { 1.0, 0.0, 1.0 })) ==
true);
8010 cColor.setToCorner(mjr::color8c16b::cornerColorEnum::BLACK);
8011 BOOST_TEST_CHECK(a4nColor.isEqual(cColor.setChansRGBA_dbl( mjr::color8c16b::colConRGBAdbl { 0.0, 1.0, 0.0, 1.0 })) ==
true);
8012 dColor.setToCorner(mjr::color8c16b::cornerColorEnum::WHITE);
8013 BOOST_TEST_CHECK(b4xColor.isEqual(dColor.setChansRGBA_dbl( mjr::color8c16b::colConRGBAdbl { 1.0, 0.0, 1.0, 0.0 })) ==
true);
8014 cColor.setToCorner(mjr::color8c16b::cornerColorEnum::BLACK);
8015 BOOST_TEST_CHECK(aColor.isEqual(cColor.setChans_byte( mjr::color8c16b::colConALLbyte { 0, 255, 0, 255, 0, 255, 0, 255 })) ==
true);
8016 dColor.setToCorner(mjr::color8c16b::cornerColorEnum::WHITE);
8017 BOOST_TEST_CHECK(bColor.isEqual(dColor.setChans_byte( mjr::color8c16b::colConALLbyte { 255, 0, 255, 0, 255, 0, 255, 0 })) ==
true);
8018 cColor.setToCorner(mjr::color8c16b::cornerColorEnum::BLACK);
8019 BOOST_TEST_CHECK(aColor.isEqual(cColor.setChans_dbl( mjr::color8c16b::colConALLdbl { 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 })) ==
true);
8020 dColor.setToCorner(mjr::color8c16b::cornerColorEnum::WHITE);
8021 BOOST_TEST_CHECK(bColor.isEqual(dColor.setChans_dbl( mjr::color8c16b::colConALLdbl { 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 })) ==
true);
8025BOOST_AUTO_TEST_CASE(bestNamedChan) {
8026 mjr::color1c8b aColor;
8027 mjr::color2c8b bColor;
8028 mjr::color3c8b cColor;
8029 mjr::color4c8b dColor;
8030 mjr::color8c8b eColor;
8032 BOOST_TEST_CHECK(aColor.bestRedChan() == 0);
8033 BOOST_TEST_CHECK(bColor.bestRedChan() == 0);
8034 BOOST_TEST_CHECK(cColor.bestRedChan() == 0);
8035 BOOST_TEST_CHECK(dColor.bestRedChan() == 0);
8036 BOOST_TEST_CHECK(eColor.bestRedChan() == 0);
8038 BOOST_TEST_CHECK(aColor.bestGreenChan() == 0);
8039 BOOST_TEST_CHECK(bColor.bestGreenChan() == 1);
8040 BOOST_TEST_CHECK(cColor.bestGreenChan() == 1);
8041 BOOST_TEST_CHECK(dColor.bestGreenChan() == 1);
8042 BOOST_TEST_CHECK(eColor.bestGreenChan() == 1);
8044 BOOST_TEST_CHECK(aColor.bestBlueChan() == 0);
8045 BOOST_TEST_CHECK(bColor.bestBlueChan() == -1);
8046 BOOST_TEST_CHECK(cColor.bestBlueChan() == 2);
8047 BOOST_TEST_CHECK(dColor.bestBlueChan() == 2);
8048 BOOST_TEST_CHECK(eColor.bestBlueChan() == 2);
8050 BOOST_TEST_CHECK(aColor.bestAlphaChan() == -1);
8051 BOOST_TEST_CHECK(bColor.bestAlphaChan() == -1);
8052 BOOST_TEST_CHECK(cColor.bestAlphaChan() == -1);
8053 BOOST_TEST_CHECK(dColor.bestAlphaChan() == 3);
8054 BOOST_TEST_CHECK(eColor.bestAlphaChan() == 3);
8058BOOST_AUTO_TEST_CASE(dist_deltaE, * boost::unit_test::tolerance(0.01)) {
8060 mjr::colorRGBA8b aColor;
8061 mjr::colorRGBA8b bColor;
8064 aColor.setToWhite();
8065 bColor.setToBlack();
8066 BOOST_TEST_CHECK(aColor.distDeltaE1976(bColor) == 100.0);
8067 BOOST_TEST_CHECK(aColor.distDeltaE1994(bColor) == 100.0);
8068 aColor.setToWhite();
8069 bColor.setToWhite();
8070 BOOST_TEST_CHECK(aColor.distDeltaE1976(bColor) == 0.0);
8071 BOOST_TEST_CHECK(aColor.distDeltaE1994(bColor) == 0.0);
8072 aColor.setToBlack();
8073 bColor.setChansRGB(128, 64, 192);
8074 BOOST_TEST_CHECK(aColor.distDeltaE1976(bColor) == 87.0379);
8075 BOOST_TEST_CHECK(aColor.distDeltaE1994(bColor) == 87.0382);
8077 aColor.setToBlack();
8078 bColor.setChansRGB(128, 128, 128);
8079 BOOST_TEST_CHECK(aColor.distDeltaE1976(bColor) == 53.585);
8080 BOOST_TEST_CHECK(aColor.distDeltaE1994(bColor) == 53.585);
8082 aColor.setToBlack();
8083 bColor.setChansRGB(32, 64, 128);
8084 BOOST_TEST_CHECK(aColor.distDeltaE1976(bColor) == 50.1239);
8085 BOOST_TEST_CHECK(aColor.distDeltaE1994(bColor) == 50.1239);
8087 aColor.setToWhite();
8088 bColor.setChansRGB(32, 64, 128);
8089 BOOST_TEST_CHECK(aColor.distDeltaE1976(bColor) == 82.8934);
8090 BOOST_TEST_CHECK(aColor.distDeltaE1994(bColor) == 82.8807);