{-# 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
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_0 VK_VERSION_1_0>,
-- 'Vulkan.Core10.ImageView.ComponentMapping'
newtype ComponentSwizzle = ComponentSwizzle Int32
  deriving newtype (ComponentSwizzle -> ComponentSwizzle -> Bool
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
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
Ord, Ptr ComponentSwizzle -> IO ComponentSwizzle
Ptr ComponentSwizzle -> Int -> IO ComponentSwizzle
Ptr ComponentSwizzle -> Int -> ComponentSwizzle -> IO ()
Ptr ComponentSwizzle -> ComponentSwizzle -> IO ()
ComponentSwizzle -> Int
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 :: forall b. Ptr b -> Int -> ComponentSwizzle -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> ComponentSwizzle -> IO ()
peekByteOff :: forall b. 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
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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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://registry.khronos.org/vulkan/specs/1.3-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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 = String
"ComponentSwizzle"

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

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

instance Show ComponentSwizzle where
  showsPrec :: Int -> ComponentSwizzle -> ShowS
showsPrec =
    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 Int32
x) -> Int32
x)
      (forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)

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