diff options
Diffstat (limited to 'source/blender/compositor/operations/COM_MapValueOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_MapValueOperation.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/source/blender/compositor/operations/COM_MapValueOperation.cpp b/source/blender/compositor/operations/COM_MapValueOperation.cpp index e8731c0f146..d99a68a5e00 100644 --- a/source/blender/compositor/operations/COM_MapValueOperation.cpp +++ b/source/blender/compositor/operations/COM_MapValueOperation.cpp @@ -20,33 +20,36 @@ MapValueOperation::MapValueOperation() : NodeOperation() { - this->addInputSocket(COM_DT_VALUE); - this->addOutputSocket(COM_DT_VALUE); - this->m_inputOperation = NULL; + this->addInputSocket(COM_DT_VALUE); + this->addOutputSocket(COM_DT_VALUE); + this->m_inputOperation = NULL; } void MapValueOperation::initExecution() { - this->m_inputOperation = this->getInputSocketReader(0); + this->m_inputOperation = this->getInputSocketReader(0); } -void MapValueOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) +void MapValueOperation::executePixelSampled(float output[4], + float x, + float y, + PixelSampler sampler) { - float src[4]; - this->m_inputOperation->readSampled(src, x, y, sampler); - TexMapping *texmap = this->m_settings; - float value = (src[0] + texmap->loc[0]) * texmap->size[0]; - if (texmap->flag & TEXMAP_CLIP_MIN) - if (value < texmap->min[0]) - value = texmap->min[0]; - if (texmap->flag & TEXMAP_CLIP_MAX) - if (value > texmap->max[0]) - value = texmap->max[0]; + float src[4]; + this->m_inputOperation->readSampled(src, x, y, sampler); + TexMapping *texmap = this->m_settings; + float value = (src[0] + texmap->loc[0]) * texmap->size[0]; + if (texmap->flag & TEXMAP_CLIP_MIN) + if (value < texmap->min[0]) + value = texmap->min[0]; + if (texmap->flag & TEXMAP_CLIP_MAX) + if (value > texmap->max[0]) + value = texmap->max[0]; - output[0] = value; + output[0] = value; } void MapValueOperation::deinitExecution() { - this->m_inputOperation = NULL; + this->m_inputOperation = NULL; } |