'\" t .\" Title: write_image (2D) .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 02/03/2019 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "WRITE_IMAGE (2D)" "3clc" "02/03/2019" "The Khronos Group" "OpenCL Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" write_image \- Write color value to location in a 2D image object\&. .SH "" .HP \w'void\ write_imagef('u .BI "void write_imagef(image2d_t\ " "image" ", int2\ " "coord" ", float4\ " "color" ");" .HP \w'void\ write_imagef('u .BI "void write_imagef(image2d_array_t\ " "image" ", int4\ " "coord" ", float4\ " "color" ");" .HP \w'void\ write_imagei('u .BI "void write_imagei(image2d_t\ " "image" ", int2\ " "coord" ", int4\ " "color" ");" .HP \w'void\ write_imagei('u .BI "void write_imagei(image2d_array_t\ " "image" ", int4\ " "coord" ", int4\ " "color" ");" .HP \w'void\ write_imageui('u .BI "void write_imageui(image2d_t\ " "image" ", int2\ " "coord" ", uint4\ " "color" ");" .HP \w'void\ write_imageui('u .BI "void write_imageui(image2d_array_t\ " "image" ", int4\ " "coord" ", uint4\ " "color" ");" .HP \w'void\ write_imageh('u .BI "void write_imageh(image2d_t\ " "image" ", int2\ " "coord" ", half4\ " "color" ");" .HP \w'void\ write_imageh('u .BI "void write_imageh(image2d_array_t\ " "image" ", int4\ " "coord" ", half4\ " "color" ");" .SH "DESCRIPTION" .PP \fBwrite_imagef\fR can only be used with image objects created with \fIimage_channel_data_type\fR set to one of the pre\-defined packed formats or set to \fBCL_SNORM_INT8\fR, \fBCL_UNORM_INT8\fR, \fBCL_SNORM_INT16\fR, \fBCL_UNORM_INT16\fR, \fBCL_HALF_FLOAT\fR or \fBCL_FLOAT\fR\&. Appropriate data format conversion will be done to convert channel data from a floating\-point value to actual data format in which the channels are stored\&. .PP \fBwrite_imagei\fR can only be used with image objects created with \fIimage_channel_data_type\fR set to one of the following values: \fBCL_SIGNED_INT8\fR, \fBCL_SIGNED_INT16\fR, and \fBCL_SIGNED_INT32\fR\&. .PP \fBwrite_imageui\fR functions can only be used with image objects created with \fIimage_channel_data_type\fR set to one of the following values: \fBCL_UNSIGNED_INT8\fR, \fBCL_UNSIGNED_INT16\fR, or \fBCL_UNSIGNED_INT32\fR\&. .PP An application that wants to use \fBhalf\fR and \fBhalf\fR\fB\fIn\fR\fR types will need to include the #pragma OPENCL EXTENSION \fBcl_khr_fp16\fR(3clc) : enable directive\&. .PP \fBwrite_imageh\fR can only be used with image objects created with \fIimage_channel_data_type\fR set to one of the pre\-defined packed formats or set to \fBCL_SNORM_INT8\fR, \fBCL_UNORM_INT8\fR, \fBCL_SNORM_INT16\fR, \fBCL_UNORM_INT16\fR or \fBCL_HALF_FLOAT\fR\&. Functions that take image2d_t.PP For the functions that take an image_2d_t image, write color value to location specified by \fIcoord\&.xy\fR in the 2D image object specified by \fIimage\fR\&. Appropriate data format conversion to the specified image format is done before writing the color value\&. \fIcoord\&.x\fR and \fIcoord\&.y\fR are considered to be unnormalized coordinates and must be in the range 0 \&... image width \- 1, and 0 \&... image height \- 1\&. .PP For functions that take image_2d_t, the behavior of \fBwrite_imagef\fR, \fBwrite_imagei\fR, \fBwrite_imageui\fR, and \fBwrite_imageh\fR for image objects created with \fIimage_channel_data_type\fR values not specified in the description above or with \fI(x, y)\fR coordinate values that are not in the range (0 \&... image width \- 1, 0 \&... image height \- 1), respectively, is undefined\&. Functions that take image2d_array_t.PP For the functions that take an image_2d_array_t image, write color value to location specified by \fIcoord\&.xy\fR in the 2D image identified by \fIcoord\&.z\fR in the 2D image array specified by \fIimage\fR\&. Appropriate data format conversion to the specified image format is done before writing the color value\&. \fIcoord\&.x\fR, \fIcoord\&.y\fR and \fIcoord\&.z\fR are considered to be unnormalized coordinates and must be in the range 0 \&... image width \- 1, 0 \&... image height \- 1 and 0 \&... image number of layers \- 1\&. .PP For functions that take image_2d_array_t, the behavior of \fBwrite_imagef\fR, \fBwrite_imagei\fR, \fBwrite_imageui\fR, and \fBwrite_imageh\fR for image objects created with \fIimage_channel_data_type\fR values not specified in the description above or with \fI(x, y, z)\fR coordinate values that are not in the range (0 \&... image width \- 1, 0 \&... image height \- 1), respectively, is undefined\&. .SH "NOTES" .PP The built\-in functions defined in this section can only be used with image memory objects\&. An image memory object can be accessed by specific function calls that read from and/or write to specific locations in the image\&. .PP Image memory objects that are being read by a kernel should be declared with the \fBaccessQualifiers\fR(3clc) qualifier\&. \fBwrite_image\fR calls to image memory objects declared with the \fBaccessQualifiers\fR(3clc) qualifier will generate a compilation error\&. Image memory objects that are being written to by a kernel should be declared with the \fBaccessQualifiers\fR(3clc) qualifier\&. \fBread_image\fR calls to image memory objects declared with the \fBaccessQualifiers\fR(3clc) qualifier will generate a compilation error\&. \fBread_image\fR and \fBwrite_image\fR calls to the same image memory object in a kernel are not supported\&. .PP The \fBread_image\fR calls returns a four component floating\-point, integer or unsigned integer color value\&. The color values returned by \fBread_image\fR are identified as x, y, z, w where x refers to the red component, y refers to the green component, z refers to the blue component and w refers to the alpha component\&. .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBimageFunctions\fR(3clc) .SH "AUTHORS" .PP \fBThe Khronos Group\fR .SH "COPYRIGHT" .br Copyright \(co 2007-2011 The Khronos Group Inc. .br Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials. .sp .SH "NOTES" .IP " 1." 4 OpenCL Specification .RS 4 \%page 292, section 6.12.14 - Image Read and Write Functions .RE