ILMFVTextOverlay Interface

This is the interface for the LEAD Video Text Overlay Transform.

Data types

typedef [v1_enum] enum TextAlignmentConstants 
{ 
   ALIGN_TOP = 0x01, 
   ALIGN_LEFT = 0x02, 
   ALIGN_RIGHT = 0x04, 
   ALIGN_BOTTOM = 0x08, 
   ALIGN_VCENTER = 0x10, 
   ALIGN_HCENTER = 0x20 
} TextAlignmentConstants; 

Describes possible alignment options.

Constant

Description

ALIGN_TOP

The reference point will be on the top edge of the output window.

ALIGN_LEFT

The reference point will be on the left edge of the output window.

ALIGN_RIGHT

The reference point will be on the right edge of the output window.

ALIGN_BOTTOM

The reference point will be on the bottom edge of the output window.

ALIGN_VCENTER

The reference point will be aligned vertically with the center of the output window.

ALIGN_HCENTER

The reference point will be aligned horizontally with the center of the output window.

typedef [v1_enum] enum ScrollDirectionConstants 
{ 
   SCROLL_LEFT_RIGHT = 1, 
   SCROLL_RIGHT_LEFT = 2, 
   SCROLL_TOP_BOTTOM = 3, 
   SCROLL_BOTTOM_TOP = 4 
} ScrollDirectionConstants; 

Describes possible scrolling options.

Constant

Description

SCROLL_LEFT_RIGHT

Set the scroll direction from left to right.

SCROLL_RIGHT_LEFT

Set the scroll direction from right to left.

SCROLL_TOP_BOTTOM

Set the scroll direction from top to bottom.

SCROLL_BOTTOM_TOP

Set the scroll direction from bottom to top.

typedef [v1_enum] enum PenStyleConstants 
{ 
   PENS_SOLID = 0, 
   PENS_DASH = 1, 
   PENS_DOT = 2, 
   PENS_DASHDOT = 3, 
   PENS_DASHDOTDOT = 4 
} PenStyleConstants; 

Describes possible pen styles.

Constant

Description

PENS_SOLID

The pen is solid.

PENS_DASH

The pen is dashed.

PENS_DOT

The pen is dotted.

PENS_DASHDOT

The pen has alternating dashes and dots.

PENS_DASHDOTDOT

The pen has alternating dashes and double dots.

typedef [v1_enum] enum BrushStyleConstants 
{ 
   BRUSHS_NULL = -1, 
   BRUSHS_SOLID = 0 
   BRUSHS_HORIZONTAL = 1, 
   BRUSHS_VERTICAL = 2, 
   BRUSHS_FDIAGONAL = 3, 
   BRUSHS_BDIAGONAL = 4, 
   BRUSHS_CROSS = 5, 
   BRUSHS_DIAGCROSS = 6, 
} BrushStyleConstants; 

Describes possible brush styles.

Constant

Description

BRUSHS_NULL

The brush is hollow.

BRUSHS_SOLID

The brush is solid.

BRUSHS_HORIZONTAL

The brush is a horizontal hatch brush.

BRUSHS_VERTICAL

The brush is a vertical hatch brush.

BRUSHS_FDIAGONAL

The brush is a 45-degree downward, left-to-right hatch brush.

BRUSHS_BDIAGONAL

The brush is a 45-degree upward, left-to-right hatch brush.

BRUSHS_CROSS

The brush is a horizontal and vertical cross-hatch brush.

BRUSHS_DIAGCROSS

The brush is a 45-degree crosshatch brush.

typedef [v1_enum] enum RotationCenterConstants 
{ 
   ROTATIONCENTER_LEFT_TOP    = 0, 
   ROTATIONCENTER_RIGHT_TOP   = 1, 
   ROTATIONCENTER_CENTER      = 2, 
   ROTATIONCENTER_AUTO        = 3, 
} RotationCenterConstants; 

Describes possible rotation center options.

