ges: Add setters to FrameCompositionMeta

Some elements might need to modify them

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1475>
This commit is contained in:
Thibault Saunier 2024-07-03 06:26:57 -04:00
parent 207694ca6c
commit 426d95bc6a

View file

@ -20,45 +20,91 @@ impl FrameCompositionMeta {
self.0.alpha self.0.alpha
} }
#[inline]
pub fn set_alpha(&mut self, alpha: f64) {
self.0.alpha = alpha;
}
#[inline] #[inline]
pub fn position(&self) -> (f64, f64) { pub fn position(&self) -> (f64, f64) {
(self.0.posx, self.0.posy) (self.0.posx, self.0.posy)
} }
#[inline]
pub fn set_position(&mut self, posx: f64, posy: f64) {
self.0.posx = posx;
self.0.posy = posy;
}
#[inline] #[inline]
pub fn pos_x(&self) -> f64 { pub fn pos_x(&self) -> f64 {
self.0.posx self.0.posx
} }
#[inline]
pub fn set_pos_x(&mut self, pos_x: f64) {
self.0.posx = pos_x;
}
#[inline] #[inline]
pub fn pos_y(&self) -> f64 { pub fn pos_y(&self) -> f64 {
self.0.posy self.0.posy
} }
#[inline]
pub fn set_pos_y(&mut self, pos_y: f64) {
self.0.posy = pos_y;
}
#[inline] #[inline]
pub fn size(&self) -> (f64, f64) { pub fn size(&self) -> (f64, f64) {
(self.0.width, self.0.height) (self.0.width, self.0.height)
} }
pub fn set_size(&mut self, width: f64, height: f64) {
self.0.width = width;
self.0.height = height;
}
#[inline] #[inline]
pub fn width(&self) -> f64 { pub fn width(&self) -> f64 {
self.0.width self.0.width
} }
#[inline]
pub fn set_width(&mut self, width: f64) {
self.0.width = width;
}
#[inline] #[inline]
pub fn height(&self) -> f64 { pub fn height(&self) -> f64 {
self.0.height self.0.height
} }
#[inline]
pub fn set_height(&mut self, height: f64) {
self.0.height = height;
}
#[inline] #[inline]
pub fn zorder(&self) -> u32 { pub fn zorder(&self) -> u32 {
self.0.zorder self.0.zorder
} }
#[inline]
pub fn set_zorder(&mut self, zorder: u32) {
self.0.zorder = zorder;
}
#[inline] #[inline]
pub fn operator(&self) -> i32 { pub fn operator(&self) -> i32 {
self.0.operator self.0.operator
} }
#[inline]
pub fn set_operator(&mut self, operator: i32) {
self.0.operator = operator;
}
} }
unsafe impl MetaAPI for FrameCompositionMeta { unsafe impl MetaAPI for FrameCompositionMeta {