Struct SubtitleRect
Represents a rectangular subtitle area and its associated metadata, such as position, size, color count, and text or bitmap data. This struct wraps an FFmpeg.AutoGen._AVSubtitleRect pointer from FFmpeg.
Inherited Members
Namespace: FFmpeg.Subtitles
Assembly: FFmpeg.dll
Syntax
public struct SubtitleRect
Properties
View SourceASS
Gets or sets the ASS/SSA formatted subtitle content. This field is used for complex, formatted subtitles (e.g., with styling, positioning).
Declaration
public string ASS { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
BitmapData
Gets a span over the bitmap data associated with the subtitle. This span references up to 4 planes of image data for bitmap subtitles.
Declaration
public Span<nint> BitmapData { get; }
Property Value
| Type | Description |
|---|---|
| Span<nint> |
ColorCount
Gets or sets the number of colors in the subtitle rectangle's color palette. This is only applicable for bitmap subtitles.
Declaration
public int ColorCount { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Height
Gets or sets the height of the subtitle rectangle.
Declaration
public int Height { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
LineSize
Gets a span over the line sizes (stride) for each plane of the bitmap data. This span is used to determine how many bytes each line of the bitmap takes.
Declaration
public Span<int> LineSize { get; }
Property Value
| Type | Description |
|---|---|
| Span<int> |
Text
Gets or sets the plain text subtitle content. This is typically used for simple, unformatted subtitles.
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Type
Gets or sets the type of the subtitle, indicating whether the subtitle is a bitmap, plain text, or formatted text (e.g., ASS).
Declaration
public SubtitleType Type { get; set; }
Property Value
| Type | Description |
|---|---|
| SubtitleType |
Width
Gets or sets the width of the subtitle rectangle.
Declaration
public int Width { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
X
Gets or sets the X-coordinate of the top-left corner of the subtitle rectangle.
Declaration
public int X { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Y
Gets or sets the Y-coordinate of the top-left corner of the subtitle rectangle.
Declaration
public int Y { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
View SourceToString()
Returns a string representation of the subtitle. If plain text is present, it will return that; otherwise, it returns the ASS-formatted content.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The plain text or ASS subtitle content as a string. |