packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUTexelCopyTextureInfo.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.GPUTexelCopyTextureInfo
       (newGPUTexelCopyTextureInfo, setTexture, getTexture, setMipLevel, getMipLevel, getMipLevelUnsafe, getMipLevelUnchecked, setOrigin, getOrigin, getOriginUnsafe, getOriginUnchecked, setAspect, getAspect, getAspectUnsafe, getAspectUnchecked, GPUTexelCopyTextureInfo(..), gTypeGPUTexelCopyTextureInfo, IsGPUTexelCopyTextureInfo, toGPUTexelCopyTextureInfo)
       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/#gputexelcopytextureinfo GPUTexelCopyTextureInfo specification>
newGPUTexelCopyTextureInfo :: (MonadDOM m) => GPUTexture -> m GPUTexelCopyTextureInfo
newGPUTexelCopyTextureInfo texture = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "texture" (toJSVal texture)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-texture GPUTexelCopyTextureInfo.texture specification>
setTexture :: (MonadDOM m, IsGPUTexelCopyTextureInfo self) => self -> GPUTexture -> m ()
setTexture self val = liftDOM (void ((Types.toGPUTexelCopyTextureInfo self) ^. jss "texture" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-texture GPUTexelCopyTextureInfo.texture specification>
getTexture :: (MonadDOM m, IsGPUTexelCopyTextureInfo self) => self -> m GPUTexture
getTexture self = liftDOM ((((Types.toGPUTexelCopyTextureInfo self) ^. js "texture") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-miplevel GPUTexelCopyTextureInfo.mipLevel specification>
setMipLevel :: (MonadDOM m, IsGPUTexelCopyTextureInfo self) => self -> Word -> m ()
setMipLevel self val = liftDOM (void ((Types.toGPUTexelCopyTextureInfo self) ^. jss "mipLevel" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-miplevel GPUTexelCopyTextureInfo.mipLevel specification>
getMipLevel :: (MonadDOM m, IsGPUTexelCopyTextureInfo self) => self -> m (Maybe Word)
getMipLevel self = liftDOM ((((Types.toGPUTexelCopyTextureInfo self) ^. js "mipLevel") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-miplevel GPUTexelCopyTextureInfo.mipLevel specification>
getMipLevelUnsafe :: (MonadDOM m, IsGPUTexelCopyTextureInfo self, HasCallStack) => self -> m Word
getMipLevelUnsafe self = liftDOM (((((Types.toGPUTexelCopyTextureInfo self) ^. js "mipLevel") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-miplevel GPUTexelCopyTextureInfo.mipLevel specification>
getMipLevelUnchecked :: (MonadDOM m, IsGPUTexelCopyTextureInfo self) => self -> m Word
getMipLevelUnchecked self = liftDOM ((P.round <$> (((Types.toGPUTexelCopyTextureInfo self) ^. js "mipLevel") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-origin GPUTexelCopyTextureInfo.origin specification>
setOrigin :: (MonadDOM m, IsGPUTexelCopyTextureInfo self, IsGPUOrigin3D val) => self -> val -> m ()
setOrigin self val = liftDOM (void ((Types.toGPUTexelCopyTextureInfo self) ^. jss "origin" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-origin GPUTexelCopyTextureInfo.origin specification>
getOrigin :: (MonadDOM m, IsGPUTexelCopyTextureInfo self) => self -> m (Maybe GPUOrigin3D)
getOrigin self = liftDOM ((((Types.toGPUTexelCopyTextureInfo self) ^. js "origin") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-origin GPUTexelCopyTextureInfo.origin specification>
getOriginUnsafe :: (MonadDOM m, IsGPUTexelCopyTextureInfo self, HasCallStack) => self -> m GPUOrigin3D
getOriginUnsafe self = liftDOM (((((Types.toGPUTexelCopyTextureInfo self) ^. js "origin") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-origin GPUTexelCopyTextureInfo.origin specification>
getOriginUnchecked :: (MonadDOM m, IsGPUTexelCopyTextureInfo self) => self -> m GPUOrigin3D
getOriginUnchecked self = liftDOM ((((Types.toGPUTexelCopyTextureInfo self) ^. js "origin") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-aspect GPUTexelCopyTextureInfo.aspect specification>
setAspect :: (MonadDOM m, IsGPUTexelCopyTextureInfo self) => self -> GPUTextureAspect -> m ()
setAspect self val = liftDOM (void ((Types.toGPUTexelCopyTextureInfo self) ^. jss "aspect" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-aspect GPUTexelCopyTextureInfo.aspect specification>
getAspect :: (MonadDOM m, IsGPUTexelCopyTextureInfo self) => self -> m (Maybe GPUTextureAspect)
getAspect self = liftDOM ((((Types.toGPUTexelCopyTextureInfo self) ^. js "aspect") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-aspect GPUTexelCopyTextureInfo.aspect specification>
getAspectUnsafe :: (MonadDOM m, IsGPUTexelCopyTextureInfo self, HasCallStack) => self -> m GPUTextureAspect
getAspectUnsafe self = liftDOM (((((Types.toGPUTexelCopyTextureInfo self) ^. js "aspect") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gputexelcopytextureinfo-aspect GPUTexelCopyTextureInfo.aspect specification>
getAspectUnchecked :: (MonadDOM m, IsGPUTexelCopyTextureInfo self) => self -> m GPUTextureAspect
getAspectUnchecked self = liftDOM ((((Types.toGPUTexelCopyTextureInfo self) ^. js "aspect") >>= fromJSValUnchecked))