Class image_format
boost::compute::image_format — A OpenCL image format.
Synopsis
class image_format {
public:
enum channel_order { r = = CL_R, a = = CL_A, intensity = = CL_INTENSITY,
luminance = = CL_LUMINANCE, rg = = CL_RG, ra = = CL_RA,
rgb = = CL_RGB, rgba = = CL_RGBA, argb = = CL_ARGB,
bgra = = CL_BGRA };
enum channel_data_type { snorm_int8 = = CL_SNORM_INT8,
snorm_int16 = = CL_SNORM_INT16,
unorm_int8 = = CL_UNORM_INT8,
unorm_int16 = = CL_UNORM_INT16,
unorm_short_565 = = CL_UNORM_SHORT_565,
unorm_short_555 = = CL_UNORM_SHORT_555,
unorm_int_101010 = = CL_UNORM_INT_101010,
signed_int8 = = CL_SIGNED_INT8,
signed_int16 = = CL_SIGNED_INT16,
signed_int32 = = CL_SIGNED_INT32,
unsigned_int8 = = CL_UNSIGNED_INT8,
unsigned_int16 = = CL_UNSIGNED_INT16,
unsigned_int32 = = CL_UNSIGNED_INT32,
float16 = = CL_HALF_FLOAT, float32 = = CL_FLOAT };
explicit image_format(cl_channel_order, cl_channel_type);
explicit image_format(const cl_image_format &);
image_format(const image_format &);
image_format & operator=(const image_format &);
~image_format();
const cl_image_format * get_format_ptr() const;
bool operator==(const image_format &) const;
bool operator!=(const image_format &) const;
};
Description
Например, для создания формата 8-битного RGBA-изображения:
boost::compute::image_format rgba8(CL_RGBA, CL_UNSIGNED_INT8);
После созданияimage_formatОбъекты обычно передаются конструктору различных классов изображений (например,image2d).,Изображение3dдля создания объекта изображения на вычислительном устройстве.
Форматы изображений, поддерживаемые контекстом, могут быть запрошены с помощью статических get_supported_formats() в каждом классе изображений. Например:
std::vector<image_format> formats = image2d::get_supported_formats(ctx);
Смотрите также:
image2d
image_format
public
construct/copy/destruct
- <
explicitimage_format(cl_channel_orderorder,cl_channel_typetype);
>Создает новый объект формата изображения с<order
>и<type
>. - <
explicitimage_format(constcl_image_format&format);
>Создает новый формат изображения из<format
>. - <
image_format(constimage_format&other);
>Создает новый объект формата изображения в виде копии<other
>. - <
image_format&operator=(constimage_format&other);
>Копии формата от<other
>до<*this
>. - <
~image_format();
>Уничтожает объект формата изображения.
image_format
public member functions
- <
constcl_image_format*get_format_ptr()const;
>Возвращает указатель на<cl_image_format
>объект. booloperator==(constimage_format&other)const;
Возвращаетсяtrue
, если*this
то же самое, чтоother
.- <
booloperator!=(constimage_format&other)const;
>Возвращается<true
>, если<*this
>не то же самое, что<other
>.