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

Method pixelAt

Engine/FrameEntry.cpp:34–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32#include "Engine/RectI.h"
33
34NATRON_NAMESPACE_ENTER
35
36
37const U8*
38FrameEntry::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
56void
57FrameEntry::copy(const FrameEntry& other)

Callers

nothing calls this directly

Calls 3

dataFunction · 0.85
widthMethod · 0.45
getBitDepthMethod · 0.45

Tested by

no test coverage detected