diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-06-14 07:11:36 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-06-14 07:11:36 +0400 |
commit | fac417a3baf132e7d04540e1fbdefe7d3a1fa17b (patch) | |
tree | e167461558b6b239a12a16fefe16df5faeba2137 /source/blender/compositor/operations/COM_GlareThresholdOperation.cpp | |
parent | cc82653b728408d5e30524549a419fe20fa6a967 (diff) |
Fixed glares
Diffstat (limited to 'source/blender/compositor/operations/COM_GlareThresholdOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_GlareThresholdOperation.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp b/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp index ea76e7551ad..f9b2ec2b32d 100644 --- a/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp +++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp @@ -25,10 +25,18 @@ GlareThresholdOperation::GlareThresholdOperation() : NodeOperation() { - this->addInputSocket(COM_DT_COLOR); + this->addInputSocket(COM_DT_COLOR, COM_SC_FIT); this->addOutputSocket(COM_DT_COLOR); this->inputProgram = NULL; } + +void GlareThresholdOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +{ + NodeOperation::determineResolution(resolution, preferredResolution); + resolution[0] = resolution[0] / (1 << settings->quality); + resolution[1] = resolution[1] / (1 << settings->quality); +} + void GlareThresholdOperation::initExecution() { this->inputProgram = this->getInputSocketReader(0); @@ -36,6 +44,8 @@ void GlareThresholdOperation::initExecution() void GlareThresholdOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) { + const float threshold = settings->threshold; + this->inputProgram->read(color, x, y, sampler, inputBuffers); if (rgb_to_luma_y(color) >= threshold) { color[0] -= threshold, color[1] -= threshold, color[2] -= threshold; |