1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://w3c.github.io/webcodecs/#videocolorspace
10 [Exposed=(Window,DedicatedWorker), Func="mozilla::dom::VideoFrame::PrefEnabled"]
11 interface VideoColorSpace {
13 constructor(optional VideoColorSpaceInit init = {});
15 readonly attribute VideoColorPrimaries? primaries;
16 readonly attribute VideoTransferCharacteristics? transfer;
17 readonly attribute VideoMatrixCoefficients? matrix;
18 readonly attribute boolean? fullRange;
20 // https://github.com/w3c/webcodecs/issues/486
21 [Default] object toJSON();
24 dictionary VideoColorSpaceInit {
25 VideoColorPrimaries? primaries = null;
26 VideoTransferCharacteristics? transfer = null;
27 VideoMatrixCoefficients? matrix = null;
28 boolean? fullRange = null;
31 enum VideoColorPrimaries {
32 "bt709", // BT.709, sRGB
33 "bt470bg", // BT.601 PAL
34 "smpte170m", // BT.601 NTSC
35 "bt2020", // BT.2020, BT.2100
39 enum VideoTransferCharacteristics {
41 "smpte170m", // BT.601 (functionally the same as bt709)
42 "iec61966-2-1", // sRGB
43 "linear", // linear RGB
48 enum VideoMatrixCoefficients {
51 "bt470bg", // BT.601 PAL
52 "smpte170m", // BT.601 NTSC (functionally the same as bt470bg)
53 "bt2020-ncl", // BT.2020 NCL