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