Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/compositor/operations/COM_MovieDistortionOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_MovieDistortionOperation.cpp34
1 files changed, 9 insertions, 25 deletions
diff --git a/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp b/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp
index a3e00e9325b..68a61dff801 100644
--- a/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp
+++ b/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp
@@ -33,8 +33,7 @@ vector<DistortionCache *> s_cache;
void deintializeDistortionCache(void)
{
- while (s_cache.size()>0)
- {
+ while (s_cache.size() > 0) {
DistortionCache * cache = s_cache.back();
s_cache.pop_back();
delete cache;
@@ -51,6 +50,7 @@ MovieDistortionOperation::MovieDistortionOperation(bool distortion) : NodeOperat
this->m_cache = NULL;
this->m_distortion = distortion;
}
+
void MovieDistortionOperation::initExecution()
{
this->m_inputOperation = this->getInputSocketReader(0);
@@ -61,8 +61,7 @@ void MovieDistortionOperation::initExecution()
BKE_movieclip_user_set_frame(&clipUser, this->m_framenumber);
BKE_movieclip_get_size(this->m_movieClip, &clipUser, &calibration_width, &calibration_height);
- for (unsigned int i = 0; i < s_cache.size(); i++)
- {
+ for (unsigned int i = 0; i < s_cache.size(); i++) {
DistortionCache *c = (DistortionCache *)s_cache[i];
if (c->isCacheFor(this->m_movieClip, this->m_width, this->m_height,
calibration_width, calibration_height, this->m_distortion))
@@ -86,15 +85,12 @@ void MovieDistortionOperation::deinitExecution()
{
this->m_inputOperation = NULL;
this->m_movieClip = NULL;
- while (s_cache.size() > COM_DISTORTIONCACHE_MAXSIZE)
- {
+ while (s_cache.size() > COM_DISTORTIONCACHE_MAXSIZE) {
double minTime = PIL_check_seconds_timer();
vector<DistortionCache*>::iterator minTimeIterator = s_cache.begin();
- for (vector<DistortionCache*>::iterator it = s_cache.begin(); it < s_cache.end(); it ++)
- {
+ for (vector<DistortionCache*>::iterator it = s_cache.begin(); it < s_cache.end(); it ++) {
DistortionCache * cache = *it;
- if (cache->getTimeLastUsage()<minTime)
- {
+ if (cache->getTimeLastUsage() < minTime) {
minTime = cache->getTimeLastUsage();
minTimeIterator = it;
}
@@ -110,21 +106,9 @@ void MovieDistortionOperation::executePixel(float output[4], float x, float y, P
if (this->m_cache != NULL) {
float u, v;
this->m_cache->getUV(&this->m_movieClip->tracking, x, y, &u, &v);
- this->m_inputOperation->read(output, u, v, sampler);
- }
+ this->m_inputOperation->read(output, u, v, COM_PS_BILINEAR);
+ }
else {
- this->m_inputOperation->read(output, x, y, sampler);
+ this->m_inputOperation->read(output, x, y, COM_PS_BILINEAR);
}
}
-
-bool MovieDistortionOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
-{
- rcti newInput;
-
- newInput.xmax = input->xmax + 100;
- newInput.xmin = input->xmin - 100;
- newInput.ymax = input->ymax + 100;
- newInput.ymin = input->ymin - 100;
-
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
-}