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:
authorManuel Castilla <manzanillawork@gmail.com>2021-08-10 16:25:10 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-08-10 17:16:23 +0300
commitd481c6651d149bdc83a8c0bbb675d3d296f7c530 (patch)
tree96f7fca0fdf2a08eb1dabbfb2025ad88ae378c03 /source/blender/compositor/operations/COM_ChangeHSVOperation.cc
parent8f6cc16490843bec88806c2f76c0aa012db938dd (diff)
Compositor: Full frame color nodes
Adds full frame implementation to "Alpha Over", "Hue Saturation Value", "Invert", "Tonemap" and "ZCombine" nodes. The other nodes in "Color" submenu are implemented separately. No functional changes. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D12092
Diffstat (limited to 'source/blender/compositor/operations/COM_ChangeHSVOperation.cc')
-rw-r--r--source/blender/compositor/operations/COM_ChangeHSVOperation.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_ChangeHSVOperation.cc b/source/blender/compositor/operations/COM_ChangeHSVOperation.cc
index eee007ce9e6..1e3e7806968 100644
--- a/source/blender/compositor/operations/COM_ChangeHSVOperation.cc
+++ b/source/blender/compositor/operations/COM_ChangeHSVOperation.cc
@@ -28,6 +28,7 @@ ChangeHSVOperation::ChangeHSVOperation()
this->addInputSocket(DataType::Value);
this->addOutputSocket(DataType::Color);
this->m_inputOperation = nullptr;
+ this->flags.can_be_constant = true;
}
void ChangeHSVOperation::initExecution()
@@ -71,4 +72,26 @@ void ChangeHSVOperation::executePixelSampled(float output[4],
output[3] = inputColor1[3];
}
+void ChangeHSVOperation::update_memory_buffer_partial(MemoryBuffer *output,
+ const rcti &area,
+ Span<MemoryBuffer *> inputs)
+{
+ for (BuffersIterator<float> it = output->iterate_with(inputs, area); !it.is_end(); ++it) {
+ const float *color = it.in(0);
+ const float hue = *it.in(1);
+ it.out[0] = color[0] + (hue - 0.5f);
+ if (it.out[0] > 1.0f) {
+ it.out[0] -= 1.0f;
+ }
+ else if (it.out[0] < 0.0f) {
+ it.out[0] += 1.0f;
+ }
+ const float saturation = *it.in(2);
+ const float value = *it.in(3);
+ it.out[1] = color[1] * saturation;
+ it.out[2] = color[2] * value;
+ it.out[3] = color[3];
+ }
+}
+
} // namespace blender::compositor