Fixes for area of interest in keying nodes: no need to wait for the whole

input image to be calculated in some cases, use only actual area which is
needed to calculate current tile.

Seems to be giving some % of speedup. Verified result of keying before
this patch and after this patch and they were identical, so hopefully
now area of interest is indeed correct.
This commit is contained in:
Sergey Sharybin
2012-06-24 10:31:48 +00:00
parent 49a9d8d4ae
commit d71d41755e
4 changed files with 8 additions and 22 deletions

View File

@@ -79,10 +79,10 @@ bool KeyingBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBuff
{
rcti newInput;
newInput.xmin = 0;
newInput.ymin = 0;
newInput.xmax = this->getWidth();
newInput.ymax = this->getHeight();
newInput.xmin = input->xmin - this->size;
newInput.ymin = input->ymin - this->size;
newInput.xmax = input->xmax + this->size;
newInput.ymax = input->ymax + this->size;
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}

View File

@@ -114,10 +114,10 @@ bool KeyingClipOperation::determineDependingAreaOfInterest(rcti *input, ReadBuff
{
rcti newInput;
newInput.xmin = 0;
newInput.ymin = 0;
newInput.xmax = this->getWidth();
newInput.ymax = this->getHeight();
newInput.xmin = input->xmin - this->kernelRadius;
newInput.ymin = input->ymin - this->kernelRadius;
newInput.xmax = input->xmax + this->kernelRadius;
newInput.ymax = input->ymax + this->kernelRadius;
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}

View File

@@ -136,15 +136,3 @@ void KeyingOperation::executePixel(float *color, float x, float y, PixelSampler
/* apply core matte */
color[0] = MAX2(color[0], coreValue[0]);
}
bool KeyingOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
{
rcti newInput;
newInput.xmin = 0;
newInput.ymin = 0;
newInput.xmax = this->getWidth();
newInput.ymax = this->getHeight();
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}

View File

@@ -52,8 +52,6 @@ public:
void setScreenBalance(float value) {this->screenBalance = value;}
void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]);
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
};
#endif