'\" t .\" Title: cl_image_format .\" 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 "CL_IMAGE_FORMAT" "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" cl_image_format \- The image format descriptor structure is defined as: .SS "" .TS tab(:); l. T{ typedef struct _cl_image_format { cl_channel_order image_channel_order; cl_channel_type image_channel_data_type; } cl_image_format; T} .TE .sp 1 .SH "MEMBERS" .PP image_channel_order .RS 4 Specifies the number of channels and the channel layout i\&.e\&. the memory layout in which channels are stored in the image\&. Valid values are described in the table below\&. .TS allbox tab(:); lB lB. T{ Format T}:T{ Description T} .T& l l l l l l l l l l l l l l. T{ CL_R, CL_Rx, or CL_A T}:T{ \ \& T} T{ CL_INTENSITY T}:T{ This format can only be used if channel data type = CL_UNORM_INT8, CL_UNORM_INT16, CL_SNORM_INT8, CL_SNORM_INT16, CL_HALF_FLOAT, or CL_FLOAT\&. T} T{ CL_LUMINANCE T}:T{ This format can only be used if channel data type = CL_UNORM_INT8, CL_UNORM_INT16, CL_SNORM_INT8, CL_SNORM_INT16, CL_HALF_FLOAT, or CL_FLOAT\&. T} T{ CL_RG, CL_RGx, or CL_RA T}:T{ \ \& T} T{ CL_RGB or CL_RGBx T}:T{ This format can only be used if channel data type = CL_UNORM_SHORT_565, CL_UNORM_SHORT_555 or CL_UNORM_INT101010\&. T} T{ CL_RGBA T}:T{ T} T{ CL_ARGB, CL_BGRA\&. T}:T{ This format can only be used if channel data type = CL_UNORM_INT8, CL_SNORM_INT8, CL_SIGNED_INT8 or CL_UNSIGNED_INT8\&. T} .TE .sp 1 .RE .PP image_channel_data_type .RS 4 Describes the size of the channel data type\&. The number of bits per element determined by the \fBimage_channel_data_type\fR and \fBimage_channel_order\fR must be a power of two\&. The list of supported values is described in the table below\&. .TS allbox tab(:); lB lB. T{ Image Channel Data Type T}:T{ Description T} .T& l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l. T{ CL_SNORM_INT8 T}:T{ Each channel component is a normalized signed 8\-bit integer value\&. T} T{ CL_SNORM_INT16 T}:T{ Each channel component is a normalized signed 16\-bit integer value\&. T} T{ CL_UNORM_INT8 T}:T{ Each channel component is a normalized unsigned 8\-bit integer value\&. T} T{ CL_UNORM_INT16 T}:T{ Each channel component is a normalized unsigned 16\-bit integer value\&. T} T{ CL_UNORM_SHORT_565 T}:T{ Represents a normalized 5\-6\-5 3\-channel RGB image\&. The channel order must be CL_RGB or CL_RGBx\&. T} T{ CL_UNORM_SHORT_555 T}:T{ Represents a normalized x\-5\-5\-5 4\-channel xRGB image\&. The channel order must be CL_RGB or CL_RGBx\&. T} T{ CL_UNORM_INT_101010 T}:T{ Represents a normalized x\-10\-10\-10 4\-channel xRGB image\&. The channel order must be CL_RGB or CL_RGBx\&. T} T{ CL_SIGNED_INT8 T}:T{ Each channel component is an unnormalized signed 8\-bit integer value\&. T} T{ CL_SIGNED_INT16 T}:T{ Each channel component is an unnormalized signed 16\-bit integer value\&. T} T{ CL_SIGNED_INT32 T}:T{ Each channel component is an unnormalized signed 32\-bit integer value\&. T} T{ CL_UNSIGNED_INT8 T}:T{ Each channel component is an unnormalized unsigned 8\-bit integer value\&. T} T{ CL_UNSIGNED_INT16 T}:T{ Each channel component is an unnormalized unsigned 16\-bit integer value\&. T} T{ CL_UNSIGNED_INT32 T}:T{ Each channel component is an unnormalized unsigned 32\-bit integer value\&. T} T{ CL_HALF_FLOAT T}:T{ Each channel component is a 16\-bit half\-float value\&. T} T{ CL_FLOAT T}:T{ Each channel component is a single precision floating\-point value\&. T} .TE .sp 1 .RE .SH "DESCRIPTION" .PP For example, to specify a normalized unsigned 8\-bit / channel RGBA image: .PP .if n \{\ .RS 4 .\} .nf image_channel_order = \fBCL_RGBA\fR image_channel_data_type = \fBCL_UNORM_INT8\fR .fi .if n \{\ .RE .\} .PP \fIimage_channel_data_type\fR values of \fBCL_UNORM_SHORT_565\fR, \fBCL_UNORM_SHORT_555\fR and \fBCL_UNORM_INT_101010\fR are special cases of packed image formats where the channels of each element are packed into a single unsigned short or unsigned int\&. For these special packed image formats, the channels are normally packed with the first channel in the most significant bits of the bitfield, and successive channels occupying progressively less significant locations\&. For \fBCL_UNORM_SHORT_565\fR, R is in bits 15:11, G is in bits 10:5 and B is in bits 4:0\&. For \fBCL_UNORM_SHORT_555\fR, bit 15 is undefined, R is in bits 14:10, G in bits 9:5 and B in bits 4:0\&. For \fBCL_UNORM_INT_101010\fR, bits 31:30 are undefined, R is in bits 29:20, G in bits 19:10 and B in bits 9:0\&. .PP OpenCL implementations must maintain the minimum precision specified by the number of bits in image_channel_data_type\&. If the image format specified by image_channel_order, and image_channel_data_type cannot be supported by the OpenCL implementation, then the call to \fBclCreateImage\fR(3clc) will return a NULL memory object\&. .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBimageDescriptor\fR(3clc), \fBEXTENSION\fR(3clc), \fBclGetSupportedImageFormats\fR(3clc), \fBclCreateImage\fR(3clc) .SH "AUTHORS" .PP \fBThe Khronos Group\fR .SH "COPYRIGHT" .br Copyright \(co 2007-2010 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 92, section 5.3.1.1 - Image Format Descriptor .RE