Constant Description
ROTATIONCENTER_LEFT_TOP Set the rotation center to the left-top point of the text.
ROTATIONCENTER_RIGHT_TOP Set the center of rotation to the right-top point of the text.
ROTATIONCENTER_CENTER Set the center of rotation to the center point of the text.
ROTATIONCENTER_AUTO Set the center of rotation, depending on the alignment. Possible values are:
  Alignment value Rotation state
  ALIGN_LEFT The left top is the center of rotation.
  ALIGN_RIGHT The right top is center of rotation.
  ALIGN_TOP and ALIGN_HCENTER The top and the horizontal center is the center of rotation.
  ALIGN_BOTTOM and ALIGN_HCENTER The bottom and the horizontal center is the center of rotation.
  ALIGN_VCENTER and ALIGN_HCENTER The vertical center and the horizontal center is the center of rotation.

 

Interface Properties

Type

Name

Description

VARIANT_BOOL

EnableTextOverLay

Enables or disables text overlaying. If set to VARIANT_FALSE, the transform will pass the video samples intact.

BSTR

OverlayText

Sets or gets the text to be overlaid over the video stream . The string can be wrapped by setting the WordWrap property to VARIANT_TRUE. The transform accepts the new line sequence \n and translates it to a new line.

BSTR

FontName

Sets or gets the font name. Use one of the installed fonts names. You can use EnumFonts API to enumerate the installed fonts.

long

FontSize

Sets or gets the font size. Possible values range from 1 to 2000. For any value below the lower limit the default value of 10 will be used. For any value beyond the upper limit, the maximum value of 2000 will be used.

long

FontColor

Sets or gets the font foreground color.

long

FontBKColor

Sets or gets the font background color.

VARIANT_BOOL

Bold

Enables or disables the bold font style.

VARIANT_BOOL

Italic

Enables or disables the italic font style.

VARIANT_BOOL

UnderLine

Enables or disables the underline font style.

VARIANT_BOOL

StrikeOut

Enables or disables the strike out font effect.

Long

RotationAngle

Sets or gets the rotation angle for the overlay text. The values range from 0 to 3600. For a multi-line text, each line is rotated independently.

VARIANT_BOOL

EnableXYPosition

Enables or disables text positioning. If this is set to VARIANT_TRUE, then the TextAlignment property will have no effect.

Long

XPos

Sets or gets the text X position.

Long

YPos

Sets or gets the text Y position.

VARIANT_BOOL

EnableTextFromFile

Enables or disables getting the overlay text from a file. To use the OverlayText property, set this property to VARIANT_FALSE. If this property is set to VARIANT_TRUE, then the TextFileName property must contain a valid file name.

BSTR

TextFileName

Sets or gets the LEADTOOLS XML file name that contains the overlay text with special tags.

See the Text Overlay XML File Format for more information on valid tags and how to use them.

TextAlignmentConstants

TextAlignment

Sets or gets the text alignment with respect to the output window. Possible values are one or more (ORed together) of the following:

ALIGN_TOP,
ALIGN_LEFT,
ALIGN_RIGHT,
ALIGN_BOTTOM,
ALIGN_VCENTER, or
ALIGN_HCENTER

VARIANT_BOOL

EnableOutline

Enables or disables the text outline option.

Long

OutlineWidth

Sets or gets the text outline pen width. Valid values range from 1 to 20.

Long

OutlinePenColor

Sets or gets the outline pen color. This is a COLORREF value. You can use the RGB macro to form a COLORREF value from an RGB triple.

Long

OutlineBrushColor

Sets or gets the text outline brush color. The brush is applied to the text body. This is a COLORREF value. You can use the RGB macro to form a COLORREF value from an RGB triple.

VARIANT_BOOL

TransparentOutline

Enables or disables the text outline transparency option. If this is set to VARIANT_TRUE, the area inside the text outline becomes transparent.

PenStyleConstants

PenStyle

Sets or gets the outline text pen style. Possible values are:

PENS_SOLID,
PENS_DASH,
PENS_DOT,
PENS_DASHDOT, or
PENS_DASHDOTDOT.

BrushStyleConstants

BrushStyle

Sets or gets the outline text brush style. The brush is applied to the text body. Possible values are:

BRUSHS_NULL,
BRUSHS_SOLID,
BRUSHS_HORIZONTAL,
BRUSHS_VERTICAL,
BRUSHS_FDIAGONAL,
BRUSHS_BDIAGONAL,
BRUSHS_CROSS, or
BRUSHS_DIAGCROSS.

ScrollDirectionConstants

ScrollDirection

