packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webcodecs (webref). Do not edit.
module JSDOM.Generated.VideoColorSpaceInit
       (newVideoColorSpaceInit, setPrimaries, getPrimaries, getPrimariesUnsafe, getPrimariesUnchecked, setTransfer, getTransfer, getTransferUnsafe, getTransferUnchecked, setMatrix, getMatrix, getMatrixUnsafe, getMatrixUnchecked, setFullRange, getFullRange, getFullRangeUnsafe, getFullRangeUnchecked, VideoColorSpaceInit(..), gTypeVideoColorSpaceInit)
       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://w3c.github.io/webcodecs/#dictdef-videocolorspaceinit VideoColorSpaceInit specification>
newVideoColorSpaceInit :: (MonadDOM m) => m VideoColorSpaceInit
newVideoColorSpaceInit = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-primaries VideoColorSpaceInit.primaries specification>
setPrimaries :: (MonadDOM m) => VideoColorSpaceInit -> Maybe VideoColorPrimaries -> m ()
setPrimaries self val = liftDOM (void (self ^. jss "primaries" (toJSVal val)))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-primaries VideoColorSpaceInit.primaries specification>
getPrimaries :: (MonadDOM m) => VideoColorSpaceInit -> m (Maybe VideoColorPrimaries)
getPrimaries self = liftDOM (((self ^. js "primaries") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-primaries VideoColorSpaceInit.primaries specification>
getPrimariesUnsafe :: (MonadDOM m, HasCallStack) => VideoColorSpaceInit -> m VideoColorPrimaries
getPrimariesUnsafe self = liftDOM ((((self ^. js "primaries") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-primaries VideoColorSpaceInit.primaries specification>
getPrimariesUnchecked :: (MonadDOM m) => VideoColorSpaceInit -> m VideoColorPrimaries
getPrimariesUnchecked self = liftDOM (((self ^. js "primaries") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-transfer VideoColorSpaceInit.transfer specification>
setTransfer :: (MonadDOM m) => VideoColorSpaceInit -> Maybe VideoTransferCharacteristics -> m ()
setTransfer self val = liftDOM (void (self ^. jss "transfer" (toJSVal val)))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-transfer VideoColorSpaceInit.transfer specification>
getTransfer :: (MonadDOM m) => VideoColorSpaceInit -> m (Maybe VideoTransferCharacteristics)
getTransfer self = liftDOM (((self ^. js "transfer") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-transfer VideoColorSpaceInit.transfer specification>
getTransferUnsafe :: (MonadDOM m, HasCallStack) => VideoColorSpaceInit -> m VideoTransferCharacteristics
getTransferUnsafe self = liftDOM ((((self ^. js "transfer") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-transfer VideoColorSpaceInit.transfer specification>
getTransferUnchecked :: (MonadDOM m) => VideoColorSpaceInit -> m VideoTransferCharacteristics
getTransferUnchecked self = liftDOM (((self ^. js "transfer") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-matrix VideoColorSpaceInit.matrix specification>
setMatrix :: (MonadDOM m) => VideoColorSpaceInit -> Maybe VideoMatrixCoefficients -> m ()
setMatrix self val = liftDOM (void (self ^. jss "matrix" (toJSVal val)))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-matrix VideoColorSpaceInit.matrix specification>
getMatrix :: (MonadDOM m) => VideoColorSpaceInit -> m (Maybe VideoMatrixCoefficients)
getMatrix self = liftDOM (((self ^. js "matrix") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-matrix VideoColorSpaceInit.matrix specification>
getMatrixUnsafe :: (MonadDOM m, HasCallStack) => VideoColorSpaceInit -> m VideoMatrixCoefficients
getMatrixUnsafe self = liftDOM ((((self ^. js "matrix") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-matrix VideoColorSpaceInit.matrix specification>
getMatrixUnchecked :: (MonadDOM m) => VideoColorSpaceInit -> m VideoMatrixCoefficients
getMatrixUnchecked self = liftDOM (((self ^. js "matrix") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-fullrange VideoColorSpaceInit.fullRange specification>
setFullRange :: (MonadDOM m) => VideoColorSpaceInit -> Maybe Bool -> m ()
setFullRange self val = liftDOM (void (self ^. jss "fullRange" (toJSVal val)))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-fullrange VideoColorSpaceInit.fullRange specification>
getFullRange :: (MonadDOM m) => VideoColorSpaceInit -> m (Maybe Bool)
getFullRange self = liftDOM (((self ^. js "fullRange") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-fullrange VideoColorSpaceInit.fullRange specification>
getFullRangeUnsafe :: (MonadDOM m, HasCallStack) => VideoColorSpaceInit -> m Bool
getFullRangeUnsafe self = liftDOM ((((self ^. js "fullRange") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-fullrange VideoColorSpaceInit.fullRange specification>
getFullRangeUnchecked :: (MonadDOM m) => VideoColorSpaceInit -> m Bool
getFullRangeUnchecked self = liftDOM (((self ^. js "fullRange") >>= valToBool))