{-# language CPP #-}
-- No documentation found for Chapter "StencilOp"
module Vulkan.Core10.Enums.StencilOp  (StencilOp( STENCIL_OP_KEEP
                                                , STENCIL_OP_ZERO
                                                , STENCIL_OP_REPLACE
                                                , STENCIL_OP_INCREMENT_AND_CLAMP
                                                , STENCIL_OP_DECREMENT_AND_CLAMP
                                                , STENCIL_OP_INVERT
                                                , STENCIL_OP_INCREMENT_AND_WRAP
                                                , STENCIL_OP_DECREMENT_AND_WRAP
                                                , ..
                                                )) 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))

-- | VkStencilOp - Stencil comparison function
--
-- = Description
--
-- For purposes of increment and decrement, the stencil bits are considered
-- as an unsigned integer.
--
-- = See Also
--
-- 'Vulkan.Core10.Pipeline.StencilOpState',
-- 'Vulkan.Extensions.VK_EXT_extended_dynamic_state.cmdSetStencilOpEXT'
newtype StencilOp = StencilOp Int32
  deriving newtype (StencilOp -> StencilOp -> Bool
(StencilOp -> StencilOp -> Bool)
-> (StencilOp -> StencilOp -> Bool) -> Eq StencilOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StencilOp -> StencilOp -> Bool
$c/= :: StencilOp -> StencilOp -> Bool
== :: StencilOp -> StencilOp -> Bool
$c== :: StencilOp -> StencilOp -> Bool
Eq, Eq StencilOp
Eq StencilOp =>
(StencilOp -> StencilOp -> Ordering)
-> (StencilOp -> StencilOp -> Bool)
-> (StencilOp -> StencilOp -> Bool)
-> (StencilOp -> StencilOp -> Bool)
-> (StencilOp -> StencilOp -> Bool)
-> (StencilOp -> StencilOp -> StencilOp)
-> (StencilOp -> StencilOp -> StencilOp)
-> Ord StencilOp
StencilOp -> StencilOp -> Bool
StencilOp -> StencilOp -> Ordering
StencilOp -> StencilOp -> StencilOp
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 :: StencilOp -> StencilOp -> StencilOp
$cmin :: StencilOp -> StencilOp -> StencilOp
max :: StencilOp -> StencilOp -> StencilOp
$cmax :: StencilOp -> StencilOp -> StencilOp
>= :: StencilOp -> StencilOp -> Bool
$c>= :: StencilOp -> StencilOp -> Bool
> :: StencilOp -> StencilOp -> Bool
$c> :: StencilOp -> StencilOp -> Bool
<= :: StencilOp -> StencilOp -> Bool
$c<= :: StencilOp -> StencilOp -> Bool
< :: StencilOp -> StencilOp -> Bool
$c< :: StencilOp -> StencilOp -> Bool
compare :: StencilOp -> StencilOp -> Ordering
$ccompare :: StencilOp -> StencilOp -> Ordering
$cp1Ord :: Eq StencilOp
Ord, Ptr b -> Int -> IO StencilOp
Ptr b -> Int -> StencilOp -> IO ()
Ptr StencilOp -> IO StencilOp
Ptr StencilOp -> Int -> IO StencilOp
Ptr StencilOp -> Int -> StencilOp -> IO ()
Ptr StencilOp -> StencilOp -> IO ()
StencilOp -> Int
(StencilOp -> Int)
-> (StencilOp -> Int)
-> (Ptr StencilOp -> Int -> IO StencilOp)
-> (Ptr StencilOp -> Int -> StencilOp -> IO ())
-> (forall b. Ptr b -> Int -> IO StencilOp)
-> (forall b. Ptr b -> Int -> StencilOp -> IO ())
-> (Ptr StencilOp -> IO StencilOp)
-> (Ptr StencilOp -> StencilOp -> IO ())
-> Storable StencilOp
forall b. Ptr b -> Int -> IO StencilOp
forall b. Ptr b -> Int -> StencilOp -> 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 StencilOp -> StencilOp -> IO ()
$cpoke :: Ptr StencilOp -> StencilOp -> IO ()
peek :: Ptr StencilOp -> IO StencilOp
$cpeek :: Ptr StencilOp -> IO StencilOp
pokeByteOff :: Ptr b -> Int -> StencilOp -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> StencilOp -> IO ()
peekByteOff :: Ptr b -> Int -> IO StencilOp
$cpeekByteOff :: forall b. Ptr b -> Int -> IO StencilOp
pokeElemOff :: Ptr StencilOp -> Int -> StencilOp -> IO ()
$cpokeElemOff :: Ptr StencilOp -> Int -> StencilOp -> IO ()
peekElemOff :: Ptr StencilOp -> Int -> IO StencilOp
$cpeekElemOff :: Ptr StencilOp -> Int -> IO StencilOp
alignment :: StencilOp -> Int
$calignment :: StencilOp -> Int
sizeOf :: StencilOp -> Int
$csizeOf :: StencilOp -> Int
Storable, StencilOp
StencilOp -> Zero StencilOp
forall a. a -> Zero a
zero :: StencilOp
$czero :: StencilOp
Zero)

