'\" t .\" Title: write_image (3D) .\" 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 (3D)" "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_image \- Write color value to location in a 3D image object\&. .SH "" .HP \w'void\ write_imagef('u .BI "void write_imagef(image3d_t\ " "image" ", int4\ " "coord" ", float4\ " "color" ");" .HP \w'void\ write_imagei('u .BI "void write_imagei(image3d_t\ " "image" ", int4\ " "coord" ", int4\ " "color" ");" .HP \w'void\ write_imageui('u .BI "void write_imageui(image3d_t\ " "image" ", int4\ " "coord" ", uint4\ " "color" ");" .HP \w'void\ write_imageh('u .BI "void write_imageh(image3d_t\ " "image" ", int4\ " "coord" ", half4\ " "color" ");" .SH "DESCRIPTION" .PP Writes to a 3D image memory object are only supported when the \fBcl_khr_3d_image_writes\fR(3clc) extension is implemented\&. Reads and writes to the same 3D image memory object are not allowed in a kernel\&. .PP An application that wants to use this extension to write to 3D image memory objects will need to include the #pragma OPENCL EXTENSION \fBcl_khr_3d_image_writes\fR(3clc) : enable directive in the OpenCL program source\&. .PP These functions write \fIcolor\fR value to location specified by coordinate \fI(x, y, z)\fR in the 3D 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, \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 depth \- 1\&. .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, or \fBCL_SIGNED_INT32\fR\&. .PP \fBwrite_imageui\fR 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 behavior of \fBwrite_imagef\fR, \fBwrite_imagei\fR and \fBwrite_imageui\fR for image objects 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, 0 \&.\&.\&. image depth \- 1), respectively, is undefined\&. .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\&. .PP The behavior of \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, 0 \&.\&.\&. image depth \- 1), respectively, is undefined\&. .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 cl_khr_fp16 : enable directive\&. .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBimageFunctions\fR(3clc), \fBcl_khr_3d_image_writes\fR(3clc) \fBscalarDataTypes\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 12, section 9.4 - Writing to 3D image memory objects .RE