本文整理汇总了C++中MemoryBuffer::getMaximumValue方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryBuffer::getMaximumValue方法的具体用法?C++ MemoryBuffer::getMaximumValue怎么用?C++ MemoryBuffer::getMaximumValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemoryBuffer
的用法示例。
在下文中一共展示了MemoryBuffer::getMaximumValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: executeOpenCL
void VariableSizeBokehBlurOperation::executeOpenCL(OpenCLDevice *device,
MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer,
MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp,
list<cl_kernel> * /*clKernelsToCleanUp*/)
{
cl_kernel defocusKernel = device->COM_clCreateKernel("defocusKernel", NULL);
cl_int step = this->getStep();
cl_int maxBlur;
cl_float threshold = this->m_threshold;
MemoryBuffer *sizeMemoryBuffer = this->m_inputSizeProgram->getInputMemoryBuffer(inputMemoryBuffers);
const float max_dim = max(m_width, m_height);
cl_float scalar = this->m_do_size_scale ? (max_dim / 100.0f) : 1.0f;
maxBlur = (cl_int)min_ff(sizeMemoryBuffer->getMaximumValue() * scalar,
(float)this->m_maxBlur);
device->COM_clAttachMemoryBufferToKernelParameter(defocusKernel, 0, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputProgram);
device->COM_clAttachMemoryBufferToKernelParameter(defocusKernel, 1, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputBokehProgram);
device->COM_clAttachMemoryBufferToKernelParameter(defocusKernel, 2, 4, clMemToCleanUp, inputMemoryBuffers, this->m_inputSizeProgram);
device->COM_clAttachOutputMemoryBufferToKernelParameter(defocusKernel, 3, clOutputBuffer);
device->COM_clAttachMemoryBufferOffsetToKernelParameter(defocusKernel, 5, outputMemoryBuffer);
clSetKernelArg(defocusKernel, 6, sizeof(cl_int), &step);
clSetKernelArg(defocusKernel, 7, sizeof(cl_int), &maxBlur);
clSetKernelArg(defocusKernel, 8, sizeof(cl_float), &threshold);
clSetKernelArg(defocusKernel, 9, sizeof(cl_float), &scalar);
device->COM_clAttachSizeToKernelParameter(defocusKernel, 10, this);
device->COM_clEnqueueRange(defocusKernel, outputMemoryBuffer, 11, this);
}
示例2: getMaximumValue
float MemoryBuffer::getMaximumValue(rcti *rect)
{
rcti rect_clamp;
/* first clamp the rect by the bounds or we get un-initialized values */
BLI_rcti_isect(rect, &this->m_rect, &rect_clamp);
if (!BLI_rcti_is_empty(&rect_clamp)) {
MemoryBuffer *temp = new MemoryBuffer(NULL, &rect_clamp);
temp->copyContentFrom(this);
float result = temp->getMaximumValue();
delete temp;
return result;
}
else {
BLI_assert(0);
return 0.0f;
}
}