packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/VideoColorSpaceInit.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webcodecs (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.VideoColorSpaceInit
       (js_newVideoColorSpaceInit, js_setPrimaries, js_getPrimaries, js_setTransfer, js_getTransfer, js_setMatrix, js_getMatrix, js_setFullRange, js_getFullRange, 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 GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(() => { return ({}); })"
        js_newVideoColorSpaceInit :: IO VideoColorSpaceInit
-- | <https://w3c.github.io/webcodecs/#dictdef-videocolorspaceinit VideoColorSpaceInit specification>
newVideoColorSpaceInit :: (MonadDOM m) => m VideoColorSpaceInit
newVideoColorSpaceInit = liftDOM ((js_newVideoColorSpaceInit))

foreign import javascript safe "(($1, $2) => { $1[\"primaries\"] = $2; })"
        js_setPrimaries :: VideoColorSpaceInit -> JSVal -> IO ()
-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-primaries VideoColorSpaceInit.primaries specification>
setPrimaries :: (MonadDOM m) => VideoColorSpaceInit -> Maybe VideoColorPrimaries -> m ()
setPrimaries self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setPrimaries (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"primaries\"]; })"
        js_getPrimaries :: VideoColorSpaceInit -> IO JSVal
-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-primaries VideoColorSpaceInit.primaries specification>
getPrimaries :: (MonadDOM m) => VideoColorSpaceInit -> m (Maybe VideoColorPrimaries)
getPrimaries self = liftDOM (((js_getPrimaries (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-primaries VideoColorSpaceInit.primaries specification>
getPrimariesUnsafe :: (MonadDOM m, HasCallStack) => VideoColorSpaceInit -> m VideoColorPrimaries
getPrimariesUnsafe self = liftDOM ((((js_getPrimaries (self)) >>= 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 ((pFromJSVal <$> (js_getPrimaries (self))))

foreign import javascript safe "(($1, $2) => { $1[\"transfer\"] = $2; })"
        js_setTransfer :: VideoColorSpaceInit -> JSVal -> IO ()
-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-transfer VideoColorSpaceInit.transfer specification>
setTransfer :: (MonadDOM m) => VideoColorSpaceInit -> Maybe VideoTransferCharacteristics -> m ()
setTransfer self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setTransfer (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"transfer\"]; })"
        js_getTransfer :: VideoColorSpaceInit -> IO JSVal
-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-transfer VideoColorSpaceInit.transfer specification>
getTransfer :: (MonadDOM m) => VideoColorSpaceInit -> m (Maybe VideoTransferCharacteristics)
getTransfer self = liftDOM (((js_getTransfer (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-transfer VideoColorSpaceInit.transfer specification>
getTransferUnsafe :: (MonadDOM m, HasCallStack) => VideoColorSpaceInit -> m VideoTransferCharacteristics
getTransferUnsafe self = liftDOM ((((js_getTransfer (self)) >>= 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 ((pFromJSVal <$> (js_getTransfer (self))))

foreign import javascript safe "(($1, $2) => { $1[\"matrix\"] = $2; })"
        js_setMatrix :: VideoColorSpaceInit -> JSVal -> IO ()
-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-matrix VideoColorSpaceInit.matrix specification>
setMatrix :: (MonadDOM m) => VideoColorSpaceInit -> Maybe VideoMatrixCoefficients -> m ()
setMatrix self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setMatrix (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"matrix\"]; })"
        js_getMatrix :: VideoColorSpaceInit -> IO JSVal
-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-matrix VideoColorSpaceInit.matrix specification>
getMatrix :: (MonadDOM m) => VideoColorSpaceInit -> m (Maybe VideoMatrixCoefficients)
getMatrix self = liftDOM (((js_getMatrix (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-matrix VideoColorSpaceInit.matrix specification>
getMatrixUnsafe :: (MonadDOM m, HasCallStack) => VideoColorSpaceInit -> m VideoMatrixCoefficients
getMatrixUnsafe self = liftDOM ((((js_getMatrix (self)) >>= 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 ((pFromJSVal <$> (js_getMatrix (self))))

foreign import javascript safe "(($1, $2) => { $1[\"fullRange\"] = $2; })"
        js_setFullRange :: VideoColorSpaceInit -> JSVal -> IO ()
-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-fullrange VideoColorSpaceInit.fullRange specification>
setFullRange :: (MonadDOM m) => VideoColorSpaceInit -> Maybe Bool -> m ()
setFullRange self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setFullRange (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"fullRange\"]; })"
        js_getFullRange :: VideoColorSpaceInit -> IO JSVal
-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-fullrange VideoColorSpaceInit.fullRange specification>
getFullRange :: (MonadDOM m) => VideoColorSpaceInit -> m (Maybe Bool)
getFullRange self = liftDOM (((js_getFullRange (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webcodecs/#dom-videocolorspaceinit-fullrange VideoColorSpaceInit.fullRange specification>
getFullRangeUnsafe :: (MonadDOM m, HasCallStack) => VideoColorSpaceInit -> m Bool
getFullRangeUnsafe self = liftDOM ((((js_getFullRange (self)) >>= 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 ((pFromJSVal <$> (js_getFullRange (self))))