Expand description
PGS (Presentation Graphic Stream) subtitle format parsing and rendering.
This module implements the Blu-ray PGS subtitle format (.sup files).
Structs§
- Assembled
Object - Assembled object from one or more ObjectDefinitionSegments.
- Composition
Object - Composition object reference within a presentation.
- Display
Set - A display set contains all segments for a single subtitle update.
- Object
Definition Segment - Object Definition Segment contains RLE-encoded bitmap data.
- Palette
Definition Segment - Palette Definition Segment contains color palette entries.
- PgsParser
- PGS subtitle parser and renderer.
- Presentation
Composition Segment - Presentation Composition Segment contains display parameters.
- Subtitle
Composition - A single subtitle composition element.
- Subtitle
Frame - A complete subtitle frame with all compositions.
- Window
Definition - Window definition specifies the on-screen rectangle for rendering.
- Window
Definition Segment - Window Definition Segment contains one or more window definitions.
Enums§
- Composition
State - Composition state indicates how the display set should be processed.
- Segment
Type - Segment type identifiers as defined in the PGS specification.
Functions§
- apply_
palette - Apply a palette to indexed pixel data, producing RGBA output. This is used when we’ve cached the indexed pixels and need to apply a new palette.
- apply_
palette_ rgba_ bytes - Apply a palette to indexed pixel data, producing RGBA bytes.
- decode_
rle_ to_ indexed - Decode RLE-encoded data to indexed pixel values (palette indices). This is optimized for high-frequency subtitle animations where we want to decode once and apply different palettes quickly.
- decode_
rle_ to_ rgba - Decode RLE-encoded data directly to RGBA pixels using a palette lookup. This is the fast path when palette doesn’t change between frames.