{-# language CPP #-}
module Graphics.Vulkan.Core10.Enums.ComponentSwizzle (ComponentSwizzle( COMPONENT_SWIZZLE_IDENTITY
, COMPONENT_SWIZZLE_ZERO
, COMPONENT_SWIZZLE_ONE
, COMPONENT_SWIZZLE_R
, COMPONENT_SWIZZLE_G
, COMPONENT_SWIZZLE_B
, COMPONENT_SWIZZLE_A
, ..
)) 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 ComponentSwizzle = ComponentSwizzle Int32
deriving newtype (Eq, Ord, Storable, Zero)
pattern COMPONENT_SWIZZLE_IDENTITY = ComponentSwizzle 0
pattern COMPONENT_SWIZZLE_ZERO = ComponentSwizzle 1
pattern COMPONENT_SWIZZLE_ONE = ComponentSwizzle 2
pattern COMPONENT_SWIZZLE_R = ComponentSwizzle 3
pattern COMPONENT_SWIZZLE_G = ComponentSwizzle 4
pattern COMPONENT_SWIZZLE_B = ComponentSwizzle 5
pattern COMPONENT_SWIZZLE_A = ComponentSwizzle 6
{-# complete COMPONENT_SWIZZLE_IDENTITY,
COMPONENT_SWIZZLE_ZERO,
COMPONENT_SWIZZLE_ONE,
COMPONENT_SWIZZLE_R,
COMPONENT_SWIZZLE_G,
COMPONENT_SWIZZLE_B,
COMPONENT_SWIZZLE_A :: ComponentSwizzle #-}
instance Show ComponentSwizzle where
showsPrec p = \case
COMPONENT_SWIZZLE_IDENTITY -> showString "COMPONENT_SWIZZLE_IDENTITY"
COMPONENT_SWIZZLE_ZERO -> showString "COMPONENT_SWIZZLE_ZERO"
COMPONENT_SWIZZLE_ONE -> showString "COMPONENT_SWIZZLE_ONE"
COMPONENT_SWIZZLE_R -> showString "COMPONENT_SWIZZLE_R"
COMPONENT_SWIZZLE_G -> showString "COMPONENT_SWIZZLE_G"
COMPONENT_SWIZZLE_B -> showString "COMPONENT_SWIZZLE_B"
COMPONENT_SWIZZLE_A -> showString "COMPONENT_SWIZZLE_A"
ComponentSwizzle x -> showParen (p >= 11) (showString "ComponentSwizzle " . showsPrec 11 x)
instance Read ComponentSwizzle where
readPrec = parens (choose [("COMPONENT_SWIZZLE_IDENTITY", pure COMPONENT_SWIZZLE_IDENTITY)
, ("COMPONENT_SWIZZLE_ZERO", pure COMPONENT_SWIZZLE_ZERO)
, ("COMPONENT_SWIZZLE_ONE", pure COMPONENT_SWIZZLE_ONE)
, ("COMPONENT_SWIZZLE_R", pure COMPONENT_SWIZZLE_R)
, ("COMPONENT_SWIZZLE_G", pure COMPONENT_SWIZZLE_G)
, ("COMPONENT_SWIZZLE_B", pure COMPONENT_SWIZZLE_B)
, ("COMPONENT_SWIZZLE_A", pure COMPONENT_SWIZZLE_A)]
+++
prec 10 (do
expectP (Ident "ComponentSwizzle")
v <- step readPrec
pure (ComponentSwizzle v)))