{-# language CPP #-}
module Vulkan.Core12.Enums.SamplerReductionMode  (SamplerReductionMode( SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE
                                                                      , SAMPLER_REDUCTION_MODE_MIN
                                                                      , SAMPLER_REDUCTION_MODE_MAX
                                                                      , ..
                                                                      )) 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)
-- | VkSamplerReductionMode - Specify reduction mode for texture filtering
--
-- = See Also
--
-- 'Vulkan.Core12.Promoted_From_VK_EXT_sampler_filter_minmax.SamplerReductionModeCreateInfo'
newtype SamplerReductionMode = SamplerReductionMode Int32
  deriving newtype (SamplerReductionMode -> SamplerReductionMode -> Bool
(SamplerReductionMode -> SamplerReductionMode -> Bool)
-> (SamplerReductionMode -> SamplerReductionMode -> Bool)
-> Eq SamplerReductionMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SamplerReductionMode -> SamplerReductionMode -> Bool
$c/= :: SamplerReductionMode -> SamplerReductionMode -> Bool
== :: SamplerReductionMode -> SamplerReductionMode -> Bool
$c== :: SamplerReductionMode -> SamplerReductionMode -> Bool
Eq, Eq SamplerReductionMode
Eq SamplerReductionMode =>
(SamplerReductionMode -> SamplerReductionMode -> Ordering)
-> (SamplerReductionMode -> SamplerReductionMode -> Bool)
-> (SamplerReductionMode -> SamplerReductionMode -> Bool)
-> (SamplerReductionMode -> SamplerReductionMode -> Bool)
-> (SamplerReductionMode -> SamplerReductionMode -> Bool)
-> (SamplerReductionMode
    -> SamplerReductionMode -> SamplerReductionMode)
-> (SamplerReductionMode
    -> SamplerReductionMode -> SamplerReductionMode)
-> Ord SamplerReductionMode
SamplerReductionMode -> SamplerReductionMode -> Bool
SamplerReductionMode -> SamplerReductionMode -> Ordering
SamplerReductionMode
-> SamplerReductionMode -> SamplerReductionMode
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 :: SamplerReductionMode
-> SamplerReductionMode -> SamplerReductionMode
$cmin :: SamplerReductionMode
-> SamplerReductionMode -> SamplerReductionMode
max :: SamplerReductionMode
-> SamplerReductionMode -> SamplerReductionMode
$cmax :: SamplerReductionMode
-> SamplerReductionMode -> SamplerReductionMode
>= :: SamplerReductionMode -> SamplerReductionMode -> Bool
$c>= :: SamplerReductionMode -> SamplerReductionMode -> Bool
> :: SamplerReductionMode -> SamplerReductionMode -> Bool
$c> :: SamplerReductionMode -> SamplerReductionMode -> Bool
<= :: SamplerReductionMode -> SamplerReductionMode -> Bool
$c<= :: SamplerReductionMode -> SamplerReductionMode -> Bool
< :: SamplerReductionMode -> SamplerReductionMode -> Bool
$c< :: SamplerReductionMode -> SamplerReductionMode -> Bool
compare :: SamplerReductionMode -> SamplerReductionMode -> Ordering
$ccompare :: SamplerReductionMode -> SamplerReductionMode -> Ordering
$cp1Ord :: Eq SamplerReductionMode
Ord, Ptr b -> Int -> IO SamplerReductionMode
Ptr b -> Int -> SamplerReductionMode -> IO ()
Ptr SamplerReductionMode -> IO SamplerReductionMode
Ptr SamplerReductionMode -> Int -> IO SamplerReductionMode
Ptr SamplerReductionMode -> Int -> SamplerReductionMode -> IO ()
Ptr SamplerReductionMode -> SamplerReductionMode -> IO ()
SamplerReductionMode -> Int
(SamplerReductionMode -> Int)
-> (SamplerReductionMode -> Int)
-> (Ptr SamplerReductionMode -> Int -> IO SamplerReductionMode)
-> (Ptr SamplerReductionMode
    -> Int -> SamplerReductionMode -> IO ())
-> (forall b. Ptr b -> Int -> IO SamplerReductionMode)
-> (forall b. Ptr b -> Int -> SamplerReductionMode -> IO ())
-> (Ptr SamplerReductionMode -> IO SamplerReductionMode)
-> (Ptr SamplerReductionMode -> SamplerReductionMode -> IO ())
-> Storable SamplerReductionMode
forall b. Ptr b -> Int -> IO SamplerReductionMode
forall b. Ptr b -> Int -> SamplerReductionMode -> 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 SamplerReductionMode -> SamplerReductionMode -> IO ()
$cpoke :: Ptr SamplerReductionMode -> SamplerReductionMode -> IO ()
peek :: Ptr SamplerReductionMode -> IO SamplerReductionMode
$cpeek :: Ptr SamplerReductionMode -> IO SamplerReductionMode
pokeByteOff :: Ptr b -> Int -> SamplerReductionMode -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> SamplerReductionMode -> IO ()
peekByteOff :: Ptr b -> Int -> IO SamplerReductionMode
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SamplerReductionMode
pokeElemOff :: Ptr SamplerReductionMode -> Int -> SamplerReductionMode -> IO ()
$cpokeElemOff :: Ptr SamplerReductionMode -> Int -> SamplerReductionMode -> IO ()
peekElemOff :: Ptr SamplerReductionMode -> Int -> IO SamplerReductionMode
$cpeekElemOff :: Ptr SamplerReductionMode -> Int -> IO SamplerReductionMode
alignment :: SamplerReductionMode -> Int
$calignment :: SamplerReductionMode -> Int
sizeOf :: SamplerReductionMode -> Int
$csizeOf :: SamplerReductionMode -> Int
Storable, SamplerReductionMode
SamplerReductionMode -> Zero SamplerReductionMode
forall a. a -> Zero a
zero :: SamplerReductionMode
$czero :: SamplerReductionMode
Zero)

