Filter Parameters:
Name | Type | Opt/Reqd | Range ======================================================================================= FE2_OVERLAY_FILE | String | Required | N/A FE2_OVERLAY_MASK_XY | Boolean | Optional | [on2false,on2true] FE2_OVERLAY_MASK_X | Numeric | Optional | [0,video width) FE2_OVERLAY_MASK_Y | Numeric | Optional | [0,video height) FE2_OVERLAY_MASK_RGB | Boolean | Optional | [on2false,on2true] FE2_OVERLAY_MASK_R | Numeric | Optional | [0,255] FE2_OVERLAY_MASK_G | Numeric | Optional | [0,255] FE2_OVERLAY_MASK_B | Numeric | Optional | [0,255] FE2_OVERLAY_POS | Numeric | Optional | [FE2_OverlayPositionMode] FE2_OVERLAY_POS_X | Numeric | Optional | [0,video width) FE2_OVERLAY_POS_Y | Numeric | Optional | [0,video height)
Example Usage:
sc = Flix2_AddFilter(&filter, flix, FE2_FILTER_OVERLAY); //apply image.png to the top left of the output video if(sc == ON2_OK) sc = Flix2_FilterSetParamAsStr(filter, FE2_OVERLAY_FILE, "/tmp/image.png");
Deprecated functions | |
on2sc | overlay_options_Reset (const FLIX2HANDLE flix) |
Resets the overlay options. | |
on2sc | overlay_options_GetUseOverlay (const FLIX2HANDLE flix, on2bool *pUseOverlay) |
Determines if an overlay is to be used. | |
on2sc | overlay_options_SetUseOverlay (FLIX2HANDLE flix, const on2bool bUseOverlay) |
Enables or disables overlay usage. | |
on2sc | overlay_options_GetOverlayPath (const FLIX2HANDLE flix, on2tc *pOverlayFilePath, int32_t *pLen) |
Returns the path to the overlay image file. | |
on2sc | overlay_options_SetOverlayPath (FLIX2HANDLE flix, const on2tc *pOverlayFilePath) |
Set the path to the overlay image file. | |
on2sc | overlay_options_GetMaskPixelXY (const FLIX2HANDLE flix, int32_t *pMaskPixelX, int32_t *pMaskPixelY) |
Return the X and Y coordinates of the mask pixel. | |
on2sc | overlay_options_SetMaskPixelXY (FLIX2HANDLE flix, int32_t maskPixelX, int32_t maskPixelY) |
Set the X and Y coordinates of the mask pixel. | |
on2sc | overlay_options_GetMaskPixelRGB (FLIX2HANDLE flix, uint8_t *pMaskPixelR, uint8_t *pMaskPixelG, uint8_t *pMaskPixelB) |
Return the Red, Green, and Blue component values of the mask pixel. | |
on2sc | overlay_options_SetMaskPixelRGB (FLIX2HANDLE flix, uint8_t maskPixelR, uint8_t maskPixelG, uint8_t maskPixelB) |
Set the Red, Green, and Blue component values of the mask pixel. | |
on2sc | overlay_options_GetOverlayPosition (FLIX2HANDLE flix, FE2_OverlayPositionMode *pMode, uint32_t *pX, uint32_t *pY) |
Return the overlay position. | |
on2sc | overlay_options_SetOverlayPosition (FLIX2HANDLE flix, FE2_OverlayPositionMode mode, uint32_t x, uint32_t y) |
Set the overlay position. | |
Defines | |
#define | FE2_FILTER_OVERLAY |
Filter name for use with Flix2_AddFilter(). | |
#define | FE2_OVERLAY_FILE |
Set the path to the overlay image file. | |
#define | FE2_OVERLAY_MASK_XY |
Use the pixel at coordinates (FE2_OVERLAY_MASK_X,FE2_OVERLAY_MASK_Y) to determine the transparent color. | |
#define | FE2_OVERLAY_MASK_X |
X coordinate of pixel to use for transparency. | |
#define | FE2_OVERLAY_MASK_Y |
Y coordinate of pixel to use for transparency. | |
#define | FE2_OVERLAY_MASK_RGB |
Use the RGB value (FE2_OVERLAY_MASK_R, FE2_OVERLAY_MASK_G, FE2_OVERLAY_MASK_B) as the transparency color. | |
#define | FE2_OVERLAY_MASK_R |
Red component of the transparency color. | |
#define | FE2_OVERLAY_MASK_G |
Green component of the transparency color. | |
#define | FE2_OVERLAY_MASK_B |
Blue component of the transparency color. | |
#define | FE2_OVERLAY_POS |
Set the overlay position. Valid modes are defined by FE2_OverlayPositionMode. | |
#define | FE2_OVERLAY_POS_X |
X coordinate of overlay top left on video. | |
#define | FE2_OVERLAY_POS_Y |
Y coordinate of overlay top left on video. | |
Enumerations | |
enum | FE2_OverlayPositionMode { FE2_OVERLAY_POS_MODE_TOPLEFT, FE2_OVERLAY_POS_MODE_BOTLEFT, FE2_OVERLAY_POS_MODE_CENTER, FE2_OVERLAY_POS_MODE_TOPRIGHT, FE2_OVERLAY_POS_MODE_BOTRIGHT, FE2_OVERLAY_POS_MODE_XY } |
Position modes for use with FE2_OVERLAY_POS. More... |
#define FE2_FILTER_OVERLAY |
#define FE2_OVERLAY_FILE |
Set the path to the overlay image file.
FE2_OVERLAY_FILE
must be accessible in this context. An absolute path should be given to help ensure this is the case. #define FE2_OVERLAY_MASK_B |
Blue component of the transparency color.
#define FE2_OVERLAY_MASK_G |
Green component of the transparency color.
#define FE2_OVERLAY_MASK_R |
Red component of the transparency color.
#define FE2_OVERLAY_MASK_RGB |
Use the RGB value (FE2_OVERLAY_MASK_R, FE2_OVERLAY_MASK_G, FE2_OVERLAY_MASK_B) as the transparency color.
#define FE2_OVERLAY_MASK_X |
#define FE2_OVERLAY_MASK_XY |
Use the pixel at coordinates (FE2_OVERLAY_MASK_X,FE2_OVERLAY_MASK_Y) to determine the transparent color.
#define FE2_OVERLAY_MASK_Y |
#define FE2_OVERLAY_POS |
Set the overlay position. Valid modes are defined by FE2_OverlayPositionMode.
#define FE2_OVERLAY_POS_X |
X coordinate of overlay top left on video.
#define FE2_OVERLAY_POS_Y |
Y coordinate of overlay top left on video.
Position modes for use with FE2_OVERLAY_POS.
on2sc overlay_options_GetMaskPixelRGB | ( | FLIX2HANDLE | flix, | |
uint8_t * | pMaskPixelR, | |||
uint8_t * | pMaskPixelG, | |||
uint8_t * | pMaskPixelB | |||
) |
Return the Red, Green, and Blue component values of the mask pixel.
[in] | flix | Handle to the flix engine returned from Flix2_Create() or Flix2_CreateEx() |
[out] | pMaskPixelR | pointer to variable that will receive the R value |
[out] | pMaskPixelG | pointer to variable that will receive the G value |
[out] | pMaskPixelB | pointer to variable that will receive the B value |
ON2_OK | the color component values were retrieved successfully | |
ON2_INVALID_PARAMS | a precondition failed | |
ON2_NET_ERROR | the underlying communication layer failed |
NULL
NULL
NULL
NULL
0
. on2sc overlay_options_GetMaskPixelXY | ( | const FLIX2HANDLE | flix, | |
int32_t * | pMaskPixelX, | |||
int32_t * | pMaskPixelY | |||
) |
Return the X and Y coordinates of the mask pixel.
[in] | flix | Handle to the flix engine returned from Flix2_Create() or Flix2_CreateEx() |
[out] | pMaskPixelX | pointer to variable that will receive the X value |
[out] | pMaskPixelY | pointer to variable that will receive the Y value |
ON2_OK | the coordinate values were retrieved successfully | |
ON2_INVALID_PARAMS | a precondition failed | |
ON2_NET_ERROR | the underlying communication layer failed |
NULL
NULL
NULL
0
. The color at the specified coordinate will become transparent when the overlay image is drawn on the video image.
on2sc overlay_options_GetOverlayPath | ( | const FLIX2HANDLE | flix, | |
on2tc * | pOverlayFilePath, | |||
int32_t * | pLen | |||
) |
Returns the path to the overlay image file.
[in] | flix | Handle to the flix engine returned from Flix2_Create() or Flix2_CreateEx() |
[out] | pOverlayFilePath | string that will receive the file path |
[in,out] | pLen | length of pOverlayFilePath |
ON2_OK | success | |
ON2_INVALID_PARAMS | a precondition failed | |
ON2_NET_ERROR | the underlying communication layer failed |
NULL
NULL
pOverlayFilePath
is not NULL
, the value pointed to by pLen must be set to the maximum number of characters that can be written to pOverlayFilePath
.
If pOverlayFilePath
is NULL
, pLen
will be set to the length of the path to the overlay image
on2sc overlay_options_GetOverlayPosition | ( | FLIX2HANDLE | flix, | |
FE2_OverlayPositionMode * | pMode, | |||
uint32_t * | pX, | |||
uint32_t * | pY | |||
) |
Return the overlay position.
[in] | flix | Handle to the flix engine returned from Flix2_Create() or Flix2_CreateEx() |
[out] | pMode | pointer to variable that will receive the mode value |
[out] | pX | pointer to variable that will receive the X value |
[out] | pY | pointer to variable that will receive the Y value |
ON2_OK | the values were retrieved successfully | |
ON2_INVALID_PARAMS | a precondition failed | |
ON2_NET_ERROR | the underlying communication layer failed |
NULL
NULL
NULL
NULL
0
. on2sc overlay_options_GetUseOverlay | ( | const FLIX2HANDLE | flix, | |
on2bool * | pUseOverlay | |||
) |
Determines if an overlay is to be used.
[in] | flix | Handle to the flix engine returned from Flix2_Create() or Flix2_CreateEx() |
[out] | pUseOverlay | pointer to the on2bool variable that will receive the usage state |
ON2_OK | pUseOverlay was set successfully | |
ON2_INVALID_PARAMS | a precondition failed | |
ON2_NET_ERROR | the underlying communication layer failed |
NULL
NULL
on2sc overlay_options_Reset | ( | const FLIX2HANDLE | flix | ) |
Resets the overlay options.
[in] | flix | Handle to the flix engine returned from Flix2_Create() or Flix2_CreateEx() |
ON2_OK | reset of overlay options was successful | |
ON2_INVALID_PARAMS | the precondition failed | |
ON2_NET_ERROR | the underlying communication layer failed |
NULL
on2sc overlay_options_SetMaskPixelRGB | ( | FLIX2HANDLE | flix, | |
uint8_t | maskPixelR, | |||
uint8_t | maskPixelG, | |||
uint8_t | maskPixelB | |||
) |
Set the Red, Green, and Blue component values of the mask pixel.
[in] | flix | Handle to the flix engine returned from Flix2_Create() or Flix2_CreateEx() |
[in] | maskPixelR | the R component value |
[in] | maskPixelG | the G component value |
[in] | maskPixelB | the B component value |
ON2_OK | the component values were set successfully | |
ON2_INVALID_PARAMS | the precondition failed | |
ON2_NET_ERROR | the underlying communication layer failed |
NULL
Once this function has been called successfully, overlay_options_Reset() must be called to turn transparency off.
Calling this method will disable masking based on XY coordinate.
Using a PNG or bitmap with full alpha channel will produce better results than using a transparency color.
If using this method to add an overlay to video with an existing alpha channel, the transparent portions of the overlay will be transparent in the output video. Opaque portions of the overlay will be averaged with the existing alpha data.
on2sc overlay_options_SetMaskPixelXY | ( | FLIX2HANDLE | flix, | |
int32_t | maskPixelX, | |||
int32_t | maskPixelY | |||
) |
Set the X and Y coordinates of the mask pixel.
[in] | flix | Handle to the flix engine returned from Flix2_Create() or Flix2_CreateEx() |
[in] | maskPixelX | the X coordinate value |
[in] | maskPixelY | the Y coordinate value |
ON2_OK | the coordinate values were set successfully | |
ON2_INVALID_PARAMS | the precondition failed | |
ON2_NET_ERROR | the underlying communication layer failed |
NULL
Once this function has been called successfully, overlay_options_Reset() must be called to turn transparency off.
Calling this method will disable masking based on RGB components.
Using a PNG or bitmap with full alpha channel will produce better results than using a transparency color.
If using this method to add an overlay to video with an existing alpha channel, the transparent portions of the overlay will be transparent in the output video. Opaque portions of the overlay will be averaged with the existing alpha data.
on2sc overlay_options_SetOverlayPath | ( | FLIX2HANDLE | flix, | |
const on2tc * | pOverlayFilePath | |||
) |
Set the path to the overlay image file.
[in] | flix | Handle to the flix engine returned from Flix2_Create() or Flix2_CreateEx() |
[in] | pOverlayFilePath | the path to the overlay image |
ON2_OK | the path to the overlay image was set successfully | |
ON2_INVALID_PARAMS | a precondition failed | |
ON2_NET_ERROR | the underlying communication layer failed |
NULL
NULL
Only PNG images, 24 bit bitmaps, and 32 bit bitmaps are supported. Use of PNG images is highly recommended.
Images with an uneven width or uneven height will be cropped.
Overlay images larger than the video image will be cropped.
When both the video and overlay images contain an alpha channel, the overlay and video alpha will be averaged. For example, if the video at the overlay position was fully transparent, and the overlay was fully opaque, the region of the exported video where the overlay was placed would become 50% opaque.
on2sc overlay_options_SetOverlayPosition | ( | FLIX2HANDLE | flix, | |
FE2_OverlayPositionMode | mode, | |||
uint32_t | x, | |||
uint32_t | y | |||
) |
Set the overlay position.
[in] | flix | Handle to the flix engine returned from Flix2_Create() or Flix2_CreateEx() |
[out] | mode | the position mode |
[out] | x | the x coordinate value |
[out] | y | the y coordinate value |
ON2_OK | success | |
ON2_INVALID_PARAMS | the precondition failed | |
ON2_NET_ERROR | the underlying communication layer failed |
NULL
mode
is equal to FE2_OVERLAY_POS_MODE_XY.
If mode
is equal to FE2_OVERLAY_POS_MODE_XY, and either coordinate value is invalid (x
>
video width or y
>
video height), the invalid coordinate will be set to 0
.
If the the value of the x
and/or y
coordinates cause any portion of the overlay to be outside of the video image bounds, the portion of the overlay image that is out of bounds will be cropped.
on2sc overlay_options_SetUseOverlay | ( | FLIX2HANDLE | flix, | |
const on2bool | bUseOverlay | |||
) |
Enables or disables overlay usage.
[in] | flix | Handle to the flix engine returned from Flix2_Create() or Flix2_CreateEx() |
[in] | bUseOverlay | on2bool value set to the desired overlay state |
ON2_OK | the overlay status was changed successfully | |
ON2_INVALID_PARAMS | the precondition failed | |
ON2_NET_ERROR | the underlying communication layer failed |
NULL
bUseOverlay
to on2true to enable overlay usage. Set bUseOverlay
to on2false to disable usage. Only PNG images, 24 bit bitmaps, and 32 bit bitmaps are supported. Use of PNG images is highly recommended.
Images with an uneven width or uneven height will be cropped.
Overlay images larger than the video image will be cropped.
When both the video and overlay images contain an alpha channel, the overlay and video alpha will be averaged. For example, if the video at the overlay position was fully transparent, and the overlay was fully opaque, the region of the exported video where the overlay was placed would become 50% opaque.