packages feed

vulkan-3.7: src/Vulkan/Core11/Enums/ChromaLocation.hs

{-# language CPP #-}
-- No documentation found for Chapter "ChromaLocation"
module Vulkan.Core11.Enums.ChromaLocation  (ChromaLocation( CHROMA_LOCATION_COSITED_EVEN
                                                          , CHROMA_LOCATION_MIDPOINT
                                                          , ..
                                                          )) where

import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import GHC.Show (showsPrec)
import Foreign.Storable (Storable)
import Data.Int (Int32)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Vulkan.Zero (Zero)
-- | VkChromaLocation - Position of downsampled chroma samples
--
-- = See Also
--
-- 'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.AndroidHardwareBufferFormatPropertiesANDROID',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.SamplerYcbcrConversionCreateInfo'
newtype ChromaLocation = ChromaLocation Int32
  deriving newtype (Eq, Ord, Storable, Zero)

-- | 'CHROMA_LOCATION_COSITED_EVEN' specifies that downsampled chroma samples
-- are aligned with luma samples with even coordinates.
pattern CHROMA_LOCATION_COSITED_EVEN = ChromaLocation 0
-- | 'CHROMA_LOCATION_MIDPOINT' specifies that downsampled chroma samples are
-- located half way between each even luma sample and the nearest higher
-- odd luma sample.
pattern CHROMA_LOCATION_MIDPOINT     = ChromaLocation 1
{-# complete CHROMA_LOCATION_COSITED_EVEN,
             CHROMA_LOCATION_MIDPOINT :: ChromaLocation #-}

conNameChromaLocation :: String
conNameChromaLocation = "ChromaLocation"

enumPrefixChromaLocation :: String
enumPrefixChromaLocation = "CHROMA_LOCATION_"

showTableChromaLocation :: [(ChromaLocation, String)]
showTableChromaLocation = [(CHROMA_LOCATION_COSITED_EVEN, "COSITED_EVEN"), (CHROMA_LOCATION_MIDPOINT, "MIDPOINT")]

instance Show ChromaLocation where
  showsPrec = enumShowsPrec enumPrefixChromaLocation
                            showTableChromaLocation
                            conNameChromaLocation
                            (\(ChromaLocation x) -> x)
                            (showsPrec 11)

instance Read ChromaLocation where
  readPrec = enumReadPrec enumPrefixChromaLocation showTableChromaLocation conNameChromaLocation ChromaLocation