MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / pixelAt

Method pixelAt

Engine/Image.cpp:1626–1643  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1624}
1625
1626unsigned char*
1627Image::pixelAt(int x,
1628 int y)
1629{
1630 if ( ( x < _bounds.x1 ) || ( x >= _bounds.x2 ) || ( y < _bounds.y1 ) || ( y >= _bounds.y2 ) ) {
1631 return NULL;
1632 } else {
1633 unsigned char* ret = (unsigned char*)this->_data.writable();
1634 if (!ret) {
1635 return 0;
1636 }
1637 int compDataSize = _depthBytesSize * _nbComponents;
1638 ret = ret + (qint64)( y - _bounds.y1 ) * compDataSize * _bounds.width()
1639 + (qint64)( x - _bounds.x1 ) * compDataSize;
1640
1641 return ret;
1642 }
1643}
1644
1645unsigned char*
1646Image::pixelAtStatic(int x,

Calls 3

writableMethod · 0.80
readableMethod · 0.80
widthMethod · 0.45

Tested by

no test coverage detected