packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUSamplerDescriptor.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webgpu (webref). Do not edit.
module JSDOM.Generated.GPUSamplerDescriptor
       (newGPUSamplerDescriptor, setAddressModeU, getAddressModeU, getAddressModeUUnsafe, getAddressModeUUnchecked, setAddressModeV, getAddressModeV, getAddressModeVUnsafe, getAddressModeVUnchecked, setAddressModeW, getAddressModeW, getAddressModeWUnsafe, getAddressModeWUnchecked, setMagFilter, getMagFilter, getMagFilterUnsafe, getMagFilterUnchecked, setMinFilter, getMinFilter, getMinFilterUnsafe, getMinFilterUnchecked, setMipmapFilter, getMipmapFilter, getMipmapFilterUnsafe, getMipmapFilterUnchecked, setLodMinClamp, getLodMinClamp, getLodMinClampUnsafe, getLodMinClampUnchecked, setLodMaxClamp, getLodMaxClamp, getLodMaxClampUnsafe, getLodMaxClampUnchecked, setCompare, getCompare, getCompareUnsafe, getCompareUnchecked, setMaxAnisotropy, getMaxAnisotropy, getMaxAnisotropyUnsafe, getMaxAnisotropyUnchecked, GPUSamplerDescriptor(..), gTypeGPUSamplerDescriptor)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums

