VideoColorSpace: VideoColorSpace() Konstruktor
Baseline
2024
Newly available
Since September 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Hinweis: Diese Funktion ist in Dedicated Web Workers verfügbar.
Der VideoColorSpace() Konstruktor erstellt ein neues VideoColorSpace Objekt, das einen Videofarbraum darstellt.
Syntax
new VideoColorSpace()
new VideoColorSpace(options)
Parameter
Alle Werte sind auf null voreingestellt, wenn sie nicht vorhanden sind.
optionsOptional-
Ein Objekt, das Folgendes enthält:
primariesOptional-
Einer der folgenden Strings:
"bt709""bt470bg""smpte170m"
transferOptional-
Einer der folgenden Strings:
"bt709""smpte170m""iec61966-2-1"
matrixOptional-
Einer der folgenden Strings:
"rgb""bt709""bt470bg""smpte170m"
fullRangeOptional-
Ein
Boolean,true, wenn Vollbereichsfarbwerte im Video verwendet werden.
Beispiele
Das folgende Beispiel erstellt ein neues VideoColorSpace Objekt mit VideoColorSpace.primaries auf "bt709" gesetzt, und VideoColorSpace.primaries auf true gesetzt.
const options = {
primaries: "bt709",
fullRange: true,
};
const colorSpace = new VideoColorSpace(options);
console.log(colorSpace);
Spezifikationen
| Specification |
|---|
| WebCodecs # dom-videocolorspace-videocolorspace |