The GstBaseTextOverlay
object used for GStreamer's Pango-based plugins (textoverlay
, clockoverlay
, etc.) has a color
property. Its documentation describes it as follows:
“color” guint
Color of the rendered text.
Flags : Read / Write
Default value : -1
A guint
is an unsigned 32-bit integer, but the default value specified here (-1) is signed. The color component order is also unspecified (presumably red, green, blue, and alpha are each allocated eight bits).
Although these plugins use Pango, in Pango colors are represented using the PangoColor
struct (it contains three guint16
values, one for each of red, green, and blue), which doesn't appear to be used in the context of GStreamer.
What is the format of values for GstBaseTextOverlay
's color
property?
The color component order is ARGB, or, in hex notation, 0xAARRGGBB
. For example:
0xFF000000
is opaque black0xFF00FFFF
is opaque cyan (green and blue)0x80FF0000
is translucent red (~50% opacity since 0x80
= 128, roughly half of 255)0x00000000
is transparentThis is mentioned in the description of the outline-color
property:
“outline-color” guint
Color to use for outline the text (big-endian ARGB).
Flags : Read / Write
Default value : -16777216
It's odd that the default values are presented as signed integers given that both properties use the guint
type, but in big-endian form the default values correspond to the following:
color
: -1 = 0xFFFFFFFF
(white)outline-color
: -16777216 = 0xFF000000
(black)