mirror of
https://github.com/zoriya/libpgs-js.git
synced 2026-08-27 00:00:51 +00:00
Not for upstream: this branch only exists so a consumer can depend on the fork straight from git while the `ready` promise waits on a release.
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { SubtitleData } from "./subtitleData";
|
|
/**
|
|
* This handles the low-level PGS loading and rendering. This renderer can operate inside the web worker without being
|
|
* linked to a video element.
|
|
*/
|
|
export declare class Renderer {
|
|
private readonly canvas;
|
|
private readonly context;
|
|
private readonly dirtyArea;
|
|
constructor(canvas: OffscreenCanvas | HTMLCanvasElement);
|
|
/**
|
|
* Renders the given subtitle data to the canvas.
|
|
* @param subtitleData The pre-compiled subtitle data to render.
|
|
*/
|
|
draw(subtitleData?: SubtitleData): void;
|
|
/**
|
|
* Draws the whole subtitle frame to the given context.
|
|
* @param subtitleData The subtitle data to draw.
|
|
* @param dirtyArea If given, it will extend the dirty rect to include the affected subtitle area.
|
|
*/
|
|
private drawSubtitleData;
|
|
/**
|
|
* Draws this subtitle composition to the given context.
|
|
* @param compositionData The subtitle composition data to draw.
|
|
* @param dirtyArea If given, it will extend the dirty rect to include the affected subtitle area.
|
|
*/
|
|
private drawSubtitleCompositionData;
|
|
}
|