'\" t .\" Title: write_image (1D) .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/14/2021 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "WRITE_IMAGE (1D)" "3clc" "01/14/2021" "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_image1d \- Write color value to location in a 1D image object\&. .SH "" .HP \w'void\ write_imagef('u .BI "void write_imagef(image1d_t\ " "image" ", int\ " "coord" ", float4\ " "color" ");" .HP \w'void\ write_imagef('u .BI "void write_imagef(image1d_buffer_t\ " "image" ", int\ " "coord" ", float4\ " "color" ");" .HP \w'void\ write_imagef('u .BI "void write_imagef(image1d_array_t\ " "image" ", int2\ " "coord" ", float4\ " "color" ");" .HP \w'void\ write_imagei('u .BI "void write_imagei(image1d_t\ " "image" ", int\ " "coord" ", int4\ " "color" ");" .HP \w'void\ write_imagei('u .BI "void write_imagei(image1d_buffer_t\ " "image" ", int\ " "coord" ", int4\ " "color" ");" .HP \w'void\ write_imagei('u .BI "void write_imagei(image1d_array_t\ " "image" ", int2\ " "coord" ", int4\ " "color" ");" .HP \w'void\ write_imageui('u .BI "void write_imageui(image1d_t\ " "image" ", int\ " "coord" ", uint4\ " "color" ");" .HP \w'void\ write_imageui('u .BI "void write_imageui(image1d_buffer_t\ " "image" ", int\ " "coord" ", uint4\ " "color" ");" .HP \w'void\ write_imageui('u .BI "void write_imageui(image1d_array_t\ " "image" ", int2\ " "coord" ", uint4\ " "color" ");" .HP \w'void\ write_imageh('u .BI "void write_imageh(image1d_t\ " "image" ", int\ " "coord" ", half4\ " "color" ");" .HP \w'void\ write_imageh('u .BI "void write_imageh(image1d_buffer_t\ " "image" ", int\ " "coord" ", half4\ " "color" ");" .HP \w'void\ write_imageh('u .BI "void write_imageh(image1d_array_t\ " "image" ", int2\ " "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 functions 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, or \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 The \fBwrite_imageh\fR functions are enabled when the half type is supported and 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\&. 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\&. Functions that take image1d_t or image1d_buffer_t.PP The functions that take image1d_t or image1d_buffer_t write the \fIcolor\fR value to the location specified by \fIcoord\fR in the 1D image or 1D image buffer object specified by \fIimage\fR\&. Appropriate data format conversion to the specified image format is done before writing the color value\&. \fIcoord\fR is considered to be unnormalized coordinates and must be in the range 0\&.\&.\&. image width \- 1\&. .PP for functions taking image1d_t or image1d_buffer_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 coordinate values that are not in the range (0\&.\&.\&. image width \- 1), is undefined\&. Functions that take image1d_array_t.PP The functions that take image1d_array_t write the \fIcolor\fR value to the location specified by \fIcoord\&.x\fR in the 1D image identified by \fIcoord\&.y\fR in the 1D 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 and \fIcoord\&.y\fR are considered to be unnormalized coordinates and must be in the range 0 \&... image width \- 1 and 0 \&... image number of layers \- 1\&. .PP For functions taking image1d_array_t, the behavior of \fBwrite_imagef\fR, \fBwrite_imagei\fR and \fBwrite_imageui\fR for image objects created with \fIimage_channel_data_type\fR values not specified in the description above or with (x, y) coordinate values that are not in the range (0 \&... image width \- 1, 0 \&...image number of layers \- 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