Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/operations/COM_MathBaseOperation.cc
| Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
| void MathBaseOperation::deinitExecution() | void MathBaseOperation::deinitExecution() | ||||
| { | { | ||||
| this->m_inputValue1Operation = nullptr; | this->m_inputValue1Operation = nullptr; | ||||
| this->m_inputValue2Operation = nullptr; | this->m_inputValue2Operation = nullptr; | ||||
| this->m_inputValue3Operation = nullptr; | this->m_inputValue3Operation = nullptr; | ||||
| } | } | ||||
| void MathBaseOperation::determineResolution(unsigned int resolution[2], | void MathBaseOperation::determine_canvas(const rcti &preferred_area, rcti &r_area) | ||||
| unsigned int preferredResolution[2]) | |||||
| { | { | ||||
| NodeOperationInput *socket; | NodeOperationInput *socket; | ||||
| unsigned int tempPreferredResolution[2] = {0, 0}; | rcti temp_area; | ||||
| unsigned int tempResolution[2]; | |||||
| socket = this->getInputSocket(0); | socket = this->getInputSocket(0); | ||||
| socket->determineResolution(tempResolution, tempPreferredResolution); | const bool determined = socket->determine_canvas(COM_AREA_NONE, temp_area); | ||||
| if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) { | if (determined) { | ||||
| this->setResolutionInputSocketIndex(0); | this->set_canvas_input_index(0); | ||||
| } | } | ||||
| else { | else { | ||||
| this->setResolutionInputSocketIndex(1); | this->set_canvas_input_index(1); | ||||
| } | } | ||||
| NodeOperation::determineResolution(resolution, preferredResolution); | NodeOperation::determine_canvas(preferred_area, r_area); | ||||
| } | } | ||||
| void MathBaseOperation::clampIfNeeded(float *color) | void MathBaseOperation::clampIfNeeded(float *color) | ||||
| { | { | ||||
| if (this->m_useClamp) { | if (this->m_useClamp) { | ||||
| CLAMP(color[0], 0.0f, 1.0f); | CLAMP(color[0], 0.0f, 1.0f); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 999 Lines • Show Last 20 Lines | |||||