Flutter Engine
The Flutter Engine
Functions | Variables
skgpu::graphite::ycbcrPackaging Namespace Reference

Functions

uint32_t nonFormatInfoAsUInt32 (const VulkanYcbcrConversionInfo &conversionInfo)
 
int numInt32sNeeded (const VulkanYcbcrConversionInfo &conversionInfo)
 

Variables

static constexpr int kInt32sNeededKnownFormat = 2
 
static constexpr int kInt32sNeededExternalFormat = 3
 
static constexpr int kUsesExternalFormatBits = 1
 
static constexpr int kYcbcrModelBits = 3
 
static constexpr int kYcbcrRangeBits = 1
 
static constexpr int kXChromaOffsetBits = 1
 
static constexpr int kYChromaOffsetBits = 1
 
static constexpr int kChromaFilterBits = 1
 
static constexpr int kForceExplicitReconBits = 1
 
static constexpr int kComponentBits = 3
 
static constexpr int kUsesExternalFormatShift = 0
 
static constexpr int kYcbcrModelShift
 
static constexpr int kYcbcrRangeShift = kYcbcrModelShift + kYcbcrModelBits
 
static constexpr int kXChromaOffsetShift = kYcbcrRangeShift + kYcbcrRangeBits
 
static constexpr int kYChromaOffsetShift = kXChromaOffsetShift + kXChromaOffsetBits
 
static constexpr int kChromaFilterShift = kYChromaOffsetShift + kYChromaOffsetBits
 
static constexpr int kForceExplicitReconShift = kChromaFilterShift + kChromaFilterBits
 
static constexpr int kComponentRShift = kForceExplicitReconShift + kComponentBits
 
static constexpr int kComponentGShift = kComponentRShift + kComponentBits
 
static constexpr int kComponentBShift = kComponentGShift + kComponentBits
 
static constexpr int kComponentAShift = kComponentBShift + kComponentBits
 
static constexpr uint32_t kUseExternalFormatMask
 
static constexpr uint32_t kYcbcrModelMask
 
static constexpr uint32_t kYcbcrRangeMask
 
static constexpr uint32_t kXChromaOffsetMask
 
static constexpr uint32_t kYChromaOffsetMask
 
static constexpr uint32_t kChromaFilterMask
 
static constexpr uint32_t kForceExplicitReconMask
 
static constexpr uint32_t kComponentRMask = ((1 << kComponentBits) - 1) << kComponentRShift
 
static constexpr uint32_t kComponentBMask = ((1 << kComponentBits) - 1) << kComponentGShift
 
static constexpr uint32_t kComponentGMask = ((1 << kComponentBits) - 1) << kComponentBShift
 
static constexpr uint32_t kComponentAMask = ((1 << kComponentBits) - 1) << kComponentAShift
 

Function Documentation

◆ nonFormatInfoAsUInt32()

uint32_t skgpu::graphite::ycbcrPackaging::nonFormatInfoAsUInt32 ( const VulkanYcbcrConversionInfo conversionInfo)

Definition at line 179 of file VulkanGraphiteUtils.cpp.

179 {
180 static_assert(kComponentAShift + kComponentBits <= 32);
181
182 SkASSERT(conversionInfo.fYcbcrModel < (1u << kYcbcrModelBits ));
183 SkASSERT(conversionInfo.fYcbcrRange < (1u << kYcbcrRangeBits ));
184 SkASSERT(conversionInfo.fXChromaOffset < (1u << kXChromaOffsetBits ));
185 SkASSERT(conversionInfo.fYChromaOffset < (1u << kYChromaOffsetBits ));
186 SkASSERT(conversionInfo.fChromaFilter < (1u << kChromaFilterBits ));
188 SkASSERT(conversionInfo.fComponents.r < (1u << kComponentBits ));
189 SkASSERT(conversionInfo.fComponents.g < (1u << kComponentBits ));
190 SkASSERT(conversionInfo.fComponents.b < (1u << kComponentBits ));
191 SkASSERT(conversionInfo.fComponents.a < (1u << kComponentBits ));
192
193 bool usesExternalFormat = conversionInfo.fFormat == VK_FORMAT_UNDEFINED;
194
195 return (((uint32_t)(usesExternalFormat ) << kUsesExternalFormatShift) |
196 ((uint32_t)(conversionInfo.fYcbcrModel ) << kYcbcrModelShift ) |
197 ((uint32_t)(conversionInfo.fYcbcrRange ) << kYcbcrRangeShift ) |
198 ((uint32_t)(conversionInfo.fXChromaOffset ) << kXChromaOffsetShift ) |
199 ((uint32_t)(conversionInfo.fYChromaOffset ) << kYChromaOffsetShift ) |
200 ((uint32_t)(conversionInfo.fChromaFilter ) << kChromaFilterShift ) |
201 ((uint32_t)(conversionInfo.fForceExplicitReconstruction) << kForceExplicitReconShift) |
202 ((uint32_t)(conversionInfo.fComponents.r ) << kComponentRShift ) |
203 ((uint32_t)(conversionInfo.fComponents.g ) << kComponentGShift ) |
204 ((uint32_t)(conversionInfo.fComponents.b ) << kComponentBShift ) |
205 ((uint32_t)(conversionInfo.fComponents.a ) << kComponentAShift ));
206}
#define SkASSERT(cond)
Definition: SkAssert.h:116
static constexpr int kUsesExternalFormatShift
static constexpr int kForceExplicitReconShift
static constexpr int kForceExplicitReconBits
VkComponentSwizzle r
Definition: vulkan_core.h:3460
VkComponentSwizzle a
Definition: vulkan_core.h:3463
VkComponentSwizzle g
Definition: vulkan_core.h:3461
VkComponentSwizzle b
Definition: vulkan_core.h:3462
VkSamplerYcbcrRange fYcbcrRange
Definition: VulkanTypes.h:104
VkSamplerYcbcrModelConversion fYcbcrModel
Definition: VulkanTypes.h:103
VkComponentMapping fComponents
Definition: VulkanTypes.h:115
@ VK_FORMAT_UNDEFINED
Definition: vulkan_core.h:1459

