ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/VideoColorSpace.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.VideoColorSpace
(js_newVideoColorSpace, js_toJSON, js_getPrimaries, js_getTransfer, js_getMatrix, js_getFullRange, newVideoColorSpace, toJSON, toJSON_, getPrimaries, getPrimariesUnsafe, getPrimariesUnchecked, getTransfer, getTransferUnsafe, getTransferUnchecked, getMatrix, getMatrixUnsafe, getMatrixUnchecked, getFullRange, getFullRangeUnsafe, getFullRangeUnchecked, VideoColorSpace(..), gTypeVideoColorSpace)
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 "(($1) => { return new globalThis[\"VideoColorSpace\"]($1); })"
js_newVideoColorSpace :: JSVal -> IO VideoColorSpace
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/VideoColorSpace MDN VideoColorSpace. documentation>
newVideoColorSpace :: (MonadDOM m) => Maybe VideoColorSpaceInit -> m VideoColorSpace
newVideoColorSpace init = liftDOM (((P.maybe (P.return jsUndefined) toJSVal init) >>= \a1' -> js_newVideoColorSpace a1'))
foreign import javascript safe "(($1) => { return $1[\"toJSON\"](); })"
js_toJSON :: VideoColorSpace -> IO VideoColorSpaceInit
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/toJSON MDN VideoColorSpace.toJSON documentation>
toJSON :: (MonadDOM m) => VideoColorSpace -> m VideoColorSpaceInit
toJSON self = liftDOM ((js_toJSON (self)))
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/toJSON MDN VideoColorSpace.toJSON documentation>
toJSON_ :: (MonadDOM m) => VideoColorSpace -> m ()
toJSON_ self = liftDOM (void ((js_toJSON (self))))
foreign import javascript unsafe "(($1) => { return $1[\"primaries\"]; })"
js_getPrimaries :: VideoColorSpace -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/primaries MDN VideoColorSpace.primaries documentation>
getPrimaries :: (MonadDOM m) => VideoColorSpace -> m (Maybe VideoColorPrimaries)
getPrimaries self = liftDOM (((js_getPrimaries (self)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/primaries MDN VideoColorSpace.primaries documentation>
getPrimariesUnsafe :: (MonadDOM m, HasCallStack) => VideoColorSpace -> m VideoColorPrimaries
getPrimariesUnsafe self = liftDOM ((((js_getPrimaries (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/primaries MDN VideoColorSpace.primaries documentation>
getPrimariesUnchecked :: (MonadDOM m) => VideoColorSpace -> m VideoColorPrimaries
getPrimariesUnchecked self = liftDOM ((pFromJSVal <$> (js_getPrimaries (self))))
foreign import javascript unsafe "(($1) => { return $1[\"transfer\"]; })"
js_getTransfer :: VideoColorSpace -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/transfer MDN VideoColorSpace.transfer documentation>
getTransfer :: (MonadDOM m) => VideoColorSpace -> m (Maybe VideoTransferCharacteristics)
getTransfer self = liftDOM (((js_getTransfer (self)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/transfer MDN VideoColorSpace.transfer documentation>
getTransferUnsafe :: (MonadDOM m, HasCallStack) => VideoColorSpace -> m VideoTransferCharacteristics
getTransferUnsafe self = liftDOM ((((js_getTransfer (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/transfer MDN VideoColorSpace.transfer documentation>
getTransferUnchecked :: (MonadDOM m) => VideoColorSpace -> m VideoTransferCharacteristics
getTransferUnchecked self = liftDOM ((pFromJSVal <$> (js_getTransfer (self))))
foreign import javascript unsafe "(($1) => { return $1[\"matrix\"]; })"
js_getMatrix :: VideoColorSpace -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/matrix MDN VideoColorSpace.matrix documentation>
getMatrix :: (MonadDOM m) => VideoColorSpace -> m (Maybe VideoMatrixCoefficients)
getMatrix self = liftDOM (((js_getMatrix (self)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/matrix MDN VideoColorSpace.matrix documentation>
getMatrixUnsafe :: (MonadDOM m, HasCallStack) => VideoColorSpace -> m VideoMatrixCoefficients
getMatrixUnsafe self = liftDOM ((((js_getMatrix (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/matrix MDN VideoColorSpace.matrix documentation>
getMatrixUnchecked :: (MonadDOM m) => VideoColorSpace -> m VideoMatrixCoefficients
getMatrixUnchecked self = liftDOM ((pFromJSVal <$> (js_getMatrix (self))))
foreign import javascript unsafe "(($1) => { return $1[\"fullRange\"]; })"
js_getFullRange :: VideoColorSpace -> IO JSVal
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/fullRange MDN VideoColorSpace.fullRange documentation>
getFullRange :: (MonadDOM m) => VideoColorSpace -> m (Maybe Bool)
getFullRange self = liftDOM (((js_getFullRange (self)) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/fullRange MDN VideoColorSpace.fullRange documentation>
getFullRangeUnsafe :: (MonadDOM m, HasCallStack) => VideoColorSpace -> m Bool
getFullRangeUnsafe self = liftDOM ((((js_getFullRange (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/VideoColorSpace/fullRange MDN VideoColorSpace.fullRange documentation>
getFullRangeUnchecked :: (MonadDOM m) => VideoColorSpace -> m Bool
getFullRangeUnchecked self = liftDOM ((pFromJSVal <$> (js_getFullRange (self))))