return(clEnv);
}
+static inline void copyPixels(const Image *source,Image *destination,
+ ExceptionInfo *exception)
+{
+ RectangleInfo
+ geometry;
+
+ OffsetInfo
+ offset;
+
+ /* The pixels only need to be copied when a channel mask has been set */
+ if (((source->channel_mask & RedChannel) != 0) &&
+ ((source->channel_mask & GreenChannel) != 0) &&
+ ((source->channel_mask & BlueChannel) != 0) &&
+ ((source->channel_mask & AlphaChannel) != 0))
+ return;
+
+ geometry.width=source->columns;
+ geometry.height=source->rows;
+ geometry.x=geometry.y=offset.x=offset.y=0;
+ CopyImagePixels(destination,source,&geometry,&offset,exception);
+}
+
/* pad the global workgroup size to the next multiple of
the local workgroup size */
inline static unsigned int padGlobalWorkgroupSizeToLocalWorkgroupSize(
goto cleanup;
if (filteredImage->number_channels != image->number_channels)
goto cleanup;
+ copyPixels(image,filteredImage,exception);
imageBuffer=GetAuthenticOpenCLBuffer(image,device,exception);
if (imageBuffer == (cl_mem) NULL)
goto cleanup;
goto cleanup;
if (filteredImage->number_channels != image->number_channels)
goto cleanup;
+ copyPixels(image,filteredImage,exception);
imageBuffer=GetAuthenticOpenCLBuffer(image,device,exception);
if (imageBuffer == (cl_mem) NULL)
goto cleanup;
goto cleanup;
if (filteredImage->number_channels != image->number_channels)
goto cleanup;
+ copyPixels(image,filteredImage,exception);
imageBuffer=GetAuthenticOpenCLBuffer(image,device,exception);
if (imageBuffer == (cl_mem) NULL)
goto cleanup;
goto cleanup;
if (filteredImage->number_channels != image->number_channels)
goto cleanup;
+ copyPixels(image,filteredImage,exception);
imageBuffer=GetAuthenticOpenCLBuffer(image,device,exception);
if (imageBuffer == (cl_mem) NULL)
goto cleanup;
goto cleanup;
if (filteredImage->number_channels != image->number_channels)
goto cleanup;
+ copyPixels(image,filteredImage,exception);
imageBuffer=GetAuthenticOpenCLBuffer(image,device,exception);
if (imageBuffer == (cl_mem) NULL)
goto cleanup;