Skip to main content

Module color_matrix

Module color_matrix 

Source
Expand description

YCbCr matrices accepted by SCStreamConfiguration.colorMatrix.

The property takes a CFStringRef and ScreenCaptureKit only honours the kCGDisplayStreamYCbCrMatrix_* values reproduced here; anything else is ignored by the system with no diagnostic. Using these constants instead of a hand-written literal is the difference between “the matrix was applied” and “the matrix was silently dropped”.

The matrix only affects YCbCr pixel formats (420v / 420f / PixelFormat::YCbCr_420v and friends); it is inert for BGRA capture.

§Examples

use screencapturekit::stream::configuration::{color_matrix, SCStreamConfiguration};

let config = SCStreamConfiguration::new().with_color_matrix(color_matrix::ITU_R_709_2).expect("color matrix has no NUL byte");

Constants§

ITU_R_601_4
kCGDisplayStreamYCbCrMatrix_ITU_R_601_4 — SD (Rec. 601).
ITU_R_709_2
kCGDisplayStreamYCbCrMatrix_ITU_R_709_2 — HD (Rec. 709).
SMPTE_240M_1995
kCGDisplayStreamYCbCrMatrix_SMPTE_240M_1995 — SMPTE 240M.