本文整理汇总了C++中BitmapImage::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapImage::resize方法的具体用法?C++ BitmapImage::resize怎么用?C++ BitmapImage::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapImage
的用法示例。
在下文中一共展示了BitmapImage::resize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sampler
BitmapImage
clRotate(ClCmdQueue& queue, cl::KernelFunctor& rotate,
BitmapImage& srcImg, float sinTheta, float cosTheta) throw (cl::Error) {
BitmapImage outImg;
outImg.resize(srcImg.getWidth(), srcImg.getHeight());
// Create the input, output image, and filter buffers!
cl::Image2D srcBuf = queue.makeImage(srcImg.getRow(0), srcImg.getWidth(),
srcImg.getHeight(), queue.ROFlags);
cl::Image2D outBuf = queue.makeImage(outImg.getRow(0), outImg.getWidth(),
outImg.getHeight(), queue.WOFlags);
// Setup sampler for source image to control sampler
cl::Sampler sampler(queue.getContext(), CL_FALSE, CL_ADDRESS_CLAMP,
CL_FILTER_LINEAR);
// Now use the OpenCl kernel to perform convolution
rotate(srcBuf, outBuf, srcImg.getWidth(), srcImg.getHeight(), sampler,
sinTheta, cosTheta);
// Copy result image back from the device to host.
queue.enqueueMapImage(outBuf);
// Return the resulting image back to the caller.
return outImg;
}
示例2: sampler
BitmapImage
clRotate(ClCmdQueue& queue, cl::KernelFunctor& vrotate,
BitmapImage& srcImg, float theta) throw (cl::Error) {
// Create a new bitmap and scale it
BitmapImage outImg = srcImg;
float imgMax = sqrt(pow(srcImg.getWidth(),2) + pow(srcImg.getHeight(),2));
outImg.resize(imgMax, imgMax);
// Create the input, output image, and filter buffers!
cl::Image2D srcBuf = queue.makeImage(srcImg.getRow(0), srcImg.getWidth(),
srcImg.getHeight(), queue.ROFlags);
cl::Image2D outBuf = queue.makeImage(outImg.getRow(0), outImg.getWidth(),
outImg.getHeight(), queue.WOFlags);
// Setup sampler for source image to control sampler
cl::Sampler sampler(queue.getContext(), CL_FALSE, CL_ADDRESS_CLAMP,
CL_FILTER_NEAREST);
// Now use the OpenCl kernel to perform convolution
vrotate(srcBuf, outBuf, outImg.getWidth(), outImg.getHeight(), sampler,
(float)cos(theta), (float)sin(theta));
// Copy result image back from the device to host.
queue.enqueueMapImage(outBuf);
// Return the resulting image back to the caller.
return outImg;
}