-- | <https://gpuweb.github.io/gpuweb/#dictdef-gpusamplerdescriptor GPUSamplerDescriptor specification>
newGPUSamplerDescriptor :: (MonadDOM m) => m GPUSamplerDescriptor
newGPUSamplerDescriptor = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-addressmodeu GPUSamplerDescriptor.addressModeU specification>
setAddressModeU :: (MonadDOM m) => GPUSamplerDescriptor -> GPUAddressMode -> m ()
setAddressModeU self val = liftDOM (void (self ^. jss "addressModeU" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-addressmodeu GPUSamplerDescriptor.addressModeU specification>
getAddressModeU :: (MonadDOM m) => GPUSamplerDescriptor -> m (Maybe GPUAddressMode)
getAddressModeU self = liftDOM (((self ^. js "addressModeU") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-addressmodeu GPUSamplerDescriptor.addressModeU specification>
getAddressModeUUnsafe :: (MonadDOM m, HasCallStack) => GPUSamplerDescriptor -> m GPUAddressMode
getAddressModeUUnsafe self = liftDOM ((((self ^. js "addressModeU") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-addressmodeu GPUSamplerDescriptor.addressModeU specification>
getAddressModeUUnchecked :: (MonadDOM m) => GPUSamplerDescriptor -> m GPUAddressMode
getAddressModeUUnchecked self = liftDOM (((self ^. js "addressModeU") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-addressmodev GPUSamplerDescriptor.addressModeV specification>
setAddressModeV :: (MonadDOM m) => GPUSamplerDescriptor -> GPUAddressMode -> m ()
setAddressModeV self val = liftDOM (void (self ^. jss "addressModeV" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-addressmodev GPUSamplerDescriptor.addressModeV specification>
getAddressModeV :: (MonadDOM m) => GPUSamplerDescriptor -> m (Maybe GPUAddressMode)
getAddressModeV self = liftDOM (((self ^. js "addressModeV") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-addressmodev GPUSamplerDescriptor.addressModeV specification>
getAddressModeVUnsafe :: (MonadDOM m, HasCallStack) => GPUSamplerDescriptor -> m GPUAddressMode
getAddressModeVUnsafe self = liftDOM ((((self ^. js "addressModeV") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-addressmodev GPUSamplerDescriptor.addressModeV specification>
getAddressModeVUnchecked :: (MonadDOM m) => GPUSamplerDescriptor -> m GPUAddressMode
getAddressModeVUnchecked self = liftDOM (((self ^. js "addressModeV") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-addressmodew GPUSamplerDescriptor.addressModeW specification>
setAddressModeW :: (MonadDOM m) => GPUSamplerDescriptor -> GPUAddressMode -> m ()
setAddressModeW self val = liftDOM (void (self ^. jss "addressModeW" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-addressmodew GPUSamplerDescriptor.addressModeW specification>
getAddressModeW :: (MonadDOM m) => GPUSamplerDescriptor -> m (Maybe GPUAddressMode)
getAddressModeW self = liftDOM (((self ^. js "addressModeW") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-addressmodew GPUSamplerDescriptor.addressModeW specification>
getAddressModeWUnsafe :: (MonadDOM m, HasCallStack) => GPUSamplerDescriptor -> m GPUAddressMode
getAddressModeWUnsafe self = liftDOM ((((self ^. js "addressModeW") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-addressmodew GPUSamplerDescriptor.addressModeW specification>
getAddressModeWUnchecked :: (MonadDOM m) => GPUSamplerDescriptor -> m GPUAddressMode
getAddressModeWUnchecked self = liftDOM (((self ^. js "addressModeW") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-magfilter GPUSamplerDescriptor.magFilter specification>
setMagFilter :: (MonadDOM m) => GPUSamplerDescriptor -> GPUFilterMode -> m ()
setMagFilter self val = liftDOM (void (self ^. jss "magFilter" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-magfilter GPUSamplerDescriptor.magFilter specification>
getMagFilter :: (MonadDOM m) => GPUSamplerDescriptor -> m (Maybe GPUFilterMode)
getMagFilter self = liftDOM (((self ^. js "magFilter") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-magfilter GPUSamplerDescriptor.magFilter specification>
getMagFilterUnsafe :: (MonadDOM m, HasCallStack) => GPUSamplerDescriptor -> m GPUFilterMode
getMagFilterUnsafe self = liftDOM ((((self ^. js "magFilter") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-magfilter GPUSamplerDescriptor.magFilter specification>
getMagFilterUnchecked :: (MonadDOM m) => GPUSamplerDescriptor -> m GPUFilterMode
getMagFilterUnchecked self = liftDOM (((self ^. js "magFilter") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-minfilter GPUSamplerDescriptor.minFilter specification>
setMinFilter :: (MonadDOM m) => GPUSamplerDescriptor -> GPUFilterMode -> m ()
setMinFilter self val = liftDOM (void (self ^. jss "minFilter" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-minfilter GPUSamplerDescriptor.minFilter specification>
getMinFilter :: (MonadDOM m) => GPUSamplerDescriptor -> m (Maybe GPUFilterMode)
getMinFilter self = liftDOM (((self ^. js "minFilter") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-minfilter GPUSamplerDescriptor.minFilter specification>
getMinFilterUnsafe :: (MonadDOM m, HasCallStack) => GPUSamplerDescriptor -> m GPUFilterMode
getMinFilterUnsafe self = liftDOM ((((self ^. js "minFilter") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-minfilter GPUSamplerDescriptor.minFilter specification>
getMinFilterUnchecked :: (MonadDOM m) => GPUSamplerDescriptor -> m GPUFilterMode
getMinFilterUnchecked self = liftDOM (((self ^. js "minFilter") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-mipmapfilter GPUSamplerDescriptor.mipmapFilter specification>
setMipmapFilter :: (MonadDOM m) => GPUSamplerDescriptor -> GPUMipmapFilterMode -> m ()
setMipmapFilter self val = liftDOM (void (self ^. jss "mipmapFilter" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-mipmapfilter GPUSamplerDescriptor.mipmapFilter specification>
getMipmapFilter :: (MonadDOM m) => GPUSamplerDescriptor -> m (Maybe GPUMipmapFilterMode)
getMipmapFilter self = liftDOM (((self ^. js "mipmapFilter") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-mipmapfilter GPUSamplerDescriptor.mipmapFilter specification>
getMipmapFilterUnsafe :: (MonadDOM m, HasCallStack) => GPUSamplerDescriptor -> m GPUMipmapFilterMode
getMipmapFilterUnsafe self = liftDOM ((((self ^. js "mipmapFilter") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-mipmapfilter GPUSamplerDescriptor.mipmapFilter specification>
getMipmapFilterUnchecked :: (MonadDOM m) => GPUSamplerDescriptor -> m GPUMipmapFilterMode
getMipmapFilterUnchecked self = liftDOM (((self ^. js "mipmapFilter") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-lodminclamp GPUSamplerDescriptor.lodMinClamp specification>
setLodMinClamp :: (MonadDOM m) => GPUSamplerDescriptor -> Float -> m ()
setLodMinClamp self val = liftDOM (void (self ^. jss "lodMinClamp" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-lodminclamp GPUSamplerDescriptor.lodMinClamp specification>
getLodMinClamp :: (MonadDOM m) => GPUSamplerDescriptor -> m (Maybe Float)
getLodMinClamp self = liftDOM (((self ^. js "lodMinClamp") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-lodminclamp GPUSamplerDescriptor.lodMinClamp specification>
getLodMinClampUnsafe :: (MonadDOM m, HasCallStack) => GPUSamplerDescriptor -> m Float
getLodMinClampUnsafe self = liftDOM ((((self ^. js "lodMinClamp") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-lodminclamp GPUSamplerDescriptor.lodMinClamp specification>
getLodMinClampUnchecked :: (MonadDOM m) => GPUSamplerDescriptor -> m Float
getLodMinClampUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "lodMinClamp") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-lodmaxclamp GPUSamplerDescriptor.lodMaxClamp specification>
setLodMaxClamp :: (MonadDOM m) => GPUSamplerDescriptor -> Float -> m ()
setLodMaxClamp self val = liftDOM (void (self ^. jss "lodMaxClamp" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-lodmaxclamp GPUSamplerDescriptor.lodMaxClamp specification>
getLodMaxClamp :: (MonadDOM m) => GPUSamplerDescriptor -> m (Maybe Float)
getLodMaxClamp self = liftDOM (((self ^. js "lodMaxClamp") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-lodmaxclamp GPUSamplerDescriptor.lodMaxClamp specification>
getLodMaxClampUnsafe :: (MonadDOM m, HasCallStack) => GPUSamplerDescriptor -> m Float
getLodMaxClampUnsafe self = liftDOM ((((self ^. js "lodMaxClamp") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-lodmaxclamp GPUSamplerDescriptor.lodMaxClamp specification>
getLodMaxClampUnchecked :: (MonadDOM m) => GPUSamplerDescriptor -> m Float
getLodMaxClampUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "lodMaxClamp") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-compare GPUSamplerDescriptor.compare specification>
setCompare :: (MonadDOM m) => GPUSamplerDescriptor -> GPUCompareFunction -> m ()
setCompare self val = liftDOM (void (self ^. jss "compare" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-compare GPUSamplerDescriptor.compare specification>
getCompare :: (MonadDOM m) => GPUSamplerDescriptor -> m (Maybe GPUCompareFunction)
getCompare self = liftDOM (((self ^. js "compare") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-compare GPUSamplerDescriptor.compare specification>
getCompareUnsafe :: (MonadDOM m, HasCallStack) => GPUSamplerDescriptor -> m GPUCompareFunction
getCompareUnsafe self = liftDOM ((((self ^. js "compare") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-compare GPUSamplerDescriptor.compare specification>
getCompareUnchecked :: (MonadDOM m) => GPUSamplerDescriptor -> m GPUCompareFunction
getCompareUnchecked self = liftDOM (((self ^. js "compare") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-maxanisotropy GPUSamplerDescriptor.maxAnisotropy specification>
setMaxAnisotropy :: (MonadDOM m) => GPUSamplerDescriptor -> Word -> m ()
setMaxAnisotropy self val = liftDOM (void (self ^. jss "maxAnisotropy" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-maxanisotropy GPUSamplerDescriptor.maxAnisotropy specification>
getMaxAnisotropy :: (MonadDOM m) => GPUSamplerDescriptor -> m (Maybe Word)
getMaxAnisotropy self = liftDOM (((self ^. js "maxAnisotropy") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-maxanisotropy GPUSamplerDescriptor.maxAnisotropy specification>
getMaxAnisotropyUnsafe :: (MonadDOM m, HasCallStack) => GPUSamplerDescriptor -> m Word
getMaxAnisotropyUnsafe self = liftDOM ((((self ^. js "maxAnisotropy") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-maxanisotropy GPUSamplerDescriptor.maxAnisotropy specification>
getMaxAnisotropyUnchecked :: (MonadDOM m) => GPUSamplerDescriptor -> m Word
getMaxAnisotropyUnchecked self = liftDOM ((P.round <$> ((self ^. js "maxAnisotropy") >>= valToNumber)))