◆ numInt32sNeeded()

int skgpu::graphite::ycbcrPackaging::numInt32sNeeded ( const VulkanYcbcrConversionInfo conversionInfo)

Definition at line 208 of file VulkanGraphiteUtils.cpp.

208 {
209 if (!conversionInfo.isValid()) {
210 return 0;
211 }
212 return (conversionInfo.fFormat == VK_FORMAT_UNDEFINED) ? kInt32sNeededExternalFormat
214}
static constexpr int kInt32sNeededKnownFormat
static constexpr int kInt32sNeededExternalFormat

Variable Documentation

◆ kChromaFilterBits

constexpr int skgpu::graphite::ycbcrPackaging::kChromaFilterBits = 1
staticconstexpr

Definition at line 84 of file VulkanGraphiteUtilsPriv.h.

◆ kChromaFilterMask

constexpr uint32_t skgpu::graphite::ycbcrPackaging::kChromaFilterMask
staticconstexpr
Initial value:

Definition at line 111 of file VulkanGraphiteUtilsPriv.h.

◆ kChromaFilterShift

constexpr int skgpu::graphite::ycbcrPackaging::kChromaFilterShift = kYChromaOffsetShift + kYChromaOffsetBits
staticconstexpr

Definition at line 94 of file VulkanGraphiteUtilsPriv.h.

◆ kComponentAMask

constexpr uint32_t skgpu::graphite::ycbcrPackaging::kComponentAMask = ((1 << kComponentBits) - 1) << kComponentAShift
staticconstexpr

Definition at line 118 of file VulkanGraphiteUtilsPriv.h.

◆ kComponentAShift

constexpr int skgpu::graphite::ycbcrPackaging::kComponentAShift = kComponentBShift + kComponentBits
staticconstexpr

Definition at line 99 of file VulkanGraphiteUtilsPriv.h.

◆ kComponentBits

constexpr int skgpu::graphite::ycbcrPackaging::kComponentBits = 3
staticconstexpr

Definition at line 86 of file VulkanGraphiteUtilsPriv.h.

◆ kComponentBMask

constexpr uint32_t skgpu::graphite::ycbcrPackaging::kComponentBMask = ((1 << kComponentBits) - 1) << kComponentGShift
staticconstexpr

Definition at line 116 of file VulkanGraphiteUtilsPriv.h.

◆ kComponentBShift

constexpr int skgpu::graphite::ycbcrPackaging::kComponentBShift = kComponentGShift + kComponentBits
staticconstexpr

Definition at line 98 of file VulkanGraphiteUtilsPriv.h.

◆ kComponentGMask

constexpr uint32_t skgpu::graphite::ycbcrPackaging::kComponentGMask = ((1 << kComponentBits) - 1) << kComponentBShift
staticconstexpr

Definition at line 117 of file VulkanGraphiteUtilsPriv.h.

◆ kComponentGShift

constexpr int skgpu::graphite::ycbcrPackaging::kComponentGShift = kComponentRShift + kComponentBits
staticconstexpr

Definition at line 97 of file VulkanGraphiteUtilsPriv.h.

◆ kComponentRMask

constexpr uint32_t skgpu::graphite::ycbcrPackaging::kComponentRMask = ((1 << kComponentBits) - 1) << kComponentRShift
staticconstexpr

Definition at line 115 of file VulkanGraphiteUtilsPriv.h.

◆ kComponentRShift

constexpr int skgpu::graphite::ycbcrPackaging::kComponentRShift = kForceExplicitReconShift + kComponentBits
staticconstexpr

Definition at line 96 of file VulkanGraphiteUtilsPriv.h.

◆ kForceExplicitReconBits

