| 32 | #include "Engine/RectI.h" |
| 33 | |
| 34 | NATRON_NAMESPACE_ENTER |
| 35 | |
| 36 | |
| 37 | const U8* |
| 38 | FrameEntry::pixelAt(int x, |
| 39 | int y ) const |
| 40 | { |
| 41 | const TextureRect& bounds = _key.getTexRect(); |
| 42 | |
| 43 | if ( (x < bounds.x1) || (x >= bounds.x2) || (y < bounds.y1) || (y > bounds.y2) ) { |
| 44 | return 0; |
| 45 | } |
| 46 | std::size_t rowSize = bounds.width(); |
| 47 | unsigned int srcPixelSize = 4; |
| 48 | if ( (ImageBitDepthEnum)_key.getBitDepth() == eImageBitDepthFloat ) { |
| 49 | srcPixelSize *= sizeof(float); |
| 50 | } |
| 51 | rowSize *= srcPixelSize; |
| 52 | |
| 53 | return data() + (y - bounds.y1) * rowSize + (x - bounds.x1) * srcPixelSize; |
| 54 | } |
| 55 | |
| 56 | void |
| 57 | FrameEntry::copy(const FrameEntry& other) |
nothing calls this directly
no test coverage detected