| 1624 | } |
| 1625 | |
| 1626 | unsigned char* |
| 1627 | Image::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 | |
| 1645 | unsigned char* |
| 1646 | Image::pixelAtStatic(int x, |
no test coverage detected