| 667 | } |
| 668 | |
| 669 | bool Tr2HostBitmap::GetPixel( int x, int y, void* data ) const |
| 670 | { |
| 671 | if( !IsValid() || GetBytesPerPixel( m_format ) != 4 || IsCompressed() ) |
| 672 | { |
| 673 | return false; |
| 674 | } |
| 675 | if( x < 0 || (unsigned)x > m_width || |
| 676 | y < 0 || (unsigned)y > m_height ) |
| 677 | { |
| 678 | return false; |
| 679 | } |
| 680 | |
| 681 | char* src = m_data.get() + y * m_width * 4 + x * 4; |
| 682 | memcpy( data, src, 4 ); |
| 683 | return true; |
| 684 | } |
| 685 | |
| 686 | #if BLUE_WITH_PYTHON |
| 687 | bool Tr2HostBitmap::SetPixelPy( PyObject* tuple ) |
no test coverage detected