{-# language CPP #-}
module Vulkan.Core10.Enums.LogicOp  (LogicOp( LOGIC_OP_CLEAR
                                            , LOGIC_OP_AND
                                            , LOGIC_OP_AND_REVERSE
                                            , LOGIC_OP_COPY
                                            , LOGIC_OP_AND_INVERTED
                                            , LOGIC_OP_NO_OP
                                            , LOGIC_OP_XOR
                                            , LOGIC_OP_OR
                                            , LOGIC_OP_NOR
                                            , LOGIC_OP_EQUIVALENT
                                            , LOGIC_OP_INVERT
                                            , LOGIC_OP_OR_REVERSE
                                            , LOGIC_OP_COPY_INVERTED
                                            , LOGIC_OP_OR_INVERTED
                                            , LOGIC_OP_NAND
                                            , LOGIC_OP_SET
                                            , ..
                                            )) 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)
-- | VkLogicOp - Framebuffer logical operations
--
-- = Description
--
-- The logical operations supported by Vulkan are summarized in the
-- following table in which
--
-- -   ¬ is bitwise invert,
--
-- -   ∧ is bitwise and,
--
-- -   ∨ is bitwise or,
--
-- -   ⊕ is bitwise exclusive or,
--
-- -   s is the fragment’s Rs0, Gs0, Bs0 or As0 component value for the
--     fragment output corresponding to the color attachment being updated,
--     and
--
-- -   d is the color attachment’s R, G, B or A component value:
--
-- +-----------------------------------+-----------------------------------+
-- | Mode                              | Operation                         |
-- +===================================+===================================+
-- | 'LOGIC_OP_CLEAR'                  | 0                                 |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_AND'                    | s ∧ d                             |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_AND_REVERSE'            | s ∧ ¬ d                           |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_COPY'                   | s                                 |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_AND_INVERTED'           | ¬ s ∧ d                           |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_NO_OP'                  | d                                 |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_XOR'                    | s ⊕ d                             |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_OR'                     | s ∨ d                             |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_NOR'                    | ¬ (s ∨ d)                         |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_EQUIVALENT'             | ¬ (s ⊕ d)                         |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_INVERT'                 | ¬ d                               |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_OR_REVERSE'             | s ∨ ¬ d                           |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_COPY_INVERTED'          | ¬ s                               |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_OR_INVERTED'            | ¬ s ∨ d                           |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_NAND'                   | ¬ (s ∧ d)                         |
-- +-----------------------------------+-----------------------------------+
-- | 'LOGIC_OP_SET'                    | all 1s                            |
-- +-----------------------------------+-----------------------------------+
--
-- Logical Operations
--
-- The result of the logical operation is then written to the color
-- attachment as controlled by the component write mask, described in
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#framebuffer-blendoperations Blend Operations>.
--
-- = See Also
--
-- 'Vulkan.Core10.Pipeline.PipelineColorBlendStateCreateInfo'
newtype LogicOp = LogicOp Int32
  deriving newtype (LogicOp -> LogicOp -> Bool
(LogicOp -> LogicOp -> Bool)
-> (LogicOp -> LogicOp -> Bool) -> Eq LogicOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogicOp -> LogicOp -> Bool
$c/= :: LogicOp -> LogicOp -> Bool
== :: LogicOp -> LogicOp -> Bool
$c== :: LogicOp -> LogicOp -> Bool
Eq, Eq LogicOp
Eq LogicOp =>
(LogicOp -> LogicOp -> Ordering)
-> (LogicOp -> LogicOp -> Bool)
-> (LogicOp -> LogicOp -> Bool)
-> (LogicOp -> LogicOp -> Bool)
-> (LogicOp -> LogicOp -> Bool)
-> (LogicOp -> LogicOp -> LogicOp)
-> (LogicOp -> LogicOp -> LogicOp)
-> Ord LogicOp
LogicOp -> LogicOp -> Bool
LogicOp -> LogicOp -> Ordering
LogicOp -> LogicOp -> LogicOp
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 :: LogicOp -> LogicOp -> LogicOp
$cmin :: LogicOp -> LogicOp -> LogicOp
max :: LogicOp -> LogicOp -> LogicOp
$cmax :: LogicOp -> LogicOp -> LogicOp
>= :: LogicOp -> LogicOp -> Bool
$c>= :: LogicOp -> LogicOp -> Bool
> :: LogicOp -> LogicOp -> Bool
$c> :: LogicOp -> LogicOp -> Bool
<= :: LogicOp -> LogicOp -> Bool
$c<= :: LogicOp -> LogicOp -> Bool
< :: LogicOp -> LogicOp -> Bool
$c< :: LogicOp -> LogicOp -> Bool
compare :: LogicOp -> LogicOp -> Ordering
$ccompare :: LogicOp -> LogicOp -> Ordering
$cp1Ord :: Eq LogicOp
Ord, Ptr b -> Int -> IO LogicOp
Ptr b -> Int -> LogicOp -> IO ()
Ptr LogicOp -> IO LogicOp
Ptr LogicOp -> Int -> IO LogicOp
Ptr LogicOp -> Int -> LogicOp -> IO ()
Ptr LogicOp -> LogicOp -> IO ()
LogicOp -> Int
(LogicOp -> Int)
-> (LogicOp -> Int)
-> (Ptr LogicOp -> Int -> IO LogicOp)
-> (Ptr LogicOp -> Int -> LogicOp -> IO ())
-> (forall b. Ptr b -> Int -> IO LogicOp)
-> (forall b. Ptr b -> Int -> LogicOp -> IO ())
-> (Ptr LogicOp -> IO LogicOp)
-> (Ptr LogicOp -> LogicOp -> IO ())
-> Storable LogicOp
forall b. Ptr b -> Int -> IO LogicOp
forall b. Ptr b -> Int -> LogicOp -> 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 LogicOp -> LogicOp -> IO ()
$cpoke :: Ptr LogicOp -> LogicOp -> IO ()
peek :: Ptr LogicOp -> IO LogicOp
$cpeek :: Ptr LogicOp -> IO LogicOp
pokeByteOff :: Ptr b -> Int -> LogicOp -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> LogicOp -> IO ()
peekByteOff :: Ptr b -> Int -> IO LogicOp
$cpeekByteOff :: forall b. Ptr b -> Int -> IO LogicOp
pokeElemOff :: Ptr LogicOp -> Int -> LogicOp -> IO ()
$cpokeElemOff :: Ptr LogicOp -> Int -> LogicOp -> IO ()
peekElemOff :: Ptr LogicOp -> Int -> IO LogicOp
$cpeekElemOff :: Ptr LogicOp -> Int -> IO LogicOp
alignment :: LogicOp -> Int
$calignment :: LogicOp -> Int
sizeOf :: LogicOp -> Int
$csizeOf :: LogicOp -> Int
Storable, LogicOp
LogicOp -> Zero LogicOp
forall a. a -> Zero a
zero :: LogicOp
$czero :: LogicOp
Zero)

