{-# language CPP #-}
module Graphics.Vulkan.Core10.Enums.ColorComponentFlagBits ( ColorComponentFlagBits( COLOR_COMPONENT_R_BIT
, COLOR_COMPONENT_G_BIT
, COLOR_COMPONENT_B_BIT
, COLOR_COMPONENT_A_BIT
, ..
)
, ColorComponentFlags
) where
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import Numeric (showHex)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Data.Bits (Bits)
import Foreign.Storable (Storable)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Graphics.Vulkan.Core10.BaseType (Flags)
import Graphics.Vulkan.Zero (Zero)
newtype ColorComponentFlagBits = ColorComponentFlagBits Flags
deriving newtype (Eq, Ord, Storable, Zero, Bits)
pattern COLOR_COMPONENT_R_BIT = ColorComponentFlagBits 0x00000001
pattern COLOR_COMPONENT_G_BIT = ColorComponentFlagBits 0x00000002
pattern COLOR_COMPONENT_B_BIT = ColorComponentFlagBits 0x00000004
pattern COLOR_COMPONENT_A_BIT = ColorComponentFlagBits 0x00000008
type ColorComponentFlags = ColorComponentFlagBits
instance Show ColorComponentFlagBits where
showsPrec p = \case
COLOR_COMPONENT_R_BIT -> showString "COLOR_COMPONENT_R_BIT"
COLOR_COMPONENT_G_BIT -> showString "COLOR_COMPONENT_G_BIT"
COLOR_COMPONENT_B_BIT -> showString "COLOR_COMPONENT_B_BIT"
COLOR_COMPONENT_A_BIT -> showString "COLOR_COMPONENT_A_BIT"
ColorComponentFlagBits x -> showParen (p >= 11) (showString "ColorComponentFlagBits 0x" . showHex x)
instance Read ColorComponentFlagBits where
readPrec = parens (choose [("COLOR_COMPONENT_R_BIT", pure COLOR_COMPONENT_R_BIT)
, ("COLOR_COMPONENT_G_BIT", pure COLOR_COMPONENT_G_BIT)
, ("COLOR_COMPONENT_B_BIT", pure COLOR_COMPONENT_B_BIT)
, ("COLOR_COMPONENT_A_BIT", pure COLOR_COMPONENT_A_BIT)]
+++
prec 10 (do
expectP (Ident "ColorComponentFlagBits")
v <- step readPrec
pure (ColorComponentFlagBits v)))