MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ get_surface_format_traits()

SurfaceFormatTraits MayaFlux::Core::get_surface_format_traits ( GraphicsSurfaceInfo::SurfaceFormat  fmt)
inline

Query DataVariant-dispatch traits for a surface format.

For the byte count, call vk_format_bytes_per_pixel(to_vk_format(fmt)).

Parameters
fmtThe MayaFlux surface format enum value.
Returns
SurfaceFormatTraits for that format.

Definition at line 199 of file VKEnumUtils.hpp.

201{
203 switch (fmt) {
204 case SF::B8G8R8A8_SRGB:
205 case SF::R8G8B8A8_SRGB:
206 case SF::B8G8R8A8_UNORM:
207 case SF::R8G8B8A8_UNORM:
208 return {
209 .channel_count = 4U,
210 .bits_per_channel = 8U,
211 .is_float = false,
212 .is_packed = false
213 };
214
215 case SF::R16G16B16A16_SFLOAT:
216 return {
217 .channel_count = 4U,
218 .bits_per_channel = 16U,
219 .is_float = true,
220 .is_packed = false
221 };
222
223 case SF::A2B10G10R10_UNORM:
224 return {
225 .channel_count = 4U,
226 .bits_per_channel = 10U,
227 .is_float = false,
228 .is_packed = true
229 };
230
231 case SF::R32G32B32A32_SFLOAT:
232 return {
233 .channel_count = 4U,
234 .bits_per_channel = 32U,
235 .is_float = true,
236 .is_packed = false
237 };
238
239 default:
240 return {
241 .channel_count = 4U,
242 .bits_per_channel = 8U,
243 .is_float = false,
244 .is_packed = false
245 };
246 }
247}
SurfaceFormat
Default pixel format for window surfaces (Vulkan-compatible)

References MayaFlux::Core::SurfaceFormatTraits::channel_count.

Referenced by MayaFlux::Kakshya::readback_region().

+ Here is the caller graph for this function: