packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPURenderPassColorAttachment.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.GPURenderPassColorAttachment
       (newGPURenderPassColorAttachment, setView, getView, setDepthSlice, getDepthSlice, getDepthSliceUnsafe, getDepthSliceUnchecked, setResolveTarget, getResolveTarget, getResolveTargetUnsafe, getResolveTargetUnchecked, setClearValue, getClearValue, getClearValueUnsafe, getClearValueUnchecked, setLoadOp, getLoadOp, setStoreOp, getStoreOp, GPURenderPassColorAttachment(..), gTypeGPURenderPassColorAttachment)
       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-gpurenderpasscolorattachment GPURenderPassColorAttachment specification>
newGPURenderPassColorAttachment :: (MonadDOM m, IsGPUTextureOrGPUTextureView view) => view -> GPULoadOp -> GPUStoreOp -> m GPURenderPassColorAttachment
newGPURenderPassColorAttachment view loadOp storeOp = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "view" (toJSVal view)) P.>> (o ^. jss "loadOp" (toJSVal loadOp)) P.>> (o ^. jss "storeOp" (toJSVal storeOp)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-view GPURenderPassColorAttachment.view specification>
setView :: (MonadDOM m, IsGPUTextureOrGPUTextureView val) => GPURenderPassColorAttachment -> val -> m ()
setView self val = liftDOM (void (self ^. jss "view" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-view GPURenderPassColorAttachment.view specification>
getView :: (MonadDOM m) => GPURenderPassColorAttachment -> m GPUTextureOrGPUTextureView
getView self = liftDOM (((self ^. js "view") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-depthslice GPURenderPassColorAttachment.depthSlice specification>
setDepthSlice :: (MonadDOM m) => GPURenderPassColorAttachment -> Word -> m ()
setDepthSlice self val = liftDOM (void (self ^. jss "depthSlice" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-depthslice GPURenderPassColorAttachment.depthSlice specification>
getDepthSlice :: (MonadDOM m) => GPURenderPassColorAttachment -> m (Maybe Word)
getDepthSlice self = liftDOM (((self ^. js "depthSlice") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-depthslice GPURenderPassColorAttachment.depthSlice specification>
getDepthSliceUnsafe :: (MonadDOM m, HasCallStack) => GPURenderPassColorAttachment -> m Word
getDepthSliceUnsafe self = liftDOM ((((self ^. js "depthSlice") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-depthslice GPURenderPassColorAttachment.depthSlice specification>
getDepthSliceUnchecked :: (MonadDOM m) => GPURenderPassColorAttachment -> m Word
getDepthSliceUnchecked self = liftDOM ((P.round <$> ((self ^. js "depthSlice") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-resolvetarget GPURenderPassColorAttachment.resolveTarget specification>
setResolveTarget :: (MonadDOM m, IsGPUTextureOrGPUTextureView val) => GPURenderPassColorAttachment -> val -> m ()
setResolveTarget self val = liftDOM (void (self ^. jss "resolveTarget" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-resolvetarget GPURenderPassColorAttachment.resolveTarget specification>
getResolveTarget :: (MonadDOM m) => GPURenderPassColorAttachment -> m (Maybe GPUTextureOrGPUTextureView)
getResolveTarget self = liftDOM (((self ^. js "resolveTarget") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-resolvetarget GPURenderPassColorAttachment.resolveTarget specification>
getResolveTargetUnsafe :: (MonadDOM m, HasCallStack) => GPURenderPassColorAttachment -> m GPUTextureOrGPUTextureView
getResolveTargetUnsafe self = liftDOM ((((self ^. js "resolveTarget") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-resolvetarget GPURenderPassColorAttachment.resolveTarget specification>
getResolveTargetUnchecked :: (MonadDOM m) => GPURenderPassColorAttachment -> m GPUTextureOrGPUTextureView
getResolveTargetUnchecked self = liftDOM (((self ^. js "resolveTarget") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-clearvalue GPURenderPassColorAttachment.clearValue specification>
setClearValue :: (MonadDOM m, IsGPUColor val) => GPURenderPassColorAttachment -> val -> m ()
setClearValue self val = liftDOM (void (self ^. jss "clearValue" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-clearvalue GPURenderPassColorAttachment.clearValue specification>
getClearValue :: (MonadDOM m) => GPURenderPassColorAttachment -> m (Maybe GPUColor)
getClearValue self = liftDOM (((self ^. js "clearValue") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-clearvalue GPURenderPassColorAttachment.clearValue specification>
getClearValueUnsafe :: (MonadDOM m, HasCallStack) => GPURenderPassColorAttachment -> m GPUColor
getClearValueUnsafe self = liftDOM ((((self ^. js "clearValue") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-clearvalue GPURenderPassColorAttachment.clearValue specification>
getClearValueUnchecked :: (MonadDOM m) => GPURenderPassColorAttachment -> m GPUColor
getClearValueUnchecked self = liftDOM (((self ^. js "clearValue") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-loadop GPURenderPassColorAttachment.loadOp specification>
setLoadOp :: (MonadDOM m) => GPURenderPassColorAttachment -> GPULoadOp -> m ()
setLoadOp self val = liftDOM (void (self ^. jss "loadOp" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-loadop GPURenderPassColorAttachment.loadOp specification>
getLoadOp :: (MonadDOM m) => GPURenderPassColorAttachment -> m GPULoadOp
getLoadOp self = liftDOM (((self ^. js "loadOp") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-storeop GPURenderPassColorAttachment.storeOp specification>
setStoreOp :: (MonadDOM m) => GPURenderPassColorAttachment -> GPUStoreOp -> m ()
setStoreOp self val = liftDOM (void (self ^. jss "storeOp" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasscolorattachment-storeop GPURenderPassColorAttachment.storeOp specification>
getStoreOp :: (MonadDOM m) => GPURenderPassColorAttachment -> m GPUStoreOp
getStoreOp self = liftDOM (((self ^. js "storeOp") >>= fromJSValUnchecked))