{-# language CPP #-}
module Graphics.Vulkan.Core11.Enums.ChromaLocation (ChromaLocation( CHROMA_LOCATION_COSITED_EVEN
, CHROMA_LOCATION_MIDPOINT
, ..
)) where
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import GHC.Show (showsPrec)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Foreign.Storable (Storable)
import Data.Int (Int32)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Graphics.Vulkan.Zero (Zero)
newtype ChromaLocation = ChromaLocation Int32
deriving newtype (Eq, Ord, Storable, Zero)
pattern CHROMA_LOCATION_COSITED_EVEN = ChromaLocation 0
pattern CHROMA_LOCATION_MIDPOINT = ChromaLocation 1
{-# complete CHROMA_LOCATION_COSITED_EVEN,
CHROMA_LOCATION_MIDPOINT :: ChromaLocation #-}
instance Show ChromaLocation where
showsPrec p = \case
CHROMA_LOCATION_COSITED_EVEN -> showString "CHROMA_LOCATION_COSITED_EVEN"
CHROMA_LOCATION_MIDPOINT -> showString "CHROMA_LOCATION_MIDPOINT"
ChromaLocation x -> showParen (p >= 11) (showString "ChromaLocation " . showsPrec 11 x)
instance Read ChromaLocation where
readPrec = parens (choose [("CHROMA_LOCATION_COSITED_EVEN", pure CHROMA_LOCATION_COSITED_EVEN)
, ("CHROMA_LOCATION_MIDPOINT", pure CHROMA_LOCATION_MIDPOINT)]
+++
prec 10 (do
expectP (Ident "ChromaLocation")
v <- step readPrec
pure (ChromaLocation v)))