Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/operations/COM_CompositorOperation.cc
| Show First 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | void CompositorOperation::update_memory_buffer_partial(MemoryBuffer *UNUSED(output), | ||||
| output_buf.copy_from(inputs[0], area); | output_buf.copy_from(inputs[0], area); | ||||
| if (this->m_useAlphaInput) { | if (this->m_useAlphaInput) { | ||||
| output_buf.copy_from(inputs[1], area, 0, COM_DATA_TYPE_VALUE_CHANNELS, 3); | output_buf.copy_from(inputs[1], area, 0, COM_DATA_TYPE_VALUE_CHANNELS, 3); | ||||
| } | } | ||||
| MemoryBuffer depth_buf(m_depthBuffer, COM_DATA_TYPE_VALUE_CHANNELS, getWidth(), getHeight()); | MemoryBuffer depth_buf(m_depthBuffer, COM_DATA_TYPE_VALUE_CHANNELS, getWidth(), getHeight()); | ||||
| depth_buf.copy_from(inputs[2], area); | depth_buf.copy_from(inputs[2], area); | ||||
| } | } | ||||
| void CompositorOperation::determineResolution(unsigned int resolution[2], | void CompositorOperation::determine_canvas(const rcti &UNUSED(preferred_area), rcti &r_area) | ||||
| unsigned int preferredResolution[2]) | |||||
| { | { | ||||
| int width = this->m_rd->xsch * this->m_rd->size / 100; | int width = this->m_rd->xsch * this->m_rd->size / 100; | ||||
| int height = this->m_rd->ysch * this->m_rd->size / 100; | int height = this->m_rd->ysch * this->m_rd->size / 100; | ||||
| /* Check actual render resolution with cropping it may differ with cropped border.rendering | /* Check actual render resolution with cropping it may differ with cropped border.rendering | ||||
| * Fix for T31777 Border Crop gives black (easy). */ | * Fix for T31777 Border Crop gives black (easy). */ | ||||
| Render *re = RE_GetSceneRender(this->m_scene); | Render *re = RE_GetSceneRender(this->m_scene); | ||||
| if (re) { | if (re) { | ||||
| RenderResult *rr = RE_AcquireResultRead(re); | RenderResult *rr = RE_AcquireResultRead(re); | ||||
| if (rr) { | if (rr) { | ||||
| width = rr->rectx; | width = rr->rectx; | ||||
| height = rr->recty; | height = rr->recty; | ||||
| } | } | ||||
| RE_ReleaseResult(re); | RE_ReleaseResult(re); | ||||
| } | } | ||||
| preferredResolution[0] = width; | rcti local_preferred; | ||||
| preferredResolution[1] = height; | BLI_rcti_init(&local_preferred, 0, width, 0, height); | ||||
| NodeOperation::determineResolution(resolution, preferredResolution); | NodeOperation::determine_canvas(local_preferred, r_area); | ||||
| r_area = local_preferred; | |||||
| resolution[0] = width; | |||||
| resolution[1] = height; | |||||
| } | } | ||||
| } // namespace blender::compositor | } // namespace blender::compositor | ||||