diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-09-11 17:07:03 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-09-11 17:07:20 +0400 |
commit | 4bbe0c8cded98d4daafe1707766041ca9b86db36 (patch) | |
tree | b217121ea53cab605e65f7cc036f358fa1abb14e /source/blender/compositor/operations/COM_MovieDistortionOperation.h | |
parent | 89b62804dcba7167c332b5f1d71f4a88e02b1781 (diff) |
Fix T41785: The combination of movie-distortion and lens-distortion leads to artifacts
Diffstat (limited to 'source/blender/compositor/operations/COM_MovieDistortionOperation.h')
-rw-r--r-- | source/blender/compositor/operations/COM_MovieDistortionOperation.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_MovieDistortionOperation.h b/source/blender/compositor/operations/COM_MovieDistortionOperation.h index a1dd08d8624..9e8d7eeba60 100644 --- a/source/blender/compositor/operations/COM_MovieDistortionOperation.h +++ b/source/blender/compositor/operations/COM_MovieDistortionOperation.h @@ -50,9 +50,14 @@ private: float *m_buffer; int *m_bufferCalculated; double timeLastUsage; + int m_margin[2]; public: - DistortionCache(MovieClip *movieclip, int width, int height, int calibration_width, int calibration_height, bool inverted) { + DistortionCache(MovieClip *movieclip, + int width, int height, + int calibration_width, int calibration_height, + bool inverted, + const int margin[2]) { this->m_k1 = movieclip->tracking.camera.k1; this->m_k2 = movieclip->tracking.camera.k2; this->m_k3 = movieclip->tracking.camera.k3; @@ -66,6 +71,7 @@ public: this->m_inverted = inverted; this->m_bufferCalculated = (int *)MEM_callocN(sizeof(int) * this->m_width * this->m_height, __func__); this->m_buffer = (float *)MEM_mallocN(sizeof(float) * this->m_width * this->m_height * 2, __func__); + copy_v2_v2_int(this->m_margin, margin); this->updateLastUsage(); } @@ -89,7 +95,10 @@ public: return this->timeLastUsage; } - bool isCacheFor(MovieClip *movieclip, int width, int height, int calibration_width, int claibration_height, bool inverted) { + bool isCacheFor(MovieClip *movieclip, + int width, int height, + int calibration_width, int claibration_height, + bool inverted) { return this->m_k1 == movieclip->tracking.camera.k1 && this->m_k2 == movieclip->tracking.camera.k2 && this->m_k3 == movieclip->tracking.camera.k3 && @@ -141,6 +150,11 @@ public: *v = this->m_buffer[offset2 + 1]; } } + + void getMargin(int margin[2]) + { + copy_v2_v2_int(margin, m_margin); + } }; class MovieDistortionOperation : public NodeOperation { |