@@ -51,7 +51,11 @@ enum class image_type : unsigned int {
5151 cubemap = 3 ,
5252 gather = 4 ,
5353};
54-
54+ // / image color space enum
55+ enum class image_color_space : uint32_t {
56+ linear = 0 ,
57+ srgb = 1 ,
58+ };
5559// / A struct to describe the properties of an image.
5660struct image_descriptor {
5761 size_t width{0 };
@@ -62,7 +66,7 @@ struct image_descriptor {
6266 image_type type{image_type::standard};
6367 unsigned int num_levels{1 };
6468 unsigned int array_size{1 };
65- std::optional<image_channel_order> channel_order ;
69+ image_color_space color_space = image_color_space::linear ;
6670 image_descriptor () = default ;
6771
6872 image_descriptor (range<1 > dims, unsigned int num_channels,
@@ -128,19 +132,18 @@ struct image_descriptor {
128132 throw sycl::exception (sycl::errc::invalid,
129133 " Images must have 1, 2, 3, or 4 channels." );
130134 }
131- if (channel_order.has_value () &&
132- channel_order.value () == image_channel_order::ext_oneapi_srgba) {
133- if (num_channels != 4 ) {
135+ if (color_space == image_color_space::srgb) {
136+ if (num_channels != 4 ) {
134137 throw sycl::exception (
135138 sycl::errc::invalid,
136- " ext_oneapi_srgba channel order requires num_channels == 4" );
137- }
138- if (channel_type != image_channel_type::unorm_int8) {
139+ " sRGB color space requires num_channels == 4" );
140+ }
141+ if (channel_type != image_channel_type::unorm_int8) {
139142 throw sycl::exception (
140143 sycl::errc::invalid,
141- " ext_oneapi_srgba channel order requires unorm_int8 channel type" );
142- }
144+ " sRGB color space requires unorm_int8 channel type" );
143145 }
146+ }
144147 switch (this ->type ) {
145148 case image_type::standard:
146149 if (this ->array_size > 1 ) {
0 commit comments