ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/VideoFrameCopyToOptions.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.VideoFrameCopyToOptions
(js_newVideoFrameCopyToOptions, js_setRect, js_getRect, js_setLayout, js_getLayout, js_setFormat, js_getFormat, js_setColorSpace, js_getColorSpace, newVideoFrameCopyToOptions, setRect, getRect, getRectUnsafe, getRectUnchecked, setLayout, getLayout, getLayoutUnsafe, getLayoutUnchecked, setFormat, getFormat, getFormatUnsafe, getFormatUnchecked, setColorSpace, getColorSpace, getColorSpaceUnsafe, getColorSpaceUnchecked, VideoFrameCopyToOptions(..), gTypeVideoFrameCopyToOptions)
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_newVideoFrameCopyToOptions :: IO VideoFrameCopyToOptions
-- | <https://w3c.github.io/webcodecs/#dictdef-videoframecopytooptions VideoFrameCopyToOptions specification>
newVideoFrameCopyToOptions :: (MonadDOM m) => m VideoFrameCopyToOptions
newVideoFrameCopyToOptions = liftDOM ((js_newVideoFrameCopyToOptions))
foreign import javascript safe "(($1, $2) => { $1[\"rect\"] = $2; })"
js_setRect :: VideoFrameCopyToOptions -> DOMRectInit -> IO ()
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-rect VideoFrameCopyToOptions.rect specification>
setRect :: (MonadDOM m) => VideoFrameCopyToOptions -> DOMRectInit -> m ()
setRect self val = liftDOM (void ((js_setRect (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"rect\"]; })"
js_getRect :: VideoFrameCopyToOptions -> IO JSVal
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-rect VideoFrameCopyToOptions.rect specification>
getRect :: (MonadDOM m) => VideoFrameCopyToOptions -> m (Maybe DOMRectInit)
getRect self = liftDOM (((js_getRect (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-rect VideoFrameCopyToOptions.rect specification>
getRectUnsafe :: (MonadDOM m, HasCallStack) => VideoFrameCopyToOptions -> m DOMRectInit
getRectUnsafe self = liftDOM ((((js_getRect (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-rect VideoFrameCopyToOptions.rect specification>
getRectUnchecked :: (MonadDOM m) => VideoFrameCopyToOptions -> m DOMRectInit
getRectUnchecked self = liftDOM ((pFromJSVal <$> (js_getRect (self))))
foreign import javascript safe "(($1, $2) => { $1[\"layout\"] = $2; })"
js_setLayout :: VideoFrameCopyToOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-layout VideoFrameCopyToOptions.layout specification>
setLayout :: (MonadDOM m) => VideoFrameCopyToOptions -> [PlaneLayout] -> m ()
setLayout self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setLayout (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"layout\"]; })"
js_getLayout :: VideoFrameCopyToOptions -> IO JSVal
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-layout VideoFrameCopyToOptions.layout specification>
getLayout :: (MonadDOM m) => VideoFrameCopyToOptions -> m (Maybe [PlaneLayout])
getLayout self = liftDOM (((js_getLayout (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-layout VideoFrameCopyToOptions.layout specification>
getLayoutUnsafe :: (MonadDOM m, HasCallStack) => VideoFrameCopyToOptions -> m [PlaneLayout]
getLayoutUnsafe self = liftDOM ((((js_getLayout (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-layout VideoFrameCopyToOptions.layout specification>
getLayoutUnchecked :: (MonadDOM m) => VideoFrameCopyToOptions -> m [PlaneLayout]
getLayoutUnchecked self = liftDOM (((js_getLayout (self)) >>= fromJSValUnchecked))
foreign import javascript safe "(($1, $2) => { $1[\"format\"] = $2; })"
js_setFormat :: VideoFrameCopyToOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-format VideoFrameCopyToOptions.format specification>
setFormat :: (MonadDOM m) => VideoFrameCopyToOptions -> VideoPixelFormat -> m ()
setFormat self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setFormat (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"format\"]; })"
js_getFormat :: VideoFrameCopyToOptions -> IO JSVal
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-format VideoFrameCopyToOptions.format specification>
getFormat :: (MonadDOM m) => VideoFrameCopyToOptions -> m (Maybe VideoPixelFormat)
getFormat self = liftDOM (((js_getFormat (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-format VideoFrameCopyToOptions.format specification>
getFormatUnsafe :: (MonadDOM m, HasCallStack) => VideoFrameCopyToOptions -> m VideoPixelFormat
getFormatUnsafe self = liftDOM ((((js_getFormat (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-format VideoFrameCopyToOptions.format specification>
getFormatUnchecked :: (MonadDOM m) => VideoFrameCopyToOptions -> m VideoPixelFormat
getFormatUnchecked self = liftDOM ((pFromJSVal <$> (js_getFormat (self))))
foreign import javascript safe "(($1, $2) => { $1[\"colorSpace\"] = $2; })"
js_setColorSpace :: VideoFrameCopyToOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-colorspace VideoFrameCopyToOptions.colorSpace specification>
setColorSpace :: (MonadDOM m) => VideoFrameCopyToOptions -> PredefinedColorSpace -> m ()
setColorSpace self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setColorSpace (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"colorSpace\"]; })"
js_getColorSpace :: VideoFrameCopyToOptions -> IO JSVal
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-colorspace VideoFrameCopyToOptions.colorSpace specification>
getColorSpace :: (MonadDOM m) => VideoFrameCopyToOptions -> m (Maybe PredefinedColorSpace)
getColorSpace self = liftDOM (((js_getColorSpace (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-colorspace VideoFrameCopyToOptions.colorSpace specification>
getColorSpaceUnsafe :: (MonadDOM m, HasCallStack) => VideoFrameCopyToOptions -> m PredefinedColorSpace
getColorSpaceUnsafe self = liftDOM ((((js_getColorSpace (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webcodecs/#dom-videoframecopytooptions-colorspace VideoFrameCopyToOptions.colorSpace specification>
getColorSpaceUnchecked :: (MonadDOM m) => VideoFrameCopyToOptions -> m PredefinedColorSpace
getColorSpaceUnchecked self = liftDOM ((pFromJSVal <$> (js_getColorSpace (self))))