diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 6836989b..50b37732 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2,6 +2,22 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "ab_glyph" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c0457472c38ea5bd1c3b5ada5e368271cb550be7a4ca4a0b4634e9913f6cc2" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" + [[package]] name = "adler2" version = "2.0.1" @@ -28,6 +44,24 @@ dependencies = [ "memchr", ] +[[package]] +name = "aligned" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee4508988c62edf04abd8d92897fca0c2995d907ce1dfeaf369dac3716a40685" +dependencies = [ + "as-slice", +] + +[[package]] +name = "aligned-vec" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b" +dependencies = [ + "equator", +] + [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -97,6 +131,15 @@ version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + [[package]] name = "arbitrary" version = "1.4.2" @@ -106,6 +149,17 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "arg_enum_proc_macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "arrayref" version = "0.3.9" @@ -118,6 +172,15 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "as-slice" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" +dependencies = [ + "stable_deref_trait", +] + [[package]] name = "async-broadcast" version = "0.7.2" @@ -284,6 +347,49 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "av-scenechange" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394" +dependencies = [ + "aligned", + "anyhow", + "arg_enum_proc_macro", + "arrayvec", + "log", + "num-rational", + "num-traits", + "pastey", + "rayon", + "thiserror 2.0.18", + "v_frame", + "y4m", +] + +[[package]] +name = "av1-grain" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cfddb07216410377231960af4fcab838eaa12e013417781b78bd95ee22077f8" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom", + "num-rational", + "v_frame", +] + +[[package]] +name = "avif-serialize" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7178fe5f7d460b13895ebb9dcb28a3a6216d2df2574a0806cb51b555d297f38" +dependencies = [ + "arrayvec", +] + [[package]] name = "axum" version = "0.8.9" @@ -366,6 +472,12 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" +[[package]] +name = "bit_field" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" + [[package]] name = "bitflags" version = "1.3.2" @@ -381,6 +493,15 @@ dependencies = [ "serde_core", ] +[[package]] +name = "bitstream-io" +version = "4.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eff00be299a18769011411c9def0d827e8f2d7bf0c3dbf53633147a8867fd1f" +dependencies = [ + "no_std_io2", +] + [[package]] name = "bitvec" version = "1.0.1" @@ -478,6 +599,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "built" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" + [[package]] name = "bumpalo" version = "3.20.2" @@ -530,6 +657,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + [[package]] name = "bytes" version = "1.11.1" @@ -613,6 +746,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" dependencies = [ "find-msvc-tools", + "jobserver", + "libc", "shlex", ] @@ -667,6 +802,12 @@ dependencies = [ "windows-link 0.2.1", ] +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + [[package]] name = "combine" version = "4.6.7" @@ -807,12 +948,37 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + [[package]] name = "crypto-common" version = "0.1.7" @@ -1104,6 +1270,12 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" +[[package]] +name = "either" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" + [[package]] name = "embed-resource" version = "3.0.9" @@ -1170,6 +1342,26 @@ dependencies = [ "regex", ] +[[package]] +name = "equator" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" +dependencies = [ + "equator-macro", +] + +[[package]] +name = "equator-macro" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -1218,6 +1410,23 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "exr" +version = "1.74.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711fe42c9964295e01ee3fba3f9fe0e1d24b98886950d68efe81b1c76e21adf3" +dependencies = [ + "bit_field", + "half", + "lebe", + "miniz_oxide", + "num-complex", + "pulp", + "rayon-core", + "smallvec", + "zune-inflate", +] + [[package]] name = "extended" version = "0.1.0" @@ -1242,6 +1451,12 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" +[[package]] +name = "fax" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a" + [[package]] name = "fdeflate" version = "0.3.7" @@ -1575,8 +1790,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -1604,6 +1821,16 @@ dependencies = [ "wasip3", ] +[[package]] +name = "gif" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159" +dependencies = [ + "color_quant", + "weezl", +] + [[package]] name = "gio" version = "0.18.4" @@ -1770,6 +1997,17 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "half" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" +dependencies = [ + "cfg-if", + "crunchy", + "zerocopy", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -2099,6 +2337,64 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "image" +version = "0.25.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" +dependencies = [ + "bytemuck", + "byteorder-lite", + "color_quant", + "exr", + "gif", + "image-webp", + "moxcms", + "num-traits", + "png 0.18.1", + "qoi", + "ravif", + "rayon", + "rgb", + "tiff", + "zune-core", + "zune-jpeg", +] + +[[package]] +name = "image-webp" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3" +dependencies = [ + "byteorder-lite", + "quick-error", +] + +[[package]] +name = "imageproc" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "602b4e8a4cc3e98372b766cd184ab532999bc0e839b7469e759511ccabc65d77" +dependencies = [ + "ab_glyph", + "approx", + "getrandom 0.2.17", + "image", + "itertools 0.12.1", + "nalgebra", + "num", + "rand 0.8.6", + "rand_distr", + "rayon", +] + +[[package]] +name = "imgref" +version = "1.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89194689a993ab15268672e99e7b0e19da2da3268ac682e8f02d29d4d1434cd7" + [[package]] name = "indexmap" version = "1.9.3" @@ -2151,6 +2447,17 @@ dependencies = [ "libc", ] +[[package]] +name = "interpolate_name" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "ipnet" version = "2.12.0" @@ -2176,6 +2483,24 @@ dependencies = [ "once_cell", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.18" @@ -2279,6 +2604,16 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "jobserver" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" +dependencies = [ + "getrandom 0.4.2", + "libc", +] + [[package]] name = "js-sys" version = "0.3.98" @@ -2356,6 +2691,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" +[[package]] +name = "lebe" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" + [[package]] name = "libappindicator" version = "0.9.0" @@ -2395,6 +2736,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libfuzzer-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2" +dependencies = [ + "arbitrary", + "cc", +] + [[package]] name = "libloading" version = "0.7.4" @@ -2405,6 +2756,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + [[package]] name = "libredox" version = "0.1.16" @@ -2455,6 +2812,15 @@ dependencies = [ "value-bag", ] +[[package]] +name = "loop9" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" +dependencies = [ + "imgref", +] + [[package]] name = "mac-notification-sys" version = "0.6.12" @@ -2493,6 +2859,26 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" +[[package]] +name = "matrixmultiply" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "maybe-rayon" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" +dependencies = [ + "cfg-if", + "rayon", +] + [[package]] name = "memchr" version = "2.8.0" @@ -2542,6 +2928,16 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "moxcms" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" +dependencies = [ + "num-traits", + "pxfm", +] + [[package]] name = "muda" version = "0.19.1" @@ -2563,6 +2959,21 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "nalgebra" +version = "0.32.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5c17de023a86f59ed79891b2e5d5a94c705dbe904a5b5c9c952ea6221b03e4" +dependencies = [ + "approx", + "matrixmultiply", + "num-complex", + "num-rational", + "num-traits", + "simba", + "typenum", +] + [[package]] name = "ndk" version = "0.9.0" @@ -2599,6 +3010,30 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +[[package]] +name = "no_std_io2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418abd1b6d34fbf6cae440dc874771b0525a604428704c76e48b29a5e67b8003" +dependencies = [ + "memchr", +] + +[[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] + +[[package]] +name = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + [[package]] name = "notify" version = "8.2.0" @@ -2640,6 +3075,20 @@ dependencies = [ "bitflags 2.11.1", ] +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -2656,6 +3105,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ + "bytemuck", "num-traits", ] @@ -2685,6 +3135,16 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" +dependencies = [ + "num-integer", + "num-traits", +] + [[package]] name = "num-rational" version = "0.4.2" @@ -2703,6 +3163,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -3048,6 +3509,15 @@ dependencies = [ "thiserror 2.0.18", ] +[[package]] +name = "owned_ttf_parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b" +dependencies = [ + "ttf-parser", +] + [[package]] name = "pango" version = "0.18.3" @@ -3102,6 +3572,18 @@ dependencies = [ "windows-link 0.2.1", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pastey" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" + [[package]] name = "pathdiff" version = "0.2.3" @@ -3247,8 +3729,11 @@ dependencies = [ name = "pomotroid" version = "1.7.1" dependencies = [ + "ab_glyph", "axum", "futures-util", + "image", + "imageproc", "log", "notify", "objc2", @@ -3373,6 +3858,25 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "profiling" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb" +dependencies = [ + "quote", + "syn 2.0.117", +] + [[package]] name = "ptr_meta" version = "0.1.4" @@ -3393,6 +3897,50 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "pulp" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046aa45b989642ec2e4717c8e72d677b13edd831a4d3b6cf37d9a3e54912496a" +dependencies = [ + "bytemuck", + "cfg-if", + "libm", + "num-complex", + "paste", + "pulp-wasm-simd-flag", + "raw-cpuid", + "reborrow", + "version_check", +] + +[[package]] +name = "pulp-wasm-simd-flag" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d8f70e07b9c3962945a74e59ca1c511bba65b6419468acc217c457d93f3c740" + +[[package]] +name = "pxfm" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea" + +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quick-xml" version = "0.37.5" @@ -3497,12 +4045,113 @@ dependencies = [ "getrandom 0.3.4", ] +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand 0.8.6", +] + +[[package]] +name = "rav1e" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b" +dependencies = [ + "aligned-vec", + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av-scenechange", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools 0.14.0", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "paste", + "profiling", + "rand 0.9.4", + "rand_chacha 0.9.0", + "simd_helpers", + "thiserror 2.0.18", + "v_frame", + "wasm-bindgen", +] + +[[package]] +name = "ravif" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e52310197d971b0f5be7fe6b57530dcd27beb35c1b013f29d66c1ad73fbbcc45" +dependencies = [ + "avif-serialize", + "imgref", + "loop9", + "quick-error", + "rav1e", + "rayon", + "rgb", +] + +[[package]] +name = "raw-cpuid" +version = "11.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" +dependencies = [ + "bitflags 2.11.1", +] + [[package]] name = "raw-window-handle" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "reborrow" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430" + [[package]] name = "redox_syscall" version = "0.5.18" @@ -3644,6 +4293,12 @@ dependencies = [ "windows-sys 0.60.2", ] +[[package]] +name = "rgb" +version = "0.8.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4" + [[package]] name = "ring" version = "0.17.14" @@ -3855,6 +4510,15 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" +[[package]] +name = "safe_arch" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" +dependencies = [ + "bytemuck", +] + [[package]] name = "same-file" version = "1.0.6" @@ -4207,6 +4871,19 @@ dependencies = [ "libc", ] +[[package]] +name = "simba" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste", + "wide", +] + [[package]] name = "simd-adler32" version = "0.3.9" @@ -4223,6 +4900,15 @@ dependencies = [ "simdutf8", ] +[[package]] +name = "simd_helpers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote", +] + [[package]] name = "simdutf8" version = "0.1.5" @@ -5094,6 +5780,20 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "tiff" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52" +dependencies = [ + "fax", + "flate2", + "half", + "quick-error", + "weezl", + "zune-jpeg", +] + [[package]] name = "time" version = "0.3.47" @@ -5467,6 +6167,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" + [[package]] name = "tungstenite" version = "0.29.0" @@ -5626,6 +6332,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "v_frame" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] + [[package]] name = "value-bag" version = "1.12.0" @@ -5926,6 +6643,22 @@ dependencies = [ "windows-core 0.61.2", ] +[[package]] +name = "weezl" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" + +[[package]] +name = "wide" +version = "0.7.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" +dependencies = [ + "bytemuck", + "safe_arch", +] + [[package]] name = "winapi" version = "0.3.9" @@ -6652,6 +7385,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" +[[package]] +name = "y4m" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448" + [[package]] name = "yoke" version = "0.8.2" @@ -6834,6 +7573,30 @@ version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" +[[package]] +name = "zune-core" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b" + +[[package]] +name = "zune-inflate" +version = "0.2.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "zune-jpeg" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296" +dependencies = [ + "zune-core", +] + [[package]] name = "zvariant" version = "5.11.0" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 026bb5ec..d4b0a4cf 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -40,6 +40,9 @@ rodio = { version = "0.22", default-features = false, features = ["playback", "w symphonia-codec-adpcm = "0.6.0" tiny-skia = "0.12" notify = "8" +image = "0.25" +imageproc = "0.25" +ab_glyph = "0.2" [dev-dependencies] tokio-tungstenite = "0.29" diff --git a/src-tauri/fonts/DejaVuSansMono-Bold.ttf b/src-tauri/fonts/DejaVuSansMono-Bold.ttf new file mode 100644 index 00000000..8184ced8 Binary files /dev/null and b/src-tauri/fonts/DejaVuSansMono-Bold.ttf differ diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 56993361..1ab5889d 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -151,7 +151,8 @@ pub fn settings_set( } else { 0.0 }; - tray::update_icon(&tray_state, &snap.round_type, snap.is_paused, progress); + let remaining = snap.total_secs.saturating_sub(snap.elapsed_secs); + tray::update_icon(&tray_state, &snap.round_type, snap.is_paused, progress, remaining); } // Update tray icon colors when the active theme changes. @@ -169,7 +170,8 @@ pub fn settings_set( } else { 0.0 }; - tray::update_icon(&tray_state, &snap.round_type, snap.is_paused, progress); + let remaining = snap.total_secs.saturating_sub(snap.elapsed_secs); + tray::update_icon(&tray_state, &snap.round_type, snap.is_paused, progress, remaining); } } diff --git a/src-tauri/src/timer/mod.rs b/src-tauri/src/timer/mod.rs index c7d6c904..a748c503 100644 --- a/src-tauri/src/timer/mod.rs +++ b/src-tauri/src/timer/mod.rs @@ -296,7 +296,8 @@ fn listen_events( 0.0 }; if (progress - last_tray_progress).abs() >= 0.01 { - tray::update_icon(&tray, &rt, false, progress); + let remaining = total_secs.saturating_sub(elapsed_secs); + tray::update_icon(&tray, &rt, false, progress, remaining); last_tray_progress = progress; } } @@ -373,7 +374,12 @@ fn listen_events( // regardless of how long the round is. Using 0.0 here caused // a ≥15-second blank period before the arc started animating. let rt = sequence.lock().unwrap().current_round.as_str().to_string(); - tray::update_icon(&tray, &rt, false, 0.0); + let total = { + let seq = sequence.lock().unwrap(); + let s = settings.lock().unwrap(); + seq.current_duration_secs(&s) + }; + tray::update_icon(&tray, &rt, false, 0.0, total); last_tray_progress = -1.0; // Broadcast round-change to any connected WebSocket clients. @@ -414,7 +420,8 @@ fn listen_events( seq.current_duration_secs(&s) }; let progress = if total > 0 { elapsed_secs as f32 / total as f32 } else { 0.0 }; - tray::update_icon(&tray, &rt, true, progress); + let remaining = total.saturating_sub(elapsed_secs); + tray::update_icon(&tray, &rt, true, progress, remaining); tray::update_menu_items(&tray, false, true); } @@ -434,7 +441,8 @@ fn listen_events( seq.current_duration_secs(&s) }; let progress = if total > 0 { elapsed_secs as f32 / total as f32 } else { 0.0 }; - tray::update_icon(&tray, &rt, false, progress); + let remaining = total.saturating_sub(elapsed_secs); + tray::update_icon(&tray, &rt, false, progress, remaining); last_tray_progress = progress; tray::update_menu_items(&tray, true, false); } @@ -469,7 +477,12 @@ fn listen_events( // Reset tray to idle (empty arc). let rt = sequence.lock().unwrap().current_round.as_str().to_string(); - tray::update_icon(&tray, &rt, false, 0.0); + let total = { + let seq = sequence.lock().unwrap(); + let s = settings.lock().unwrap(); + seq.current_duration_secs(&s) + }; + tray::update_icon(&tray, &rt, false, 0.0, total); last_tray_progress = -1.0; tray::update_menu_items(&tray, false, false); } @@ -490,7 +503,8 @@ fn listen_events( seq.current_duration_secs(&s) }; let progress = if total > 0 { elapsed_secs as f32 / total as f32 } else { 0.0 }; - tray::update_icon(&tray, &rt, true, progress); + let remaining = total.saturating_sub(elapsed_secs); + tray::update_icon(&tray, &rt, true, progress, remaining); } } } diff --git a/src-tauri/src/tray/mod.rs b/src-tauri/src/tray/mod.rs index c6f05ee9..ecbee311 100644 --- a/src-tauri/src/tray/mod.rs +++ b/src-tauri/src/tray/mod.rs @@ -1,9 +1,8 @@ /// System tray management with dynamic arc icon via tiny-skia. /// -/// The tray icon is a 32×32 RGBA image: -/// - Solid filled background circle in the theme's background color. -/// - Progress arc from 12 o'clock sweeping clockwise, colored by round type. -/// - While paused: two vertical bars drawn over the progress arc. +/// The tray icon is a 64×64 RGBA image displaying remaining time as "MM:SS" +/// text on a colored background matching the round type (work/short-break/long-break). +/// While paused: two semi-transparent bars drawn over the time display. /// /// Colors come from the active theme, updated when theme changes. /// The tray is created/destroyed when `min_to_tray` setting changes. @@ -15,7 +14,6 @@ /// typically does not ship these libraries. `create_tray` probes for them /// before calling `TrayIconBuilder::build()` and returns early with a warning /// when they are absent, preventing the abort. -use std::f32::consts::{FRAC_PI_2, PI, TAU}; use std::sync::{Arc, Mutex}; use tauri::{ @@ -26,7 +24,9 @@ use tauri::{ }; use crate::timer::TimerController; -use tiny_skia::{Color, Paint, PathBuilder, Pixmap, Stroke, Transform}; +use image::{ImageBuffer, Rgba, RgbaImage}; +use imageproc::drawing::draw_text_mut; +use ab_glyph::{FontRef, PxScale}; // --------------------------------------------------------------------------- // Theme colors for tray rendering @@ -264,7 +264,7 @@ pub fn create_tray(app: &AppHandle, state: &Arc) { let image = { let colors = state.colors.lock().unwrap().clone(); let countdown = *state.countdown_mode.lock().unwrap(); - let bytes = render_tray_icon_rgba(&colors, false, 0.0, "work", countdown); + let bytes = render_tray_icon_rgba(&colors, false, 0.0, "work", countdown, 0); Image::new_owned(bytes, SIZE, SIZE) }; @@ -370,13 +370,14 @@ pub fn destroy_tray(state: &Arc) { /// - `round_type`: "work" | "short-break" | "long-break" /// - `paused`: show pause bars over the progress arc /// - `progress`: 0.0 (empty) to 1.0 (full, i.e. elapsed/total) -pub fn update_icon(state: &Arc, round_type: &str, paused: bool, progress: f32) { +/// - `remaining_secs`: remaining seconds to display as text +pub fn update_icon(state: &Arc, round_type: &str, paused: bool, progress: f32, remaining_secs: u32) { let guard = state.icon.lock().unwrap(); let Some(tray) = guard.as_ref() else { return }; let colors = state.colors.lock().unwrap().clone(); let countdown = *state.countdown_mode.lock().unwrap(); - let bytes = render_tray_icon_rgba(&colors, paused, progress, round_type, countdown); + let bytes = render_tray_icon_rgba(&colors, paused, progress, round_type, countdown, remaining_secs); let image = Image::new_owned(bytes, SIZE, SIZE); let _ = tray.set_icon(Some(image)); @@ -405,129 +406,103 @@ pub fn update_menu_items(state: &Arc, is_running: bool, is_paused: bo } // --------------------------------------------------------------------------- -// Icon rendering (tiny-skia) +// Icon rendering // --------------------------------------------------------------------------- // Render at 64×64 so the icon looks sharp on HiDPI displays (Ubuntu often // runs at 1.5× or 2× scale). The tray host scales it down on standard -// density displays; the larger source means the circle stays clean either way. +// density displays; the larger source means the text stays clean either way. const SIZE: u32 = 64; -const CENTER: f32 = SIZE as f32 / 2.0; -const RADIUS: f32 = CENTER - 5.0; // 5 px margin keeps the stroke inside the canvas -const STROKE_WIDTH: f32 = 6.0; -// Track opacity: the "empty" part of the ring at this brightness on a dark panel. -// 22% white on #1a1a1a ≈ #383838 — invisible. 65% ≈ #a6a6a6 — clearly visible. -const TRACK_ALPHA: u8 = 165; // ≈ 65 % - -fn rgba_color(c: [u8; 4]) -> Color { - Color::from_rgba8(c[0], c[1], c[2], c[3]) -} -/// Render a 64×64 RGBA tray icon as a **ring** with a progress arc. +/// Render a 64×64 RGBA tray icon with remaining time text. /// -/// Using a ring (stroke-only circle) on a transparent background means the -/// icon reads as a clear circle regardless of panel colour or scale factor, -/// unlike a solid filled disc which looks like a dark blob at small sizes. +/// Instead of the ring progress, this displays the remaining time as "MM:SS" +/// in the center of the icon with a colored background based on round type. pub fn render_tray_icon_rgba( colors: &TrayColors, paused: bool, - progress: f32, + _progress: f32, round_type: &str, - countdown: bool, + _countdown: bool, + remaining_secs: u32, ) -> Vec { - let mut pixmap = Pixmap::new(SIZE, SIZE).expect("pixmap alloc"); - - let mut paint = Paint { anti_alias: true, ..Default::default() }; - - let stroke = Stroke { - width: STROKE_WIDTH, - line_cap: tiny_skia::LineCap::Round, - ..Default::default() + // Create a transparent background + let mut img: RgbaImage = ImageBuffer::new(SIZE, SIZE); + + // Round-type color for background circle + let bg_color = match round_type { + "short-break" => colors.short_round, + "long-break" => colors.long_round, + _ => colors.focus_round, }; - // Track ring: full circle at low opacity — defines the circular shape. - { - let [r, g, b, _] = colors.foreground; - paint.set_color(Color::from_rgba8(r, g, b, TRACK_ALPHA)); + // Draw filled circle background + let center_x = (SIZE / 2) as i32; + let center_y = (SIZE / 2) as i32; + let radius = (SIZE / 2 - 2) as i32; // Leave 2px margin + + for y in 0..SIZE { + for x in 0..SIZE { + let dx = x as i32 - center_x; + let dy = y as i32 - center_y; + let distance_squared = dx * dx + dy * dy; + + if distance_squared <= radius * radius { + img.put_pixel(x, y, Rgba([bg_color[0], bg_color[1], bg_color[2], bg_color[3]])); + } else { + img.put_pixel(x, y, Rgba([0, 0, 0, 0])); // Transparent outside circle + } + } } - let ring = { - let mut pb = PathBuilder::new(); - pb.push_circle(CENTER, CENTER, RADIUS); - pb.finish().expect("ring path") - }; - pixmap.stroke_path(&ring, &paint, &stroke, Transform::identity(), None); - // Round-type color: used for both the progress arc and the pause bars. - let round_color = match round_type { - "short-break" => rgba_color(colors.short_round), - "long-break" => rgba_color(colors.long_round), - _ => rgba_color(colors.focus_round), - }; + // Format time - only show minutes + let minutes = remaining_secs / 60; + let time_text = format!("{:02}", minutes); - // Progress arc from 12 o'clock, clockwise, in the round-type colour. - paint.set_color(round_color); - - // In elapsed mode the arc grows as time passes; in countdown mode it shrinks. - let effective = if countdown { 1.0 - progress } else { progress }; - let sweep = effective.clamp(0.0, 1.0) * TAU; - if sweep > 0.001 { - let start = -FRAC_PI_2; - let end = start + sweep; - let path = build_arc_path(CENTER, CENTER, RADIUS, start, end); - pixmap.stroke_path(&path, &paint, &stroke, Transform::identity(), None); - } + // Use embedded font data + let font_data = include_bytes!("../../fonts/DejaVuSansMono-Bold.ttf"); + let font = FontRef::try_from_slice(font_data).expect("Error loading font"); + + // Use larger font scale for better visibility (48.0 instead of 24.0) + let scale = PxScale::from(48.0); + + // Text color (white for visibility) + let text_color = Rgba([colors.foreground[0], colors.foreground[1], colors.foreground[2], 255]); + // Draw text centered (adjusted position for larger font and 2-digit display) + draw_text_mut(&mut img, text_color, 8, 8, scale, &font, &time_text); + + // If paused, draw pause bars overlay if paused { - // Two vertical bars centred in the ring, in the round-type colour so - // they read clearly on any panel colour regardless of theme foreground. - paint.set_color(round_color); - let bar_h = RADIUS * 0.75; - let bar_w = STROKE_WIDTH * 1.2; - let bar_gap = STROKE_WIDTH * 1.1; - let bar_y = CENTER - bar_h / 2.0; - for x in [CENTER - bar_gap / 2.0 - bar_w, CENTER + bar_gap / 2.0] { - if let Some(rect) = tiny_skia::Rect::from_xywh(x, bar_y, bar_w, bar_h) { - let p = PathBuilder::from_rect(rect); - pixmap.fill_path( - &p, &paint, tiny_skia::FillRule::Winding, - Transform::identity(), None, - ); + let bar_color = Rgba([colors.foreground[0], colors.foreground[1], colors.foreground[2], 180]); + let bar_width = 4; + let bar_height = 16; + let bar_gap = 6; + let bar_y = (SIZE / 2 - bar_height / 2) as i32; + + // Left bar + let bar_x1 = (SIZE / 2 - bar_gap / 2 - bar_width) as i32; + for dy in 0..bar_height { + for dx in 0..bar_width { + if let Some(pixel) = img.get_pixel_mut_checked((bar_x1 + dx as i32) as u32, (bar_y + dy as i32) as u32) { + *pixel = bar_color; + } } } - } - - pixmap.take() -} -/// Approximate a circular arc with cubic Bézier segments (max π/2 per segment). -fn build_arc_path(cx: f32, cy: f32, r: f32, start: f32, end: f32) -> tiny_skia::Path { - let total = end - start; - let n = ((total / (PI / 2.0)).ceil() as usize).max(1); - let step = total / n as f32; - let mut pb = PathBuilder::new(); - - for i in 0..n { - let a0 = start + step * i as f32; - let a1 = a0 + step; - arc_segment(&mut pb, cx, cy, r, a0, a1, i == 0); + // Right bar + let bar_x2 = (SIZE / 2 + bar_gap / 2) as i32; + for dy in 0..bar_height { + for dx in 0..bar_width { + if let Some(pixel) = img.get_pixel_mut_checked((bar_x2 + dx as i32) as u32, (bar_y + dy as i32) as u32) { + *pixel = bar_color; + } + } + } } - pb.finish().unwrap_or_else(|| { - PathBuilder::from_rect(tiny_skia::Rect::from_xywh(cx, cy, 1.0, 1.0).unwrap()) - }) -} - -/// Append one arc segment (≤ π/2) as a cubic Bézier. -fn arc_segment(pb: &mut PathBuilder, cx: f32, cy: f32, r: f32, a0: f32, a1: f32, first: bool) { - let alpha = ((a1 - a0) / 4.0).tan() * 4.0 / 3.0; - let (s0, c0) = a0.sin_cos(); - let (s1, c1) = a1.sin_cos(); - let x0 = cx + r * c0; let y0 = cy + r * s0; - let x3 = cx + r * c1; let y3 = cy + r * s1; - let x1 = x0 - alpha * r * s0; let y1 = y0 + alpha * r * c0; - let x2 = x3 + alpha * r * s1; let y2 = y3 - alpha * r * c1; - if first { pb.move_to(x0, y0); } - pb.cubic_to(x1, y1, x2, y2, x3, y3); + // Convert ImageBuffer to Vec + img.into_raw() } // --------------------------------------------------------------------------- @@ -540,33 +515,33 @@ mod tests { #[test] fn render_returns_correct_byte_count() { - let bytes = render_tray_icon_rgba(&TrayColors::default(), false, 0.5, "work", false); + let bytes = render_tray_icon_rgba(&TrayColors::default(), false, 0.5, "work", false, 1500); assert_eq!(bytes.len(), (SIZE * SIZE * 4) as usize); } #[test] fn render_paused_returns_correct_byte_count() { - let bytes = render_tray_icon_rgba(&TrayColors::default(), true, 0.0, "work", false); + let bytes = render_tray_icon_rgba(&TrayColors::default(), true, 0.0, "work", false, 1500); assert_eq!(bytes.len(), (SIZE * SIZE * 4) as usize); } #[test] fn render_paused_preserves_progress_arc() { - let empty = render_tray_icon_rgba(&TrayColors::default(), true, 0.0, "work", false); - let half = render_tray_icon_rgba(&TrayColors::default(), true, 0.5, "work", false); + let empty = render_tray_icon_rgba(&TrayColors::default(), true, 0.0, "work", false, 0); + let half = render_tray_icon_rgba(&TrayColors::default(), true, 0.5, "work", false, 750); assert!(empty != half); } #[test] fn render_paused_still_shows_pause_indicator() { - let running = render_tray_icon_rgba(&TrayColors::default(), false, 0.5, "work", false); - let paused = render_tray_icon_rgba(&TrayColors::default(), true, 0.5, "work", false); + let running = render_tray_icon_rgba(&TrayColors::default(), false, 0.5, "work", false, 750); + let paused = render_tray_icon_rgba(&TrayColors::default(), true, 0.5, "work", false, 750); assert!(running != paused); } #[test] fn render_zero_progress_returns_correct_byte_count() { - let bytes = render_tray_icon_rgba(&TrayColors::default(), false, 0.0, "work", false); + let bytes = render_tray_icon_rgba(&TrayColors::default(), false, 0.0, "work", false, 0); assert_eq!(bytes.len(), (SIZE * SIZE * 4) as usize); }