{-# language CPP #-}
-- No documentation found for Chapter "ComponentSwizzle"
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 Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import GHC.Show (showsPrec)
import Vulkan.Zero (Zero)
import Foreign.Storable (Storable)
import Data.Int (Int32)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))

-- | 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 #-}

conNameComponentSwizzle :: String
conNameComponentSwizzle :: String
conNameComponentSwizzle = "ComponentSwizzle"

enumPrefixComponentSwizzle :: String
enumPrefixComponentSwizzle :: String
enumPrefixComponentSwizzle = "COMPONENT_SWIZZLE_"

showTableComponentSwizzle :: [(ComponentSwizzle, String)]
showTableComponentSwizzle :: [(ComponentSwizzle, String)]
showTableComponentSwizzle =
  [ (ComponentSwizzle
COMPONENT_SWIZZLE_IDENTITY, "IDENTITY")
  , (ComponentSwizzle
COMPONENT_SWIZZLE_ZERO    , "ZERO")
  , (ComponentSwizzle
COMPONENT_SWIZZLE_ONE     , "ONE")
  , (ComponentSwizzle
COMPONENT_SWIZZLE_R       , "R")
  , (ComponentSwizzle
COMPONENT_SWIZZLE_G       , "G")
  , (ComponentSwizzle
COMPONENT_SWIZZLE_B       , "B")
  , (ComponentSwizzle
COMPONENT_SWIZZLE_A       , "A")
  ]

instance Show ComponentSwizzle where
  showsPrec :: Int -> ComponentSwizzle -> ShowS
showsPrec = String
-> [(ComponentSwizzle, String)]
-> String
-> (ComponentSwizzle -> Int32)
-> (Int32 -> ShowS)
-> Int
-> ComponentSwizzle
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixComponentSwizzle
                            [(ComponentSwizzle, String)]
showTableComponentSwizzle
                            String
conNameComponentSwizzle
                            (\(ComponentSwizzle x :: Int32
x) -> Int32
x)
                            (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read ComponentSwizzle where
  readPrec :: ReadPrec ComponentSwizzle
readPrec = String
-> [(ComponentSwizzle, String)]
-> String
-> (Int32 -> ComponentSwizzle)
-> ReadPrec ComponentSwizzle
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixComponentSwizzle [(ComponentSwizzle, String)]
showTableComponentSwizzle String
conNameComponentSwizzle Int32 -> ComponentSwizzle
ComponentSwizzle