mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
daemon: revert zbus to 1.9.1 in daemon
This commit is contained in:
@@ -28,7 +28,7 @@ pub mod error;
|
||||
// packet data
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub enum AniMeSequence {
|
||||
pub enum AniMeBlock {
|
||||
/// Full gif sequence. Immutable.
|
||||
Animation(AniMeGif),
|
||||
/// Basic image, can have properties changed
|
||||
@@ -37,15 +37,15 @@ pub enum AniMeSequence {
|
||||
Pause(Duration),
|
||||
}
|
||||
|
||||
impl AniMeSequence {
|
||||
pub fn gif(file: &Path, brightness: f32) -> Result<Self, AnimeError> {
|
||||
impl AniMeBlock {
|
||||
pub fn asus_gif(file: &Path, brightness: f32) -> Result<Self, AnimeError> {
|
||||
let frames = AniMeGif::create_diagonal_gif(file, brightness)?;
|
||||
Ok(Self::Animation(frames))
|
||||
}
|
||||
|
||||
pub fn png(
|
||||
file: &Path,
|
||||
scale: Vec2,
|
||||
scale: f32,
|
||||
angle: f32,
|
||||
translation: Vec2,
|
||||
brightness: f32,
|
||||
@@ -55,27 +55,34 @@ impl AniMeSequence {
|
||||
Ok(Self::Image(Box::new(data)))
|
||||
}
|
||||
|
||||
pub fn png_gif(
|
||||
pub fn image_gif(
|
||||
file: &Path,
|
||||
// scale: Vec2,
|
||||
// angle: f32,
|
||||
// translation: Vec2,
|
||||
scale: f32,
|
||||
angle: f32,
|
||||
translation: Vec2,
|
||||
brightness: f32,
|
||||
) -> Result<Self, AnimeError> {
|
||||
let frames = AniMeGif::create_png_gif(file, brightness)?;
|
||||
let frames = AniMeGif::create_png_gif(file, scale, angle, translation, brightness)?;
|
||||
Ok(Self::Animation(frames))
|
||||
}
|
||||
|
||||
pub fn get_animation(&self) -> Option<&AniMeGif> {
|
||||
match self {
|
||||
AniMeSequence::Animation(anim) => Some(anim),
|
||||
AniMeBlock::Animation(anim) => Some(anim),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_image(&self) -> Option<&AniMeDataBuffer> {
|
||||
match self {
|
||||
AniMeSequence::Image(image) => Some(image),
|
||||
AniMeBlock::Image(image) => Some(image),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_pause(&self) -> Option<Duration> {
|
||||
match self {
|
||||
AniMeBlock::Pause(pause) => Some(*pause),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user