18 #include <system_error>
21 inline namespace _V1 {
22 namespace ext::oneapi::experimental {
28 switch (num_channels) {
36 assert(
false &&
"Invalid channel number");
100 "Invalid descriptor `image_type` passed to "
101 "`get_mip_level_desc`. A mipmap level descriptor can only be "
102 "requested by a descriptor with mipmap image type!");
106 size_t width = std::max<size_t>(this->width >> level, 1);
107 size_t height = this->height == 0
109 : std::max<size_t>(this->height >> level, 1);
111 : std::max<size_t>(this->depth >> level, 1);
128 "Images must have only 1, 2, or 4 channels! Use a "
129 "valid number of channels instead.");
132 switch (this->
type) {
138 "Standard images cannot have array_size greater than 1! Use "
139 "image_type::array for image arrays.");
145 "Standard images cannot have num_levels greater than 1! Use "
146 "image_type::mipmap for mipmap images.");
154 "Image array must have array_size greater than "
155 "1! Use image_type::standard otherwise.");
157 if (this->
depth != 0) {
160 "Cannot have 3D image arrays! Either depth must "
161 "be 0 or array_size must be 1.");
166 "Cannot have mipmap image arrays! Either "
167 "num_levels or array_size must be 1.");
176 "Mipmap images cannot have array_size greater than 1! Use "
177 "image_type::array for image arrays.");
182 "Mipmap images must have num_levels greater than "
183 "1! Use image_type::standard otherwise.");
191 "Cubemap images must have array_size of 6 only! "
192 "Use image_type::array instead.");
199 "Cubemap images must be square with valid and equivalent width and "
200 "height! Use image_type::array instead.");
205 "Cannot have mipmap cubemaps! Either num_levels "
206 "or array_size must be 1.");
image_channel_order get_image_default_channel_order(unsigned int num_channels)
image_type
image type enum
A struct to describe the properties of an image.
image_descriptor(range< 1 > dims, unsigned int num_channels, image_channel_type channel_type, image_type type=image_type::standard, unsigned int num_levels=1, unsigned int array_size=1)
image_descriptor(range< 3 > dims, unsigned int num_channels, image_channel_type channel_type, image_type type=image_type::standard, unsigned int num_levels=1, unsigned int array_size=1)
image_descriptor()=default
unsigned int num_channels
image_descriptor get_mip_level_desc(unsigned int level) const
Get the descriptor for a mipmap level.
image_descriptor(range< 2 > dims, unsigned int num_channels, image_channel_type channel_type, image_type type=image_type::standard, unsigned int num_levels=1, unsigned int array_size=1)
image_channel_type channel_type