MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetPixel

Method GetPixel

trinity/Tr2HostBitmap.cpp:669–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

667}
668
669bool 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
687bool Tr2HostBitmap::SetPixelPy( PyObject* tuple )

Callers 1

SampleMaskMethod · 0.80

Calls 2

getMethod · 0.80
IsValidFunction · 0.70

Tested by

no test coverage detected