本文整理汇总了C++中BitmapImage::getHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapImage::getHeight方法的具体用法?C++ BitmapImage::getHeight怎么用?C++ BitmapImage::getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapImage
的用法示例。
在下文中一共展示了BitmapImage::getHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sampler
BitmapImage
clVflip(ClCmdQueue& queue, cl::KernelFunctor& vflip,
BitmapImage& srcImg) throw (cl::Error) {
BitmapImage outImg = srcImg;
// 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
vflip(srcBuf, outBuf, srcImg.getWidth(), srcImg.getHeight(), sampler);
// Copy result image back from the device to host.
queue.enqueueMapImage(outBuf);
// Return the resulting image back to the caller.
return outImg;
}
示例2: main
// A simple tester for testing operation of toggling characters via OpenCL
int main(int argc, char *argv[]) {
if (argc < 4) {
std::cout << "Specify [CPU|GPU|ACC] <InputBMP> <OutputBMP> <theta_radians>\n";
return 1;
}
// Load source image from the given file
BitmapImage srcImg;
srcImg.load(argv[2]);
// Create the OpenCL command queue for a given device
ClCmdQueue queue(getDevType(argv[1]));
// Create a kernel and functor using OpenCL kernel code from a file.
cl::Kernel kernel = queue.loadKernel("batesokr_rotate.cl", "img_rotate");
cl::NDRange globalRange(srcImg.getWidth(), srcImg.getHeight());
cl::KernelFunctor vrotate(kernel, queue.getQueue(), cl::NullRange,
globalRange, cl::NullRange);
BitmapImage outImg = clRotate(queue, vrotate, srcImg, atof(argv[4])*(M_PI/180.0f));
outImg.write(argv[3]);
return 0;
}