diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-12 00:51:00 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-12 00:51:00 +0400 |
commit | 4fb850c72ee15cf0a305079e8fb6d23f180fb419 (patch) | |
tree | d15b2ecb8f2ed2bb057e6ff04e2e189b347beae1 /source/blender/compositor/intern/COM_MemoryBuffer.h | |
parent | 83d2314edfe2c123c3151884a66c5a6ba2d849f6 (diff) |
Compositor:
re-optimized the Defocus node.
* localized MemoryBuffers
* removed read(x,y) calls
* shuffled some lines in the execute pixel
* added a readNoCheck function to the memorybuffer (only use this when
you are certain you are reading a pixel inside the memorybuffer.
Diffstat (limited to 'source/blender/compositor/intern/COM_MemoryBuffer.h')
-rw-r--r-- | source/blender/compositor/intern/COM_MemoryBuffer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index 51a45efc051..eed0c796cd8 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -140,6 +140,13 @@ public: } } + inline void readNoCheck(float result[4], int x, int y) { + const int dx = x - this->m_rect.xmin; + const int dy = y - this->m_rect.ymin; + const int offset = (this->m_chunkWidth * dy + dx) * COM_NUMBER_OF_CHANNELS; + copy_v4_v4(result, &this->m_buffer[offset]); + } + void writePixel(int x, int y, const float color[4]); void addPixel(int x, int y, const float color[4]); inline void readCubic(float result[4], float x, float y) |