gstreamer_video/
video_color_matrix.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use std::mem;
4
5use glib::translate::IntoGlib;
6
7impl crate::VideoColorMatrix {
8    #[doc(alias = "get_kr_kb")]
9    pub fn kr_kb(&self) -> Result<(f64, f64), glib::BoolError> {
10        assert_initialized_main_thread!();
11        unsafe {
12            let mut kr = mem::MaybeUninit::uninit();
13            let mut kb = mem::MaybeUninit::uninit();
14            glib::result_from_gboolean!(
15                crate::ffi::gst_video_color_matrix_get_Kr_Kb(
16                    self.into_glib(),
17                    kr.as_mut_ptr(),
18                    kb.as_mut_ptr(),
19                ),
20                "{:?} is not a YUV matrix",
21                self
22            )?;
23            let kr = kr.assume_init();
24            let kb = kb.assume_init();
25            Ok((kr, kb))
26        }
27    }
28}