clCreateImage2D - Load RGB image

北战南征 提交于 2019-12-08 09:40:00

问题


I'm trying to load an OpenCV image (IplImage) into GPU with clCreateImage2D.

Reason of using IplImage is, i want to load any kind of image.(jpg, bmp, png).

I can load image using clCreateImage2D with CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR mem_flags, and CL_RGB and CL_UNORM_SHORT_565 type. But in kernel function read_imagef function is not accept CL_UNORM_SHORT_565 type.

So, how can i send RGB image to OpenCL kernel function?

Edit: I converted the input image to 32bit. Bu tnow what would be the image_channel_order and image_channel_data_type? Order can't be RGBA because it has no alpha channel.


回答1:


24 bit RGB is not supported by OpenCL. So you have to first convert it to 32 bit RGB and then pass it to the OpenCL kernel



来源:https://stackoverflow.com/questions/14362876/clcreateimage2d-load-rgb-image

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!