Sets or gets the text scrolling direction. This is valid and has effect only if the EnableTextFromFile property is set to VARIANT_TRUE and the XML file contains the scrolling option. Possible values are:

SCROLL_LEFT_RIGHT,
SCROLL_RIGHT_LEFT,
SCROLL_TOP_BOTTOM, or
SCROLL_BOTTOM_TOP.

VARIANT_BOOL

TextRepeating

Enables or disables the text repeating option. It will cause the text sequence to repeat infinitely. This is valid and has effect only if the EnableTextFromFile property is true.

VARIANT_BOOL

WordWrap

Enables or disables the word wrap option. This is valid and has effect only if the EnableTextFromFile property is true.

VARIANT_BOOL

EnableOpacity

Enables or disables the opacity option.

Long

Opacity

Sets or gets the desired opacity percentage.

VARIANT_BOOL

ViewBackground

Enables or disables viewing the text background.

Long

ViewRectLeft

Sets or gets the left coordinate, in pixels, of the view rectangle. This value is with respect to the video stream dimensions. The overlay text will be displayed within this view rectangle. The default value is zero.

Long

ViewRectRight

Sets or gets the right coordinate, in pixels, of the view rectangle. This value is with respect to the video stream dimensions. The overlay text will be displayed within this view rectangle. The default value is the video stream width.

Long

ViewRectTop

Sets or gets the top (upper) coordinate, in pixels, of the view rectangle. This value is with respect to the video stream dimensions. The overlay text will be displayed within this view rectangle. The default value is zero.

Long

ViewRectBottom

Sets or gets the bottom (lower) coordinate, in pixels, of the view rectangle. This value is with respect to the video stream dimensions. The overlay text will be displayed within this view rectangle. The default value is the video stream height.

VARIANT_BOOL

AutoReposToViewRect

Enables or disables auto repositioning of the overlay text to the view rectangle. If set to VARIANT_TRUE, the transform will use the current values of XPos and YPos with respect to the view rectangle instead of the whole video stream rectangle.

long

AvgCharWidth

Get the average width, in pixels, of one character according to the current font settings.

long

MaxCharWidth

Get the maximum possible width, in pixels, of one character according to the current font settings.

long

CharHeight

Get the height, in pixels, of one character according to the current font settings.

BSTR

CurrentText

This is an internal property. Do not attempt to use it.

RotationCenterConstants

RotationCenter

Determines the text rotation center. Possible values are:

ROTATIONCENTER_LEFT_TOP

ROTATIONCENTER_RIGHT_TOP

ROTATIONCENTER_CENTER

ROTATIONCENTER_AUTO

VARIANT_BOOL

TextAlwaysVisible

Enables or disables the option that handle the text visibility when the text rotated outside the view area.. This is valid only if the EnableXYPosition is disabled.

VARIANT_BOOL

IgnoreHTMLTags

Ignores the HTML tags from the subtitle file.

long

InWidth

Read only. Gets the input video stream width in pixels. Should contain the same value as the OutWidth property.

long

InHeight

Read only. Gets the input video stream height in pixels. Should contain the same value as the OutHeight property.

long

OutWidth

Read only. Gets the output video stream width in pixels. Should contain the same value as the InWidth property.

long

OutHeight

Read only. Gets the output video stream height in pixels. Should contain the same value as the InHeight property.

long

InBits

Read only. Gets the input video stream bits per pixel. Should contain the same value as the OutBits property.

long

 

OutBits

Read only. Gets the input video stream bits per pixel. Should contain the same value as the InBits property.

long

 

CodePage

 

Numeric value for the code page setting that determines the text encoding in .SRT subtitle files.

 

Methods:

HRESULT ResetToDefaults()

Parameters

None.

 

Description

Reset the text overly option values to the default values.

HRESULT LoadAttributes()

Parameters

None.

 

Description

Loads transform settings from the registry. The Media Foundation transforms import the settings from the registry only at creation time. This method will force the transform to re-load its settings from the registry. If the transform has no settings to load from the registry, E_NOTIMPL is returned.

Return

S_OK if successful, S_FALSE otherwis.

HRESULT SaveAttributes()

Parameters

None.

 

Description

Writes transform settings to the registry.

If the transform has no settings to write to the registry, E_NOTIMPL is returned..

Return

S_OK if successful, S_FALSE otherwis.

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Transforms C API Help