-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_CLEAR"
pattern $bLOGIC_OP_CLEAR :: LogicOp
$mLOGIC_OP_CLEAR :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_CLEAR = LogicOp 0
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_AND"
pattern $bLOGIC_OP_AND :: LogicOp
$mLOGIC_OP_AND :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_AND = LogicOp 1
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_AND_REVERSE"
pattern $bLOGIC_OP_AND_REVERSE :: LogicOp
$mLOGIC_OP_AND_REVERSE :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_AND_REVERSE = LogicOp 2
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_COPY"
pattern $bLOGIC_OP_COPY :: LogicOp
$mLOGIC_OP_COPY :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_COPY = LogicOp 3
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_AND_INVERTED"
pattern $bLOGIC_OP_AND_INVERTED :: LogicOp
$mLOGIC_OP_AND_INVERTED :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_AND_INVERTED = LogicOp 4
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_NO_OP"
pattern $bLOGIC_OP_NO_OP :: LogicOp
$mLOGIC_OP_NO_OP :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_NO_OP = LogicOp 5
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_XOR"
pattern $bLOGIC_OP_XOR :: LogicOp
$mLOGIC_OP_XOR :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_XOR = LogicOp 6
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_OR"
pattern $bLOGIC_OP_OR :: LogicOp
$mLOGIC_OP_OR :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_OR = LogicOp 7
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_NOR"
pattern $bLOGIC_OP_NOR :: LogicOp
$mLOGIC_OP_NOR :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_NOR = LogicOp 8
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_EQUIVALENT"
pattern $bLOGIC_OP_EQUIVALENT :: LogicOp
$mLOGIC_OP_EQUIVALENT :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_EQUIVALENT = LogicOp 9
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_INVERT"
pattern $bLOGIC_OP_INVERT :: LogicOp
$mLOGIC_OP_INVERT :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_INVERT = LogicOp 10
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_OR_REVERSE"
pattern $bLOGIC_OP_OR_REVERSE :: LogicOp
$mLOGIC_OP_OR_REVERSE :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_OR_REVERSE = LogicOp 11
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_COPY_INVERTED"
pattern $bLOGIC_OP_COPY_INVERTED :: LogicOp
$mLOGIC_OP_COPY_INVERTED :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_COPY_INVERTED = LogicOp 12
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_OR_INVERTED"
pattern $bLOGIC_OP_OR_INVERTED :: LogicOp
$mLOGIC_OP_OR_INVERTED :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_OR_INVERTED = LogicOp 13
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_NAND"
pattern $bLOGIC_OP_NAND :: LogicOp
$mLOGIC_OP_NAND :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_NAND = LogicOp 14
-- No documentation found for Nested "VkLogicOp" "VK_LOGIC_OP_SET"
pattern $bLOGIC_OP_SET :: LogicOp
$mLOGIC_OP_SET :: forall r. LogicOp -> (Void# -> r) -> (Void# -> r) -> r
LOGIC_OP_SET = LogicOp 15
{-# complete LOGIC_OP_CLEAR,
             LOGIC_OP_AND,
             LOGIC_OP_AND_REVERSE,
             LOGIC_OP_COPY,
             LOGIC_OP_AND_INVERTED,
             LOGIC_OP_NO_OP,
             LOGIC_OP_XOR,
             LOGIC_OP_OR,
             LOGIC_OP_NOR,
             LOGIC_OP_EQUIVALENT,
             LOGIC_OP_INVERT,
             LOGIC_OP_OR_REVERSE,
             LOGIC_OP_COPY_INVERTED,
             LOGIC_OP_OR_INVERTED,
             LOGIC_OP_NAND,
             LOGIC_OP_SET :: LogicOp #-}

instance Show LogicOp where
  showsPrec :: Int -> LogicOp -> ShowS
showsPrec p :: Int
p = \case
    LOGIC_OP_CLEAR -> String -> ShowS
showString "LOGIC_OP_CLEAR"
    LOGIC_OP_AND -> String -> ShowS
showString "LOGIC_OP_AND"
    LOGIC_OP_AND_REVERSE -> String -> ShowS
showString "LOGIC_OP_AND_REVERSE"
    LOGIC_OP_COPY -> String -> ShowS
showString "LOGIC_OP_COPY"
    LOGIC_OP_AND_INVERTED -> String -> ShowS
showString "LOGIC_OP_AND_INVERTED"
    LOGIC_OP_NO_OP -> String -> ShowS
showString "LOGIC_OP_NO_OP"
    LOGIC_OP_XOR -> String -> ShowS
showString "LOGIC_OP_XOR"
    LOGIC_OP_OR -> String -> ShowS
showString "LOGIC_OP_OR"
    LOGIC_OP_NOR -> String -> ShowS
showString "LOGIC_OP_NOR"
    LOGIC_OP_EQUIVALENT -> String -> ShowS
showString "LOGIC_OP_EQUIVALENT"
    LOGIC_OP_INVERT -> String -> ShowS
showString "LOGIC_OP_INVERT"
    LOGIC_OP_OR_REVERSE -> String -> ShowS
showString "LOGIC_OP_OR_REVERSE"
    LOGIC_OP_COPY_INVERTED -> String -> ShowS
showString "LOGIC_OP_COPY_INVERTED"
    LOGIC_OP_OR_INVERTED -> String -> ShowS
showString "LOGIC_OP_OR_INVERTED"
    LOGIC_OP_NAND -> String -> ShowS
showString "LOGIC_OP_NAND"
    LOGIC_OP_SET -> String -> ShowS
showString "LOGIC_OP_SET"
    LogicOp x :: Int32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "LogicOp " 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 LogicOp where
  readPrec :: ReadPrec LogicOp
readPrec = ReadPrec LogicOp -> ReadPrec LogicOp
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec LogicOp)] -> ReadPrec LogicOp
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("LOGIC_OP_CLEAR", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_CLEAR)
                            , ("LOGIC_OP_AND", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_AND)
                            , ("LOGIC_OP_AND_REVERSE", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_AND_REVERSE)
                            , ("LOGIC_OP_COPY", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_COPY)
                            , ("LOGIC_OP_AND_INVERTED", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_AND_INVERTED)
                            , ("LOGIC_OP_NO_OP", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_NO_OP)
                            , ("LOGIC_OP_XOR", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_XOR)
                            , ("LOGIC_OP_OR", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_OR)
                            , ("LOGIC_OP_NOR", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_NOR)
                            , ("LOGIC_OP_EQUIVALENT", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_EQUIVALENT)
                            , ("LOGIC_OP_INVERT", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_INVERT)
                            , ("LOGIC_OP_OR_REVERSE", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_OR_REVERSE)
                            , ("LOGIC_OP_COPY_INVERTED", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_COPY_INVERTED)
                            , ("LOGIC_OP_OR_INVERTED", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_OR_INVERTED)
                            , ("LOGIC_OP_NAND", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_NAND)
                            , ("LOGIC_OP_SET", LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure LogicOp
LOGIC_OP_SET)]
                     ReadPrec LogicOp -> ReadPrec LogicOp -> ReadPrec LogicOp
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int -> ReadPrec LogicOp -> ReadPrec LogicOp
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "LogicOp")
                       Int32
v <- ReadPrec Int32 -> ReadPrec Int32
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Int32
forall a. Read a => ReadPrec a
readPrec
                       LogicOp -> ReadPrec LogicOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int32 -> LogicOp
LogicOp Int32
v)))