-- | 'STENCIL_OP_KEEP' keeps the current value.
pattern $bSTENCIL_OP_KEEP :: StencilOp
$mSTENCIL_OP_KEEP :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_KEEP                = StencilOp 0
-- | 'STENCIL_OP_ZERO' sets the value to 0.
pattern $bSTENCIL_OP_ZERO :: StencilOp
$mSTENCIL_OP_ZERO :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_ZERO                = StencilOp 1
-- | 'STENCIL_OP_REPLACE' sets the value to @reference@.
pattern $bSTENCIL_OP_REPLACE :: StencilOp
$mSTENCIL_OP_REPLACE :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_REPLACE             = StencilOp 2
-- | 'STENCIL_OP_INCREMENT_AND_CLAMP' increments the current value and clamps
-- to the maximum representable unsigned value.
pattern $bSTENCIL_OP_INCREMENT_AND_CLAMP :: StencilOp
$mSTENCIL_OP_INCREMENT_AND_CLAMP :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_INCREMENT_AND_CLAMP = StencilOp 3
-- | 'STENCIL_OP_DECREMENT_AND_CLAMP' decrements the current value and clamps
-- to 0.
pattern $bSTENCIL_OP_DECREMENT_AND_CLAMP :: StencilOp
$mSTENCIL_OP_DECREMENT_AND_CLAMP :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_DECREMENT_AND_CLAMP = StencilOp 4
-- | 'STENCIL_OP_INVERT' bitwise-inverts the current value.
pattern $bSTENCIL_OP_INVERT :: StencilOp
$mSTENCIL_OP_INVERT :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_INVERT              = StencilOp 5
-- | 'STENCIL_OP_INCREMENT_AND_WRAP' increments the current value and wraps
-- to 0 when the maximum value would have been exceeded.
pattern $bSTENCIL_OP_INCREMENT_AND_WRAP :: StencilOp
$mSTENCIL_OP_INCREMENT_AND_WRAP :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_INCREMENT_AND_WRAP  = StencilOp 6
-- | 'STENCIL_OP_DECREMENT_AND_WRAP' decrements the current value and wraps
-- to the maximum possible value when the value would go below 0.
pattern $bSTENCIL_OP_DECREMENT_AND_WRAP :: StencilOp
$mSTENCIL_OP_DECREMENT_AND_WRAP :: forall r. StencilOp -> (Void# -> r) -> (Void# -> r) -> r
STENCIL_OP_DECREMENT_AND_WRAP  = StencilOp 7
{-# complete STENCIL_OP_KEEP,
             STENCIL_OP_ZERO,
             STENCIL_OP_REPLACE,
             STENCIL_OP_INCREMENT_AND_CLAMP,
             STENCIL_OP_DECREMENT_AND_CLAMP,
             STENCIL_OP_INVERT,
             STENCIL_OP_INCREMENT_AND_WRAP,
             STENCIL_OP_DECREMENT_AND_WRAP :: StencilOp #-}

conNameStencilOp :: String
conNameStencilOp :: String
conNameStencilOp = "StencilOp"

enumPrefixStencilOp :: String
enumPrefixStencilOp :: String
enumPrefixStencilOp = "STENCIL_OP_"

showTableStencilOp :: [(StencilOp, String)]
showTableStencilOp :: [(StencilOp, String)]
showTableStencilOp =
  [ (StencilOp
STENCIL_OP_KEEP               , "KEEP")
  , (StencilOp
STENCIL_OP_ZERO               , "ZERO")
  , (StencilOp
STENCIL_OP_REPLACE            , "REPLACE")
  , (StencilOp
STENCIL_OP_INCREMENT_AND_CLAMP, "INCREMENT_AND_CLAMP")
  , (StencilOp
STENCIL_OP_DECREMENT_AND_CLAMP, "DECREMENT_AND_CLAMP")
  , (StencilOp
STENCIL_OP_INVERT             , "INVERT")
  , (StencilOp
STENCIL_OP_INCREMENT_AND_WRAP , "INCREMENT_AND_WRAP")
  , (StencilOp
STENCIL_OP_DECREMENT_AND_WRAP , "DECREMENT_AND_WRAP")
  ]

instance Show StencilOp where
  showsPrec :: Int -> StencilOp -> ShowS
showsPrec =
    String
-> [(StencilOp, String)]
-> String
-> (StencilOp -> Int32)
-> (Int32 -> ShowS)
-> Int
-> StencilOp
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixStencilOp [(StencilOp, String)]
showTableStencilOp String
conNameStencilOp (\(StencilOp x :: Int32
x) -> Int32
x) (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read StencilOp where
  readPrec :: ReadPrec StencilOp
readPrec = String
-> [(StencilOp, String)]
-> String
-> (Int32 -> StencilOp)
-> ReadPrec StencilOp
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixStencilOp [(StencilOp, String)]
showTableStencilOp String
conNameStencilOp Int32 -> StencilOp
StencilOp