Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/operations/COM_WriteBufferOperation.cc
| Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | void WriteBufferOperation::executePixelSampled(float output[4], | ||||
| PixelSampler sampler) | PixelSampler sampler) | ||||
| { | { | ||||
| this->m_input->readSampled(output, x, y, sampler); | this->m_input->readSampled(output, x, y, sampler); | ||||
| } | } | ||||
| void WriteBufferOperation::initExecution() | void WriteBufferOperation::initExecution() | ||||
| { | { | ||||
| this->m_input = this->getInputOperation(0); | this->m_input = this->getInputOperation(0); | ||||
| this->m_memoryProxy->allocate(this->m_width, this->m_height); | this->m_memoryProxy->allocate(this->getWidth(), this->getHeight()); | ||||
| } | } | ||||
| void WriteBufferOperation::deinitExecution() | void WriteBufferOperation::deinitExecution() | ||||
| { | { | ||||
| this->m_input = nullptr; | this->m_input = nullptr; | ||||
| this->m_memoryProxy->free(); | this->m_memoryProxy->free(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | while (!clKernelsToCleanUp->empty()) { | ||||
| if (error != CL_SUCCESS) { | if (error != CL_SUCCESS) { | ||||
| printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); | printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); | ||||
| } | } | ||||
| clKernelsToCleanUp->pop_front(); | clKernelsToCleanUp->pop_front(); | ||||
| } | } | ||||
| delete clKernelsToCleanUp; | delete clKernelsToCleanUp; | ||||
| } | } | ||||
| void WriteBufferOperation::determineResolution(unsigned int resolution[2], | void WriteBufferOperation::determine_canvas(const rcti &preferred_area, rcti &r_area) | ||||
| unsigned int preferredResolution[2]) | |||||
| { | { | ||||
| NodeOperation::determineResolution(resolution, preferredResolution); | NodeOperation::determine_canvas(preferred_area, r_area); | ||||
| /* make sure there is at least one pixel stored in case the input is a single value */ | /* make sure there is at least one pixel stored in case the input is a single value */ | ||||
| m_single_value = false; | m_single_value = false; | ||||
| if (resolution[0] == 0) { | if (BLI_rcti_size_x(&r_area) == 0) { | ||||
| resolution[0] = 1; | r_area.xmax += 1; | ||||
| m_single_value = true; | m_single_value = true; | ||||
| } | } | ||||
| if (resolution[1] == 0) { | if (BLI_rcti_size_y(&r_area) == 0) { | ||||
| resolution[1] = 1; | r_area.ymax += 1; | ||||
| m_single_value = true; | m_single_value = true; | ||||
| } | } | ||||
| } | } | ||||
| void WriteBufferOperation::readResolutionFromInputSocket() | void WriteBufferOperation::readResolutionFromInputSocket() | ||||
| { | { | ||||
| NodeOperation *inputOperation = this->getInputOperation(0); | NodeOperation *inputOperation = this->getInputOperation(0); | ||||
| this->setWidth(inputOperation->getWidth()); | this->setWidth(inputOperation->getWidth()); | ||||
| this->setHeight(inputOperation->getHeight()); | this->setHeight(inputOperation->getHeight()); | ||||
| } | } | ||||
| } // namespace blender::compositor | } // namespace blender::compositor | ||||