| 622 | } |
| 623 | |
| 624 | bool Tr2HostBitmap::IsMonochrome() const |
| 625 | { |
| 626 | if( !IsValid() || GetBytesPerPixel( m_format ) != 4 || IsCompressed() ) |
| 627 | { |
| 628 | return false; |
| 629 | } |
| 630 | |
| 631 | for( uint32_t x = 0; x < m_width; x++ ) |
| 632 | { |
| 633 | for( uint32_t y = 0; y < m_height; y++ ) |
| 634 | { |
| 635 | uint32_t pixval; |
| 636 | if( GetPixel( x, y, &pixval ) ) |
| 637 | { |
| 638 | bool matches = true; |
| 639 | uint32_t red_val = ( pixval & 0x00FF0000 ) >> 16; |
| 640 | matches &= check_chan_value( 0x0000FF00, 8, pixval, red_val ); |
| 641 | matches &= check_chan_value( 0x000000FF, 0, pixval, red_val ); |
| 642 | if( !matches ) |
| 643 | { |
| 644 | return false; |
| 645 | } |
| 646 | } |
| 647 | } |
| 648 | } |
| 649 | return true; |
| 650 | } |
| 651 | |
| 652 | bool Tr2HostBitmap::SetPixel( int x, int y, const void* data ) |
| 653 | { |
nothing calls this directly
no test coverage detected