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§
- PgsDisplay
Set - 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. - PgsMemory
Buffer - A memory buffer that supports reading and seeking operations.
- PgsOds
Segment - 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.
- PgsPcs
Segment - PgsPds
Segment - 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.
- PgsPds
Segment Palette Entry - 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. - PgsSegment
Header - Struct representing the header of a PGS segment.
- PgsWds
Segment - Represents a Window Definition Segment (WDS) in a Presentation Graphic Stream (PGS).
- PgsWds
Segment Window Definition - 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.
- Little
Endian - A struct representing the little-endian byte order.
- PgsDisplay
SetState - Enum representing the state of the
PgsDisplaySet
. - PgsOds
Sequence Flag - 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.
- PgsPcs
Composition State - 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.
- PgsPcs
Object Cropped Flag - 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.
- PgsSegment
Type - Represents the type of a segment in a Presentation Graphic Stream (PGS).
Traits§
- Byte
Order - 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.
- Read
Bytes - A trait for reading bytes with support for different byte orders.
Type Aliases§
- Result
- A custom result type used throughout the library.