{-# language CPP #-}
module 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 Vulkan.Zero (Zero)
-- | VkComponentSwizzle - Specify how a component is swizzled
--
-- = Description
--
-- Setting the identity swizzle on a component is equivalent to setting the
-- identity mapping on that component. That is:
--
-- +-----------------------------------+-----------------------------------+
-- | Component                         | Identity Mapping                  |
-- +===================================+===================================+
-- | @components.r@                    | 'COMPONENT_SWIZZLE_R'             |
-- +-----------------------------------+-----------------------------------+
-- | @components.g@                    | 'COMPONENT_SWIZZLE_G'             |
-- +-----------------------------------+-----------------------------------+
-- | @components.b@                    | 'COMPONENT_SWIZZLE_B'             |
-- +-----------------------------------+-----------------------------------+
-- | @components.a@                    | 'COMPONENT_SWIZZLE_A'             |
-- +-----------------------------------+-----------------------------------+
--
-- Component Mappings Equivalent To 'COMPONENT_SWIZZLE_IDENTITY'
--
-- = See Also
--
-- 'Vulkan.Core10.ImageView.ComponentMapping'
newtype ComponentSwizzle = ComponentSwizzle Int32
  deriving newtype (ComponentSwizzle -> ComponentSwizzle -> Bool
(ComponentSwizzle -> ComponentSwizzle -> Bool)
-> (ComponentSwizzle -> ComponentSwizzle -> Bool)
-> Eq ComponentSwizzle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentSwizzle -> ComponentSwizzle -> Bool
$c/= :: ComponentSwizzle -> ComponentSwizzle -> Bool
== :: ComponentSwizzle -> ComponentSwizzle -> Bool
$c== :: ComponentSwizzle -> ComponentSwizzle -> Bool
Eq, Eq ComponentSwizzle
Eq ComponentSwizzle =>
(ComponentSwizzle -> ComponentSwizzle -> Ordering)
-> (ComponentSwizzle -> ComponentSwizzle -> Bool)
-> (ComponentSwizzle -> ComponentSwizzle -> Bool)
-> (ComponentSwizzle -> ComponentSwizzle -> Bool)
-> (ComponentSwizzle -> ComponentSwizzle -> Bool)
-> (ComponentSwizzle -> ComponentSwizzle -> ComponentSwizzle)
-> (ComponentSwizzle -> ComponentSwizzle -> ComponentSwizzle)
-> Ord ComponentSwizzle
ComponentSwizzle -> ComponentSwizzle -> Bool
ComponentSwizzle -> ComponentSwizzle -> Ordering
ComponentSwizzle -> ComponentSwizzle -> ComponentSwizzle
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ComponentSwizzle -> ComponentSwizzle -> ComponentSwizzle
$cmin :: ComponentSwizzle -> ComponentSwizzle -> ComponentSwizzle
max :: ComponentSwizzle -> ComponentSwizzle -> ComponentSwizzle
$cmax :: ComponentSwizzle -> ComponentSwizzle -> ComponentSwizzle
>= :: ComponentSwizzle -> ComponentSwizzle -> Bool
$c>= :: ComponentSwizzle -> ComponentSwizzle -> Bool
> :: ComponentSwizzle -> ComponentSwizzle -> Bool
$c> :: ComponentSwizzle -> ComponentSwizzle -> Bool
<= :: ComponentSwizzle -> ComponentSwizzle -> Bool
$c<= :: ComponentSwizzle -> ComponentSwizzle -> Bool
< :: ComponentSwizzle -> ComponentSwizzle -> Bool
$c< :: ComponentSwizzle -> ComponentSwizzle -> Bool
compare :: ComponentSwizzle -> ComponentSwizzle -> Ordering
$ccompare :: ComponentSwizzle -> ComponentSwizzle -> Ordering
$cp1Ord :: Eq ComponentSwizzle
Ord, Ptr b -> Int -> IO ComponentSwizzle
Ptr b -> Int -> ComponentSwizzle -> IO ()
Ptr ComponentSwizzle -> IO ComponentSwizzle
Ptr ComponentSwizzle -> Int -> IO ComponentSwizzle
Ptr ComponentSwizzle -> Int -> ComponentSwizzle -> IO ()
Ptr ComponentSwizzle -> ComponentSwizzle -> IO ()
ComponentSwizzle -> Int
(ComponentSwizzle -> Int)
-> (ComponentSwizzle -> Int)
-> (Ptr ComponentSwizzle -> Int -> IO ComponentSwizzle)
-> (Ptr ComponentSwizzle -> Int -> ComponentSwizzle -> IO ())
-> (forall b. Ptr b -> Int -> IO ComponentSwizzle)
-> (forall b. Ptr b -> Int -> ComponentSwizzle -> IO ())
-> (Ptr ComponentSwizzle -> IO ComponentSwizzle)
-> (Ptr ComponentSwizzle -> ComponentSwizzle -> IO ())
-> Storable ComponentSwizzle
forall b. Ptr b -> Int -> IO ComponentSwizzle
forall b. Ptr b -> Int -> ComponentSwizzle -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr ComponentSwizzle -> ComponentSwizzle -> IO ()
$cpoke :: Ptr ComponentSwizzle -> ComponentSwizzle -> IO ()
peek :: Ptr ComponentSwizzle -> IO ComponentSwizzle
$cpeek :: Ptr ComponentSwizzle -> IO ComponentSwizzle
pokeByteOff :: Ptr b -> Int -> ComponentSwizzle -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> ComponentSwizzle -> IO ()
peekByteOff :: Ptr b -> Int -> IO ComponentSwizzle
$cpeekByteOff :: forall b. Ptr b -> Int -> IO ComponentSwizzle
pokeElemOff :: Ptr ComponentSwizzle -> Int -> ComponentSwizzle -> IO ()
$cpokeElemOff :: Ptr ComponentSwizzle -> Int -> ComponentSwizzle -> IO ()
peekElemOff :: Ptr ComponentSwizzle -> Int -> IO ComponentSwizzle
$cpeekElemOff :: Ptr ComponentSwizzle -> Int -> IO ComponentSwizzle
alignment :: ComponentSwizzle -> Int
$calignment :: ComponentSwizzle -> Int
sizeOf :: ComponentSwizzle -> Int
$csizeOf :: ComponentSwizzle -> Int
Storable, ComponentSwizzle
ComponentSwizzle -> Zero ComponentSwizzle
forall a. a -> Zero a
zero :: ComponentSwizzle
$czero :: ComponentSwizzle
Zero)

-- | 'COMPONENT_SWIZZLE_IDENTITY' specifies that the component is set to the
-- identity swizzle.
pattern $bCOMPONENT_SWIZZLE_IDENTITY :: ComponentSwizzle
$mCOMPONENT_SWIZZLE_IDENTITY :: forall r. ComponentSwizzle -> (Void# -> r) -> (Void# -> r) -> r
COMPONENT_SWIZZLE_IDENTITY = ComponentSwizzle 0
-- | 'COMPONENT_SWIZZLE_ZERO' specifies that the component is set to zero.
pattern $bCOMPONENT_SWIZZLE_ZERO :: ComponentSwizzle
$mCOMPONENT_SWIZZLE_ZERO :: forall r. ComponentSwizzle -> (Void# -> r) -> (Void# -> r) -> r
COMPONENT_SWIZZLE_ZERO = ComponentSwizzle 1
-- | 'COMPONENT_SWIZZLE_ONE' specifies that the component is set to either 1
-- or 1.0, depending on whether the type of the image view format is
-- integer or floating-point respectively, as determined by the
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-definition Format Definition>
-- section for each 'Vulkan.Core10.Enums.Format.Format'.
pattern $bCOMPONENT_SWIZZLE_ONE :: ComponentSwizzle
$mCOMPONENT_SWIZZLE_ONE :: forall r. ComponentSwizzle -> (Void# -> r) -> (Void# -> r) -> r
COMPONENT_SWIZZLE_ONE = ComponentSwizzle 2
-- | 'COMPONENT_SWIZZLE_R' specifies that the component is set to the value
-- of the R component of the image.
pattern $bCOMPONENT_SWIZZLE_R :: ComponentSwizzle
$mCOMPONENT_SWIZZLE_R :: forall r. ComponentSwizzle -> (Void# -> r) -> (Void# -> r) -> r
COMPONENT_SWIZZLE_R = ComponentSwizzle 3
-- | 'COMPONENT_SWIZZLE_G' specifies that the component is set to the value
-- of the G component of the image.
pattern $bCOMPONENT_SWIZZLE_G :: ComponentSwizzle
$mCOMPONENT_SWIZZLE_G :: forall r. ComponentSwizzle -> (Void# -> r) -> (Void# -> r) -> r
COMPONENT_SWIZZLE_G = ComponentSwizzle 4
-- | 'COMPONENT_SWIZZLE_B' specifies that the component is set to the value
-- of the B component of the image.
pattern $bCOMPONENT_SWIZZLE_B :: ComponentSwizzle
$mCOMPONENT_SWIZZLE_B :: forall r. ComponentSwizzle -> (Void# -> r) -> (Void# -> r) -> r
COMPONENT_SWIZZLE_B = ComponentSwizzle 5
-- | 'COMPONENT_SWIZZLE_A' specifies that the component is set to the value
-- of the A component of the image.
pattern $bCOMPONENT_SWIZZLE_A :: ComponentSwizzle
$mCOMPONENT_SWIZZLE_A :: forall r. ComponentSwizzle -> (Void# -> r) -> (Void# -> r) -> r
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 :: Int -> ComponentSwizzle -> ShowS
showsPrec p :: Int
p = \case
    COMPONENT_SWIZZLE_IDENTITY -> String -> ShowS
showString "COMPONENT_SWIZZLE_IDENTITY"
    COMPONENT_SWIZZLE_ZERO -> String -> ShowS
showString "COMPONENT_SWIZZLE_ZERO"
    COMPONENT_SWIZZLE_ONE -> String -> ShowS
showString "COMPONENT_SWIZZLE_ONE"
    COMPONENT_SWIZZLE_R -> String -> ShowS
showString "COMPONENT_SWIZZLE_R"
    COMPONENT_SWIZZLE_G -> String -> ShowS
showString "COMPONENT_SWIZZLE_G"
    COMPONENT_SWIZZLE_B -> String -> ShowS
showString "COMPONENT_SWIZZLE_B"
    COMPONENT_SWIZZLE_A -> String -> ShowS
showString "COMPONENT_SWIZZLE_A"
    ComponentSwizzle x :: Int32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "ComponentSwizzle " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11 Int32
x)

instance Read ComponentSwizzle where
  readPrec :: ReadPrec ComponentSwizzle
readPrec = ReadPrec ComponentSwizzle -> ReadPrec ComponentSwizzle
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec ComponentSwizzle)] -> ReadPrec ComponentSwizzle
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("COMPONENT_SWIZZLE_IDENTITY", ComponentSwizzle -> ReadPrec ComponentSwizzle
forall (f :: * -> *) a. Applicative f => a -> f a
pure ComponentSwizzle
COMPONENT_SWIZZLE_IDENTITY)
                            , ("COMPONENT_SWIZZLE_ZERO", ComponentSwizzle -> ReadPrec ComponentSwizzle
forall (f :: * -> *) a. Applicative f => a -> f a
pure ComponentSwizzle
COMPONENT_SWIZZLE_ZERO)
                            , ("COMPONENT_SWIZZLE_ONE", ComponentSwizzle -> ReadPrec ComponentSwizzle
forall (f :: * -> *) a. Applicative f => a -> f a
pure ComponentSwizzle
COMPONENT_SWIZZLE_ONE)
                            , ("COMPONENT_SWIZZLE_R", ComponentSwizzle -> ReadPrec ComponentSwizzle
forall (f :: * -> *) a. Applicative f => a -> f a
pure ComponentSwizzle
COMPONENT_SWIZZLE_R)
                            , ("COMPONENT_SWIZZLE_G", ComponentSwizzle -> ReadPrec ComponentSwizzle
forall (f :: * -> *) a. Applicative f => a -> f a
pure ComponentSwizzle
COMPONENT_SWIZZLE_G)
                            , ("COMPONENT_SWIZZLE_B", ComponentSwizzle -> ReadPrec ComponentSwizzle
forall (f :: * -> *) a. Applicative f => a -> f a
pure ComponentSwizzle
COMPONENT_SWIZZLE_B)
                            , ("COMPONENT_SWIZZLE_A", ComponentSwizzle -> ReadPrec ComponentSwizzle
forall (f :: * -> *) a. Applicative f => a -> f a
pure ComponentSwizzle
COMPONENT_SWIZZLE_A)]
                     ReadPrec ComponentSwizzle
-> ReadPrec ComponentSwizzle -> ReadPrec ComponentSwizzle
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int -> ReadPrec ComponentSwizzle -> ReadPrec ComponentSwizzle
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "ComponentSwizzle")
                       Int32
v <- ReadPrec Int32 -> ReadPrec Int32
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Int32
forall a. Read a => ReadPrec a
readPrec
                       ComponentSwizzle -> ReadPrec ComponentSwizzle
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int32 -> ComponentSwizzle
ComponentSwizzle Int32
v)))