// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files
// DO NOT EDIT

use glib::translate::*;

use crate::{ffi, Cicp, MemoryFormat};

glib::wrapper! {
    #[doc(alias = "GlyFrame")]
    pub struct Frame(Object<ffi::GlyFrame, ffi::GlyFrameClass>);

    match fn {
        type_ => || ffi::gly_frame_get_type(),
    }
}

impl Frame {
    #[doc(alias = "gly_frame_get_buf_bytes")]
    #[doc(alias = "get_buf_bytes")]
    pub fn buf_bytes(&self) -> glib::Bytes {
        unsafe { from_glib_none(ffi::gly_frame_get_buf_bytes(self.to_glib_none().0)) }
    }

    #[doc(alias = "gly_frame_get_color_cicp")]
    #[doc(alias = "get_color_cicp")]
    pub fn color_cicp(&self) -> Option<Cicp> {
        unsafe { from_glib_full(ffi::gly_frame_get_color_cicp(self.to_glib_none().0)) }
    }

    #[doc(alias = "gly_frame_get_delay")]
    #[doc(alias = "get_delay")]
    pub fn delay(&self) -> i64 {
        unsafe { ffi::gly_frame_get_delay(self.to_glib_none().0) }
    }

    #[doc(alias = "gly_frame_get_height")]
    #[doc(alias = "get_height")]
    pub fn height(&self) -> u32 {
        unsafe { ffi::gly_frame_get_height(self.to_glib_none().0) }
    }

    #[doc(alias = "gly_frame_get_memory_format")]
    #[doc(alias = "get_memory_format")]
    pub fn memory_format(&self) -> MemoryFormat {
        unsafe { from_glib(ffi::gly_frame_get_memory_format(self.to_glib_none().0)) }
    }

    #[doc(alias = "gly_frame_get_stride")]
    #[doc(alias = "get_stride")]
    pub fn stride(&self) -> u32 {
        unsafe { ffi::gly_frame_get_stride(self.to_glib_none().0) }
    }

    #[doc(alias = "gly_frame_get_width")]
    #[doc(alias = "get_width")]
    pub fn width(&self) -> u32 {
        unsafe { ffi::gly_frame_get_width(self.to_glib_none().0) }
    }
}
