( overrideColorSpace: VideoColorSpaceInit | undefined, format: VideoPixelFormat | null, )
| 860 | }; |
| 861 | |
| 862 | const PickColorSpace = ( |
| 863 | overrideColorSpace: VideoColorSpaceInit | undefined, |
| 864 | format: VideoPixelFormat | null, |
| 865 | ): VideoColorSpace => { |
| 866 | // 1. If overrideColorSpace is provided, return a new VideoColorSpace constructed with overrideColorSpace. |
| 867 | if (overrideColorSpace) { |
| 868 | return new VideoColorSpacePolyfill(overrideColorSpace); |
| 869 | } |
| 870 | // 2. Otherwise, if [[format]] is an RGB format return a new instance of the sRGB Color Space. |
| 871 | if (format && isRGBFormat(format)) { |
| 872 | return new VideoColorSpacePolyfill( |
| 873 | { primaries: 'bt709', transfer: 'iec61966-2-1', matrix: 'rgb', fullRange: true }, |
| 874 | ); |
| 875 | } |
| 876 | // 3. Otherwise, return a new instance of the REC709 Color Space. |
| 877 | return new VideoColorSpacePolyfill( |
| 878 | { primaries: 'bt709', transfer: 'bt709', matrix: 'bt709', fullRange: false }, |
| 879 | ); |
| 880 | }; |
| 881 | |
| 882 | const InitializeFrameFromOtherFrame = ( |
| 883 | init: VideoFrameInit, |
no test coverage detected