Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
An opaque video overlay rectangle object. A rectangle contains a single overlay rectangle which can be added to a composition.
Synopsis
- newtype VideoOverlayRectangle = VideoOverlayRectangle (ManagedPtr VideoOverlayRectangle)
- videoOverlayRectangleCopy :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> m VideoOverlayRectangle
- videoOverlayRectangleGetFlags :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> m [VideoOverlayFormatFlags]
- videoOverlayRectangleGetGlobalAlpha :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> m Float
- videoOverlayRectangleGetPixelsArgb :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> [VideoOverlayFormatFlags] -> m Buffer
- videoOverlayRectangleGetPixelsAyuv :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> [VideoOverlayFormatFlags] -> m Buffer
- videoOverlayRectangleGetPixelsRaw :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> [VideoOverlayFormatFlags] -> m Buffer
- videoOverlayRectangleGetPixelsUnscaledArgb :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> [VideoOverlayFormatFlags] -> m Buffer
- videoOverlayRectangleGetPixelsUnscaledAyuv :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> [VideoOverlayFormatFlags] -> m Buffer
- videoOverlayRectangleGetPixelsUnscaledRaw :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> [VideoOverlayFormatFlags] -> m Buffer
- videoOverlayRectangleGetRenderRectangle :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> m (Bool, Int32, Int32, Word32, Word32)
- videoOverlayRectangleGetSeqnum :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> m Word32
- videoOverlayRectangleNewRaw :: (HasCallStack, MonadIO m) => Buffer -> Int32 -> Int32 -> Word32 -> Word32 -> [VideoOverlayFormatFlags] -> m VideoOverlayRectangle
- videoOverlayRectangleSetGlobalAlpha :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> Float -> m ()
- videoOverlayRectangleSetRenderRectangle :: (HasCallStack, MonadIO m) => VideoOverlayRectangle -> Int32 -> Int32 -> Word32 -> Word32 -> m ()
Exported types
newtype VideoOverlayRectangle Source #
Memory-managed wrapper type.
VideoOverlayRectangle (ManagedPtr VideoOverlayRectangle) |
Instances
Methods
Click to display all available methods, including inherited ones
copy
videoOverlayRectangleCopy Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> m VideoOverlayRectangle | Returns: a new |
Makes a copy of rectangle
, so that it is possible to modify it
(e.g. to change the render co-ordinates or render dimension). The
actual overlay pixel data buffers contained in the rectangle are not
copied.
getFlags
videoOverlayRectangleGetFlags Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> m [VideoOverlayFormatFlags] | Returns: the |
Retrieves the flags associated with a VideoOverlayRectangle
.
This is useful if the caller can handle both premultiplied alpha and
non premultiplied alpha, for example. By knowing whether the rectangle
uses premultiplied or not, it can request the pixel data in the format
it is stored in, to avoid unnecessary conversion.
getGlobalAlpha
videoOverlayRectangleGetGlobalAlpha Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> m Float | Returns: the global-alpha value associated with the rectangle. |
Retrieves the global-alpha value associated with a VideoOverlayRectangle
.
getPixelsArgb
videoOverlayRectangleGetPixelsArgb Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> [VideoOverlayFormatFlags] |
|
-> m Buffer | Returns: a |
No description available in the introspection data.
getPixelsAyuv
videoOverlayRectangleGetPixelsAyuv Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> [VideoOverlayFormatFlags] |
|
-> m Buffer | Returns: a |
No description available in the introspection data.
getPixelsRaw
videoOverlayRectangleGetPixelsRaw Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> [VideoOverlayFormatFlags] |
|
-> m Buffer | Returns: a |
No description available in the introspection data.
getPixelsUnscaledArgb
videoOverlayRectangleGetPixelsUnscaledArgb Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> [VideoOverlayFormatFlags] |
|
-> m Buffer | Returns: a |
Retrieves the pixel data as it is. This is useful if the caller can
do the scaling itself when handling the overlaying. The rectangle will
need to be scaled to the render dimensions, which can be retrieved using
videoOverlayRectangleGetRenderRectangle
.
getPixelsUnscaledAyuv
videoOverlayRectangleGetPixelsUnscaledAyuv Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> [VideoOverlayFormatFlags] |
|
-> m Buffer | Returns: a |
Retrieves the pixel data as it is. This is useful if the caller can
do the scaling itself when handling the overlaying. The rectangle will
need to be scaled to the render dimensions, which can be retrieved using
videoOverlayRectangleGetRenderRectangle
.
getPixelsUnscaledRaw
videoOverlayRectangleGetPixelsUnscaledRaw Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> [VideoOverlayFormatFlags] |
|
-> m Buffer | Returns: a |
Retrieves the pixel data as it is. This is useful if the caller can
do the scaling itself when handling the overlaying. The rectangle will
need to be scaled to the render dimensions, which can be retrieved using
videoOverlayRectangleGetRenderRectangle
.
getRenderRectangle
videoOverlayRectangleGetRenderRectangle Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> m (Bool, Int32, Int32, Word32, Word32) | Returns: TRUE if valid render dimensions were retrieved. |
Retrieves the render position and render dimension of the overlay rectangle on the video.
getSeqnum
videoOverlayRectangleGetSeqnum Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> m Word32 | Returns: the sequence number of |
Returns the sequence number of this rectangle. Sequence numbers are monotonically increasing and unique for overlay compositions and rectangles (meaning there will never be a rectangle with the same sequence number as a composition).
Using the sequence number of a rectangle as an indicator for changed
pixel-data of a rectangle is dangereous. Some API calls, like e.g.
videoOverlayRectangleSetGlobalAlpha
, automatically update
the per rectangle sequence number, which is misleading for renderers/
consumers, that handle global-alpha themselves. For them the
pixel-data returned by gst_video_overlay_rectangle_get_pixels_*()
won't be different for different global-alpha values. In this case a
renderer could also use the GstBuffer pointers as a hint for changed
pixel-data.
newRaw
videoOverlayRectangleNewRaw Source #
:: (HasCallStack, MonadIO m) | |
=> Buffer |
|
-> Int32 |
|
-> Int32 |
|
-> Word32 |
|
-> Word32 |
|
-> [VideoOverlayFormatFlags] |
|
-> m VideoOverlayRectangle | Returns: a new |
Creates a new video overlay rectangle with ARGB or AYUV pixel data.
The layout in case of ARGB of the components in memory is B-G-R-A
on little-endian platforms
(corresponding to GST_VIDEO_FORMAT_BGRA
) and A-R-G-B on big-endian
platforms (corresponding to GST_VIDEO_FORMAT_ARGB
). In other words,
pixels are treated as 32-bit words and the lowest 8 bits then contain
the blue component value and the highest 8 bits contain the alpha
component value. Unless specified in the flags, the RGB values are
non-premultiplied. This is the format that is used by most hardware,
and also many rendering libraries such as Cairo, for example.
The pixel data buffer must have VideoMeta
set.
setGlobalAlpha
videoOverlayRectangleSetGlobalAlpha Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> Float |
|
-> m () |
Sets the global alpha value associated with a VideoOverlayRectangle
. Per-
pixel alpha values are multiplied with this value. Valid
values: 0 <= global_alpha <= 1; 1 to deactivate.
rectangle
must be writable, meaning its refcount must be 1. You can
make the rectangles inside a VideoOverlayComposition
writable using
videoOverlayCompositionMakeWritable
or
videoOverlayCompositionCopy
.
setRenderRectangle
videoOverlayRectangleSetRenderRectangle Source #
:: (HasCallStack, MonadIO m) | |
=> VideoOverlayRectangle |
|
-> Int32 |
|
-> Int32 |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Sets the render position and dimensions of the rectangle on the video. This function is mainly for elements that modify the size of the video in some way (e.g. through scaling or cropping) and need to adjust the details of any overlays to match the operation that changed the size.
rectangle
must be writable, meaning its refcount must be 1. You can
make the rectangles inside a VideoOverlayComposition
writable using
videoOverlayCompositionMakeWritable
or
videoOverlayCompositionCopy
.