Files
libpgs-js/dist/renderer.d.ts
T
zoriya bfd15e68bc Commit the build output.
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.
2026-08-26 19:23:04 +02:00

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;
}