@@ -489,6 +489,23 @@ class CHSVPalette16 {
489
489
return &(entries[0 ]);
490
490
}
491
491
492
+ bool operator ==( const CHSVPalette16 rhs)
493
+ {
494
+ const uint8_t * p = (const uint8_t *)(&(this ->entries [0 ]));
495
+ const uint8_t * q = (const uint8_t *)(&(rhs.entries [0 ]));
496
+ if ( p == q) return true ;
497
+ for ( uint8_t i = 0 ; i < (sizeof ( entries)); i++) {
498
+ if ( *p != *q) return false ;
499
+ p++;
500
+ q++;
501
+ }
502
+ return true ;
503
+ }
504
+ bool operator !=( const CHSVPalette16 rhs)
505
+ {
506
+ return !( *this == rhs);
507
+ }
508
+
492
509
CHSVPalette16 ( const CHSV& c1)
493
510
{
494
511
fill_solid ( &(entries[0 ]), 16 , c1);
@@ -577,6 +594,23 @@ class CHSVPalette256 {
577
594
return &(entries[0 ]);
578
595
}
579
596
597
+ bool operator ==( const CHSVPalette256 rhs)
598
+ {
599
+ const uint8_t * p = (const uint8_t *)(&(this ->entries [0 ]));
600
+ const uint8_t * q = (const uint8_t *)(&(rhs.entries [0 ]));
601
+ if ( p == q) return true ;
602
+ for ( uint16_t i = 0 ; i < (sizeof ( entries)); i++) {
603
+ if ( *p != *q) return false ;
604
+ p++;
605
+ q++;
606
+ }
607
+ return true ;
608
+ }
609
+ bool operator !=( const CHSVPalette256 rhs)
610
+ {
611
+ return !( *this == rhs);
612
+ }
613
+
580
614
CHSVPalette256 ( const CHSV& c1)
581
615
{
582
616
fill_solid ( &(entries[0 ]), 256 , c1);
@@ -648,6 +682,23 @@ class CRGBPalette16 {
648
682
return *this ;
649
683
}
650
684
685
+ bool operator ==( const CRGBPalette16 rhs)
686
+ {
687
+ const uint8_t * p = (const uint8_t *)(&(this ->entries [0 ]));
688
+ const uint8_t * q = (const uint8_t *)(&(rhs.entries [0 ]));
689
+ if ( p == q) return true ;
690
+ for ( uint8_t i = 0 ; i < (sizeof ( entries)); i++) {
691
+ if ( *p != *q) return false ;
692
+ p++;
693
+ q++;
694
+ }
695
+ return true ;
696
+ }
697
+ bool operator !=( const CRGBPalette16 rhs)
698
+ {
699
+ return !( *this == rhs);
700
+ }
701
+
651
702
inline CRGB& operator [] (uint8_t x) __attribute__((always_inline))
652
703
{
653
704
return entries[x];
@@ -880,6 +931,23 @@ class CRGBPalette256 {
880
931
return *this ;
881
932
}
882
933
934
+ bool operator ==( const CRGBPalette256 rhs)
935
+ {
936
+ const uint8_t * p = (const uint8_t *)(&(this ->entries [0 ]));
937
+ const uint8_t * q = (const uint8_t *)(&(rhs.entries [0 ]));
938
+ if ( p == q) return true ;
939
+ for ( uint16_t i = 0 ; i < (sizeof ( entries)); i++) {
940
+ if ( *p != *q) return false ;
941
+ p++;
942
+ q++;
943
+ }
944
+ return true ;
945
+ }
946
+ bool operator !=( const CRGBPalette256 rhs)
947
+ {
948
+ return !( *this == rhs);
949
+ }
950
+
883
951
inline CRGB& operator [] (uint8_t x) __attribute__((always_inline))
884
952
{
885
953
return entries[x];
0 commit comments