{-# language CPP #-}
module Vulkan.Core10.Enums.SamplerMipmapMode  (SamplerMipmapMode( SAMPLER_MIPMAP_MODE_NEAREST
                                                                , SAMPLER_MIPMAP_MODE_LINEAR
                                                                , ..
                                                                )) 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)
-- | VkSamplerMipmapMode - Specify mipmap mode used for texture lookups
--
-- = Description
--
-- These modes are described in detail in
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#textures-texel-filtering Texel Filtering>.
--
-- = See Also
--
-- 'Vulkan.Core10.Sampler.SamplerCreateInfo'
newtype SamplerMipmapMode = SamplerMipmapMode Int32
  deriving newtype (SamplerMipmapMode -> SamplerMipmapMode -> Bool
(SamplerMipmapMode -> SamplerMipmapMode -> Bool)
-> (SamplerMipmapMode -> SamplerMipmapMode -> Bool)
-> Eq SamplerMipmapMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SamplerMipmapMode -> SamplerMipmapMode -> Bool
$c/= :: SamplerMipmapMode -> SamplerMipmapMode -> Bool
== :: SamplerMipmapMode -> SamplerMipmapMode -> Bool
$c== :: SamplerMipmapMode -> SamplerMipmapMode -> Bool
Eq, Eq SamplerMipmapMode
Eq SamplerMipmapMode =>
(SamplerMipmapMode -> SamplerMipmapMode -> Ordering)
-> (SamplerMipmapMode -> SamplerMipmapMode -> Bool)
-> (SamplerMipmapMode -> SamplerMipmapMode -> Bool)
-> (SamplerMipmapMode -> SamplerMipmapMode -> Bool)
-> (SamplerMipmapMode -> SamplerMipmapMode -> Bool)
-> (SamplerMipmapMode -> SamplerMipmapMode -> SamplerMipmapMode)
-> (SamplerMipmapMode -> SamplerMipmapMode -> SamplerMipmapMode)
-> Ord SamplerMipmapMode
SamplerMipmapMode -> SamplerMipmapMode -> Bool
SamplerMipmapMode -> SamplerMipmapMode -> Ordering
SamplerMipmapMode -> SamplerMipmapMode -> SamplerMipmapMode
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 :: SamplerMipmapMode -> SamplerMipmapMode -> SamplerMipmapMode
$cmin :: SamplerMipmapMode -> SamplerMipmapMode -> SamplerMipmapMode
max :: SamplerMipmapMode -> SamplerMipmapMode -> SamplerMipmapMode
$cmax :: SamplerMipmapMode -> SamplerMipmapMode -> SamplerMipmapMode
>= :: SamplerMipmapMode -> SamplerMipmapMode -> Bool
$c>= :: SamplerMipmapMode -> SamplerMipmapMode -> Bool
> :: SamplerMipmapMode -> SamplerMipmapMode -> Bool
$c> :: SamplerMipmapMode -> SamplerMipmapMode -> Bool
<= :: SamplerMipmapMode -> SamplerMipmapMode -> Bool
$c<= :: SamplerMipmapMode -> SamplerMipmapMode -> Bool
< :: SamplerMipmapMode -> SamplerMipmapMode -> Bool
$c< :: SamplerMipmapMode -> SamplerMipmapMode -> Bool
compare :: SamplerMipmapMode -> SamplerMipmapMode -> Ordering
$ccompare :: SamplerMipmapMode -> SamplerMipmapMode -> Ordering
$cp1Ord :: Eq SamplerMipmapMode
Ord, Ptr b -> Int -> IO SamplerMipmapMode
Ptr b -> Int -> SamplerMipmapMode -> IO ()
Ptr SamplerMipmapMode -> IO SamplerMipmapMode
Ptr SamplerMipmapMode -> Int -> IO SamplerMipmapMode
Ptr SamplerMipmapMode -> Int -> SamplerMipmapMode -> IO ()
Ptr SamplerMipmapMode -> SamplerMipmapMode -> IO ()
SamplerMipmapMode -> Int
(SamplerMipmapMode -> Int)
-> (SamplerMipmapMode -> Int)
-> (Ptr SamplerMipmapMode -> Int -> IO SamplerMipmapMode)
-> (Ptr SamplerMipmapMode -> Int -> SamplerMipmapMode -> IO ())
-> (forall b. Ptr b -> Int -> IO SamplerMipmapMode)
-> (forall b. Ptr b -> Int -> SamplerMipmapMode -> IO ())
-> (Ptr SamplerMipmapMode -> IO SamplerMipmapMode)
-> (Ptr SamplerMipmapMode -> SamplerMipmapMode -> IO ())
-> Storable SamplerMipmapMode
forall b. Ptr b -> Int -> IO SamplerMipmapMode
forall b. Ptr b -> Int -> SamplerMipmapMode -> 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 SamplerMipmapMode -> SamplerMipmapMode -> IO ()
$cpoke :: Ptr SamplerMipmapMode -> SamplerMipmapMode -> IO ()
peek :: Ptr SamplerMipmapMode -> IO SamplerMipmapMode
$cpeek :: Ptr SamplerMipmapMode -> IO SamplerMipmapMode
pokeByteOff :: Ptr b -> Int -> SamplerMipmapMode -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> SamplerMipmapMode -> IO ()
peekByteOff :: Ptr b -> Int -> IO SamplerMipmapMode
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SamplerMipmapMode
pokeElemOff :: Ptr SamplerMipmapMode -> Int -> SamplerMipmapMode -> IO ()
$cpokeElemOff :: Ptr SamplerMipmapMode -> Int -> SamplerMipmapMode -> IO ()
peekElemOff :: Ptr SamplerMipmapMode -> Int -> IO SamplerMipmapMode
$cpeekElemOff :: Ptr SamplerMipmapMode -> Int -> IO SamplerMipmapMode
alignment :: SamplerMipmapMode -> Int
$calignment :: SamplerMipmapMode -> Int
sizeOf :: SamplerMipmapMode -> Int
$csizeOf :: SamplerMipmapMode -> Int
Storable, SamplerMipmapMode
SamplerMipmapMode -> Zero SamplerMipmapMode
forall a. a -> Zero a
zero :: SamplerMipmapMode
$czero :: SamplerMipmapMode
Zero)

-- | 'SAMPLER_MIPMAP_MODE_NEAREST' specifies nearest filtering.
pattern $bSAMPLER_MIPMAP_MODE_NEAREST :: SamplerMipmapMode
$mSAMPLER_MIPMAP_MODE_NEAREST :: forall r. SamplerMipmapMode -> (Void# -> r) -> (Void# -> r) -> r
SAMPLER_MIPMAP_MODE_NEAREST = SamplerMipmapMode 0
-- | 'SAMPLER_MIPMAP_MODE_LINEAR' specifies linear filtering.
pattern $bSAMPLER_MIPMAP_MODE_LINEAR :: SamplerMipmapMode
$mSAMPLER_MIPMAP_MODE_LINEAR :: forall r. SamplerMipmapMode -> (Void# -> r) -> (Void# -> r) -> r
SAMPLER_MIPMAP_MODE_LINEAR = SamplerMipmapMode 1
{-# complete SAMPLER_MIPMAP_MODE_NEAREST,
             SAMPLER_MIPMAP_MODE_LINEAR :: SamplerMipmapMode #-}

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