| Flutter Impeller |

Public Member Functions | Friends | List of all members
impeller::YUVConversionVK Class Referencefinal

It is sometimes necessary to deal with formats not native to Vulkan. In such cases, extra information is necessary to access images. A YUV conversion object is needed in such instances. More...

`#include <yuv_conversion_vk.h>`

## Public Member Functions
| ~YUVConversionVK ()
| YUVConversionVK (const YUVConversionVK &)=delete
YUVConversionVK & | operator= (const YUVConversionVK &)=delete
bool | IsValid () const
const YUVConversionDescriptorVK & | GetDescriptor () const
| Get the descriptor used to create this conversion. More...
vk::SamplerYcbcrConversion | GetConversion () const

## Friends
class | YUVConversionLibraryVK

## Detailed Description

It is sometimes necessary to deal with formats not native to Vulkan. In such cases, extra information is necessary to access images. A YUV conversion object is needed in such instances.

There are usually only a handful of viable conversions in a given context. However, due to the way the Vulkan spec. treats "identically defined" conversions, only a single conversion object is valid for an equivalent `YUVConversionDescriptorVK`. Because of this restriction, it is not possible to just create a conversion from a descriptor (as the underlying handles will be equivalent but different). Instead, a conversion may only be obtained from a conversion library. Libraries handle hashing and caching conversions by descriptor. Caller can find a library on the top-level context. They may not create their own (the constructor is private).

Definition at line 51 of file yuv_conversion_vk.h.

## Constructor & Destructor Documentation

## ◆ ~YUVConversionVK()

impeller::YUVConversionVK::~YUVConversionVK | ( |  | ) |
| default

## ◆ YUVConversionVK()

impeller::YUVConversionVK::YUVConversionVK | ( | const YUVConversionVK & |  | ) |
| delete

## Member Function Documentation

## ◆ GetConversion()

vk::SamplerYcbcrConversion impeller::YUVConversionVK::GetConversion | ( |  | ) | const

Returns
  The Vulkan handle of the YUV conversion.

Definition at line 32 of file yuv_conversion_vk.cc.

32 {
33 return conversion_ ? conversion_.get()
34 : static_cast<vk::SamplerYcbcrConversion>(VK_NULL_HANDLE);
35 }

## ◆ GetDescriptor()

const YUVConversionDescriptorVK & impeller::YUVConversionVK::GetDescriptor | ( |  | ) | const

Get the descriptor used to create this conversion.

Definition at line 37 of file yuv_conversion_vk.cc.

37 {
38 return chain_;
39 }

## ◆ IsValid()

bool impeller::YUVConversionVK::IsValid | ( |  | ) | const

Returns
  `true` if this conversion is valid for use with images and samplers.

Definition at line 28 of file yuv_conversion_vk.cc.

28 {
29 return conversion_ && !!conversion_.get();
30 }

## ◆ operator=()

YUVConversionVK& impeller::YUVConversionVK::operator= | ( | const YUVConversionVK & |  | ) |
| delete

## Friends And Related Function Documentation

## ◆ YUVConversionLibraryVK

friend class YUVConversionLibraryVK
| friend

Definition at line 76 of file yuv_conversion_vk.h.

The documentation for this class was generated from the following files:

- impeller/renderer/backend/vulkan/yuv_conversion_vk.h
- impeller/renderer/backend/vulkan/yuv_conversion_vk.cc