当前位置: 首页>>代码示例>>C++>>正文


C++ BitmapImage::resize方法代码示例

本文整理汇总了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;
}
开发者ID:haitzza,项目名称:classwork,代码行数:21,代码来源:haitzza_Ex8.cpp

示例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;
}
开发者ID:batesokr,项目名称:CSE620H,代码行数:23,代码来源:VerticalFlip.cpp


注:本文中的BitmapImage::resize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。