Skip to main content

Module pgs

Module pgs 

Source
Expand description

PGS (Presentation Graphic Stream) subtitle format parsing and rendering.

This module implements the Blu-ray PGS subtitle format (.sup files).

Structs§

AssembledObject
Assembled object from one or more ObjectDefinitionSegments.
CompositionObject
Composition object reference within a presentation.
DisplaySet
A display set contains all segments for a single subtitle update.
ObjectDefinitionSegment
Object Definition Segment contains RLE-encoded bitmap data.
PaletteDefinitionSegment
Palette Definition Segment contains color palette entries.
PgsParser
PGS subtitle parser and renderer.
PresentationCompositionSegment
Presentation Composition Segment contains display parameters.
SubtitleComposition
A single subtitle composition element.
SubtitleFrame
A complete subtitle frame with all compositions.
WindowDefinition
Window definition specifies the on-screen rectangle for rendering.
WindowDefinitionSegment
Window Definition Segment contains one or more window definitions.

Enums§

CompositionState
Composition state indicates how the display set should be processed.
SegmentType
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.