Crate pgs_parse

Source
Expand description

§PGS Parsing Library

This library provides functionality for parsing PGS (Presentation Graphic Stream) subtitles, commonly used in Blu-ray media. It defines various modules and components needed for reading, decoding, and processing PGS files.

§Example Usage

use pgs_parse::PgsParser;

let parser = PgsParser::parse("subtitle.sup");
match parser {
    Ok(parser) => {
        let ds = parser.get_display_sets();
        // ...
    },
    Err(err) => {
        // ...
    }
}

Structs§

PgsDisplaySet
Struct representing a collection of PGS segments required for rendering a single subtitle frame. The segments include:
PgsFile
A wrapper around a File that includes file metadata and provides methods to read data.
PgsMemoryBuffer
A memory buffer that supports reading and seeking operations.
PgsOdsSegment
Struct representing an Object Definition Segment (ODS) in a PGS file. The ODS contains the actual image data (subtitle graphics) along with metadata.
PgsParser
A parser for PGS files.
PgsPcsSegment
PgsPdsSegment
Struct representing a Palette Definition Segment (PDS) in a PGS file. The PDS defines a color palette that can be used by various objects in the PGS file.
PgsPdsSegmentPaletteEntry
Struct representing an individual palette entry in a PDS. Each palette entry consists of the palette ID and its corresponding color values (Y, Cr, Cb).
PgsReader
A struct for handling the opening of files to create PgsFile instances.
PgsSegmentHeader
Struct representing the header of a PGS segment.
PgsWdsSegment
Represents a Window Definition Segment (WDS) in a Presentation Graphic Stream (PGS).
PgsWdsSegmentWindowDefinition
Represents the definition of a display window within a Window Definition Segment (WDS).

Enums§

BigEndian
A struct representing the big-endian byte order.
Error
Enum representing different error types used in the library.
LittleEndian
A struct representing the little-endian byte order.
PgsDisplaySetState
Enum representing the state of the PgsDisplaySet.
PgsOdsSequenceFlag
Enum representing the sequence flag in an ODS. The sequence flag indicates whether this segment is part of a sequence, and if it is, whether it is the first, last, or both.
PgsPcsCompositionState
Enum representing the composition state of a PCS. The composition state describes whether the segment starts a new display, refreshes an existing display, or updates a display.
PgsPcsObjectCroppedFlag
Enum representing the object cropping flag in a PCS. This flag indicates whether the object (subtitle image) is cropped and whether a forced cropped image should be used.
PgsSegment
Enum representing different types of PGS (Presentation Graphic Stream) segments. These segments are used in Blu-ray subtitles to define various aspects of the subtitle data.
PgsSegmentType
Represents the type of a segment in a Presentation Graphic Stream (PGS).

Traits§

ByteOrder
A trait for handling different byte orders.
PgsRead
A trait for reading data with seeking capabilities.
PgsSeek
A trait for seeking within a read/write context.
ReadBytes
A trait for reading bytes with support for different byte orders.

Type Aliases§

Result
A custom result type used throughout the library.