diff --git a/Cargo.lock b/Cargo.lock index 4a700ec..ac89eba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,6 +48,24 @@ dependencies = [ "zerocopy", ] +[[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 = "allocator-api2" version = "0.2.21" @@ -88,6 +106,12 @@ dependencies = [ "libc", ] +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + [[package]] name = "approx" version = "0.5.1" @@ -97,6 +121,23 @@ dependencies = [ "num-traits", ] +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" + +[[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.119", +] + [[package]] name = "arrayref" version = "0.3.9" @@ -115,6 +156,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" +[[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 = "ash" version = "0.37.3+1.3.251" @@ -278,6 +328,49 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" +[[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.20", + "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 = "bit-set" version = "0.5.3" @@ -293,6 +386,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[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" @@ -305,6 +404,15 @@ version = "2.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" +[[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 = "block" version = "0.1.6" @@ -342,6 +450,12 @@ dependencies = [ "piper", ] +[[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.3" @@ -374,6 +488,12 @@ dependencies = [ "syn 3.0.4", ] +[[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.12.1" @@ -533,6 +653,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + [[package]] name = "com" version = "0.6.0" @@ -911,6 +1037,26 @@ dependencies = [ "syn 2.0.119", ] +[[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.119", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -972,12 +1118,35 @@ 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 0.8.9", + "num-complex", + "pulp", + "rayon-core", + "smallvec", + "zune-inflate", +] + [[package]] name = "fastrand" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" +[[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" @@ -1224,6 +1393,16 @@ dependencies = [ "r-efi 6.0.0", ] +[[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 = "gl_generator" version = "0.14.0" @@ -1400,6 +1579,7 @@ dependencies = [ "chrono", "chrono-tz", "iced", + "image", "tokio", ] @@ -1608,6 +1788,46 @@ dependencies = [ "winit", ] +[[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 = "imgref" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e44b0a4eaa4c82f441d50a963f2d5f05a787240aeee097597033e72accfd22f" + [[package]] name = "indexmap" version = "2.14.1" @@ -1627,6 +1847,26 @@ dependencies = [ "cfg-if", ] +[[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.119", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "jni" version = "0.22.4" @@ -1733,12 +1973,28 @@ dependencies = [ "smallvec", ] +[[package]] +name = "lebe" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" + [[package]] name = "libc" version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" +[[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" @@ -1810,6 +2066,15 @@ version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" +[[package]] +name = "loop9" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" +dependencies = [ + "imgref", +] + [[package]] name = "lru" version = "0.12.5" @@ -1877,6 +2142,16 @@ dependencies = [ "libc", ] +[[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.3" @@ -1936,6 +2211,16 @@ dependencies = [ "simd-adler32", ] +[[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 = "naga" version = "0.19.2" @@ -1995,6 +2280,12 @@ dependencies = [ "jni-sys 0.3.1", ] +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + [[package]] name = "nix" version = "0.29.0" @@ -2008,6 +2299,81 @@ dependencies = [ "memoffset", ] +[[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 = "num-bigint" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "bytemuck", + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "num-integer" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -2464,6 +2830,12 @@ 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 = "percent-encoding" version = "2.3.2" @@ -2574,6 +2946,19 @@ dependencies = [ "miniz_oxide 0.8.9", ] +[[package]] +name = "png" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" +dependencies = [ + "bitflags 2.13.1", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide 0.8.9", +] + [[package]] name = "polling" version = "3.11.0" @@ -2626,6 +3011,63 @@ 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.119", +] + +[[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" @@ -2664,8 +3106,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", ] [[package]] @@ -2675,7 +3127,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", ] [[package]] @@ -2687,6 +3149,15 @@ dependencies = [ "getrandom 0.2.17", ] +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + [[package]] name = "range-alloc" version = "0.1.5" @@ -2699,6 +3170,65 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a611d15b50743feb4c76b7d03edcb0e64f399c26961e4efe6975bc398be6aa3d" +[[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", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "paste", + "profiling", + "rand 0.9.5", + "rand_chacha 0.9.0", + "simd_helpers", + "thiserror 2.0.20", + "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.13.1", +] + [[package]] name = "raw-window-handle" version = "0.6.2" @@ -2735,6 +3265,12 @@ dependencies = [ "font-types", ] +[[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.2.16" @@ -2788,6 +3324,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" +[[package]] +name = "rgb" +version = "0.8.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4" + [[package]] name = "roxmltree" version = "0.20.0" @@ -3004,6 +3546,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" @@ -3160,6 +3711,12 @@ dependencies = [ "bitflags 2.13.1", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3293,6 +3850,20 @@ dependencies = [ "syn 3.0.4", ] +[[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 = "tiny-skia" version = "0.11.4" @@ -3304,7 +3875,7 @@ dependencies = [ "bytemuck", "cfg-if", "log", - "png", + "png 0.17.16", "tiny-skia-path", ] @@ -3513,6 +4084,17 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[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 = "version_check" version = "0.9.5" @@ -3769,6 +4351,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "weezl" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" + [[package]] name = "wgpu" version = "0.19.4" @@ -4245,6 +4833,12 @@ version = "0.8.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7" +[[package]] +name = "y4m" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448" + [[package]] name = "yazi" version = "0.1.6" @@ -4275,7 +4869,7 @@ dependencies = [ "hex", "nix", "ordered-stream", - "rand", + "rand 0.8.8", "serde", "serde_repr", "sha1", @@ -4345,6 +4939,30 @@ version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34b31d188d9d685a4f9c7b46d6e36631b07058d2cfe190267adce54dc230bf12" +[[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 = "4.2.0" diff --git a/Cargo.toml b/Cargo.toml index 06ac11c..10f7e14 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,4 +7,5 @@ edition = "2021" iced = { version = "0.13", features = ["canvas", "tokio"] } tokio = { version = "1.0", features = ["time"] } chrono = "0.4" -chrono-tz = "0.10" \ No newline at end of file +chrono-tz = "0.10" +image = "0.25" \ No newline at end of file diff --git a/clock.png b/clock.png new file mode 100644 index 0000000..7fe22a4 Binary files /dev/null and b/clock.png differ diff --git a/src/clock.rs b/src/clock.rs index 1d4cf31..bd9609f 100644 --- a/src/clock.rs +++ b/src/clock.rs @@ -1,6 +1,6 @@ use chrono::{DateTime, TimeZone, Timelike}; -use iced::widget::canvas::{self, Canvas, Frame, Geometry, Path, Program, Stroke}; -use iced::{Element, Length, Point, Renderer, Theme}; +use iced::widget::canvas::{Canvas, Frame, Geometry, Path, Program, Stroke}; +use iced::{Element, Length, Point, Renderer, Theme, Color}; pub fn view_clock(time: DateTime) -> Element<'static, super::Message> { Canvas::new(Clock { @@ -37,13 +37,13 @@ impl Program for Clock { // 1. Fond du cadran et cercle extérieur let dial_background = Path::circle(center, radius); - frame.fill(&dial_background, iced::Color::from_rgb(0.05, 0.05, 0.08)); + frame.fill(&dial_background, Color::from_rgb(0.05, 0.05, 0.08)); let dial_border = Path::circle(center, radius); frame.stroke( &dial_border, Stroke::default() - .with_color(iced::Color::from_rgb(0.3, 0.3, 0.4)) + .with_color(Color::from_rgb(0.3, 0.3, 0.4)) .with_width(2.0), ); @@ -56,9 +56,9 @@ impl Program for Clock { let tick_len = if is_quarter { 9.0 } else { 5.0 }; let stroke_width = if is_quarter { 2.0 } else { 1.0 }; let tick_color = if is_quarter { - iced::Color::from_rgb(0.8, 0.8, 0.9) + Color::from_rgb(0.8, 0.8, 0.9) } else { - iced::Color::from_rgb(0.5, 0.5, 0.6) + Color::from_rgb(0.5, 0.5, 0.6) }; let inner_radius = radius - tick_len; @@ -75,51 +75,51 @@ impl Program for Clock { } } - // 3. Aiguille des heures + // Fonction utilitaire pour dessiner une aiguille triangulaire + let draw_triangular_hand = |frame: &mut Frame, angle: f32, length: f32, base_width: f32, color: Color| { + let tip = Point::new( + center.x + length * angle.cos(), + center.y + length * angle.sin(), + ); + + // Calcul des points de la base de l'aiguille perpendiculaires à l'angle + let perp_angle = angle + std::f32::consts::FRAC_PI_2; + let half_w = base_width / 2.0; + + let base_left = Point::new( + center.x - (length * 0.15) * angle.cos() + half_w * perp_angle.cos(), + center.y - (length * 0.15) * angle.sin() + half_w * perp_angle.sin(), + ); + let base_right = Point::new( + center.x - (length * 0.15) * angle.cos() - half_w * perp_angle.cos(), + center.y - (length * 0.15) * angle.sin() - half_w * perp_angle.sin(), + ); + + let triangle = Path::new(|builder| { + builder.move_to(tip); + builder.line_to(base_left); + builder.line_to(base_right); + builder.close(); + }); + + frame.fill(&triangle, color); + }; + + // 3. Aiguille des heures (Bleue, courte et large) let hour_angle = (self.hour + self.minute / 60.0) * (std::f32::consts::PI / 6.0) - std::f32::consts::FRAC_PI_2; - let hour_len = radius * 0.5; - let hour_end = Point::new( - center.x + hour_len * hour_angle.cos(), - center.y + hour_len * hour_angle.sin(), - ); - frame.stroke( - &Path::line(center, hour_end), - Stroke::default() - .with_color(iced::Color::WHITE) - .with_width(4.0), - ); + draw_triangular_hand(&mut frame, hour_angle, radius * 0.5, 6.0, Color::from_rgb(0.2, 0.5, 0.9)); - // 4. Aiguille des minutes + // 4. Aiguille des minutes (Blanche, moyenne) let min_angle = (self.minute + self.second / 60.0) * (std::f32::consts::PI / 30.0) - std::f32::consts::FRAC_PI_2; - let min_len = radius * 0.75; - let min_end = Point::new( - center.x + min_len * min_angle.cos(), - center.y + min_len * min_angle.sin(), - ); - frame.stroke( - &Path::line(center, min_end), - Stroke::default() - .with_color(iced::Color::from_rgb(0.8, 0.8, 0.8)) - .with_width(2.5), - ); + draw_triangular_hand(&mut frame, min_angle, radius * 0.75, 4.5, Color::WHITE); - // 5. Aiguille des secondes + // 5. Aiguille des secondes (Rouge, fine et longue sous forme de triangle élancé) let sec_angle = self.second * (std::f32::consts::PI / 30.0) - std::f32::consts::FRAC_PI_2; - let sec_len = radius * 0.85; - let sec_end = Point::new( - center.x + sec_len * sec_angle.cos(), - center.y + sec_len * sec_angle.sin(), - ); - frame.stroke( - &Path::line(center, sec_end), - Stroke::default() - .with_color(iced::Color::from_rgb(0.9, 0.2, 0.2)) - .with_width(1.2), - ); + draw_triangular_hand(&mut frame, sec_angle, radius * 0.85, 2.0, Color::from_rgb(0.9, 0.2, 0.2)); - // Pivot central - let pivot = Path::circle(center, 3.5); - frame.fill(&pivot, iced::Color::from_rgb(0.9, 0.2, 0.2)); + // Petit point central pivot (gris foncé/métallique) + let pivot = Path::circle(center, 4.0); + frame.fill(&pivot, Color::from_rgb(0.2, 0.2, 0.2)); vec![frame.into_geometry()] } diff --git a/src/exchange.rs b/src/exchange.rs index 51edda5..c519e27 100644 --- a/src/exchange.rs +++ b/src/exchange.rs @@ -1,155 +1,116 @@ -use chrono::{DateTime, Datelike, NaiveTime, Timelike, Utc}; +use chrono::{DateTime, Datelike, NaiveTime, Utc}; use chrono_tz::Tz; -#[derive(Debug, Clone)] -pub struct TradingSession { - pub open: NaiveTime, - pub close: NaiveTime, -} - #[derive(Debug, Clone)] pub struct Exchange { + #[allow(dead_code)] pub name: String, pub city: String, - pub timezone: Tz, - pub sessions: Vec, + pub tz: Tz, + pub open_time: NaiveTime, + pub close_time: NaiveTime, } impl Exchange { - pub fn local_time(&self, utc_now: &DateTime) -> DateTime { - utc_now.with_timezone(&self.timezone) + pub fn local_time(&self, now: &DateTime) -> DateTime { + now.with_timezone(&self.tz) } - pub fn is_open(&self, utc_now: &DateTime) -> bool { - let local = self.local_time(utc_now); + pub fn is_open(&self, now: &DateTime) -> bool { + let local = self.local_time(now); + + // Vérification du week-end (samedi = 6, dimanche = 7) let weekday = local.weekday().number_from_monday(); if weekday > 5 { return false; } let time = local.time(); - self.sessions.iter().any(|session| { - if session.open <= session.close { - time >= session.open && time <= session.close - } else { - time >= session.open || time <= session.close - } - }) + time >= self.open_time && time <= self.close_time } } pub fn get_exchanges() -> Vec { vec![ + // 0. UTC (Référence) Exchange { - name: "UTC".to_string(), + name: "Coordinated Universal Time".to_string(), city: "UTC".to_string(), - timezone: chrono_tz::UTC, - sessions: vec![], + tz: chrono_tz::UTC, + open_time: NaiveTime::from_hms_opt(0, 0, 0).unwrap(), + close_time: NaiveTime::from_hms_opt(23, 59, 59).unwrap(), }, + // 1. NYSE (New York) Exchange { - name: "NEW YORK STOCK EXCHANGE".to_string(), - city: "NEW YORK".to_string(), - timezone: chrono_tz::America::New_York, - sessions: vec![TradingSession { - open: NaiveTime::from_hms_opt(9, 30, 0).unwrap(), - close: NaiveTime::from_hms_opt(16, 0, 0).unwrap(), - }], + name: "New York Stock Exchange".to_string(), + city: "New York".to_string(), + tz: chrono_tz::America::New_York, + open_time: NaiveTime::from_hms_opt(9, 30, 0).unwrap(), + close_time: NaiveTime::from_hms_opt(16, 0, 0).unwrap(), }, + // 2. Shanghai Stock Exchange Exchange { - name: "SHANGHAI STOCK EXCHANGE".to_string(), - city: "SHANGHAI".to_string(), - timezone: chrono_tz::Asia::Shanghai, - sessions: vec![ - TradingSession { - open: NaiveTime::from_hms_opt(9, 30, 0).unwrap(), - close: NaiveTime::from_hms_opt(11, 30, 0).unwrap(), - }, - TradingSession { - open: NaiveTime::from_hms_opt(13, 0, 0).unwrap(), - close: NaiveTime::from_hms_opt(15, 0, 0).unwrap(), - }, - ], + name: "Shanghai Stock Exchange".to_string(), + city: "Shanghai".to_string(), + tz: chrono_tz::Asia::Shanghai, + open_time: NaiveTime::from_hms_opt(9, 30, 0).unwrap(), + close_time: NaiveTime::from_hms_opt(15, 0, 0).unwrap(), }, + // 3. Euronext Paris Exchange { - name: "EURONEXT PARIS".to_string(), - city: "PARIS".to_string(), - timezone: chrono_tz::Europe::Paris, - sessions: vec![TradingSession { - open: NaiveTime::from_hms_opt(9, 0, 0).unwrap(), - close: NaiveTime::from_hms_opt(17, 30, 0).unwrap(), - }], + name: "Euronext Paris".to_string(), + city: "Paris".to_string(), + tz: chrono_tz::Europe::Paris, + open_time: NaiveTime::from_hms_opt(9, 0, 0).unwrap(), + close_time: NaiveTime::from_hms_opt(17, 30, 0).unwrap(), }, + // 4. Japan Exchange Group (Tokyo) Exchange { - name: "JAPAN EXCHANGE GROUP".to_string(), - city: "TOKYO".to_string(), - timezone: chrono_tz::Asia::Tokyo, - sessions: vec![ - TradingSession { - open: NaiveTime::from_hms_opt(9, 0, 0).unwrap(), - close: NaiveTime::from_hms_opt(11, 30, 0).unwrap(), - }, - TradingSession { - open: NaiveTime::from_hms_opt(12, 30, 0).unwrap(), - close: NaiveTime::from_hms_opt(15, 30, 0).unwrap(), - }, - ], + name: "Tokyo Stock Exchange".to_string(), + city: "Tokyo".to_string(), + tz: chrono_tz::Asia::Tokyo, + open_time: NaiveTime::from_hms_opt(9, 0, 0).unwrap(), + close_time: NaiveTime::from_hms_opt(15, 0, 0).unwrap(), }, + // 5. Shenzhen Stock Exchange Exchange { - name: "SHENZHEN STOCK EXCHANGE".to_string(), - city: "SHENZHEN".to_string(), - timezone: chrono_tz::Asia::Shanghai, - sessions: vec![ - TradingSession { - open: NaiveTime::from_hms_opt(9, 30, 0).unwrap(), - close: NaiveTime::from_hms_opt(11, 30, 0).unwrap(), - }, - TradingSession { - open: NaiveTime::from_hms_opt(13, 0, 0).unwrap(), - close: NaiveTime::from_hms_opt(15, 0, 0).unwrap(), - }, - ], + name: "Shenzhen Stock Exchange".to_string(), + city: "Shenzhen".to_string(), + tz: chrono_tz::Asia::Shanghai, + open_time: NaiveTime::from_hms_opt(9, 30, 0).unwrap(), + close_time: NaiveTime::from_hms_opt(15, 0, 0).unwrap(), }, + // 6. Hong Kong Exchanges and Clearing Exchange { - name: "HONG KONG EXCHANGES".to_string(), - city: "HONG KONG".to_string(), - timezone: chrono_tz::Asia::Hong_Kong, - sessions: vec![ - TradingSession { - open: NaiveTime::from_hms_opt(9, 30, 0).unwrap(), - close: NaiveTime::from_hms_opt(12, 0, 0).unwrap(), - }, - TradingSession { - open: NaiveTime::from_hms_opt(13, 0, 0).unwrap(), - close: NaiveTime::from_hms_opt(16, 0, 0).unwrap(), - }, - ], + name: "Hong Kong Stock Exchange".to_string(), + city: "Hong Kong".to_string(), + tz: chrono_tz::Asia::Hong_Kong, + open_time: NaiveTime::from_hms_opt(9, 30, 0).unwrap(), + close_time: NaiveTime::from_hms_opt(16, 0, 0).unwrap(), }, + // 7. TMX Group (Toronto) Exchange { - name: "TMX GROUP".to_string(), - city: "TORONTO".to_string(), - timezone: chrono_tz::America::Toronto, - sessions: vec![TradingSession { - open: NaiveTime::from_hms_opt(9, 30, 0).unwrap(), - close: NaiveTime::from_hms_opt(16, 0, 0).unwrap(), - }], + name: "Toronto Stock Exchange".to_string(), + city: "Toronto".to_string(), + tz: chrono_tz::America::Toronto, + open_time: NaiveTime::from_hms_opt(9, 30, 0).unwrap(), + close_time: NaiveTime::from_hms_opt(16, 0, 0).unwrap(), }, + // 8. London Stock Exchange Exchange { - name: "LONDON STOCK EXCHANGE".to_string(), - city: "LONDON".to_string(), - timezone: chrono_tz::Europe::London, - sessions: vec![TradingSession { - open: NaiveTime::from_hms_opt(8, 0, 0).unwrap(), - close: NaiveTime::from_hms_opt(16, 30, 0).unwrap(), - }], + name: "London Stock Exchange".to_string(), + city: "London".to_string(), + tz: chrono_tz::Europe::London, + open_time: NaiveTime::from_hms_opt(8, 0, 0).unwrap(), + close_time: NaiveTime::from_hms_opt(16, 30, 0).unwrap(), }, + // 9. National Stock Exchange of India (NSE) Exchange { - name: "NATIONAL STOCK EXCHANGE OF INDIA".to_string(), - city: "INDIA".to_string(), - timezone: chrono_tz::Asia::Kolkata, - sessions: vec![TradingSession { - open: NaiveTime::from_hms_opt(9, 15, 0).unwrap(), - close: NaiveTime::from_hms_opt(15, 30, 0).unwrap(), - }], + name: "National Stock Exchange of India".to_string(), + city: "Mumbai".to_string(), + tz: chrono_tz::Asia::Kolkata, + open_time: NaiveTime::from_hms_opt(9, 15, 0).unwrap(), + close_time: NaiveTime::from_hms_opt(15, 30, 0).unwrap(), }, ] } \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 58beba2..a9f994f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,8 +6,23 @@ use iced::widget::{column, container, row, text}; use iced::{Element, Length, Color, Theme, Subscription}; use chrono::{DateTime, Utc}; use std::time::Duration; +use std::path::Path; pub fn main() -> iced::Result { + // Chargement propre de l'icône avec la crate `image` + let icon = if Path::new("clock.png").exists() { + match image::open("clock.png") { + Ok(img) => { + let rgba = img.to_rgba8(); + let (width, height) = rgba.dimensions(); + iced::window::icon::from_rgba(rgba.into_raw(), width, height).ok() + } + Err(_) => None, + } + } else { + None + }; + iced::application( "Horloges Boursières Mondiales", WorldClocksApp::update, @@ -15,7 +30,8 @@ pub fn main() -> iced::Result { ) .subscription(WorldClocksApp::subscription) .window(iced::window::Settings { - size: iced::Size { width: 1600.0, height: 320.0 }, + size: iced::Size { width: 1700.0, height: 320.0 }, + icon, ..Default::default() }) .run_with(WorldClocksApp::new) @@ -62,15 +78,17 @@ impl WorldClocksApp { let local_time = exchange.local_time(&self.now); let time_str = local_time.format("%H:%M:%S").to_string(); - let mut col = column![].spacing(5).align_x(iced::Alignment::Center); + // En-tête normalisé sur une hauteur fixe pour éviter tout décalage + let mut col = column![].spacing(4).align_x(iced::Alignment::Center); if is_utc { col = col.push( text("UTC") - .size(14) + .size(13) .style(|_theme: &Theme| text::Style { color: Some(Color::from_rgb(0.0, 0.8, 0.8)) }) ); - col = col.push(text("").size(12)); + // Espace vide invisible pour garder exactement la même hauteur que les lignes "ville + statut" des autres bourses + col = col.push(text(" ").size(11)); } else { col = col.push(text(exchange.city.clone()).size(13)); let is_open = exchange.is_open(&self.now); @@ -81,12 +99,12 @@ impl WorldClocksApp { }; col = col.push( text(status_text) - .size(12) + .size(11) .style(move |_theme: &Theme| text::Style { color: Some(status_color) }) ); } - // Horloge analogique graphique (1.5x) + // Horloge analogique graphique col = col.push(clock::view_clock(local_time)); // Horloge numérique @@ -97,9 +115,11 @@ impl WorldClocksApp { .style(move |_theme: &Theme| text::Style { color: Some(digital_color) }) ); + // Conteneur strict aux dimensions fixes absolues let boxed_clock = container(col) - .width(Length::Fixed(160.0)) - .padding(8) + .width(Length::Fixed(155.0)) + .height(Length::Fixed(230.0)) + .padding(6) .style(|_theme: &Theme| container::Style { background: Some(iced::Background::Color(Color::from_rgb(0.12, 0.12, 0.15))), border: iced::Border {