AniMe: more png colour type support

Closes #121, #122
This commit is contained in:
Luke D. Jones
2021-08-11 16:37:25 +12:00
parent a54e112978
commit 2a8e05707d
11 changed files with 287 additions and 91 deletions

View File

@@ -261,12 +261,12 @@ impl CtrlAnime<'static> {
scale: f32,
angle: f32,
xy: (f32, f32),
time: Option<Timer>,
time: Timer,
brightness: f32,
) -> zbus::fdo::Result<String> {
if let Ok(mut config) = self.config.try_lock() {
let file = Path::new(&file);
let time = time.map(|time| time.into());
let time = time.into();
let action = ActionLoader::Image {
file: file.into(),
scale,

View File

@@ -95,6 +95,15 @@ impl Default for UserAnimeConfig {
Self {
name: "default".to_string(),
anime: vec![
ActionLoader::AsusImage {
file: "/usr/share/asusd/anime/custom/diagonal-template.png".into(),
brightness: 1.0,
time: AnimTime::Fade(Fade::new(
Duration::from_secs(2),
None,
Duration::from_secs(2),
)),
},
ActionLoader::AsusAnimation {
file: "/usr/share/asusd/anime/asus/rog/Sunset.gif".into(),
brightness: 0.5,
@@ -121,11 +130,11 @@ impl Default for UserAnimeConfig {
scale: 1.0,
angle: 0.0,
translation: Vec2::default(),
time: Some(AnimTime::Fade(Fade::new(
time: AnimTime::Fade(Fade::new(
Duration::from_secs(2),
Some(Duration::from_secs(1)),
Duration::from_secs(2),
))),
)),
brightness: 0.6,
},
ActionLoader::Pause(Duration::from_secs(1)),