| 152 | // Image |
| 153 | |
| 154 | Image::Image(COpenCL& CL, const SImage& Img, void * ImageData, cl_mem_flags flags) |
| 155 | : Buffer(CL, (char *) ImageData, Img.Height * Img.Step, flags), |
| 156 | ImageBase(Img) |
| 157 | { |
| 158 | if (Img.Channels < 1 || Img.Channels > 4) |
| 159 | throw cl::Error(CL_IMAGE_FORMAT_NOT_SUPPORTED, "Invalid number of channels"); |
| 160 | |
| 161 | if (Img.Channels == 3) |
| 162 | throw cl::Error(CL_IMAGE_FORMAT_NOT_SUPPORTED, "Please use ColorImage for 3 channel images"); |
| 163 | |
| 164 | if (Img.Type < 0 || Img.Type >= Img.NbDataTypes) |
| 165 | throw cl::Error(CL_IMAGE_FORMAT_NOT_SUPPORTED, "Invalid data type"); |
| 166 | } |
| 167 | |
| 168 | Image::Image(bool Is3Channel, COpenCL& CL, const SImage& Img, void * ImageData, cl_mem_flags flags) |
| 169 | : Buffer(CL, (char *) ImageData, Img.Height * Img.Step, flags), |
nothing calls this directly
no test coverage detected