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

Method SetPixel

trinity/Tr2HostBitmap.cpp:652–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650}
651
652bool Tr2HostBitmap::SetPixel( int x, int y, const void* data )
653{
654 if( !IsValid() || GetBytesPerPixel( m_format ) != 4 || IsCompressed() )
655 {
656 return false;
657 }
658 if( x < 0 || (unsigned)x > m_width ||
659 y < 0 || (unsigned)y > m_height )
660 {
661 return false;
662 }
663
664 char* dest = m_data.get() + y * m_width * 4 + x * 4;
665 memcpy( dest, data, 4 );
666 return true;
667}
668
669bool Tr2HostBitmap::GetPixel( int x, int y, void* data ) const
670{

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
IsValidFunction · 0.70

Tested by

no test coverage detected