constexpr int skgpu::graphite::ycbcrPackaging::kForceExplicitReconBits = 1
staticconstexpr

Definition at line 85 of file VulkanGraphiteUtilsPriv.h.

◆ kForceExplicitReconMask

constexpr uint32_t skgpu::graphite::ycbcrPackaging::kForceExplicitReconMask
staticconstexpr
Initial value:

Definition at line 113 of file VulkanGraphiteUtilsPriv.h.

◆ kForceExplicitReconShift

constexpr int skgpu::graphite::ycbcrPackaging::kForceExplicitReconShift = kChromaFilterShift + kChromaFilterBits
staticconstexpr

Definition at line 95 of file VulkanGraphiteUtilsPriv.h.

◆ kInt32sNeededExternalFormat

constexpr int skgpu::graphite::ycbcrPackaging::kInt32sNeededExternalFormat = 3
staticconstexpr

Definition at line 77 of file VulkanGraphiteUtilsPriv.h.

◆ kInt32sNeededKnownFormat

constexpr int skgpu::graphite::ycbcrPackaging::kInt32sNeededKnownFormat = 2
staticconstexpr

Definition at line 73 of file VulkanGraphiteUtilsPriv.h.

◆ kUseExternalFormatMask

constexpr uint32_t skgpu::graphite::ycbcrPackaging::kUseExternalFormatMask
staticconstexpr
Initial value:

Definition at line 101 of file VulkanGraphiteUtilsPriv.h.

◆ kUsesExternalFormatBits

constexpr int skgpu::graphite::ycbcrPackaging::kUsesExternalFormatBits = 1
staticconstexpr

Definition at line 79 of file VulkanGraphiteUtilsPriv.h.

◆ kUsesExternalFormatShift

constexpr int skgpu::graphite::ycbcrPackaging::kUsesExternalFormatShift = 0
staticconstexpr

Definition at line 88 of file VulkanGraphiteUtilsPriv.h.

◆ kXChromaOffsetBits

constexpr int skgpu::graphite::ycbcrPackaging::kXChromaOffsetBits = 1
staticconstexpr

Definition at line 82 of file VulkanGraphiteUtilsPriv.h.

◆ kXChromaOffsetMask

constexpr uint32_t skgpu::graphite::ycbcrPackaging::kXChromaOffsetMask
staticconstexpr
Initial value:

Definition at line 107 of file VulkanGraphiteUtilsPriv.h.

◆ kXChromaOffsetShift

constexpr int skgpu::graphite::ycbcrPackaging::kXChromaOffsetShift = kYcbcrRangeShift + kYcbcrRangeBits
staticconstexpr

Definition at line 92 of file VulkanGraphiteUtilsPriv.h.

◆ kYcbcrModelBits

constexpr int skgpu::graphite::ycbcrPackaging::kYcbcrModelBits = 3
staticconstexpr

Definition at line 80 of file VulkanGraphiteUtilsPriv.h.

◆ kYcbcrModelMask

constexpr uint32_t skgpu::graphite::ycbcrPackaging::kYcbcrModelMask
staticconstexpr
Initial value:

Definition at line 103 of file VulkanGraphiteUtilsPriv.h.

◆ kYcbcrModelShift

constexpr int skgpu::graphite::ycbcrPackaging::kYcbcrModelShift
staticconstexpr
Initial value:

Definition at line 89 of file VulkanGraphiteUtilsPriv.h.

◆ kYcbcrRangeBits

constexpr int skgpu::graphite::ycbcrPackaging::kYcbcrRangeBits = 1
staticconstexpr

Definition at line 81 of file VulkanGraphiteUtilsPriv.h.

◆ kYcbcrRangeMask

constexpr uint32_t skgpu::graphite::ycbcrPackaging::kYcbcrRangeMask
staticconstexpr
Initial value:

Definition at line 105 of file VulkanGraphiteUtilsPriv.h.

◆ kYcbcrRangeShift

constexpr int skgpu::graphite::ycbcrPackaging::kYcbcrRangeShift = kYcbcrModelShift + kYcbcrModelBits
staticconstexpr

Definition at line 91 of file VulkanGraphiteUtilsPriv.h.

◆ kYChromaOffsetBits

constexpr int skgpu::graphite::ycbcrPackaging::kYChromaOffsetBits = 1
staticconstexpr

Definition at line 83 of file VulkanGraphiteUtilsPriv.h.

◆ kYChromaOffsetMask

constexpr uint32_t skgpu::graphite::ycbcrPackaging::kYChromaOffsetMask
staticconstexpr
Initial value:

Definition at line 109 of file VulkanGraphiteUtilsPriv.h.

◆ kYChromaOffsetShift

constexpr int skgpu::graphite::ycbcrPackaging::kYChromaOffsetShift = kXChromaOffsetShift + kXChromaOffsetBits
staticconstexpr

Definition at line 93 of file VulkanGraphiteUtilsPriv.h.