1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use crate::Movie;
#[cfg(any(feature = "v0_89", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v0_89")))]
use glib::translate::*;

impl Movie {
    /// Returns the dimensions of the movie's bounding box (in pixels).
    /// The respective PDF movie dictionary entry is optional; if missing,
    /// -1x-1 will be returned.
    /// ## `width`
    /// width of the movie's bounding box
    /// ## `height`
    /// height of the movie's bounding box
    #[cfg(any(feature = "v0_89", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_89")))]
    #[doc(alias = "poppler_movie_get_aspect")]
    #[doc(alias = "get_aspect")]
    pub fn aspect(&self) -> (i32, i32) {
        unsafe {
            let mut width = std::mem::MaybeUninit::uninit();
            let mut height = std::mem::MaybeUninit::uninit();
            ffi::poppler_movie_get_aspect(
                self.to_glib_none().0,
                width.as_mut_ptr(),
                height.as_mut_ptr(),
            );
            (width.assume_init(), height.assume_init())
        }
    }
}