Differential D12689 Diff 42663 source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc
| Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | if (!this->m_dispersionAvailable) { | ||||
| this->m_dispersion = result[0]; | this->m_dispersion = result[0]; | ||||
| this->m_kr = 0.25f * max_ff(min_ff(this->m_dispersion, 1.0f), 0.0f); | this->m_kr = 0.25f * max_ff(min_ff(this->m_dispersion, 1.0f), 0.0f); | ||||
| this->m_kr2 = this->m_kr * 20; | this->m_kr2 = this->m_kr * 20; | ||||
| this->m_dispersionAvailable = true; | this->m_dispersionAvailable = true; | ||||
| } | } | ||||
| this->unlockMutex(); | this->unlockMutex(); | ||||
| } | } | ||||
| void ProjectorLensDistortionOperation::determine_canvas(const rcti &preferred_area, rcti &r_area) | |||||
| { | |||||
| switch (execution_model_) { | |||||
| case eExecutionModel::FullFrame: { | |||||
| set_determined_canvas_modifier([=](rcti &canvas) { | |||||
| /* Ensure screen space. */ | |||||
| BLI_rcti_translate(&canvas, -canvas.xmin, -canvas.ymin); | |||||
| }); | |||||
| break; | |||||
| } | |||||
| default: | |||||
| break; | |||||
| } | |||||
| NodeOperation::determine_canvas(preferred_area, r_area); | |||||
| } | |||||
| void ProjectorLensDistortionOperation::get_area_of_interest(const int input_idx, | void ProjectorLensDistortionOperation::get_area_of_interest(const int input_idx, | ||||
| const rcti &output_area, | const rcti &output_area, | ||||
| rcti &r_input_area) | rcti &r_input_area) | ||||
| { | { | ||||
| if (input_idx == 1) { | if (input_idx == 1) { | ||||
| /* Dispersion input is used as constant only. */ | /* Dispersion input is used as constant only. */ | ||||
| r_input_area = COM_SINGLE_ELEM_AREA; | r_input_area = COM_CONSTANT_INPUT_AREA_OF_INTEREST; | ||||
| return; | return; | ||||
| } | } | ||||
| r_input_area.ymax = output_area.ymax; | r_input_area.ymax = output_area.ymax; | ||||
| r_input_area.ymin = output_area.ymin; | r_input_area.ymin = output_area.ymin; | ||||
| r_input_area.xmin = output_area.xmin - this->m_kr2 - 2; | r_input_area.xmin = output_area.xmin - this->m_kr2 - 2; | ||||
| r_input_area.xmax = output_area.xmax + this->m_kr2 + 2; | r_input_area.xmax = output_area.xmax + this->m_kr2 + 2; | ||||
| } | } | ||||
| Show All 23 Lines | |||||