Differential D12689 Diff 42663 source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc
| Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | BLI_INLINE void warpCoord(float x, float y, float matrix[3][3], float uv[2], float deriv[2][2]) | ||||
| deriv[0][0] = (matrix[0][0] - matrix[0][2] * uv[0]) / vec[2]; | deriv[0][0] = (matrix[0][0] - matrix[0][2] * uv[0]) / vec[2]; | ||||
| deriv[1][0] = (matrix[0][1] - matrix[0][2] * uv[1]) / vec[2]; | deriv[1][0] = (matrix[0][1] - matrix[0][2] * uv[1]) / vec[2]; | ||||
| deriv[0][1] = (matrix[1][0] - matrix[1][2] * uv[0]) / vec[2]; | deriv[0][1] = (matrix[1][0] - matrix[1][2] * uv[0]) / vec[2]; | ||||
| deriv[1][1] = (matrix[1][1] - matrix[1][2] * uv[1]) / vec[2]; | deriv[1][1] = (matrix[1][1] - matrix[1][2] * uv[1]) / vec[2]; | ||||
| } | } | ||||
| PlaneDistortWarpImageOperation::PlaneDistortWarpImageOperation() : PlaneDistortBaseOperation() | PlaneDistortWarpImageOperation::PlaneDistortWarpImageOperation() : PlaneDistortBaseOperation() | ||||
| { | { | ||||
| this->addInputSocket(DataType::Color, ResizeMode::None); | this->addInputSocket(DataType::Color, ResizeMode::Align); | ||||
| this->addOutputSocket(DataType::Color); | this->addOutputSocket(DataType::Color); | ||||
| this->m_pixelReader = nullptr; | this->m_pixelReader = nullptr; | ||||
| this->flags.complex = true; | this->flags.complex = true; | ||||
| } | } | ||||
| void PlaneDistortWarpImageOperation::calculateCorners(const float corners[4][2], | void PlaneDistortWarpImageOperation::calculateCorners(const float corners[4][2], | ||||
| bool normalized, | bool normalized, | ||||
| int sample) | int sample) | ||||
| ▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | void PlaneDistortWarpImageOperation::get_area_of_interest(const int input_idx, | ||||
| rcti &r_input_area) | rcti &r_input_area) | ||||
| { | { | ||||
| if (input_idx != 0) { | if (input_idx != 0) { | ||||
| r_input_area = output_area; | r_input_area = output_area; | ||||
| return; | return; | ||||
| } | } | ||||
| /* TODO: figure out the area needed for warping and EWA filtering. */ | /* TODO: figure out the area needed for warping and EWA filtering. */ | ||||
| r_input_area.xmin = 0; | r_input_area = get_input_operation(0)->get_canvas(); | ||||
| r_input_area.ymin = 0; | |||||
| r_input_area.xmax = get_input_operation(0)->getWidth(); | |||||
| r_input_area.ymax = get_input_operation(0)->getHeight(); | |||||
| /* Old implementation but resulting coordinates are way out of input operation bounds and in some | /* Old implementation but resulting coordinates are way out of input operation bounds and in some | ||||
| * cases the area result may incorrectly cause cropping. */ | * cases the area result may incorrectly cause cropping. */ | ||||
| #if 0 | #if 0 | ||||
| float min[2], max[2]; | float min[2], max[2]; | ||||
| INIT_MINMAX2(min, max); | INIT_MINMAX2(min, max); | ||||
| for (int sample = 0; sample < this->m_motion_blur_samples; sample++) { | for (int sample = 0; sample < this->m_motion_blur_samples; sample++) { | ||||
| float UVs[4][2]; | float UVs[4][2]; | ||||
| ▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines | |||||