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

◆ from_vulkan_format()

std::optional< ImageFormat > MayaFlux::Portal::Graphics::TextureLoom::from_vulkan_format ( vk::Format  vk_format)
static

Convert Vulkan format to Portal ImageFormat.

Reverse twin of to_vulkan_format. Returns std::nullopt for Vulkan formats with no ImageFormat equivalent rather than guessing.

Definition at line 696 of file TextureLoom.cpp.

697{
698 switch (vk_format) {
699 case vk::Format::eR8Unorm:
700 return ImageFormat::R8;
701 case vk::Format::eR8G8Unorm:
702 return ImageFormat::RG8;
703 case vk::Format::eR8G8B8Unorm:
704 return ImageFormat::RGB8;
705 case vk::Format::eR8G8B8A8Unorm:
706 return ImageFormat::RGBA8;
707 case vk::Format::eR8G8B8A8Srgb:
709 case vk::Format::eB8G8R8A8Unorm:
710 return ImageFormat::BGRA8;
711
712 case vk::Format::eR16Unorm:
713 return ImageFormat::R16;
714 case vk::Format::eR16G16Unorm:
715 return ImageFormat::RG16;
716 case vk::Format::eR16G16B16A16Unorm:
717 return ImageFormat::RGBA16;
718
719 case vk::Format::eR16Sfloat:
720 return ImageFormat::R16F;
721 case vk::Format::eR16G16Sfloat:
722 return ImageFormat::RG16F;
723 case vk::Format::eR16G16B16A16Sfloat:
725
726 case vk::Format::eR32Sfloat:
727 return ImageFormat::R32F;
728 case vk::Format::eR32G32Sfloat:
729 return ImageFormat::RG32F;
730 case vk::Format::eR32G32B32A32Sfloat:
732
733 case vk::Format::eD16Unorm:
735 case vk::Format::eX8D24UnormPack32:
737 case vk::Format::eD32Sfloat:
739 case vk::Format::eD24UnormS8Uint:
741
742 default:
743 return std::nullopt;
744 }
745}
@ DEPTH24_STENCIL8
24-bit depth + 8-bit stencil
@ RG16
Two channel 16-bit unsigned integer.
@ BGRA8
8-bit BGRA unsigned normalized
@ RGBA16
Four channel 16-bit unsigned integer.
@ RGBA32F
Four channel 32-bit float.
@ R16F
Single channel 16-bit float.
@ R16
Single channel 16-bit unsigned integer.
@ RGBA16F
Four channel 16-bit float.
@ RG32F
Two channel 32-bit float.
@ R32F
Single channel 32-bit float.
@ RG16F
Two channel 16-bit float.
@ RGBA8_SRGB
Four channel 8-bit sRGB.

References MayaFlux::Portal::Graphics::BGRA8, MayaFlux::Portal::Graphics::DEPTH16, MayaFlux::Portal::Graphics::DEPTH24, MayaFlux::Portal::Graphics::DEPTH24_STENCIL8, MayaFlux::Portal::Graphics::DEPTH32F, MayaFlux::Portal::Graphics::R16, MayaFlux::Portal::Graphics::R16F, MayaFlux::Portal::Graphics::R32F, MayaFlux::Portal::Graphics::R8, MayaFlux::Portal::Graphics::RG16, MayaFlux::Portal::Graphics::RG16F, MayaFlux::Portal::Graphics::RG32F, MayaFlux::Portal::Graphics::RG8, MayaFlux::Portal::Graphics::RGB8, MayaFlux::Portal::Graphics::RGBA16, MayaFlux::Portal::Graphics::RGBA16F, MayaFlux::Portal::Graphics::RGBA32F, MayaFlux::Portal::Graphics::RGBA8, and MayaFlux::Portal::Graphics::RGBA8_SRGB.

Referenced by MayaFlux::IO::download_image().

+ Here is the caller graph for this function: