/** * VideoColorSpace - Describes the color space of a video frame * Implements the W3C WebCodecs VideoColorSpace interface */ export type VideoColorPrimaries = | 'bt709' | 'bt470bg' | 'smpte170m' | 'bt2020' | 'smpte432'; export type VideoTransferCharacteristics = | 'bt709' | 'smpte170m' | 'iec61966-2-1' | 'linear' | 'pq' | 'hlg'; export type VideoMatrixCoefficients = | 'rgb' | 'bt709' | 'bt470bg' | 'smpte170m' | 'bt2020-ncl'; export interface VideoColorSpaceInit { primaries?: VideoColorPrimaries | null; transfer?: VideoTransferCharacteristics | null; matrix?: VideoMatrixCoefficients | null; fullRange?: boolean | null; } export class VideoColorSpace { readonly primaries: VideoColorPrimaries | null; readonly transfer: VideoTransferCharacteristics | null; readonly matrix: VideoMatrixCoefficients | null; readonly fullRange: boolean | null; constructor(init?: VideoColorSpaceInit) { this.primaries = init?.primaries ?? null; this.transfer = init?.transfer ?? null; this.matrix = init?.matrix ?? null; this.fullRange = init?.fullRange ?? null; } toJSON(): VideoColorSpaceInit { return { primaries: this.primaries, transfer: this.transfer, matrix: this.matrix, fullRange: this.fullRange, }; } }