Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/operations/COM_CalculateMeanOperation.cc
| Show All 21 Lines | |||||
| #include "COM_ExecutionSystem.h" | #include "COM_ExecutionSystem.h" | ||||
| #include "IMB_colormanagement.h" | #include "IMB_colormanagement.h" | ||||
| namespace blender::compositor { | namespace blender::compositor { | ||||
| CalculateMeanOperation::CalculateMeanOperation() | CalculateMeanOperation::CalculateMeanOperation() | ||||
| { | { | ||||
| this->addInputSocket(DataType::Color, ResizeMode::None); | this->addInputSocket(DataType::Color, ResizeMode::Align); | ||||
| this->addOutputSocket(DataType::Value); | this->addOutputSocket(DataType::Value); | ||||
| this->m_imageReader = nullptr; | this->m_imageReader = nullptr; | ||||
| this->m_iscalculated = false; | this->m_iscalculated = false; | ||||
| this->m_setting = 1; | this->m_setting = 1; | ||||
| this->flags.complex = true; | this->flags.complex = true; | ||||
| } | } | ||||
| void CalculateMeanOperation::initExecution() | void CalculateMeanOperation::initExecution() | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | void CalculateMeanOperation::setSetting(int setting) | ||||
| } | } | ||||
| } | } | ||||
| void CalculateMeanOperation::get_area_of_interest(int input_idx, | void CalculateMeanOperation::get_area_of_interest(int input_idx, | ||||
| const rcti &UNUSED(output_area), | const rcti &UNUSED(output_area), | ||||
| rcti &r_input_area) | rcti &r_input_area) | ||||
| { | { | ||||
| BLI_assert(input_idx == 0); | BLI_assert(input_idx == 0); | ||||
| NodeOperation *operation = getInputOperation(input_idx); | r_input_area = get_input_operation(input_idx)->get_canvas(); | ||||
| r_input_area.xmin = 0; | |||||
| r_input_area.ymin = 0; | |||||
| r_input_area.xmax = operation->getWidth(); | |||||
| r_input_area.ymax = operation->getHeight(); | |||||
| } | } | ||||
| void CalculateMeanOperation::update_memory_buffer_started(MemoryBuffer *UNUSED(output), | void CalculateMeanOperation::update_memory_buffer_started(MemoryBuffer *UNUSED(output), | ||||
| const rcti &UNUSED(area), | const rcti &UNUSED(area), | ||||
| Span<MemoryBuffer *> inputs) | Span<MemoryBuffer *> inputs) | ||||
| { | { | ||||
| if (!this->m_iscalculated) { | if (!this->m_iscalculated) { | ||||
| MemoryBuffer *input = inputs[0]; | MemoryBuffer *input = inputs[0]; | ||||
| ▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines | |||||