-- | 'SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE' specifies that texel values
-- are combined by computing a weighted average of values in the footprint,
-- using weights as specified in
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#textures-unnormalized-to-integer the image operations chapter>.
pattern $bSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE :: SamplerReductionMode
$mSAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE :: forall r. SamplerReductionMode -> (Void# -> r) -> (Void# -> r) -> r
SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE = SamplerReductionMode 0
-- | 'SAMPLER_REDUCTION_MODE_MIN' specifies that texel values are combined by
-- taking the component-wise minimum of values in the footprint with
-- non-zero weights.
pattern $bSAMPLER_REDUCTION_MODE_MIN :: SamplerReductionMode
$mSAMPLER_REDUCTION_MODE_MIN :: forall r. SamplerReductionMode -> (Void# -> r) -> (Void# -> r) -> r
SAMPLER_REDUCTION_MODE_MIN = SamplerReductionMode 1
-- | 'SAMPLER_REDUCTION_MODE_MAX' specifies that texel values are combined by
-- taking the component-wise maximum of values in the footprint with
-- non-zero weights.
pattern $bSAMPLER_REDUCTION_MODE_MAX :: SamplerReductionMode
$mSAMPLER_REDUCTION_MODE_MAX :: forall r. SamplerReductionMode -> (Void# -> r) -> (Void# -> r) -> r
SAMPLER_REDUCTION_MODE_MAX = SamplerReductionMode 2
{-# complete SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE,
             SAMPLER_REDUCTION_MODE_MIN,
             SAMPLER_REDUCTION_MODE_MAX :: SamplerReductionMode #-}

instance Show SamplerReductionMode where
  showsPrec :: Int -> SamplerReductionMode -> ShowS
showsPrec p :: Int
p = \case
    SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE -> String -> ShowS
showString "SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE"
    SAMPLER_REDUCTION_MODE_MIN -> String -> ShowS
showString "SAMPLER_REDUCTION_MODE_MIN"
    SAMPLER_REDUCTION_MODE_MAX -> String -> ShowS
showString "SAMPLER_REDUCTION_MODE_MAX"
    SamplerReductionMode x :: Int32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "SamplerReductionMode " 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 SamplerReductionMode where
  readPrec :: ReadPrec SamplerReductionMode
readPrec = ReadPrec SamplerReductionMode -> ReadPrec SamplerReductionMode
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec SamplerReductionMode)]
-> ReadPrec SamplerReductionMode
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE", SamplerReductionMode -> ReadPrec SamplerReductionMode
forall (f :: * -> *) a. Applicative f => a -> f a
pure SamplerReductionMode
SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE)
                            , ("SAMPLER_REDUCTION_MODE_MIN", SamplerReductionMode -> ReadPrec SamplerReductionMode
forall (f :: * -> *) a. Applicative f => a -> f a
pure SamplerReductionMode
SAMPLER_REDUCTION_MODE_MIN)
                            , ("SAMPLER_REDUCTION_MODE_MAX", SamplerReductionMode -> ReadPrec SamplerReductionMode
forall (f :: * -> *) a. Applicative f => a -> f a
pure SamplerReductionMode
SAMPLER_REDUCTION_MODE_MAX)]
                     ReadPrec SamplerReductionMode
-> ReadPrec SamplerReductionMode -> ReadPrec SamplerReductionMode
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int
-> ReadPrec SamplerReductionMode -> ReadPrec SamplerReductionMode
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "SamplerReductionMode")
                       Int32
v <- ReadPrec Int32 -> ReadPrec Int32
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Int32
forall a. Read a => ReadPrec a
readPrec
                       SamplerReductionMode -> ReadPrec SamplerReductionMode
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int32 -> SamplerReductionMode
SamplerReductionMode Int32
v)))