diff --git a/Cargo.lock b/Cargo.lock index 7b83fce..062fda0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ab_glyph" -version = "0.2.23" +version = "0.2.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80179d7dd5d7e8c285d67c4a1e652972a92de7475beddfb92028c76463b13225" +checksum = "79faae4620f45232f599d9bc7b290f88247a0834162c4495ab2f02d60004adfb" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser", @@ -33,7 +33,7 @@ dependencies = [ "libloading 0.7.4", "lock_api", "parking_lot", - "paste 1.0.14", + "paste 1.0.15", "repr_offset", "rustc_version", "serde", @@ -51,7 +51,7 @@ dependencies = [ "as_derive_utils", "core_extensions", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "rustc_version", "syn 1.0.109", "typed-arena", @@ -68,9 +68,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -82,10 +82,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] -name = "aes" -version = "0.8.3" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", @@ -107,13 +113,34 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] +[[package]] +name = "aligned-vec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" + +[[package]] +name = "aligned-vec" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e0966165eaf052580bd70eb1b32cb3d6245774c0104d1b2793e9650bf83b52a" +dependencies = [ + "equator", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "android-activity" version = "0.4.3" @@ -126,12 +153,33 @@ dependencies = [ "jni-sys", "libc", "log", - "ndk", + "ndk 0.7.0", "ndk-context", - "ndk-sys", + "ndk-sys 0.4.1+23.1.7779620", "num_enum 0.6.1", ] +[[package]] +name = "android-activity" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" +dependencies = [ + "android-properties", + "bitflags 2.6.0", + "cc", + "cesu8", + "jni", + "jni-sys", + "libc", + "log", + "ndk 0.8.0", + "ndk-context", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum 0.7.3", + "thiserror", +] + [[package]] name = "android-properties" version = "0.2.2" @@ -154,19 +202,68 @@ dependencies = [ ] [[package]] -name = "ansi_term" -version = "0.12.1" +name = "anstream" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ - "winapi", + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "approx" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" +dependencies = [ + "num-traits", +] [[package]] name = "approx" @@ -178,16 +275,39 @@ dependencies = [ ] [[package]] -name = "arrayref" -version = "0.3.7" +name = "arbitrary" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" + +[[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 1.0.86", + "quote 1.0.37", + "syn 2.0.75", +] + +[[package]] +name = "arrayref" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" [[package]] name = "as_derive_utils" @@ -197,58 +317,76 @@ checksum = "ff3c96645900a44cf11941c111bd08a6573b0e2f9f69bc9264b179d8fae753c4" dependencies = [ "core_extensions", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 1.0.109", ] [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] [[package]] name = "atomic-polyfill" -version = "0.1.11" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" dependencies = [ "critical-section", ] [[package]] -name = "atty" -version = "0.2.14" +name = "atomic-waker" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "av1-grain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom", + "num-rational 0.4.2", + "v_frame", +] + +[[package]] +name = "avif-serialize" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876c75a42f6364451a033496a14c44bffe41f5f4a8236f697391f11024e596d2" +dependencies = [ + "arrayvec", +] [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.7.4", "object", "rustc-demangle", ] @@ -267,24 +405,24 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bindgen" -version = "0.59.2" +version = "0.66.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "cexpr", "clang-sys", - "clap", - "env_logger", "lazy_static", "lazycell", "log", "peeking_take_while", + "prettyplease", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "regex", "rustc-hash", "shlex", + "syn 2.0.75", "which", ] @@ -306,6 +444,12 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "bitstream-io" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b81e1519b0d82120d2fd469d5bfb2919a9361c48b02d82d04befc1cdd2002452" + [[package]] name = "block" version = "0.1.6" @@ -327,7 +471,16 @@ version = "0.1.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" dependencies = [ - "objc-sys", + "objc-sys 0.2.0-beta.2", +] + +[[package]] +name = "block-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" +dependencies = [ + "objc-sys 0.3.5", ] [[package]] @@ -336,8 +489,18 @@ version = "0.2.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" dependencies = [ - "block-sys", - "objc2-encode", + "block-sys 0.1.0-beta.1", + "objc2-encode 2.0.0-pre.2", +] + +[[package]] +name = "block2" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" +dependencies = [ + "block-sys 0.2.1", + "objc2 0.4.1", ] [[package]] @@ -347,16 +510,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3902fc846b836c3c020710520d985de20449aa341a43e8f5b698cd25bbd8b5f2" [[package]] -name = "bumpalo" -version = "3.13.0" +name = "built" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "236e6289eda5a812bc6b53c3b024039382a2895fbbeef2d748b2931546d392c4" + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.75", +] [[package]] name = "byteorder" @@ -365,10 +548,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] -name = "bytes" -version = "1.5.0" +name = "byteorder-lite" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "bzip2" @@ -425,7 +614,7 @@ checksum = "691d0c66b1fb4881be80a760cb8fe76ea97218312f9dfe2c9cc0f496ca279cb1" dependencies = [ "glib-sys 0.17.10", "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", ] [[package]] @@ -454,14 +643,74 @@ dependencies = [ ] [[package]] -name = "cc" -version = "1.0.79" +name = "calloop" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" +dependencies = [ + "bitflags 2.6.0", + "log", + "polling", + "rustix", + "slab", + "thiserror", +] + +[[package]] +name = "calloop" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" +dependencies = [ + "bitflags 2.6.0", + "log", + "polling", + "rustix", + "slab", + "thiserror", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" +dependencies = [ + "calloop 0.12.4", + "rustix", + "wayland-backend", + "wayland-client 0.31.5", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" +dependencies = [ + "calloop 0.13.0", + "rustix", + "wayland-backend", + "wayland-client 0.31.5", +] + +[[package]] +name = "cc" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" dependencies = [ "jobserver", + "libc", + "shlex", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cexpr" version = "0.6.0" @@ -473,9 +722,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.3" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "215c0072ecc28f92eeb0eea38ba63ddfcb65c2828c46311d646f1a3ff5f9841c" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", "target-lexicon", @@ -513,17 +762,28 @@ dependencies = [ ] [[package]] -name = "chrono" -version = "0.4.33" +name = "cgmath" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "1a98d30140e3296250832bbaaff83b27dcd6fa3cc70fb6f1f3e5c9c0023b5317" +dependencies = [ + "approx 0.4.0", + "num-traits", +] + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", + "serde", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -545,28 +805,27 @@ dependencies = [ "flate2", "fns", "futures", - "geo", + "geo 0.26.0", "geo-macros", "geo-types", "geojson 0.24.1", + "gi", "gl", "glib-build-tools", - "glib-macros 0.19.2", + "glib-macros 0.19.9", "glow", "glue", "gtk4", - "image", + "image 0.24.9", "imgref", "indexmap", "lazy_static", "libadwaita", - "libloading 0.8.3", + "libloading 0.8.5", "ndarray", "npyz", "num-traits", "once_cell", - "plotters", - "plotters-backend", "proj", "proj-sys", "quadtree_rs", @@ -579,7 +838,7 @@ dependencies = [ "relm4-icons", "reqwest", "rgb", - "rstar", + "rstar 0.12.0", "serde", "serde_json", "shapefile", @@ -591,7 +850,7 @@ dependencies = [ "thiserror", "tokio", "tokio-condvar", - "toml 0.8.19", + "toml", "topojson", "tracing", "tracing-subscriber", @@ -611,35 +870,30 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", - "libloading 0.7.4", + "libloading 0.8.5", ] [[package]] -name = "clap" -version = "2.34.0" +name = "clipboard-win" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "9fdf5e01086b6be750428ba4a40619f847eb2e95756eee84b18e06e5f0b50342" dependencies = [ - "ansi_term", - "atty", - "bitflags 1.3.2", - "strsim 0.8.0", - "textwrap", - "unicode-width", - "vec_map", + "lazy-bytes-cast", + "winapi", ] [[package]] name = "cmake" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" dependencies = [ "cc", ] @@ -654,8 +908,8 @@ dependencies = [ "block", "cocoa-foundation", "core-foundation", - "core-graphics", - "foreign-types", + "core-graphics 0.22.3", + "foreign-types 0.3.2", "libc", "objc", ] @@ -681,10 +935,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] -name = "const-cstr" -version = "0.3.0" +name = "colorchoice" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3d0b5ff30645a68f35ece8cea4556ca14ef8a1651455f789a099a0513532a6" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] [[package]] name = "const_panic" @@ -698,6 +971,20 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "copypasta" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb85422867ca93da58b7f95fb5c0c10f6183ed6e1ef8841568968a896d3a858" +dependencies = [ + "clipboard-win", + "objc", + "objc-foundation", + "objc_id", + "smithay-clipboard", + "x11-clipboard", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -710,9 +997,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core-graphics" @@ -723,7 +1010,20 @@ dependencies = [ "bitflags 1.3.2", "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types 0.5.0", "libc", ] @@ -738,18 +1038,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-text" -version = "19.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" -dependencies = [ - "core-foundation", - "core-graphics", - "foreign-types", - "libc", -] - [[package]] name = "core_extensions" version = "1.5.3" @@ -767,27 +1055,27 @@ checksum = "69f3b219d28b6e3b4ac87bc1fc522e0803ab22e055da177bff0068c4150c61a6" [[package]] name = "cpufeatures" -version = "0.2.8" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "critical-section" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" +checksum = "f64009896348fc5af4222e9cf7d7d82a95a256c634ebcf61c53e4ea461422242" [[package]] name = "crossbeam" @@ -804,9 +1092,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -841,9 +1129,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -861,6 +1149,12 @@ dependencies = [ "typenum", ] +[[package]] +name = "cursor-icon" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" + [[package]] name = "darling" version = "0.9.0" @@ -881,7 +1175,7 @@ dependencies = [ "ident_case", "proc-macro2 0.4.30", "quote 0.6.13", - "strsim 0.7.0", + "strsim", "syn 0.15.44", ] @@ -906,6 +1200,15 @@ dependencies = [ "time", ] +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + [[package]] name = "derive_builder" version = "0.7.2" @@ -951,16 +1254,6 @@ dependencies = [ "dirs-sys", ] -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - [[package]] name = "dirs-sys" version = "0.4.1" @@ -973,17 +1266,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "dispatch" version = "0.2.0" @@ -996,48 +1278,36 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.3", + "libloading 0.8.5", ] [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "dwrote" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" -dependencies = [ - "lazy_static", - "libc", - "winapi", - "wio", -] +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "earcutr" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0812b44697951d35fde8fcb0da81c9de7e809e825a66bbf1ecb79d9829d4ca3d" +checksum = "79127ed59a85d7687c409e9978547cffb7dc79675355ed22da6b66fd5f6ead01" dependencies = [ - "itertools", + "itertools 0.11.0", "num-traits", ] [[package]] name = "either" -version = "1.8.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -1050,27 +1320,37 @@ checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" [[package]] name = "enum_dispatch" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" dependencies = [ "once_cell", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] [[package]] -name = "env_logger" -version = "0.9.3" +name = "env_filter" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" dependencies = [ - "atty", - "humantime", "log", "regex", - "termcolor", +] + +[[package]] +name = "env_logger" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", ] [[package]] @@ -1085,6 +1365,26 @@ dependencies = [ "shared_library", ] +[[package]] +name = "equator" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c35da53b5a021d2484a7cc49b2ac7f2d840f8236a286f84202369bd338d761ea" +dependencies = [ + "equator-macro", +] + +[[package]] +name = "equator-macro" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf679796c0322556351f287a51b49e48f7c4986e727b5dd78c972d30e2e16cc" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.75", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -1093,34 +1393,53 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", ] +[[package]] +name = "etws_loader" +version = "0.1.0" +dependencies = [ + "abi_stable", + "anyhow", + "byteorder", + "chrono", + "flate2", + "geo 0.28.0", + "nom", + "nom-derive", + "num-traits", + "radarg_plugin_interface", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "euclid" -version = "0.22.9" +version = "0.22.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f253bc5c813ca05792837a0ff4b3a580336b224512d48f7eda1d7dd9210787" +checksum = "e0f0eb73b934648cd7a4a61f1b15391cd95dab0b4da6e2e66c2a072c144b4a20" dependencies = [ "num-traits", ] [[package]] name = "exr" -version = "1.7.0" +version = "1.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1e481eb11a482815d3e9d618db8c42a93207134662873809335a92327440c18" +checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" dependencies = [ "bit_field", - "flume 0.10.14", + "flume", "half", "lebe", - "miniz_oxide", + "miniz_oxide 0.7.4", "rayon-core", "smallvec", "zune-inflate", @@ -1128,9 +1447,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fdeflate" @@ -1143,14 +1462,14 @@ dependencies = [ [[package]] name = "femtovg" -version = "0.9.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad3cf7e8f8e3c684b418c2640c931afc8bbc7ebe547bed6bf64170f1f51d57c9" +checksum = "47921d14afc4daad9bedc926099bc6edcaa23e37a957448f86cdefcbafe2f632" dependencies = [ "bitflags 2.6.0", "fnv", "glow", - "image", + "image 0.25.2", "imgref", "log", "lru", @@ -1169,57 +1488,38 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ - "memoffset 0.9.0", + "memoffset 0.9.1", "rustc_version", ] [[package]] name = "filetime" -version = "0.2.21" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +checksum = "bf401df4a4e3872c4fe8151134cf483738e74b67fc934d6532c882b3d24a4550" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", - "windows-sys 0.48.0", + "libredox 0.1.3", + "windows-sys 0.59.0", ] [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "9c0596c1eac1f9e04ed902702e9878208b336edc9d6fddc8a48387349bab3666" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.0", ] -[[package]] -name = "float-ord" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bad48618fdb549078c333a7a8528acb57af271d0433bdecd523eb620628364e" - [[package]] name = "float_next_after" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8" -[[package]] -name = "flume" -version = "0.10.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" -dependencies = [ - "futures-core", - "futures-sink", - "nanorand", - "pin-project", - "spin", -] - [[package]] name = "flume" version = "0.11.0" @@ -1247,38 +1547,34 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "font-kit" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21fe28504d371085fae9ac7a3450f0b289ab71e07c8e57baa3fb68b9e57d6ce5" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "core-foundation", - "core-graphics", - "core-text", - "dirs-next", - "dwrote", - "float-ord", - "freetype", - "lazy_static", - "libc", - "log", - "pathfinder_geometry", - "pathfinder_simd", - "walkdir", - "winapi", - "yeslogic-fontconfig-sys", -] - [[package]] name = "foreign-types" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.75", ] [[package]] @@ -1287,6 +1583,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1303,22 +1605,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] -name = "freetype" -version = "0.7.0" +name = "freetype-rs" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee38378a9e3db1cc693b4f88d166ae375338a0ff75cb8263e1c601d51f35dc6" +checksum = "d1d1f81b925f09d7040682dbc91eb1b6ad43232f4bc6ee080f518001c05b5415" dependencies = [ + "bitflags 2.6.0", "freetype-sys", "libc", ] [[package]] name = "freetype-sys" -version = "0.13.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" +checksum = "ddb84abd9992afaa8eb9b8bef907a94553504d0a890924e1bf1f1ab1249455af" dependencies = [ - "cmake", + "cc", "libc", "pkg-config", ] @@ -1378,7 +1681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] @@ -1501,7 +1804,24 @@ dependencies = [ "log", "num-traits", "robust", - "rstar", + "rstar 0.11.0", +] + +[[package]] +name = "geo" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f811f663912a69249fa620dcd2a005db7254529da2d8a0b23942e81f47084501" +dependencies = [ + "earcutr", + "float_next_after", + "geo-types", + "geographiclib-rs", + "log", + "num-traits", + "robust", + "rstar 0.12.0", + "spade", ] [[package]] @@ -1509,30 +1829,31 @@ name = "geo-macros" version = "0.1.0" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "regex", "syn 2.0.75", ] [[package]] name = "geo-types" -version = "0.7.11" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9705398c5c7b26132e74513f4ee7c1d7dafd786004991b375c172be2be0eecaa" +checksum = "9ff16065e5720f376fbced200a5ae0f47ace85fd70b7e54269790281353b6d61" dependencies = [ - "approx", + "approx 0.5.1", "num-traits", - "rstar", + "rstar 0.11.0", + "rstar 0.12.0", "serde", ] [[package]] name = "geographiclib-rs" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea804e7bd3c6a4ca6a01edfa35231557a8a81d4d3f3e1e2b650d028c42592be" +checksum = "e6e5ed84f8089c70234b0a8e0aedb6dc733671612ddc0d37c6066052f9781960" dependencies = [ - "lazy_static", + "libm", ] [[package]] @@ -1562,10 +1883,20 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.2.10" +name = "gethostname" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -1574,11 +1905,56 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gi" +version = "0.1.0" +dependencies = [ + "aligned-vec 0.6.1", + "anyhow", + "bytemuck", + "byteorder", + "cgmath", + "chrono", + "copypasta", + "dirs", + "env_logger", + "femtovg", + "flate2", + "freetype-rs", + "geo 0.28.0", + "glow", + "glsl", + "glsl-quasiquote", + "glutin", + "glutin-winit", + "image 0.25.2", + "include_dir", + "log", + "lru", + "nalgebra 0.33.0", + "nalgebra-glm", + "ndarray", + "nom", + "nom-derive", + "once_cell", + "pathfinder_geometry", + "raw-window-handle", + "regex", + "rust-embed", + "serde", + "serde_json", + "tempfile", + "thiserror", + "tinyfiledialogs", + "toml", + "tracker", +] + [[package]] name = "gif" -version = "0.12.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" dependencies = [ "color_quant", "weezl", @@ -1586,9 +1962,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "gio" @@ -1616,7 +1992,7 @@ dependencies = [ "glib-sys 0.17.10", "gobject-sys 0.17.10", "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", "winapi", ] @@ -1661,7 +2037,7 @@ checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" dependencies = [ "khronos_api 3.1.0", "log", - "xml-rs 0.8.19", + "xml-rs 0.8.21", ] [[package]] @@ -1725,20 +2101,20 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 1.0.109", ] [[package]] name = "glib-macros" -version = "0.19.2" +version = "0.19.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f5897ca27a83e4cdc7b4666850bade0a2e73e17689aabafcc9acddad9d823b8" +checksum = "4429b0277a14ae9751350ad9b658b1be0abb5b54faa5bcdf6e74a3372582fad7" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro-crate 3.1.0", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] @@ -1751,7 +2127,7 @@ dependencies = [ "heck 0.5.0", "proc-macro-crate 3.1.0", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] @@ -1762,7 +2138,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d80aa6ea7bba0baac79222204aa786a6293078c210abe69ef1336911d4bdc4f0" dependencies = [ "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", ] [[package]] @@ -1793,6 +2169,27 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glsl" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "577ac945ce66a4b7004c6e2807f517f94ef027dda89df578abe1fbb979d22f49" +dependencies = [ + "nom", +] + +[[package]] +name = "glsl-quasiquote" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165f0276eb5b572678e2658b357d669aa08eca35032ca20381c24d58b46cca62" +dependencies = [ + "glsl", + "proc-macro-faithful-display", + "proc-macro2 1.0.86", + "quote 1.0.37", +] + [[package]] name = "glue" version = "0.8.7" @@ -1803,6 +2200,71 @@ dependencies = [ "paste 0.1.18", ] +[[package]] +name = "glutin" +version = "0.31.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fcd4ae4e86d991ad1300b8f57166e5be0c95ef1f63f3f5b827f8a164548746" +dependencies = [ + "bitflags 2.6.0", + "cfg_aliases", + "cgl", + "core-foundation", + "dispatch", + "glutin_egl_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "icrate", + "libloading 0.8.5", + "objc2 0.4.1", + "once_cell", + "raw-window-handle", + "wayland-sys 0.31.4", + "windows-sys 0.48.0", + "x11-dl", +] + +[[package]] +name = "glutin-winit" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebcdfba24f73b8412c5181e56f092b5eff16671c514ce896b258a0a64bd7735" +dependencies = [ + "cfg_aliases", + "glutin", + "raw-window-handle", + "winit 0.29.15", +] + +[[package]] +name = "glutin_egl_sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77cc5623f5309ef433c3dd4ca1223195347fe62c413da8e2fdd0eb76db2d9bcd" +dependencies = [ + "gl_generator 0.14.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "glutin_glx_sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a165fd686c10dcc2d45380b35796e577eacfd43d4660ee741ec8ebe2201b3b4f" +dependencies = [ + "gl_generator 0.14.0", + "x11-dl", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +dependencies = [ + "gl_generator 0.14.0", +] + [[package]] name = "gobject-sys" version = "0.17.10" @@ -1811,7 +2273,7 @@ checksum = "cd34c3317740a6358ec04572c1bcfd3ac0b5b6529275fae255b237b314bb8062" dependencies = [ "glib-sys 0.17.10", "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", ] [[package]] @@ -1908,7 +2370,7 @@ checksum = "188211f546ce5801f6d0245c37b6249143a2cb4fa040e54829ca1e76796e9f09" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] @@ -1939,7 +2401,7 @@ checksum = "acfa8cd2aa58da96876eb6276afe617c414d5846d1229274a821c1f8e8aa9e02" dependencies = [ "byteorder", "flate2", - "quick-xml", + "quick-xml 0.31.0", "safe-transmute", "serde", "serde_json", @@ -1949,9 +2411,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -1968,10 +2430,11 @@ dependencies = [ [[package]] name = "half" -version = "2.2.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ + "cfg-if", "crunchy", ] @@ -1985,24 +2448,47 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.14.3" +name = "hash32" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "heapless" -version = "0.7.16" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" dependencies = [ "atomic-polyfill", - "hash32", + "hash32 0.2.1", "rustc_version", "spin", "stable_deref_trait", ] +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "stable_deref_trait", +] + [[package]] name = "heck" version = "0.4.1" @@ -2015,21 +2501,18 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hmac" version = "0.12.1" @@ -2039,6 +2522,15 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "http" version = "0.2.12" @@ -2063,9 +2555,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -2081,9 +2573,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -2118,9 +2610,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2139,6 +2631,17 @@ dependencies = [ "cc", ] +[[package]] +name = "icrate" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" +dependencies = [ + "block2 0.3.0", + "dispatch", + "objc2 0.4.1", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -2157,9 +2660,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.7" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" dependencies = [ "bytemuck", "byteorder", @@ -2167,13 +2670,45 @@ dependencies = [ "exr", "gif", "jpeg-decoder", - "num-rational 0.4.1", "num-traits", "png", "qoi", "tiff", ] +[[package]] +name = "image" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" +dependencies = [ + "bytemuck", + "byteorder-lite", + "color_quant", + "exr", + "gif", + "image-webp", + "num-traits", + "png", + "qoi", + "ravif", + "rayon", + "rgb", + "tiff", + "zune-core", + "zune-jpeg", +] + +[[package]] +name = "image-webp" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79afb8cbee2ef20f59ccd477a218c12a93943d075b492015ecb1bb81f8ee904" +dependencies = [ + "byteorder-lite", + "quick-error", +] + [[package]] name = "imgref" version = "1.10.1" @@ -2181,10 +2716,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" [[package]] -name = "indexmap" -version = "2.2.2" +name = "include_dir" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", +] + +[[package]] +name = "indexmap" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown", @@ -2201,9 +2755,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", "js-sys", @@ -2211,6 +2765,17 @@ dependencies = [ "web-sys", ] +[[package]] +name = "interpolate_name" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.75", +] + [[package]] name = "io-surface" version = "0.15.1" @@ -2230,19 +2795,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] -name = "itertools" -version = "0.10.5" +name = "is_terminal_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", +] [[package]] name = "jni-sys" @@ -2252,27 +2848,27 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "jpeg-decoder" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" dependencies = [ "rayon", ] [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -2290,10 +2886,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] -name = "lazy_static" -version = "1.4.0" +name = "lazy-bytes-cast" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "10257499f089cd156ad82d0a9cd57d9501fa2c989068992a97eb3c27836f206b" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" @@ -2355,9 +2957,20 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "libfuzzer-sys" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" +dependencies = [ + "arbitrary", + "cc", + "once_cell", +] [[package]] name = "libloading" @@ -2371,30 +2984,19 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" - -[[package]] -name = "libredox" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" -dependencies = [ - "bitflags 2.6.0", - "libc", - "redox_syscall 0.4.1", -] +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libredox" @@ -2408,16 +3010,27 @@ dependencies = [ ] [[package]] -name = "linux-raw-sys" -version = "0.4.13" +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", + "redox_syscall 0.5.3", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2425,15 +3038,27 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[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.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +dependencies = [ + "hashbrown", +] [[package]] name = "mach" @@ -2455,14 +3080,23 @@ dependencies = [ [[package]] name = "matrixmultiply" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" +checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" 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", +] + [[package]] name = "memchr" version = "2.7.4" @@ -2478,6 +3112,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -2489,9 +3132,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] @@ -2505,7 +3148,7 @@ dependencies = [ "bitflags 1.3.2", "block", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "log", "objc", ] @@ -2524,14 +3167,23 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", "simd-adler32", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "mio" version = "0.8.11" @@ -2556,6 +3208,60 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "nalgebra" +version = "0.32.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5c17de023a86f59ed79891b2e5d5a94c705dbe904a5b5c9c952ea6221b03e4" +dependencies = [ + "approx 0.5.1", + "matrixmultiply", + "num-complex 0.4.6", + "num-rational 0.4.2", + "num-traits", + "simba 0.8.1", + "typenum", +] + +[[package]] +name = "nalgebra" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c4b5f057b303842cf3262c27e465f4c303572e7f6b0648f60e16248ac3397f4" +dependencies = [ + "approx 0.5.1", + "matrixmultiply", + "nalgebra-macros", + "num-complex 0.4.6", + "num-rational 0.4.2", + "num-traits", + "simba 0.9.0", + "typenum", +] + +[[package]] +name = "nalgebra-glm" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e68879ff227a94627e63bbd518b4f82b8f0cc56bb01a498251507de6d1c412d6" +dependencies = [ + "approx 0.5.1", + "nalgebra 0.32.6", + "num-traits", + "simba 0.8.1", +] + +[[package]] +name = "nalgebra-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.75", +] + [[package]] name = "nanorand" version = "0.7.0" @@ -2567,11 +3273,10 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -2590,7 +3295,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" dependencies = [ "matrixmultiply", - "num-complex 0.4.3", + "num-complex 0.4.6", "num-integer", "num-traits", "rawpointer", @@ -2605,12 +3310,27 @@ checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" dependencies = [ "bitflags 1.3.2", "jni-sys", - "ndk-sys", + "ndk-sys 0.4.1+23.1.7779620", "num_enum 0.5.11", "raw-window-handle", "thiserror", ] +[[package]] +name = "ndk" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" +dependencies = [ + "bitflags 2.6.0", + "jni-sys", + "log", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum 0.7.3", + "raw-window-handle", + "thiserror", +] + [[package]] name = "ndk-context" version = "0.1.1" @@ -2626,6 +3346,21 @@ dependencies = [ "jni-sys", ] +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +dependencies = [ + "jni-sys", +] + +[[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.24.3" @@ -2662,13 +3397,41 @@ dependencies = [ ] [[package]] -name = "npyz" -version = "0.8.1" +name = "nom-derive" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d7d7b4142b8ad36ba84122b91491276a4e9f7104e7f51c8c56f16a7a3825ef" +checksum = "1ff943d68b88d0b87a6e0d58615e8fa07f9fd5a1319fa0a72efc1f62275c79a7" +dependencies = [ + "nom", + "nom-derive-impl", + "rustversion", +] + +[[package]] +name = "nom-derive-impl" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b9a93a84b0d3ec3e70e02d332dc33ac6dfac9cde63e17fcb77172dededa62" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 1.0.109", +] + +[[package]] +name = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + +[[package]] +name = "npyz" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13f27ea175875c472b3df61ece89a6d6ef4e0627f43704e400c782f174681ebd" dependencies = [ "byteorder", - "num-bigint 0.4.3", + "num-bigint 0.4.6", "py_literal", "zip", ] @@ -2710,11 +3473,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -2731,28 +3493,44 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] [[package]] -name = "num-integer" -version = "0.1.45" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.75", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.43" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -2773,20 +3551,20 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", + "num-bigint 0.4.6", "num-integer", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -2810,6 +3588,15 @@ dependencies = [ "num_enum_derive 0.6.1", ] +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive 0.7.3", +] + [[package]] name = "num_enum_derive" version = "0.5.11" @@ -2818,7 +3605,7 @@ checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 1.0.109", ] @@ -2830,7 +3617,19 @@ checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", + "syn 2.0.75", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2 1.0.86", + "quote 1.0.37", "syn 2.0.75", ] @@ -2861,15 +3660,31 @@ version = "0.2.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + [[package]] name = "objc2" version = "0.3.0-beta.3.patch-leaks.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" dependencies = [ - "block2", - "objc-sys", - "objc2-encode", + "block2 0.2.0-alpha.6", + "objc-sys 0.2.0-beta.2", + "objc2-encode 2.0.0-pre.2", +] + +[[package]] +name = "objc2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" +dependencies = [ + "objc-sys 0.3.5", + "objc2-encode 3.0.0", ] [[package]] @@ -2878,9 +3693,15 @@ version = "2.0.0-pre.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" dependencies = [ - "objc-sys", + "objc-sys 0.2.0-beta.2", ] +[[package]] +name = "objc2-encode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" + [[package]] name = "objc_exception" version = "0.1.2" @@ -2901,9 +3722,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "memchr", ] @@ -2916,13 +3737,13 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags 2.6.0", "cfg-if", - "foreign-types", + "foreign-types 0.3.2", "libc", "once_cell", "openssl-macros", @@ -2936,7 +3757,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] @@ -2948,9 +3769,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.101" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -2981,11 +3802,11 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owned_ttf_parser" -version = "0.20.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" +checksum = "490d3a563d3122bf7c911a59b0add9389e5ec0f5f0c3ac6b91ff235a0e6a7f90" dependencies = [ - "ttf-parser 0.20.0", + "ttf-parser 0.24.1", ] [[package]] @@ -3014,9 +3835,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -3024,15 +3845,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.5.3", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.52.6", ] [[package]] @@ -3058,9 +3879,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "paste-impl" @@ -3083,9 +3904,9 @@ dependencies = [ [[package]] name = "pathfinder_simd" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0444332826c70dc47be74a7c6a5fc44e23a7905ad6858d4162b658320455ef93" +checksum = "5cf07ef4804cfa9aea3b04a7bbdd5a40031dbb6b4f2cbaf2b011666c80c5b4f2" dependencies = [ "rustc_version", ] @@ -3116,19 +3937,20 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.0" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.0" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef623c9bbfa0eedf5a0efba11a5ee83209c326653ca31ff019bec3a95bfff2b" +checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" dependencies = [ "pest", "pest_generator", @@ -3136,53 +3958,33 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.0" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e8cba4ec22bada7fc55ffe51e2deb6a0e0db2d0b7ab0b103acc80d2510c190" +checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" dependencies = [ "pest", "pest_meta", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] [[package]] name = "pest_meta" -version = "2.7.0" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01f71cb40bd8bb94232df14b946909e14660e33fc05db3e50ae2a82d7ea0ca0" +checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" dependencies = [ "once_cell", "pest", "sha2", ] -[[package]] -name = "pin-project" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.35", - "syn 2.0.75", -] - [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -3196,63 +3998,57 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "plotters" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" -dependencies = [ - "chrono", - "font-kit", - "image", - "lazy_static", - "num-traits", - "pathfinder_geometry", - "plotters-backend", - "plotters-bitmap", - "plotters-svg", - "ttf-parser 0.17.1", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" - -[[package]] -name = "plotters-bitmap" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cebbe1f70205299abc69e8b295035bb52a6a70ee35474ad10011f0a4efb8543" -dependencies = [ - "gif", - "image", - "plotters-backend", -] - -[[package]] -name = "plotters-svg" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" -dependencies = [ - "plotters-backend", -] - [[package]] name = "png" -version = "0.17.11" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" dependencies = [ "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.7.4", +] + +[[package]] +name = "polling" +version = "3.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2 1.0.86", + "syn 2.0.75", ] [[package]] @@ -3262,7 +4058,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit 0.19.11", + "toml_edit 0.19.15", ] [[package]] @@ -3271,7 +4067,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit 0.21.0", + "toml_edit 0.21.1", ] [[package]] @@ -3282,7 +4078,7 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 1.0.109", "version_check", ] @@ -3294,10 +4090,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "version_check", ] +[[package]] +name = "proc-macro-faithful-display" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5bdf93a22e0e7b3d52e42837f111845a69957294d23671efeeb8d1baef4773a" + [[package]] name = "proc-macro-hack" version = "0.5.20+deprecated" @@ -3322,6 +4124,25 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "profiling" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" +dependencies = [ + "quote 1.0.37", + "syn 2.0.75", +] + [[package]] name = "proj" version = "0.27.2" @@ -3337,9 +4158,9 @@ dependencies = [ [[package]] name = "proj-sys" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921ae7fa2556cbb23d13ba8f166eb47641c76d8e4b7ee867540921b36ec0fda9" +checksum = "601bf4fa1e17fde1a56d303f7bed5c65969cf1822c6baf5d6c2c12c593638fec" dependencies = [ "bindgen", "cmake", @@ -3354,8 +4175,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "102df7a3d46db9d3891f178dcc826dc270a6746277a9ae6436f8d29fd490a8e1" dependencies = [ - "num-bigint 0.4.3", - "num-complex 0.4.3", + "num-bigint 0.4.6", + "num-complex 0.4.6", "num-traits", "pest", "pest_derive", @@ -3380,6 +4201,12 @@ dependencies = [ "num", ] +[[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.31.0" @@ -3391,10 +4218,19 @@ dependencies = [ ] [[package]] -name = "quick_cache" -version = "0.4.1" +name = "quick-xml" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c20af3800cee5134b79a3bd4a3d4b583c16ccfa5f53338f46400851a5b3819" +checksum = "6f24d770aeca0eacb81ac29dfbc55ebcc09312fdd1f8bbecdc7e4a84e000e3b4" +dependencies = [ + "memchr", +] + +[[package]] +name = "quick_cache" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a4b807ec70346b4fac3c13ae967634237847d49871f623fe0d455403346bad4" dependencies = [ "ahash", "equivalent", @@ -3413,9 +4249,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2 1.0.86", ] @@ -3427,11 +4263,84 @@ dependencies = [ "abi_stable", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + [[package]] name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rav1e" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" +dependencies = [ + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools 0.12.1", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "once_cell", + "paste 1.0.15", + "profiling", + "rand", + "rand_chacha", + "simd_helpers", + "system-deps 6.2.2", + "thiserror", + "v_frame", + "wasm-bindgen", +] + +[[package]] +name = "ravif" +version = "0.11.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f0bfd976333248de2078d350bfdf182ff96e168a24d23d2436cef320dd4bdd" +dependencies = [ + "avif-serialize", + "imgref", + "loop9", + "quick-error", + "rav1e", + "rgb", +] [[package]] name = "raw-window-handle" @@ -3447,9 +4356,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.8.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -3465,15 +4374,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.3.5" @@ -3493,21 +4393,30 @@ dependencies = [ ] [[package]] -name = "redox_users" -version = "0.4.4" +name = "redox_syscall" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", - "libredox 0.0.1", + "libredox 0.1.3", "thiserror", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -3517,9 +4426,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -3528,9 +4437,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "relm4" @@ -3538,7 +4447,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf0363f92b6a7eefd985b47f27b7ae168dd2fd5cd4013a338c9b111c33744d1f" dependencies = [ - "flume 0.11.0", + "flume", "fragile", "futures", "gtk4", @@ -3576,7 +4485,7 @@ dependencies = [ "gtk4", "gvdb", "serde", - "toml 0.8.19", + "toml", ] [[package]] @@ -3586,7 +4495,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5885640821d60062497737dd42fd04248d13c7ecccee620caaa4b210fe9905" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] @@ -3601,9 +4510,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.25" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64", "bytes", @@ -3641,9 +4550,9 @@ dependencies = [ [[package]] name = "rgb" -version = "0.8.37" +version = "0.8.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8" +checksum = "0f86ae463694029097b846d8f99fd5536740602ae00022c0c50c5600720b2f71" dependencies = [ "bytemuck", ] @@ -3660,16 +4569,61 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73111312eb7a2287d229f06c00ff35b51ddee180f017ab6dec1f69d62ac098d6" dependencies = [ - "heapless", + "heapless 0.7.17", "num-traits", "smallvec", ] [[package]] -name = "rustc-demangle" -version = "0.1.23" +name = "rstar" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "133315eb94c7b1e8d0cb097e5a710d850263372fd028fff18969de708afc7008" +dependencies = [ + "heapless 0.8.0", + "num-traits", + "smallvec", +] + +[[package]] +name = "rust-embed" +version = "8.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa66af4a4fdd5e7ebc276f115e895611a34739a9c1c01028383d612d550953c0" +dependencies = [ + "rust-embed-impl", + "rust-embed-utils", + "walkdir", +] + +[[package]] +name = "rust-embed-impl" +version = "8.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6125dbc8867951125eec87294137f4e9c2c96566e61bf72c45095a7c77761478" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "rust-embed-utils", + "syn 2.0.75", + "walkdir", +] + +[[package]] +name = "rust-embed-utils" +version = "8.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5347777e9aacb56039b0e1f28785929a8a3b709e87482e7442c72e7c12529d" +dependencies = [ + "sha2", + "walkdir", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -3688,15 +4642,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.8" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3709,15 +4663,21 @@ dependencies = [ ] [[package]] -name = "rustybuzz" -version = "0.13.0" +name = "rustversion" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88117946aa1bfb53c2ae0643ceac6506337f44887f8c9fbfb43587b1cc52ba49" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "rustybuzz" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb9cf8877777222e4a3bc7eb247e398b56baba500c38c1c46842431adc8b55c" dependencies = [ "bitflags 2.6.0", "bytemuck", "smallvec", - "ttf-parser 0.20.0", + "ttf-parser 0.21.1", "unicode-bidi-mirroring", "unicode-ccc", "unicode-properties", @@ -3726,15 +4686,24 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "safe-transmute" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98a01dab6acf992653be49205bdd549f32f17cb2803e8eacf1560bf97259aae8" +checksum = "3944826ff8fa8093089aba3acb4ef44b9446a99a16f3bf4e74af3f77d340ab7d" + +[[package]] +name = "safe_arch" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" +dependencies = [ + "bytemuck", +] [[package]] name = "same-file" @@ -3762,9 +4731,9 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sctk-adwaita" @@ -3774,18 +4743,18 @@ checksum = "cda4e97be1fd174ccc2aae81c8b694e803fa99b34e8fd0f057a9d70698e3ed09" dependencies = [ "ab_glyph", "log", - "memmap2", - "smithay-client-toolkit", + "memmap2 0.5.10", + "smithay-client-toolkit 0.16.1", "tiny-skia", ] [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -3794,9 +4763,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -3804,9 +4773,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" @@ -3824,17 +4793,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] [[package]] name = "serde_json" -version = "1.0.112" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d1bd37ce2324cf3bf85e5a25f96eb4baf0d5aa6eba43e7ae8958870c4ec48ed" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -3866,7 +4836,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1060be2a0bbc35e712ec35ae98119b8def1071a5f2edbe392fd4c899bc2a5f4" dependencies = [ - "foreign-types", + "foreign-types 0.3.2", "objc", "objc-foundation", "thiserror", @@ -3875,9 +4845,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -3886,9 +4856,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -3927,19 +4897,45 @@ dependencies = [ [[package]] name = "shlex" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] +[[package]] +name = "simba" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" +dependencies = [ + "approx 0.5.1", + "num-complex 0.4.6", + "num-traits", + "paste 1.0.15", + "wide", +] + +[[package]] +name = "simba" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a386a501cd104797982c15ae17aafe8b9261315b5d07e3ec803f2ea26be0fa" +dependencies = [ + "approx 0.5.1", + "num-complex 0.4.6", + "num-traits", + "paste 1.0.15", + "wide", +] + [[package]] name = "simd-adler32" version = "0.3.7" @@ -3947,10 +4943,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] -name = "slab" -version = "0.4.8" +name = "simd_helpers" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote 1.0.37", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -3976,9 +4981,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smithay-client-toolkit" @@ -3987,23 +4992,93 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "870427e30b8f2cbe64bf43ec4b86e88fe39b0a84b3f15efd9c9c2d020bc86eb9" dependencies = [ "bitflags 1.3.2", - "calloop", + "calloop 0.10.6", "dlib", "lazy_static", "log", - "memmap2", + "memmap2 0.5.10", "nix 0.24.3", "pkg-config", - "wayland-client", - "wayland-cursor", - "wayland-protocols", + "wayland-client 0.29.5", + "wayland-cursor 0.29.5", + "wayland-protocols 0.29.5", +] + +[[package]] +name = "smithay-client-toolkit" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" +dependencies = [ + "bitflags 2.6.0", + "calloop 0.12.4", + "calloop-wayland-source 0.2.0", + "cursor-icon", + "libc", + "log", + "memmap2 0.9.4", + "rustix", + "thiserror", + "wayland-backend", + "wayland-client 0.31.5", + "wayland-csd-frame", + "wayland-cursor 0.31.5", + "wayland-protocols 0.31.2", + "wayland-protocols-wlr 0.2.0", + "wayland-scanner 0.31.4", + "xkeysym", +] + +[[package]] +name = "smithay-client-toolkit" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" +dependencies = [ + "bitflags 2.6.0", + "calloop 0.13.0", + "calloop-wayland-source 0.3.0", + "cursor-icon", + "libc", + "log", + "memmap2 0.9.4", + "rustix", + "thiserror", + "wayland-backend", + "wayland-client 0.31.5", + "wayland-csd-frame", + "wayland-cursor 0.31.5", + "wayland-protocols 0.32.3", + "wayland-protocols-wlr 0.3.3", + "wayland-scanner 0.31.4", + "xkeysym", +] + +[[package]] +name = "smithay-clipboard" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc8216eec463674a0e90f29e0ae41a4db573ec5b56b1c6c1c71615d249b6d846" +dependencies = [ + "libc", + "smithay-client-toolkit 0.19.2", + "wayland-backend", +] + +[[package]] +name = "smol_str" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +dependencies = [ + "serde", ] [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4015,6 +5090,18 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6734caf0b6f51addd5eeacca12fb39b2c6c14e8d4f3ac42f3a78955c0467458" +[[package]] +name = "spade" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd14cf9e23b5241e1b1289ed3b9afc7746c95ead8df52d9254f5ed2d40c561b" +dependencies = [ + "hashbrown", + "num-traits", + "robust", + "smallvec", +] + [[package]] name = "spin" version = "0.9.8" @@ -4048,17 +5135,11 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "surfman" @@ -4071,7 +5152,7 @@ dependencies = [ "cgl", "cocoa", "core-foundation", - "core-graphics", + "core-graphics 0.22.3", "euclid", "gl_generator 0.14.0", "io-surface", @@ -4085,7 +5166,7 @@ dependencies = [ "servo-display-link", "wayland-sys 0.30.1", "winapi", - "winit", + "winit 0.28.7", "wio", ] @@ -4113,7 +5194,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "unicode-ident", ] @@ -4124,7 +5205,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "unicode-ident", ] @@ -4136,20 +5217,20 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "system-configuration" -version = "0.6.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "bitflags 2.6.0", + "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.6.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ "core-foundation-sys", "libc", @@ -4157,15 +5238,15 @@ dependencies = [ [[package]] name = "system-deps" -version = "6.1.1" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c2de8a4d8f4b823d634affc9cd2a74ec98c53a756f317e529a48046cbf71f3" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ - "cfg-expr 0.15.3", - "heck 0.4.1", + "cfg-expr 0.15.8", + "heck 0.5.0", "pkg-config", - "toml 0.7.5", - "version-compare 0.1.1", + "toml", + "version-compare", ] [[package]] @@ -4177,15 +5258,15 @@ dependencies = [ "cfg-expr 0.16.0", "heck 0.5.0", "pkg-config", - "toml 0.8.19", - "version-compare 0.2.0", + "toml", + "version-compare", ] [[package]] name = "tar" -version = "0.4.38" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" dependencies = [ "filetime", "libc", @@ -4200,60 +5281,42 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", + "once_cell", "rustix", - "windows-sys 0.48.0", -] - -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", + "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -4261,9 +5324,9 @@ dependencies = [ [[package]] name = "tiff" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" dependencies = [ "flate2", "jpeg-decoder", @@ -4272,19 +5335,22 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ + "deranged", + "num-conv", + "powerfmt", "serde", "time-core", ] [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-point" @@ -4318,10 +5384,20 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tinyfiledialogs" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "e25fa0bc43a6566e2cc6d7ac96df3fa5a57beba34445bead1b368ba8fe9ca568" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -4366,7 +5442,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] @@ -4382,28 +5458,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", -] - -[[package]] -name = "toml" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebafdf5ad1220cb59e7d17cf4d2c72015297b75b19a10472f99b89225089240" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.19.11", ] [[package]] @@ -4429,26 +5492,24 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.11" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap", - "serde", - "serde_spanned", "toml_datetime", - "winnow 0.4.7", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "toml_datetime", - "winnow 0.5.35", + "winnow 0.5.40", ] [[package]] @@ -4478,9 +5539,9 @@ dependencies = [ [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -4500,7 +5561,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] @@ -4541,21 +5602,21 @@ dependencies = [ [[package]] name = "tracker" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff9636d15e370187f6bf55b79ce62ebf4221998bc0ba1774d7fa208b007f6bf8" +checksum = "ce5c98457ff700aaeefcd4a4a492096e78a2af1dd8523c66e94a3adb0fdbd415" dependencies = [ "tracker-macros", ] [[package]] name = "tracker-macros" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca029746fbe0efda3298205de77bf759d7fef23ac97902641e0b49a623b0455f" +checksum = "dc19eb2373ccf3d1999967c26c3d44534ff71ae5d8b9dacf78f4b13132229e48" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] @@ -4567,9 +5628,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tstr" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cca3264971090dec0feef3b455a3c178f02762f7550cf4592991ac64b3be2d7e" +checksum = "7f8e0294f14baae476d0dd0a2d780b2e24d66e349a9de876f5126777a37bdba7" dependencies = [ "tstr_proc_macros", ] @@ -4582,15 +5643,15 @@ checksum = "e78122066b0cb818b8afd08f7ed22f7fdbc3e90815035726f0840d0d26c0747a" [[package]] name = "ttf-parser" -version = "0.17.1" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375812fa44dab6df41c195cd2f7fecb488f6c09fbaafb62807488cefab642bff" +checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" [[package]] name = "ttf-parser" -version = "0.20.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" +checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a" [[package]] name = "typed-arena" @@ -4600,21 +5661,21 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-bidi-mirroring" @@ -4630,9 +5691,9 @@ checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -4645,27 +5706,21 @@ dependencies = [ [[package]] name = "unicode-properties" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" +checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524" [[package]] name = "unicode-script" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d817255e1bed6dfd4ca47258685d14d2bdcfbc64fdc9e3819bd5848057b8ecc" +checksum = "ad8d71f5726e5f285a935e9fe8edfd53f0491eb6e9a5774097fdabee7cd8c9cd" [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-xid" @@ -4675,15 +5730,32 @@ checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "v_frame" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f32aaa24bacd11e488aa9ba66369c7cd514885742c9fe08cfe85884db3e92b" +dependencies = [ + "aligned-vec 0.5.0", + "num-traits", + "wasm-bindgen", +] + [[package]] name = "valuable" version = "0.1.0" @@ -4702,12 +5774,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" -[[package]] -name = "version-compare" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" - [[package]] name = "version-compare" version = "0.2.0" @@ -4716,15 +5782,15 @@ checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -4747,34 +5813,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -4784,22 +5851,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ - "quote 1.0.35", + "quote 1.0.37", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -4807,9 +5874,23 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" + +[[package]] +name = "wayland-backend" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90e11ce2ca99c97b940ee83edbae9da2d56a08f9ea8158550fd77fa31722993" +dependencies = [ + "cc", + "downcast-rs", + "rustix", + "scoped-tls", + "smallvec", + "wayland-sys 0.31.4", +] [[package]] name = "wayland-client" @@ -4823,10 +5904,22 @@ dependencies = [ "nix 0.24.3", "scoped-tls", "wayland-commons", - "wayland-scanner", + "wayland-scanner 0.29.5", "wayland-sys 0.29.5", ] +[[package]] +name = "wayland-client" +version = "0.31.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e321577a0a165911bdcfb39cf029302479d7527b517ee58ab0f6ad09edf0943" +dependencies = [ + "bitflags 2.6.0", + "rustix", + "wayland-backend", + "wayland-scanner 0.31.4", +] + [[package]] name = "wayland-commons" version = "0.29.5" @@ -4839,6 +5932,17 @@ dependencies = [ "wayland-sys 0.29.5", ] +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.6.0", + "cursor-icon", + "wayland-backend", +] + [[package]] name = "wayland-cursor" version = "0.29.5" @@ -4846,7 +5950,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" dependencies = [ "nix 0.24.3", - "wayland-client", + "wayland-client 0.29.5", + "xcursor", +] + +[[package]] +name = "wayland-cursor" +version = "0.31.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ef9489a8df197ebf3a8ce8a7a7f0a2320035c3743f3c1bd0bdbccf07ce64f95" +dependencies = [ + "rustix", + "wayland-client 0.31.5", "xcursor", ] @@ -4857,9 +5972,72 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6" dependencies = [ "bitflags 1.3.2", - "wayland-client", + "wayland-client 0.29.5", "wayland-commons", - "wayland-scanner", + "wayland-scanner 0.29.5", +] + +[[package]] +name = "wayland-protocols" +version = "0.31.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" +dependencies = [ + "bitflags 2.6.0", + "wayland-backend", + "wayland-client 0.31.5", + "wayland-scanner 0.31.4", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62989625a776e827cc0f15d41444a3cea5205b963c3a25be48ae1b52d6b4daaa" +dependencies = [ + "bitflags 2.6.0", + "wayland-backend", + "wayland-client 0.31.5", + "wayland-scanner 0.31.4", +] + +[[package]] +name = "wayland-protocols-plasma" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" +dependencies = [ + "bitflags 2.6.0", + "wayland-backend", + "wayland-client 0.31.5", + "wayland-protocols 0.31.2", + "wayland-scanner 0.31.4", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +dependencies = [ + "bitflags 2.6.0", + "wayland-backend", + "wayland-client 0.31.5", + "wayland-protocols 0.31.2", + "wayland-scanner 0.31.4", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd993de54a40a40fbe5601d9f1fbcaef0aebcc5fda447d7dc8f6dcbaae4f8953" +dependencies = [ + "bitflags 2.6.0", + "wayland-backend", + "wayland-client 0.31.5", + "wayland-protocols 0.32.3", + "wayland-scanner 0.31.4", ] [[package]] @@ -4869,8 +6047,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f4303d8fa22ab852f789e75a967f0a2cdc430a607751c0499bada3e451cbd53" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", - "xml-rs 0.8.19", + "quote 1.0.37", + "xml-rs 0.8.21", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7b56f89937f1cf2ee1f1259cf2936a17a1f45d8f0aa1019fae6d470d304cfa6" +dependencies = [ + "proc-macro2 1.0.86", + "quick-xml 0.34.0", + "quote 1.0.37", ] [[package]] @@ -4897,10 +6086,32 @@ dependencies = [ ] [[package]] -name = "web-sys" -version = "0.3.64" +name = "wayland-sys" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "43676fe2daf68754ecf1d72026e4e6c15483198b5d24e888b74d3f22f887a148" +dependencies = [ + "dlib", + "log", + "once_cell", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" dependencies = [ "js-sys", "wasm-bindgen", @@ -4908,19 +6119,30 @@ dependencies = [ [[package]] name = "weezl" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix", +] + +[[package]] +name = "wide" +version = "0.7.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b828f995bf1e9622031f8009f8481a85406ce1f4d4588ff746d872043e855690" +dependencies = [ + "bytemuck", + "safe_arch", ] [[package]] @@ -4941,11 +6163,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -4960,7 +6182,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -4978,7 +6200,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -4987,7 +6209,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -5007,32 +6238,33 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -5043,15 +6275,15 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -5061,15 +6293,15 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -5079,15 +6311,21 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -5097,15 +6335,15 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -5115,15 +6353,15 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -5133,15 +6371,15 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -5151,15 +6389,15 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" @@ -5167,49 +6405,87 @@ version = "0.28.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9596d90b45384f5281384ab204224876e8e8bf7d58366d9b795ad99aa9894b94" dependencies = [ - "android-activity", + "android-activity 0.4.3", "bitflags 1.3.2", "cfg_aliases", "core-foundation", - "core-graphics", + "core-graphics 0.22.3", "dispatch", "instant", "libc", "log", "mio 0.8.11", - "ndk", - "objc2", + "ndk 0.7.0", + "objc2 0.3.0-beta.3.patch-leaks.3", "once_cell", "orbclient", "percent-encoding", "raw-window-handle", "redox_syscall 0.3.5", "sctk-adwaita", - "smithay-client-toolkit", + "smithay-client-toolkit 0.16.1", "wasm-bindgen", - "wayland-client", + "wayland-client 0.29.5", "wayland-commons", - "wayland-protocols", - "wayland-scanner", + "wayland-protocols 0.29.5", + "wayland-scanner 0.29.5", "web-sys", "windows-sys 0.45.0", "x11-dl", ] [[package]] -name = "winnow" -version = "0.4.7" +name = "winit" +version = "0.29.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca" dependencies = [ - "memchr", + "ahash", + "android-activity 0.5.2", + "atomic-waker", + "bitflags 2.6.0", + "bytemuck", + "calloop 0.12.4", + "cfg_aliases", + "core-foundation", + "core-graphics 0.23.2", + "cursor-icon", + "icrate", + "js-sys", + "libc", + "log", + "memmap2 0.9.4", + "ndk 0.8.0", + "ndk-sys 0.5.0+25.2.9519653", + "objc2 0.4.1", + "once_cell", + "orbclient", + "percent-encoding", + "raw-window-handle", + "redox_syscall 0.3.5", + "rustix", + "smithay-client-toolkit 0.18.1", + "smol_str", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client 0.31.5", + "wayland-protocols 0.31.2", + "wayland-protocols-plasma", + "web-sys", + "web-time", + "windows-sys 0.48.0", + "x11-dl", + "x11rb", + "xkbcommon-dl", ] [[package]] name = "winnow" -version = "0.5.35" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] @@ -5242,6 +6518,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "x11-clipboard" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98785a09322d7446e28a13203d2cae1059a0dd3dfb32cb06d0a225f023d8286" +dependencies = [ + "libc", + "x11rb", +] + [[package]] name = "x11-dl" version = "2.21.0" @@ -5254,19 +6540,61 @@ dependencies = [ ] [[package]] -name = "xattr" -version = "0.2.3" +name = "x11rb" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading 0.8.5", + "once_cell", + "rustix", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" + +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", + "linux-raw-sys", + "rustix", ] [[package]] name = "xcursor" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" +checksum = "0ef33da6b1660b4ddbfb3aef0ade110c8b8a781a3b6382fa5f2b5b040fd55f61" + +[[package]] +name = "xkbcommon-dl" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" +dependencies = [ + "bitflags 2.6.0", + "dlib", + "log", + "once_cell", + "xkeysym", +] + +[[package]] +name = "xkeysym" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" [[package]] name = "xml-rs" @@ -5279,39 +6607,28 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.19" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" - -[[package]] -name = "yeslogic-fontconfig-sys" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2bbd69036d397ebbff671b1b8e4d918610c181c5a16073b96f984a38d08c386" -dependencies = [ - "const-cstr", - "dlib", - "once_cell", - "pkg-config", -] +checksum = "539a77ee7c0de333dcc6da69b177380a0b81e0dacfa4f7344c465a36871ee601" [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", + "quote 1.0.37", "syn 2.0.75", ] @@ -5356,15 +6673,20 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", - "libc", "pkg-config", ] +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + [[package]] name = "zune-inflate" version = "0.2.54" @@ -5375,10 +6697,19 @@ dependencies = [ ] [[package]] -name = "zvariant" -version = "4.0.2" +name = "zune-jpeg" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1b3ca6db667bfada0f1ebfc94b2b1759ba25472ee5373d4551bb892616389a" +checksum = "16099418600b4d8f028622f73ff6e3deaabdff330fb9a2a131dea781ee8b0768" +dependencies = [ + "zune-core", +] + +[[package]] +name = "zvariant" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" dependencies = [ "endi", "serde", @@ -5388,24 +6719,24 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "4.0.2" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7a4b236063316163b69039f77ce3117accb41a09567fd24c168e43491e521bc" +checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2 1.0.86", - "quote 1.0.35", - "syn 1.0.109", + "quote 1.0.37", + "syn 2.0.75", "zvariant_utils", ] [[package]] name = "zvariant_utils" -version = "1.1.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00bedb16a193cc12451873fee2a1bc6550225acece0e36f333e68326c73c8172" +checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.35", - "syn 1.0.109", + "quote 1.0.37", + "syn 2.0.75", ] diff --git a/Cargo.toml b/Cargo.toml index 3fb5ad3..3d819f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,92 +1,9 @@ -[package] -name = "cinrad_g" -version = "0.1.0" -edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - - -[dependencies] -cairo-rs = { version = "0.17.0" } -# glib = "0.17.9" -gtk = { version = "0.9", package = "gtk4", features = ["v4_14"] } -geo-types = "0.7.9" -shapefile = { version = "0.4", features = ["geo-types"] } -thiserror = "1.0.40" -num-traits = "0.2.15" -npyz = { version = "0.8.0", features = ["npz"] } -ndarray = { version = "0.15.6", features = ["rayon"] } -quadtree_rs = "0.1.2" -proj-sys = "0.23.1" -glib-macros = "0.19.2" -svg = "0.13.1" -libloading = "0.8.3" -glue = "0.8.7" -epoxy = "0.1.0" -femtovg = "0.9.0" -glow = "0.13.1" -proj = "0.27.2" -image = "0.24.7" -anyhow = "1.0.72" -relm4 = { version = "0.9", features = ["libadwaita"] } -relm4-components = "0.9" -rstar = "*" -geo = "0.26.0" -topojson = "0.5.1" -geojson = "0.24.1" -plotters = "0.3.5" -core_extensions = { version = "1.5.2", default_features = false, features = [ - "std", -] } -plotters-backend = "0.3.5" -tokio = { version = "1.36.0", features = ["full"] } -async-trait = "0.1.77" -lazy_static = "1.4.0" -once_cell = "1.19.0" -relm4-icons = { version = "0.9" } -surfman = "0.8.1" -euclid = "0.22.9" -gl = "0.14.0" -crossbeam = "0.8.4" -chrono = "0.4.32" -tracker = "0.2.1" -abi_stable = "0.11.3" -serde = "1.0.196" -serde_json = "1.0.112" -flate2 = "1.0.28" -toml = "0.8.8" -dirs = "5.0.1" -regex = "1.10.3" -smallvec = "1.13.1" -rayon = "1.8.1" -futures = "0.3.30" -sorted-vec = "0.8.3" -tracing = "0.1.40" -tracing-subscriber = "0.3.18" -indexmap = "2.2.2" -tokio-condvar = "0.1.0" -imgref = "1.10.1" -rgb = "0.8.37" -slippy-map-tiles = "0.16.0" -reqwest = "0.11.25" -url = "2.5.0" -quick_cache = "0.4.1" -fns = "0.0.7" -enum_dispatch = "0.3.12" - - -[build-dependencies] -glib-build-tools = "0.17.0" -[dependencies.geo-macros] -path = "geo-macros" - -[dependencies.radarg_plugin_interface] -path = "radarg_plugin_interface" - -#[dependencies.etws_loader] -#path = "etws_loader" - -[dependencies.adw] -package = "libadwaita" -version = "0.7.0" -features = ["v1_4"] +[workspace] +members = [ + "etws_loader", + "radarg_plugin_interface", + "geo-macros", + "radar-g", + "gi", +] diff --git a/back.txt b/back.txt deleted file mode 100644 index 562849b..0000000 --- a/back.txt +++ /dev/null @@ -1,395 +0,0 @@ - - Layer::geojson_layer_with_path( - "/Users/tsuki/Downloads/new_zhejiang.json", - true, - |_self, c, render, _| { - if let Some(json_resources) = _self.get_resources() { - if let Resources::GeoJson(geojson) = json_resources.deref() { - MapRender::test(&geojson, c, render); - } - } - }, - ), - Layer::new(true, None, |s, c, render, _| { - if let Some(target) = s.render_target() { - if let Ok(_) = c.image_size(target.target) { - let (x, y) = target.size(render); - let (ox, oy) = target.origin(render); - let painter = Paint::image(target.target, ox, oy, x, y, 0.0, 1.0); - let mut path = Path::new(); - path.rect(ox, oy, x, y); - c.fill_path(&path, &painter); - } - } else { - let renderer = RadarEchoRenderer::new(BoundaryNorm::new( - vec![0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65], - vec![ - Color::rgb(0, 172, 164), - Color::rgb(192, 192, 254), - Color::rgb(122, 114, 238), - Color::rgb(30, 38, 208), - Color::rgb(166, 252, 168), - Color::rgb(0, 234, 0), - Color::rgb(16, 146, 26), - Color::rgb(252, 244, 100), - Color::rgb(200, 200, 2), - Color::rgb(140, 140, 0), - Color::rgb(254, 172, 172), - Color::rgb(254, 100, 92), - Color::rgb(238, 2, 48), - Color::rgb(212, 142, 254), - Color::rgb(170, 36, 250), - ], - true, - )); - let loader = Npz; - let data: RadarData2d> = loader - .load("/Users/tsuki/projects/radar-g/test2.npz") - .unwrap(); - let img = renderer.render(render, c, &data); - if let Ok(_) = c.image_size(img.target) { - let (x, y) = img.size(render); - let (ox, oy) = img.origin(render); - println!("{} {} {} {}", x, y, ox, oy); - let painter = Paint::image(img.target, ox, oy, x, y, 0.0, 1.0); - let mut path = Path::new(); - path.rect(ox, oy, x, y); - s.set_render_target(img); - c.fill_path(&path, &painter); - c.flush(); - } - } - }), - - - - - - -############# TEMPLATES ################### -// Monitor::new( - // Render::new( - // Some(Mapper::new( - // Proj::new(Mercator::default().build().as_str()).unwrap(), - // (119.539..121.135).into(), - // (29.13..30.164).into(), - // )), - // RenderConfig { padding: [50.0;4] } - // ) - // ) - - - -// Layer::grid_render_layer_with_path( - // "/users/tsuki/projects/radar-g/test2.npz", - // Npz, - // BoundaryNorm::default(), - // ) - - - -// fn resample( -// &self, -// width_rate: f64, -// height_rate: f64, -// filter_len: f64, -// ) -> Result>, DataError> { -// let width_rate = width_rate.min(1.0); -// let height_rate = height_rate.min(1.0); -// match self.coord_type { -// CoordType::Polar => Err(DataError::FormatError), -// CoordType::LatLon => { -// let width_filtered: ArrayBase, Ix2> = -// Self::_resample(&self.data, width_rate, filter_len); - -// let result: ArrayBase, Ix2> = -// Self::_resample(&width_filtered.t(), height_rate, filter_len) -// .t() -// .to_owned(); - -// let new_dim1: ArrayBase, Ix1> = Self::_resample( -// &Array2::from_shape_vec((1, self.dim1.len()), self.dim1.to_vec()).unwrap(), -// width_rate, -// filter_len, -// ) -// .slice(s![0, ..]) -// .to_owned(); - -// let new_dim2: ArrayBase, Ix1> = Self::_resample( -// &Array2::from_shape_vec((1, self.dim2.len()), self.dim2.to_vec()).unwrap(), -// height_rate, -// filter_len, -// ) -// .slice(s![0, ..]) -// .to_owned(); - -// Ok(RadarData2d { -// dim1: new_dim1, -// dim2: new_dim2, -// data: result, -// coord_type: self.coord_type.to_owned(), -// }) -// } -// } -// } - -// fn _resample<'a, V, R: ndarray::Data>( -// data: &'a ArrayBase, -// rate: f64, -// filter_len: f64, -// ) -> Array2 -// where -// V: Num + Clone + AsPrimitive + FromPrimitive, -// { -// let ori_width = data.ncols(); -// let ori_height = data.nrows(); - -// let new_width = (ori_width as f64 * rate).ceil() as usize; -// let mut result: Array2 = Array2::zeros((ori_height, new_width)); -// (0..ori_height).into_iter().for_each(|height| { -// for width in 0..new_width { -// let center_x = (width as f64 + 0.5) / new_width as f64 * ori_width as f64; -// let filter_start = center_x - filter_len / 2.0; -// let start_idx = (filter_start - 0.5).ceil() as usize; - -// let mut value_sum = 0.0; -// let mut filter_sum = 0.0; - -// for i in 0..filter_len as usize { -// let input_x = start_idx + i; -// let weight = windowed_sinc( -// (input_x as f64 + 0.5 - center_x) * rate, -// (input_x as f64 + 0.5 - filter_start) / filter_len, -// ); -// value_sum += weight * data[[height, input_x.clamp(0, ori_width - 1)]].as_(); -// filter_sum += weight; -// } - -// result[[height, width]] = V::from_f64(value_sum / filter_sum).unwrap(); -// } -// }); -// result -// } - -// pub struct LevelData( -// pub Quadtree>>, -// ); - -// impl LevelData -// where -// T: Num + Clone + AsPrimitive + FromPrimitive + Debug + PartialEq + PartialOrd, -// { -// fn value( -// level_data: Vec>>, -// level_num: usize, -// ) -> Vec>> { -// if level_num == 0 { -// return level_data; -// } - -// let mut result: Vec>> = -// Vec::with_capacity(level_data.len() * 4); - -// let results = level_data -// .iter() -// .flat_map(|v| v.split().into_iter().map(|x| x.value_to_owned())); - -// result.extend(results); - -// return Self::value(result, level_num - 1); -// } - -// fn new(data: &RadarData2d>, level: usize, rate: f64) -> Self { -// // let rate = 1.0 / level as f64; -// let resampled = data.resample(rate, rate, 2.0).unwrap(); -// let blocks = Self::value(vec![resampled], level); -// let mut tree: Quadtree>> = -// quadtree_rs::Quadtree::new(level); - -// blocks.into_iter().for_each(|block| { -// tree.insert( -// AreaBuilder::default() -// .anchor(quadtree_rs::point::Point { -// x: *block.dim1.first().unwrap() as i64, -// y: *block.dim2.first().unwrap() as i64, -// }) -// .dimensions((block.dim1.len() as i64, block.dim2.len() as i64)) -// .build() -// .unwrap(), -// block, -// ); -// }); - -// Self(tree) -// } -// } - -// pub fn levels(data: Radar2d, levels: usize) -> Vec> -// where -// T: Num + Clone + AsPrimitive + FromPrimitive + Debug, -// T: PartialEq + PartialOrd, -// { -// let numerator = 1.0 / levels as f64; -// (0..levels) -// .into_iter() -// .map(|level| LevelData::new(&data, level + 1, 1.0 - level as f64 * numerator)) -// .collect() -// } - - - - - -#[inline] -fn windowed_sinc(x: f64, y: f64) -> f64 { - let x = x * PI; - let sinc = if x != 0.0 { f64::sin(x) / x } else { 1.0 }; - let window = if 0f64 <= y && y <= 1.0 { - 1.0 - (y - 0.5).abs() * 2.0 - } else { - 0f64 - }; - sinc * window -} - -pub enum DownSampleMeth { - STD, - MEAN, - VAR, -} - -#[derive(Clone, Copy, Debug)] -pub enum CoordType { - Polar, - LatLon, -} - - -// let levels: Vec = vec![0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65]; -// let colors = vec![ -// RGBABuilder::default() -// .red(0 as f32 / 255.0) -// .green(172 as f32 / 255.0) -// .blue(164 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(192 as f32 / 255.0) -// .green(192 as f32 / 255.0) -// .blue(254 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(122 as f32 / 255.0) -// .green(114 as f32 / 255.0) -// .blue(238 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(30 as f32 / 255.0) -// .green(38 as f32 / 255.0) -// .blue(208 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(166 as f32 / 255.0) -// .green(252 as f32 / 255.0) -// .blue(168 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(0 as f32 / 255.0) -// .green(234 as f32 / 255.0) -// .blue(0 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(16 as f32 / 255.0) -// .green(146 as f32 / 255.0) -// .blue(26 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(252 as f32 / 255.0) -// .green(244 as f32 / 255.0) -// .blue(100 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(200 as f32 / 255.0) -// .green(200 as f32 / 255.0) -// .blue(2 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(140 as f32 / 255.0) -// .green(140 as f32 / 255.0) -// .blue(0 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(254 as f32 / 255.0) -// .green(172 as f32 / 255.0) -// .blue(172 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(254 as f32 / 255.0) -// .green(100 as f32 / 255.0) -// .blue(92 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(238 as f32 / 255.0) -// .green(2 as f32 / 255.0) -// .blue(48 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(212 as f32 / 255.0) -// .green(142 as f32 / 255.0) -// .blue(254 as f32 / 255.0) -// .build(), -// RGBABuilder::default() -// .red(170 as f32 / 255.0) -// .green(36 as f32 / 255.0) -// .blue(250 as f32 / 255.0) -// .build(), -// ]; - - - - // let texture = ctx.create_texture().expect("Cannot create texture"); - - // ctx.bind_texture(glow::TEXTURE_2D, Some(texture)); - // ctx.tex_image_2d( - // glow::TEXTURE_2D, - // 0, - // glow::RGBA as i32, - // 3000, - // 3000, - // 0, - // glow::RGBA, - // glow::UNSIGNED_BYTE, - // None, - // ); - // ctx.tex_parameter_i32( - // glow::TEXTURE_2D, - // glow::TEXTURE_MIN_FILTER, - // glow::LINEAR as i32, - // ); - // ctx.tex_parameter_i32( - // glow::TEXTURE_2D, - // glow::TEXTURE_MAG_FILTER, - // glow::LINEAR as i32, - // ); - // ctx.framebuffer_texture_2d( - // glow::FRAMEBUFFER, - // glow::COLOR_ATTACHMENT0, - // glow::TEXTURE_2D, - // Some(texture), - // 0, - // ); - - // let depth_buffer = ctx - // .create_renderbuffer() - // .expect("Cannot create renderbuffer"); - // ctx.bind_renderbuffer(glow::RENDERBUFFER, Some(depth_buffer)); - // ctx.renderbuffer_storage(glow::RENDERBUFFER, glow::DEPTH_COMPONENT16, 3000, 3000); - // ctx.framebuffer_renderbuffer( - // glow::FRAMEBUFFER, - // glow::DEPTH_ATTACHMENT, - // glow::RENDERBUFFER, - // Some(depth_buffer), - // ); - // // let id = NonZeroU32::new(ctx.get_parameter_i32(glow::DRAW_FRAMEBUFFER_BINDING) as u32) - // // .expect("No GTK provided framebuffer binding"); - - \ No newline at end of file diff --git a/check.py b/check.py deleted file mode 100644 index 8691492..0000000 --- a/check.py +++ /dev/null @@ -1,9 +0,0 @@ -import numpy as np - -data = np.load("/Users/tsuki/projects/radar-g/test2.npz") - -print(data['lat'][0]) -print(data['lat'][-1]) - -print(data['lon'][0]) -print(data['lon'][-1]) \ No newline at end of file diff --git a/gi/Cargo.toml b/gi/Cargo.toml new file mode 100644 index 0000000..5f4c2da --- /dev/null +++ b/gi/Cargo.toml @@ -0,0 +1,58 @@ +[package] +edition = "2021" +name = "gi" +version = "0.1.0" + +[dependencies] +aligned-vec = "0.6.0" +anyhow = "1.0.86" +bytemuck = { version = "1.16.1", features = ["derive"] } +byteorder = "1.5.0" +cgmath = "0.18.0" +chrono = "0.4.38" +copypasta = "0.10.1" +dirs = "5.0.1" +env_logger = "0.11.3" +flate2 = "1.0.30" +freetype-rs = { version = "0.37.0", features = ["bundled"] } +geo = "0.28.0" +glow = "0.13.1" +glutin = "0.31.3" +glutin-winit = "0.4.2" +image = "0.25.2" +include_dir = "0.7.4" +log = "0.4.22" +lru = "0.12.4" +nalgebra = "0.33.0" +nalgebra-glm = "0.18.0" +ndarray = "0.15.6" +nom = "7.1.3" +nom-derive = "0.10.1" +once_cell = "1.19.0" +pathfinder_geometry = "0.5.1" +raw-window-handle = "0.5.2" +regex = "1.10.5" +serde = { version = "1.0.204", features = ["derive"] } +serde_json = "1.0.120" +thiserror = "1.0.61" +tinyfiledialogs = "3.0" +tracker = "0.2.2" +glsl = "7.0.0" +glsl-quasiquote = "7.0.0" +toml = "0.8.19" +femtovg = "0.9.2" +rust-embed = "8.5.0" +tempfile = "3.12.0" + +[features] +default = ["sdf_font"] + +sdfer_use_f64_instead_of_f32 = [] +normal_font = [] +sdf_font = [] +inparser = [] +femtovg = [] + + +[lib] +name = "gi" diff --git a/gi/src/camera.rs b/gi/src/camera.rs new file mode 100644 index 0000000..b611238 --- /dev/null +++ b/gi/src/camera.rs @@ -0,0 +1,66 @@ +use cgmath::Euler; +use glow::NativeProgram; +use nalgebra_glm::{look_at, Mat4x4, Vec3}; +use std::num::NonZeroU32; + +#[derive(Clone)] +pub(crate) struct Camera { + pos: Vec3, + upward: Vec3, + center: Vec3, +} + +pub type CameraPositon = Vec3; + +impl Camera { + pub(crate) fn new(world_loc: CameraPositon, upward: Vec3, center: Vec3) -> Self { + Self { + pos: world_loc, + upward, + center, + } + } + + pub fn get_position(&self) -> CameraPositon { + self.pos + } + + pub fn set_position(&mut self, pos: CameraPositon) { + self.pos = pos; + } + + pub fn get_upward(&self) -> Vec3 { + self.upward + } + + pub fn get_center(&self) -> Vec3 { + self.center + } + + pub fn set_upward(&mut self, upward: Vec3) { + self.upward = upward; + } + + pub fn set_center(&mut self, center: Vec3) { + self.center = center; + } + + pub fn get_view_matrix(&self) -> Mat4x4 { + let l = self.center; + look_at(&self.pos, &l, &self.upward) + } + + pub fn front(&self) -> Vec3 { + self.center - self.pos + } +} + +impl Default for Camera { + fn default() -> Self { + Self { + pos: Vec3::new(0.0, 0.0, 0.0), + upward: Vec3::new(0.0, 1.0, 0.0), + center: Vec3::new(0.0, 0.0, -1.0), + } + } +} diff --git a/gi/src/components/mod.rs b/gi/src/components/mod.rs new file mode 100644 index 0000000..a229798 --- /dev/null +++ b/gi/src/components/mod.rs @@ -0,0 +1,5 @@ +mod program; +mod shader; + +pub use program::Program; +pub use shader::Shader; diff --git a/gi/src/components/program.rs b/gi/src/components/program.rs new file mode 100644 index 0000000..6d8e615 --- /dev/null +++ b/gi/src/components/program.rs @@ -0,0 +1,136 @@ +use glow::{HasContext, NativeUniformLocation}; + +use super::shader::Shader; + +#[derive(Debug)] +pub struct Program { + version: &'static str, + vertex: Shader, + fragment: Shader, + + geometry: Option, + pub native_program: Option<::Program>, +} + +impl Program { + pub fn new( + vertex: Shader, + fragment: Shader, + geometry: Option, + version: &'static str, + ) -> Self { + let res = Self { + version, + vertex, + fragment, + geometry, + native_program: None, + }; + + res + } + + pub fn vertex(&self) -> &Shader { + &self.vertex + } + + pub fn fragment(&self) -> &Shader { + &self.fragment + } + + pub fn geometry(&self) -> Option<&Shader> { + self.geometry.as_ref() + } + + #[cfg(feature = "inparser")] + pub fn set_hook(&mut self, hook: &str, code: &Snippet) { + self.vertex.set_hook(hook, code); + self.fragment.set_hook(hook, code); + self.geometry.as_mut().map(|g| g.set_hook(hook, code)); + } + + #[cfg(feature = "inparser")] + pub fn set_transform(&mut self, value: &T) { + self.set_hook("transform", value.snippet()); + } + + #[cfg(feature = "inparser")] + pub fn set_viewport(&mut self, viewport: &Viewport) { + self.set_hook("viewport", viewport.snippet()); + } + + pub fn compile(&mut self, gl: &glow::Context) -> crate::errors::Result<()> { + use crate::errors::Error; + + #[cfg(feature = "inparser")] + { + self.vertex.define("_GLUMPY__VERTEX_SHADER__"); + self.fragment.define("_GLUMPY__FRAGMENT_SHADER__"); + } + + unsafe { + let program = gl.create_program().map_err(|e| Error::InvalidProgram(e))?; + + let vertex_shader = self.vertex.compile(&self.version, gl); + let fragment_shader = self.fragment.compile(&self.version, gl); + + gl.attach_shader(program, vertex_shader); + gl.attach_shader(program, fragment_shader); + + // Geom Shader + let geom_shader = if let Some(geometry) = self.geometry.as_mut() { + #[cfg(feature = "inparser")] + geometry.define("_GLUMPY__GEOMETRY_SHADER__"); + let geometry_shader = geometry.compile(&self.version, gl); + + gl.attach_shader(program, geometry_shader); + + Some(geometry_shader) + } else { + None + }; + + gl.link_program(program); + + if !gl.get_program_link_status(program) { + return Err(Error::InvalidProgram(gl.get_program_info_log(program))); + } + + gl.detach_shader(program, vertex_shader); + gl.detach_shader(program, fragment_shader); + if let Some(_) = self.geometry.as_ref() { + gl.detach_shader(program, geom_shader.unwrap()); + gl.delete_shader(geom_shader.unwrap()); + } + + gl.delete_shader(vertex_shader); + gl.delete_shader(fragment_shader); + + gl.use_program(Some(program)); + + self.native_program = Some(program); + } + + Ok(()) + } + + pub fn destroy(&self, gl: &glow::Context) { + unsafe { + self.native_program.map(|p| gl.delete_program(p)); + } + } + + pub fn get_uniform_location( + &self, + gl: &glow::Context, + name: &str, + ) -> Option { + self.native_program + .as_ref() + .map(|p| unsafe { + let location = gl.get_uniform_location(*p, name); + location + }) + .flatten() + } +} diff --git a/gi/src/components/shader.rs b/gi/src/components/shader.rs new file mode 100644 index 0000000..46079b3 --- /dev/null +++ b/gi/src/components/shader.rs @@ -0,0 +1,83 @@ +use std::borrow::Borrow; + +use crate::{ + errors::{Error, Result}, + shaders::CodePiece, +}; +use glow::HasContext; +use log::{info, warn}; +pub type ShaderType = u32; +#[derive(Debug)] +pub struct Shader { + target: u32, + #[cfg(feature = "inparser")] + parsed: CodeBlock, + parsed: String, + #[cfg(feature = "inparser")] + pub hooks: Vec, +} + +impl std::fmt::Display for Shader { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.parsed) + } +} + +impl Shader { + pub fn new(target: ShaderType, code: impl CodePiece) -> Result { + let code = code.to_string(); + + #[cfg(feature = "inparser")] + { + let code = merge_includes(code).map_err(|e| Error::InvalidSnippet(e.to_string()))?; + let parsed = CodeBlock::new(&code)?; + let hooks = parsed.all_hooks().iter().map(|h| h.name.clone()).collect(); + info!("Shader:{} Hooks: {:?}", target, hooks); + return Ok(Self { + target, + parsed, + hooks, + }); + } + + Ok(Self { + target, + parsed: code, + }) + } + + pub fn compile( + &self, + version: &str, + gl: &glow::Context, + ) -> ::Shader { + let shader = unsafe { + let shader = gl.create_shader(self.target).expect("Cannot create shader"); + gl.shader_source( + shader, + &format!("{}\n{}", &format!("#version {}", version), self.to_string()), + ); + gl.compile_shader(shader); + if !gl.get_shader_compile_status(shader) { + panic!("{}", gl.get_shader_info_log(shader)) + } + shader + }; + shader + } + + #[cfg(feature = "inparser")] + pub fn define(&mut self, s: &str) { + self.parsed + .insert(Code::new(&format!("#define {}\n", s)), 0); + } + + #[cfg(feature = "inparser")] + pub fn set_hook(&mut self, hook: &str, code: &Snippet) { + self.parsed.set_hook(hook, code); + } + + pub fn target(&self) -> u32 { + self.target + } +} diff --git a/gi/src/data_loader/error.rs b/gi/src/data_loader/error.rs new file mode 100644 index 0000000..ed2f9b5 --- /dev/null +++ b/gi/src/data_loader/error.rs @@ -0,0 +1,14 @@ +use thiserror::Error; +#[derive(Debug, Error)] +pub enum ETWSError { + #[error("IO Error")] + IOError { + #[from] + source: std::io::Error, + }, + #[error("Format Error")] + FormatError { + #[from] + source: anyhow::Error, + }, +} diff --git a/gi/src/data_loader/mod.rs b/gi/src/data_loader/mod.rs new file mode 100644 index 0000000..5ca3407 --- /dev/null +++ b/gi/src/data_loader/mod.rs @@ -0,0 +1,260 @@ +use crate::errors::*; +use crate::utils::geo_tools::calculate_coverage; +use ndarray::ArrayD; +pub mod error; +mod parser; + +use chrono::Utc; + +macro_rules! block_prepare { + ($data: ident, $_ty: ty, $shape:ident, $(($branch: tt),)+) => { + match $data { + $( + $branch(data) => ArrayD::from_shape_vec($shape.as_slice(), data.into_iter().map(|b| b as $_ty).collect::>()).unwrap(), + )+ + } + }; +} + +macro_rules! block_data_type_prepare { + ($data: ident, $($branch: tt => $data_type: tt,)+) => { + match $data { + $( + $branch => $data_type, + )+ + _ => DataType::Unknown + } + }; +} + +#[derive(Debug, Clone)] +pub struct Data { + pub filetime: chrono::DateTime, + pub radar_info: RadarInfo, + pub blocks: Vec, +} + +#[derive(Debug, Clone, Copy)] +pub enum DataType { + ET, + VIL, + EB, + DBZ, + VEl, + ZDR, + PHIDP, + KDP, + CC, + HCA, + QPE, + QPF, + Unknown, +} + +#[derive(Debug, Clone)] +pub struct Block { + pub data: ArrayD, + pub data_type: DataType, + pub coord_type: CoordType, + pub min_value: f32, + pub max_value: f32, + pub unvalid_value: f32, +} + +#[derive(Debug, Clone)] +pub enum CoordType { + Polar { + azimuth_range: [f64; 2], + r_range: [f64; 2], + elevation_range: [f64; 2], + azimuth: Vec, + r: Vec, + elevation: Vec, + }, + Cartesian { + lat_range: [f64; 2], + lon_range: [f64; 2], + hgt_range: [f64; 2], + lat: Vec, + lon: Vec, + hgt: Vec, + }, + + Other, +} + +#[derive(Debug, Clone)] +pub struct RadarInfo { + pub lat_range: [f32; 2], + pub lon_range: [f32; 2], + pub center: [f32; 3], +} + +impl Data { + pub fn from_path(path: impl AsRef) -> Result { + let record = parser::Record::parse_from_path(path)?; + + let mut radar_loc: [Option; 3] = [None, None, None]; + + let blocks = record + .blocks + .into_iter() + .map(|b| { + let vec_data = b.data; + use parser::ValueResult::*; + + let info = b.info; + + radar_loc = [info.radar_alt, info.radar_lat, info.radar_lon]; + let shape = info + .dimension_size + .into_iter() + .map(|s| s as usize) + .collect::>(); + + let new_data = block_prepare!( + vec_data, + f32, + shape, + (I64), + (F64), + (I32), + (F32), + (I16), + (U64), + (U32), + (I8), + (U8), + ); + + let dim_len = info.dimension_values.len(); + let dim_last = info.dimension_values.get(dim_len - 1).unwrap(); + let dim_minus_one = info.dimension_values.get(dim_len - 2).unwrap(); + let (dim_minus_two_range, dim_minus_two) = if dim_len == 3 { + let hgt = info.dimension_values.get(dim_len - 3).unwrap(); + ( + [hgt[0], hgt[hgt.len() - 1]], + hgt.iter().map(|v| *v as f32).collect(), + ) + } else { + ([0.0, 0.0], vec![]) + }; + + let dim_last_range = [dim_last[0], dim_last[dim_last.len() - 1]]; + let dim_minus_one_range = + [dim_minus_one[0], dim_minus_one[dim_minus_one.len() - 1]]; + + let coord_type = if info.dimension_des.contains(&format!("lat")) { + CoordType::Cartesian { + lat_range: dim_minus_one_range, + lon_range: dim_last_range, + hgt_range: dim_minus_two_range, + lat: dim_minus_one.iter().map(|v| *v as f32).collect(), + lon: dim_last.iter().map(|v| *v as f32).collect(), + hgt: dim_minus_two, + } + } else if info.dimension_des.contains(&format!("ele")) + || info.dimension_des.contains(&format!("el")) + || info.dimension_des.contains(&format!("elevation")) + { + CoordType::Polar { + azimuth_range: dim_minus_one_range, + r_range: dim_last_range, + elevation_range: dim_minus_two_range, + azimuth: dim_minus_one.iter().map(|v| *v as f32).collect(), + r: dim_last.iter().map(|v| *v as f32).collect(), + elevation: dim_minus_two, + } + } else { + CoordType::Other + }; + + use DataType::*; + let valuetype = info.value_name.as_str(); + + let data_type = block_data_type_prepare!(valuetype, + "ET" => ET, + "VIL" => VIL, + "EB" => EB, + "DBZ" =>DBZ, + "CR" => DBZ, + "R" => DBZ, + "V" => VEl, + "ZDR" => ZDR, + "PHIDP" => PHIDP, + "KDP" => KDP, + "CC" => CC, + "HCA" => HCA, + "QPE" => QPE, + "QPF" => QPF, + "FR" => DBZ, + ); + + Block { + data: new_data, + data_type, + coord_type, + min_value: 0.0, + max_value: 204.0, + unvalid_value: info.fill_value as f32, + } + }) + .collect::>(); + + let radar_info = match blocks.first().unwrap().coord_type { + CoordType::Cartesian { + lat_range, + lon_range, + .. + } => RadarInfo { + lat_range: [lat_range[0] as f32, lat_range[1] as f32], + lon_range: [lon_range[0] as f32, lon_range[1] as f32], + center: [ + lat_range[0] as f32 + (lat_range[1] - lat_range[0]) as f32 / 2.0, + lon_range[0] as f32 + (lon_range[1] - lon_range[0]) as f32 / 2.0, + 0.0, + ], + }, + CoordType::Polar { r_range, .. } => { + let (min_lat, max_lat, min_lon, max_lon) = + calculate_coverage(radar_loc[1].unwrap(), radar_loc[2].unwrap(), r_range[1]); + + RadarInfo { + lat_range: [min_lat as f32, max_lat as f32], + lon_range: [min_lon as f32, max_lon as f32], + center: [ + radar_loc[1].unwrap() as f32, + radar_loc[2].unwrap() as f32, + radar_loc[0].unwrap() as f32, + ], + } + } + _ => { + panic!("Unknown coord type"); + } + }; + + Ok(Self { + filetime: record.filetime, + blocks, + radar_info, + }) + } + + pub fn get_data_slice(&self, index: usize) -> Option<&[f32]> { + self.blocks.get(index).map(|b| b.data.as_slice().unwrap()) + } +} + +mod test { + use super::Data; + + #[test] + fn test_load() { + // let path = "/Volumes/data6/RadarArray/ShaoXing/radarData/OutputProducts/RadarProducts/FuseDataX/20030506/ZJSXAA_20030506200000_FR.dat.gz"; + let path = "/Users/tsuki/Desktop/ZJSXAA_20230627163400_VIL.dat.gz"; + + let data = Data::from_path(path).unwrap(); + println!("{:?}", data); + } +} diff --git a/gi/src/data_loader/parser.rs b/gi/src/data_loader/parser.rs new file mode 100644 index 0000000..6173d88 --- /dev/null +++ b/gi/src/data_loader/parser.rs @@ -0,0 +1,388 @@ +use super::error::ETWSError; +use aligned_vec::AVec; +use byteorder::{BigEndian, ByteOrder, LittleEndian}; +use chrono::{DateTime, NaiveDateTime, Utc}; +use flate2::read::GzDecoder; +use nom::{ + bytes::complete::{tag, take}, + multi::count, + IResult, +}; +use nom_derive::*; +use serde::{Deserialize, Serialize}; +use std::fs::File; +use std::io::Read; +use std::path::Path; + +pub enum ValueResult { + I64(Vec), + F64(Vec), + I32(Vec), + F32(Vec), + I16(Vec), + U64(Vec), + U32(Vec), + I8(Vec), + U8(Vec), +} + +enum ValueTypes { + I64, + F64, + I32, + F32, + U64, + U32, + I16, + I8, + U8, +} + +#[derive(Clone, Copy)] +enum Order { + BigEndian, + LittleEndian, +} + +pub struct Record { + pub filetime: DateTime, + pub blocks: Vec, // Fill in generic types appropriately +} + +macro_rules! match_in_macro { + ($block:ident,$len:ident,$input:ident,$offset:ident,$scale:ident,$fill_value:ident,$(($branch:path, $t:ty, $bigger:ty,$raw_result:path, $bigger_result:path)),+) => { + { + use std::mem; + let need_trans = $offset != 0.0 || $scale != 1.0; + let trans_to_bigger = $offset.trunc() != $offset || $scale != 1.0; + match $block { + $( + $branch => { + let ratio = mem::size_of::<$t>() / mem::size_of::(); + let (input, result) = take($len * ratio)($input)?; + + let result = unsafe { + + let mut ptr = result.as_ptr() as *const u8; + let aligned = ptr.align_offset(mem::align_of::<$t>()); + + if aligned != 0 { + let p = AVec::::from_slice(mem::align_of::<$t>(), result); + ptr = p.into_raw_parts().0; + } + + let ptr = ptr.cast::<$t>(); + + let slice = std::slice::from_raw_parts(ptr, $len); + let slice = slice.to_vec(); + + if trans_to_bigger { + let offset = $offset as $bigger; + let scale = $scale as $bigger; + $bigger_result( + slice + .into_iter() + .map(|p| if (p as f64 - $fill_value).abs() < f64::EPSILON {p as $bigger} else {(p as $bigger - offset) / scale} ) + .collect::>(), + ) + } else { + $raw_result(if need_trans { + let offset = $offset as $t; + slice.into_iter().map(|p| if (p as f64 - $fill_value).abs() < f64::EPSILON {p} else {p - offset}).collect::>() + } else { + slice + }) + } + }; + Ok((input, result)) + }, + )+ + } + } + + }; +} + +impl Record { + pub fn parse_from_path(path: impl AsRef) -> Result { + let path = path.as_ref(); + if !(path.ends_with(".dat") || !path.ends_with(".dat.gz")) { + return Err(std::io::Error::new( + std::io::ErrorKind::InvalidInput, + "Invalid file extension", + ) + .into()); + } + + if !path.exists() { + return Err(std::io::Error::new(std::io::ErrorKind::NotFound, "File not found").into()); + } + + let mut file = File::open(path)?; + let binary_data = if path.extension().unwrap() == "gz" { + let mut result: Vec = Vec::new(); + let mut decoder = GzDecoder::new(file); + decoder.read_to_end(&mut result)?; + result + } else { + let mut result = Vec::new(); + file.read_to_end(&mut result)?; + result + }; + + let (_, parsed) = + Self::_parse(binary_data.as_slice()).map_err(|_| anyhow::Error::msg("Parse error"))?; + + Ok(parsed) + } + + fn _parse(binary_data: &[u8]) -> IResult<&[u8], Record> { + let start_tag = b"UNI_DATA"; + let (input, _) = tag(start_tag)(binary_data)?; + let (input, order) = Self::_parse_split_fn(input, 8, 8, Self::_parse_order)?; + let (input, hlen) = take(4usize)(input)?; + + let hlen = match order { + Order::BigEndian => BigEndian::read_u32(hlen), + _ => LittleEndian::read_u32(hlen), + }; + let (input, record_info) = Self::_parse_split_fn(input, 0, 8, |input| { + let (input, p) = take(hlen)(input)?; + let p: RecordInfo = serde_json::from_slice(p).unwrap(); + Ok((input, p)) + })?; + + let (input, blocks) = + count(Self::_parse_block_fn(order), record_info.block_num as usize)(input)?; + + let data_time = + NaiveDateTime::parse_from_str(&record_info.file_time, r"%Y%m%d%H%M%S").unwrap(); + let filetime = data_time.and_utc(); + + Ok((input, Record { filetime, blocks })) + } + + fn _parse_order(input: &[u8]) -> IResult<&[u8], Order> { + let (input, order) = take(4usize)(input)?; + let result = if order == b"LEND" { + Order::LittleEndian + } else { + Order::BigEndian + }; + let (input, _) = take(4usize)(input)?; + Ok((input, result)) + } + + fn _parse_split(input: &[u8], s: usize, fore: usize, after: usize) -> IResult<&[u8], &[u8]> { + let (input, _) = take(fore)(input)?; + let (input, result) = take(s)(input)?; + let (input, _) = take(after)(input)?; + Ok((input, result)) + } + + fn _parse_split_fn IResult<&[u8], E>>( + input: &[u8], + fore: usize, + after: usize, + f: F, + ) -> IResult<&[u8], E> { + let (input, _) = take(fore)(input)?; + let (input, result) = (f)(input)?; + let (input, _) = take(after)(input)?; + Ok((input, result)) + } + + fn _parse_block_fn(order: Order) -> impl FnMut(&[u8]) -> IResult<&[u8], ParsedBlock> { + move |input| Self::_parse_split_fn(input, 0, 0, |input| Self::_parse_block(input, order)) + } + + fn _parse_block(input: &[u8], order: Order) -> IResult<&[u8], ParsedBlock> { + let (input, _) = take(8usize)(input)?; + let (input, hlen1) = Self::_parse_u32(input, order)?; + let (input, block_info) = Self::_parse_split_fn(input, 0, 8, |input| { + let (input, p) = take(hlen1)(input)?; + + let p: BlockJsonInfo = serde_json::from_slice(p).unwrap(); + Ok((input, p)) + })?; + + let (input, _) = take(8usize)(input)?; // skip 8 bytes + let (input, hlen2) = Self::_parse_u32(input, order)?; + let dimension_size = block_info.dimension_size.clone(); + let size = dimension_size.iter().fold(1, |acc, x| acc * x) as usize; + let value_type = block_info.value_type.clone(); + let value_type = Self::_parse_type(&value_type); + + let (input, data) = Self::_parse_matrix( + input, + value_type, + order, + size, + block_info.value_offset, + block_info.value_scale, + block_info.fill_value, + )?; + + Ok(( + input, + ParsedBlock { + info: block_info, + data, + }, + )) + } + + fn _parse_i32(input: &[u8], order: Order) -> IResult<&[u8], i32> { + let (input, hlen) = take(4usize)(input)?; + let hlen = match order { + Order::BigEndian => BigEndian::read_i32(hlen), + _ => LittleEndian::read_i32(hlen), + }; + + Ok((input, hlen)) + } + + fn _parse_u32(input: &[u8], order: Order) -> IResult<&[u8], u32> { + let (input, hlen) = take(4usize)(input)?; + let hlen = match order { + Order::BigEndian => BigEndian::read_u32(hlen), + _ => LittleEndian::read_u32(hlen), + }; + + Ok((input, hlen)) + } + + fn _parse_i64(input: &[u8], order: Order) -> IResult<&[u8], i64> { + let (input, hlen) = take(8usize)(input)?; + let hlen = match order { + Order::BigEndian => BigEndian::read_i64(hlen), + _ => LittleEndian::read_i64(hlen), + }; + + Ok((input, hlen)) + } + + fn _parse_u64(input: &[u8], order: Order) -> IResult<&[u8], u64> { + let (input, hlen) = take(8usize)(input)?; + let hlen = match order { + Order::BigEndian => BigEndian::read_u64(hlen), + _ => LittleEndian::read_u64(hlen), + }; + + Ok((input, hlen)) + } + + fn _parse_type<'a>(type_str: &'a str) -> ValueTypes { + match type_str { + "b" => ValueTypes::I8, + "B" => ValueTypes::U8, + "i" => ValueTypes::I32, + "I" => ValueTypes::U32, + "f" => ValueTypes::F32, + "d" => ValueTypes::F64, + "h" => ValueTypes::I16, + _ => panic!("Invalid type"), + } + } + + fn _parse_matrix( + input: &[u8], + type_: ValueTypes, + order: Order, + len: usize, + offset: f32, + scale: f32, + fill_value: f64, + ) -> IResult<&[u8], ValueResult> { + match_in_macro!( + type_, + len, + input, + offset, + scale, + fill_value, + ( + ValueTypes::I64, + i64, + f64, + ValueResult::I64, + ValueResult::F64 + ), + ( + ValueTypes::F64, + f64, + f64, + ValueResult::F64, + ValueResult::F64 + ), + ( + ValueTypes::U64, + u64, + f64, + ValueResult::U64, + ValueResult::F64 + ), + ( + ValueTypes::I32, + i32, + f32, + ValueResult::I32, + ValueResult::F32 + ), + ( + ValueTypes::F32, + f32, + f32, + ValueResult::F32, + ValueResult::F32 + ), + ( + ValueTypes::U32, + u32, + f32, + ValueResult::U32, + ValueResult::F32 + ), + ( + ValueTypes::I16, + i16, + f32, + ValueResult::I16, + ValueResult::F32 + ), + (ValueTypes::I8, i8, f32, ValueResult::I8, ValueResult::F32), + (ValueTypes::U8, u8, f32, ValueResult::U8, ValueResult::F32) + ) + } +} + +#[derive(Serialize, Deserialize, Debug)] +struct RecordInfo { + file_time: String, + block_num: i32, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct BlockJsonInfo { + pub value_name: String, + pub value_des: String, + pub value_type: String, + pub dimension_size: Vec, + pub dimension: usize, + pub dimension_des: Vec, + pub dimension_start: Vec, + pub dimension_end: Vec, + pub dimension_values: Vec>, + pub fill_value: f64, + pub value_scale: f32, + pub value_offset: f32, + pub radar_alt: Option, + pub radar_lat: Option, + pub radar_lon: Option, + pub radar_name: Option, +} + +pub struct ParsedBlock { + pub info: BlockJsonInfo, + pub data: ValueResult, +} diff --git a/gi/src/errors.rs b/gi/src/errors.rs new file mode 100644 index 0000000..53edfc0 --- /dev/null +++ b/gi/src/errors.rs @@ -0,0 +1,33 @@ +use thiserror::Error; + +pub type Result = std::result::Result; + +#[derive(Error, Debug)] +pub enum Error { + #[error("Invalid Snippet {0}")] + InvalidSnippet(String), + + #[error("Invalid Shader {0}")] + InvalidShader(String), + + #[error("Invalid Program {0}")] + InvalidProgram(String), + + #[error("Invalid Data")] + InvalidData { + #[from] + source: crate::data_loader::error::ETWSError, + }, + + #[error("Invalid CoordType")] + InvalidDataType, + + #[error("Init Error, cause of {0}")] + InitError(anyhow::Error), + + #[error("Invalid Font {0}")] + FontError(String), + + #[error("Invalid Setting {0}")] + SettingError(String), +} diff --git a/gi/src/font_manager/mod.rs b/gi/src/font_manager/mod.rs new file mode 100644 index 0000000..107dceb --- /dev/null +++ b/gi/src/font_manager/mod.rs @@ -0,0 +1,211 @@ +use crate::errors::*; +use dirs::font_dir; +use freetype::face::LoadFlag; +use freetype::{Face, GlyphMetrics, Library}; + +use image::GrayImage; +use image::ImageBuffer; +use log::*; +use std::collections::HashMap; +use std::io::Write; +use std::path::PathBuf; +use std::{env, fs}; +pub struct FontManager { + library: Library, + fonts: HashMap, +} +use tempfile::NamedTempFile; + +impl FontManager { + pub fn new() -> Result { + // let source = fk::source::SystemSource::new(); + + let library = Library::init().map_err(|e| Error::InitError(e.into()))?; + + let root_path = font_dir().unwrap(); + + Ok(Self { + library, + fonts: HashMap::new(), + }) + } + + pub fn get_font_or_insert(&mut self, path: &str) -> Option<&Font> { + if self.fonts.contains_key(path) { + return self.fonts.get(path); + } + + let font = self.library.new_face(path, 0).ok()?; + let font = Font::new(font).ok()?; + self.fonts.insert(path.to_string(), font); + + self.fonts.get(path) + } +} + +pub struct Font { + font: Face, +} + +pub struct CharImg { + img: Vec, + width: usize, + height: usize, +} + +impl CharImg { + pub fn to_image(&self) -> GrayImage { + ImageBuffer::from_raw(self.width as u32, self.height as u32, self.img.clone()) + .map(|img| img.into()) + .unwrap() + } + + pub fn pixels(&self) -> &[u8] { + &self.img + } + + pub fn width(&self) -> usize { + self.width + } + + pub fn height(&self) -> usize { + self.height + } +} + +impl Font { + fn new(font: Face) -> Result { + Ok(Self { font }) + } + + pub fn get_char(&self, c: char, size: isize) -> Result { + self.font.set_char_size(0, size * 64, 0, 96).unwrap(); + + if let Err(_) = self.font.load_char(c as usize, LoadFlag::RENDER) { + self.font.load_char(0, LoadFlag::RENDER).unwrap(); + } + let glyph = self.font.glyph(); + let bitmap = glyph.bitmap(); + if bitmap.width() == 0 || bitmap.rows() == 0 { + return Err(Error::FontError("bitmap is empty".to_string())); + } + + Ok(CharImg { + img: bitmap.buffer().to_vec(), + width: bitmap.width() as usize, + height: bitmap.rows() as usize, + }) + } + + pub fn set_char_size(&self, size: isize) { + self.font.set_char_size(0, size * 64, 0, 96).unwrap(); + } + + pub fn set_char(&self, c: char) { + self.font.load_char(c as usize, LoadFlag::RENDER).unwrap(); + } + + pub fn glyph(&self) -> &freetype::GlyphSlot { + self.font.glyph() + } + + pub fn get_advance(&self) -> (f32, f32) { + let advance = self.font.glyph().advance(); + (advance.x as f32 / 64.0, advance.y as f32 / 64.0) + } + + pub fn get_kerning(&self, prev: char, c: char) -> (f32, f32) { + let prev = self.font.get_char_index(prev as usize).unwrap(); + let curr = self.font.get_char_index(c as usize).unwrap(); + let kerning = self + .font + .get_kerning(prev, curr, freetype::face::KerningMode::KerningDefault) + .unwrap(); + (kerning.x as f32 / 64.0, kerning.y as f32 / 64.0) + } + + pub fn get_line_height(&self) -> i16 { + self.font.height() + } + + pub fn get_metrics(&self, c: char) -> GlyphMetrics { + self.font.glyph().metrics() + } +} + +#[derive(Debug, Clone)] +pub enum FontSize { + Absolute(f32), + WindowScale(f32), + DistanceScale(f32), +} + +#[derive(Debug, Clone)] +pub struct FontStyle { + pub postscript_name: String, + pub size: FontSize, + pub color: [f32; 4], + pub style: f32, +} + +impl Default for FontStyle { + fn default() -> Self { + Self { + postscript_name: "resources/Roboto-Regular.ttf".to_string(), + size: FontSize::Absolute(12.0), + color: [1.0, 1.0, 1.0, 1.0], + style: 0.0, + } + } +} + +#[derive(Debug, Default)] +pub struct FontStyleBuilder { + style: FontStyle, +} + +impl FontStyleBuilder { + pub fn new() -> Self { + Self::default() + } + + pub fn build(self) -> FontStyle { + self.style + } + + pub fn postscript_name(mut self, name: &str) -> Self { + self.style.postscript_name = name.to_string(); + self + } + + pub fn size(mut self, size: FontSize) -> Self { + self.style.size = size; + self + } + + pub fn color(mut self, color: [f32; 4]) -> Self { + self.style.color = color; + self + } +} + +impl FontStyle { + pub fn buider() -> FontStyleBuilder { + FontStyleBuilder::default() + } +} + +mod test { + use super::{FontManager, FontStyle}; + + #[test] + fn test() { + let mut fon = FontManager::new().unwrap(); + let font = + fon.get_font_or_insert("/Users/tsuki/projects/radar-gi/resources/Dokdo-Regular.ttf"); + + if let Some(font) = font { + font.get_char('g', 64).unwrap(); + } + } +} diff --git a/gi/src/graphics/collections/agg_fast_path.rs b/gi/src/graphics/collections/agg_fast_path.rs new file mode 100644 index 0000000..286631f --- /dev/null +++ b/gi/src/graphics/collections/agg_fast_path.rs @@ -0,0 +1,396 @@ +use std::ops::{Deref, DerefMut}; + +use bytemuck::{Pod, Zeroable}; +use glow::{HasContext, NativeBuffer, NativeVertexArray}; + +use crate::components::{Program, Shader}; +use crate::errors::*; +use crate::graphics::ty::Ty; +use crate::graphics::{AttaWithBuffer, Graphics}; +use crate::shaders::agg_path::{AggPathFragment, AggPathVertex}; + +use super::Colletion; + +pub struct AggFastPath { + program: Program, +} + +pub struct AggFastPathConfig { + pub color: [f32; 4], + pub linewidth: f32, + pub antialias: f32, +} + +impl AggFastPath { + pub fn new() -> Result { + let vertex = Shader::new(glow::VERTEX_SHADER, AggPathVertex::new())?; + + let fragment = Shader::new(glow::FRAGMENT_SHADER, AggPathFragment::new())?; + + let program = Program::new(vertex, fragment, None, "330 core"); + + Ok(Self { program }) + } + + pub fn set_viewport(&mut self, gl: &glow::Context, viewport: [f32; 2]) { + let loc = self.program.get_uniform_location(gl, "viewport"); + unsafe { + gl.uniform_2_f32(loc.as_ref(), viewport[0], viewport[1]); + } + } + + pub fn set_linecolor(&mut self, gl: &glow::Context, color: [f32; 4]) { + let loc = self.program.get_uniform_location(gl, "color"); + unsafe { + gl.uniform_4_f32(loc.as_ref(), color[0], color[1], color[2], color[3]); + } + } + + pub fn set_linewidth(&mut self, gl: &glow::Context, linewidth: f32) { + let loc = self.program.get_uniform_location(gl, "thickness"); + unsafe { + gl.uniform_1_f32(loc.as_ref(), linewidth); + } + } + + pub fn set_anatialias(&mut self, gl: &glow::Context, antialias: f32) { + let loc = self.program.get_uniform_location(gl, "antialias"); + unsafe { + gl.uniform_1_f32(loc.as_ref(), antialias); + } + } + + pub fn set_config(&mut self, gl: &glow::Context, config: &AggFastPathConfig) { + self.set_linecolor(gl, config.color); + self.set_linewidth(gl, config.linewidth); + self.set_anatialias(gl, config.antialias); + } + + pub fn program(&mut self) -> &mut Program { + &mut self.program + } + + pub fn program_ref(&self) -> &Program { + &self.program + } +} + +impl Graphics for AggFastPath { + const id: &'static str = "AggPath"; + type Config = AggFastPathConfig; + fn compile(&mut self, gl: &glow::Context) -> Result<()> { + self.program.compile(gl) + } + + fn draw(&self, gl: &glow::Context, count: i32) -> Result<()> { + unsafe { + gl.draw_elements(glow::TRIANGLES, count, glow::UNSIGNED_INT, 0); + } + Ok(()) + } + + fn destroy(&mut self, gl: &glow::Context) -> Result<()> { + self.program.destroy(gl); + Ok(()) + } + + fn program_ref(&self) -> &Program { + &self.program + } + + fn program_mut(&mut self) -> &mut Program { + &mut self.program + } + + fn set_config(&mut self, gl: &glow::Context, config: &Self::Config) -> Result<()> { + Ok(()) + } + + fn mount(&mut self, gl: &glow::Context) -> Result<()> { + unsafe { + gl.use_program(self.program.native_program); + } + Ok(()) + } + + fn unmount(&mut self, gl: &glow::Context) -> Result<()> { + unsafe { + gl.use_program(None); + } + Ok(()) + } +} + +impl AttaWithBuffer for AggFastPath { + type Data = Vec; + + fn bake<'a, 'gl: 'a>( + &'a self, + gl: &'gl glow::Context, + data: &Self::Data, + config: &::Config, + ) -> Result<(Vec, Option>, i32)> { + let points = data.iter().map(|v| &v.points).flatten().collect::>(); + + let mut lens = Vec::with_capacity(data.len()); + let mut sum = 0; + for num in data.iter().map(|v| v.len()) { + lens.push(sum); + sum += num; + } + + let mut vbo = Vec::with_capacity(points.len() * 10); + for p in points { + vbo.extend_from_slice(&[ + p.prev[0], p.prev[1], p.prev[2], p.curr[0], p.curr[1], p.curr[2], p.next[0], + p.next[1], p.next[2], p.id, + ]); + } + let mut ebo = vec![]; + for (idx, e) in data.iter().map(|v| &v.ebo).enumerate() { + let len = lens[idx] as u32; + for e in e.iter() { + ebo.extend_from_slice(&[e[0] + len, e[1] + len, e[2] + len]); + } + } + + let len = ebo.len() as i32; + + Ok((vbo, Some(ebo), len)) + } + + fn init(&self, gl: &glow::Context) -> (NativeVertexArray, NativeBuffer, Option) { + unsafe { + let vao = gl.create_vertex_array().unwrap(); + gl.bind_vertex_array(Some(vao)); + + let vbo = gl.create_buffer().unwrap(); + gl.bind_buffer(glow::ARRAY_BUFFER, Some(vbo)); + + gl.enable_vertex_attrib_array(0); + gl.vertex_attrib_pointer_f32(0, 3, glow::FLOAT, false, 40, 0); + + gl.enable_vertex_attrib_array(1); + gl.vertex_attrib_pointer_f32(1, 3, glow::FLOAT, false, 40, 12); + + gl.enable_vertex_attrib_array(2); + gl.vertex_attrib_pointer_f32(2, 3, glow::FLOAT, false, 40, 24); + + gl.enable_vertex_attrib_array(3); + gl.vertex_attrib_pointer_f32(3, 1, glow::FLOAT, false, 40, 36); + let ebo = gl.create_buffer().unwrap(); + gl.bind_buffer(glow::ELEMENT_ARRAY_BUFFER, Some(ebo)); + gl.bind_vertex_array(None); + + gl.bind_buffer(glow::ARRAY_BUFFER, None); + (vao, vbo, Some(ebo)) + } + } +} +#[repr(C)] +#[derive(Debug, Clone, Copy, Zeroable, Pod)] +pub struct Point { + prev: [f32; 3], + curr: [f32; 3], + next: [f32; 3], + id: f32, +} + +impl std::fmt::Display for Point { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!( + f, + "Point {{ prev: {:?}, curr: {:?}, next: {:?}, id: {} }}", + self.prev, self.curr, self.next, self.id + ) + } +} +impl Point { + fn f32_slice(&self) -> &[f32] { + unsafe { std::slice::from_raw_parts(self as *const Self as *const f32, 13) } + } +} + +impl Ty for Point {} + +#[derive(Debug)] +pub struct Path { + points: Vec, + ebo: Vec<[u32; 3]>, + + is_closed: bool, + is_empty: bool, +} + +impl Default for Path { + fn default() -> Self { + Self { + points: Vec::with_capacity(500), + ebo: Vec::with_capacity(500), + + is_closed: false, + is_empty: true, + } + } +} + +pub struct PathBuilder { + is_closed: bool, +} + +impl Default for PathBuilder { + fn default() -> Self { + Self { is_closed: false } + } +} + +impl PathBuilder { + pub fn is_closed(&mut self, is_closed: bool) -> &mut Self { + self.is_closed = is_closed; + self + } + + pub fn build(&self) -> Path { + Path { + points: Vec::with_capacity(500), + is_closed: self.is_closed, + ebo: Vec::with_capacity(500), + + is_empty: true, + } + } +} + +impl Path { + pub fn new(is_closed: bool) -> Self { + Self { + points: Vec::with_capacity(500), + ebo: Vec::with_capacity(500), + is_closed, + is_empty: true, + } + } + + pub fn builder() -> PathBuilder { + PathBuilder::default() + } + + pub fn push(&mut self, point: [f32; 3]) { + if self.is_empty { + self.points.push(Point { + prev: point, + curr: point, + next: point, + id: 1.0, + }); + + self.points.push(Point { + prev: point, + curr: point, + next: point, + id: -1.0, + }); + + self.is_empty = false; + } else { + let len = self.points.len(); + let prev = self.points[len - 1].curr; + let curr = point; + let next = point; + self.points.push(Point { + prev, + curr, + next, + id: 1.0, + }); + self.points.push(Point { + prev, + curr, + next, + id: -1.0, + }); + + self.points[len - 1].next = curr; + self.points[len - 2].next = curr; + } + } + + pub fn finish(&mut self) { + if self.is_closed { + let len = self.points.len(); + let curr = self.points.first().unwrap().curr; + let prev = self.points[len - 1].curr; + let next = self.points[1].next; + self.points.push(Point { + prev, + curr, + next, + id: 1.0, + }); + self.points.push(Point { + prev, + curr, + next, + id: -1.0, + }); + self.points[len - 1].next = curr; + self.points[len - 2].next = curr; + } + for s in 0..(self.points.len() / 2) - 1 { + let s = s as u32; + self.ebo.push([s * 2, s * 2 + 1, (s + 1) * 2 + 1]); + self.ebo.push([s * 2, (s + 1) * 2 + 1, (s + 1) * 2]); + } + } + + pub fn len(&self) -> usize { + self.points.len() + } +} + +impl Deref for Path { + type Target = [u8]; + + fn deref(&self) -> &Self::Target { + use bytemuck::cast_slice; + cast_slice(&self.points) + } +} + +impl DerefMut for Path { + fn deref_mut(&mut self) -> &mut Self::Target { + use bytemuck::cast_slice_mut; + cast_slice_mut(&mut self.points) + } +} + +mod test { + + use super::*; + + #[test] + fn test_path() { + let mut path = Path::builder().is_closed(false).build(); + + path.push([9.0, 9.0, 9.0]); + + path.push([9.0, 19.0, 9.0]); + + path.finish(); + + println!("{:?}, len: {}", path, path.len()); + } + + #[test] + fn test_agg() { + // let viewport = Trackball::new().unwrap(); + // let trans = Polar::new().unwrap(); + // let position = Position::new().unwrap(); + + // let transform = viewport.chain(trans.chain(position)); + + // let viewport = &Viewport::new().unwrap(); + + // let agg_path = AggFastPath::new(&transform, &viewport).unwrap(); + } +} diff --git a/gi/src/graphics/collections/mod.rs b/gi/src/graphics/collections/mod.rs new file mode 100644 index 0000000..c31d625 --- /dev/null +++ b/gi/src/graphics/collections/mod.rs @@ -0,0 +1,7 @@ +pub mod agg_fast_path; + +pub trait Colletion { + type Item; + + fn append(&mut self, item: Self::Item); +} diff --git a/gi/src/graphics/colormap/linear.rs b/gi/src/graphics/colormap/linear.rs new file mode 100644 index 0000000..a1216af --- /dev/null +++ b/gi/src/graphics/colormap/linear.rs @@ -0,0 +1,125 @@ +use super::ColorMap; +use crate::components::Program; +use crate::errors::*; +use crate::shaders::colormap::ColorMap as CmapPiece; +use glow::HasContext; + +pub struct LinearColormap { + colors: Vec<[u8; 4]>, + + color_changed: bool, + texture: Option, + + pub unvalid: f32, + pub min: f32, + pub max: f32, +} + +impl LinearColormap { + pub fn new() -> Result { + Ok(Self { + colors: vec![], + texture: None, + color_changed: true, + min: 0.0, + max: 1.0, + unvalid: 0.0, + }) + } + + pub fn set_unvalid_value(&mut self, value: f32) { + self.unvalid = value; + self.color_changed = true; + } + + pub fn set_colors(&mut self, colors: Vec<[u8; 4]>) { + self.colors = colors; + self.color_changed = true; + } + + pub fn set_range(&mut self, min: f32, max: f32) { + self.min = min; + self.max = max; + } +} + +impl ColorMap for LinearColormap { + fn attach_with_program( + &mut self, + gl: &glow::Context, + program: &crate::components::Program, + ) -> crate::errors::Result<()> { + use bytemuck::cast_slice; + unsafe { + if self.color_changed { + let texture = gl.create_texture().unwrap(); + gl.bind_texture(glow::TEXTURE_1D, Some(texture)); + gl.tex_image_1d( + glow::TEXTURE_1D, + 0, + glow::RGBA as i32, + self.colors.len() as i32, + 0, + glow::RGBA, + glow::UNSIGNED_BYTE, + Some(cast_slice(&self.colors)), + ); + + gl.tex_parameter_i32( + glow::TEXTURE_1D, + glow::TEXTURE_MIN_FILTER, + glow::NEAREST as i32, + ); + gl.tex_parameter_i32( + glow::TEXTURE_1D, + glow::TEXTURE_MAG_FILTER, + glow::NEAREST as i32, + ); + + let location = program.get_uniform_location(gl, "colormap_conf"); + gl.uniform_4_f32( + location.as_ref(), + self.min, + self.max, + self.colors.len() as f32, + self.unvalid, + ); + self.texture = Some(texture); + } + } + + Ok(()) + } + + fn destroy(&mut self, gl: &glow::Context) { + unsafe { + if let Some(texture) = self.texture { + gl.delete_texture(texture); + } + } + } + + fn bind_texture(&self, gl: &glow::Context, program: &Program) -> crate::errors::Result<()> { + unsafe { + gl.active_texture(glow::TEXTURE0); + gl.bind_texture(glow::TEXTURE_1D, self.texture); + let location = program.get_uniform_location(gl, "colormap"); + gl.uniform_1_i32(location.as_ref(), 0); + } + + Ok(()) + } +} + +mod test { + #[test] + + fn test() { + use super::LinearColormap; + + let mut colormap = LinearColormap::new().unwrap(); + + // colormap.set_colors(vec![[0.0, 0.0, 0.0, 1.0], [1.0, 1.0, 1.0, 1.0]]); + colormap.set_range(0.0, 1.0); + } +} diff --git a/gi/src/graphics/colormap/mod.rs b/gi/src/graphics/colormap/mod.rs new file mode 100644 index 0000000..7b288ea --- /dev/null +++ b/gi/src/graphics/colormap/mod.rs @@ -0,0 +1,15 @@ +use crate::components::Program; + +pub mod linear; + +pub trait ColorMap { + fn attach_with_program( + &mut self, + gl: &glow::Context, + program: &crate::components::Program, + ) -> crate::errors::Result<()>; + + fn bind_texture(&self, gl: &glow::Context, program: &Program) -> crate::errors::Result<()>; + + fn destroy(&mut self, gl: &glow::Context); +} diff --git a/gi/src/graphics/colormesh.rs b/gi/src/graphics/colormesh.rs new file mode 100644 index 0000000..b81ba1a --- /dev/null +++ b/gi/src/graphics/colormesh.rs @@ -0,0 +1 @@ +pub struct ColorMesh {} diff --git a/gi/src/graphics/font/esdt/esdt.rs b/gi/src/graphics/font/esdt/esdt.rs new file mode 100644 index 0000000..21d3002 --- /dev/null +++ b/gi/src/graphics/font/esdt/esdt.rs @@ -0,0 +1,740 @@ +//! Rust port of the ESDT ("Euclidean Subpixel Distance Transform") algorithm. +//! +//! +//! This algorithm was originally published as the [`@use-gpu/glyph`](https://www.npmjs.com/package/@use-gpu/glyph) +//! `npm` package, and was described in . + +use super::img::{Bitmap, Image2d, NDCursor, NDCursorExt as _, Unorm8}; + +// HACK(eddyb) only exists to allow toggling precision for testing purposes. +#[cfg(sdfer_use_f64_instead_of_f32)] +type f32 = f64; + +#[derive(Copy, Clone, Debug)] +pub struct Params { + pub pad: usize, + pub radius: f32, + pub cutoff: f32, + pub solidify: bool, + pub preprocess: bool, + // FIXME(eddyb) implement. + // pub postprocess: bool, +} + +impl Default for Params { + fn default() -> Self { + Self { + pad: 4, + radius: 3.0, + cutoff: 0.25, + solidify: true, + preprocess: false, + // FIXME(eddyb) implement. + // postprocess: false, + } + } +} + +/// Opaque `struct` allowing buffer reuse between SDF computations, instead of +/// reallocating all the buffers every time. +#[derive(Default)] +pub struct ReusableBuffers(ReusableBuffers2d, ReusableBuffers1d); + +// Convert grayscale glyph to SDF +pub fn glyph_to_sdf( + glyph: &mut Image2d + AsRef<[Unorm8]>>, + params: Params, + reuse_bufs: Option, +) -> (Image2d, ReusableBuffers) { + if params.solidify { + solidify_alpha(glyph.reborrow_mut()); + } + glyph_to_esdt(glyph.reborrow_mut(), params, reuse_bufs) +} + +// Solidify semi-transparent areas +fn solidify_alpha(mut glyph: Image2d) { + let (w, h) = (glyph.width(), glyph.height()); + + let mut mask: Image2d = Image2d::new(w, h); + + let get_data = |x: isize, y: isize| { + if x >= 0 && (x as usize) < w && y >= 0 && (y as usize) < h { + glyph[(x as usize, y as usize)] + } else { + Unorm8::MIN + } + }; + + let mut masked = 0; + + // Mask pixels whose alpha matches their 4 adjacent neighbors (within 16 steps) + // and who don't have black or white neighbors. + for y in 0..(h as isize) { + for x in 0..(w as isize) { + let a = get_data(x, y); + // FIXME(eddyb) audit all comparisons with `254` and try removing them. + if a == Unorm8::MIN || a >= Unorm8::from_bits(254) { + continue; + } + + let l = get_data(x - 1, y); + let r = get_data(x + 1, y); + let t = get_data(x, y - 1); + let b = get_data(x, y + 1); + + let (min, max) = [a, l, r, t, b] + .into_iter() + .map(|x| (x, x)) + .reduce(|(a_min, a_max), (b_min, b_max)| (a_min.min(b_min), a_max.max(b_max))) + .unwrap(); + + let [a, min, max] = [a, min, max].map(Unorm8::to_bits); + + // FIXME(eddyb) audit all comparisons with `254` and try removing them. + if (max - min) < 16 && min > 0 && max < 254 { + // NOTE(eddyb) `min > 0` guarantees all neighbors are in-bounds. + let (x, y) = (x as usize, y as usize); + + // Spread to 4 neighbors with max + mask[(x - 1, y)] = mask[(x - 1, y)].max(a); + mask[(x, y - 1)] = mask[(x, y - 1)].max(a); + mask[(x, y)] = a; + mask[(x + 1, y)] = mask[(x + 1, y)].max(a); + mask[(x, y + 1)] = mask[(x, y + 1)].max(a); + masked += 1; + } + } + } + + if masked == 0 { + return; + } + + let get_mask = |x: isize, y: isize| { + if x >= 0 && (x as usize) < w && y >= 0 && (y as usize) < h { + mask[(x as usize, y as usize)] + } else { + 0 + } + }; + + // Sample 3x3 area for alpha normalization factor + for y in 0..(h as isize) { + for x in 0..(w as isize) { + let a = &mut glyph[(x as usize, y as usize)]; + // FIXME(eddyb) audit all comparisons with `254` and try removing them. + if *a == Unorm8::MIN || *a >= Unorm8::from_bits(254) { + continue; + } + + let c = get_mask(x, y); + + let l = get_mask(x - 1, y); + let r = get_mask(x + 1, y); + let t = get_mask(x, y - 1); + let b = get_mask(x, y + 1); + + let tl = get_mask(x - 1, y - 1); + let tr = get_mask(x + 1, y - 1); + let bl = get_mask(x - 1, y + 1); + let br = get_mask(x + 1, y + 1); + + if let Some(m) = [c, l, r, t, b, tl, tr, bl, br] + .into_iter() + .find(|&x| x != 0) + { + *a = Unorm8::from_bits((a.to_bits() as f32 / m as f32 * 255.0) as u8); + } + } + } +} + +// Convert grayscale or color glyph to SDF using subpixel distance transform +fn glyph_to_esdt( + mut glyph: Image2d, + params: Params, + reuse_bufs: Option, +) -> (Image2d, ReusableBuffers) { + // FIXME(eddyb) use `Params` itself directly in more places. + let Params { + pad, + radius, + cutoff, + solidify: _, + preprocess, + } = params; + + let wp = glyph.width() + pad * 2; + let hp = glyph.height() + pad * 2; + + let mut state = State::from_glyph(glyph.reborrow_mut(), params, reuse_bufs); + + state.esdt_outer_and_inner(wp, hp); + + // FIXME(eddyb) implement. + // if postprocess { state.relax_subpixel_offsets(glyph, pad); } + + let mut sdf = Image2d::from_fn(wp, hp, |x, y| { + let i = y * wp + x; + let ReusableBuffers2d { xo, yo, xi, yi, .. } = &state.bufs_2d; + let outer = ((xo[i].powi(2) + yo[i].powi(2)).sqrt() - 0.5).max(0.0); + let inner = ((xi[i].powi(2) + yi[i].powi(2)).sqrt() - 0.5).max(0.0); + let d = if outer >= inner { outer } else { -inner }; + Unorm8::encode(1.0 - (d / radius + cutoff)) + }); + + if !preprocess { + paint_into_distance_field(&mut sdf, glyph.reborrow(), params); + } + + (sdf, ReusableBuffers(state.bufs_2d, state.reuse_bufs_1d)) +} + +// Helpers +fn is_black(x: f32) -> bool { + x == 0.0 +} +fn is_white(x: f32) -> bool { + x == 1.0 +} +fn is_solid(x: f32) -> bool { + x == 0.0 || x == 1.0 +} + +// Paint original alpha channel into final SDF when gray +fn paint_into_distance_field( + sdf: &mut Image2d, + glyph: Image2d, + params: Params, +) { + let Params { + pad, + radius, + cutoff, + .. + } = params; + + for y in 0..glyph.height() { + for x in 0..glyph.width() { + let a = glyph[(x, y)].decode(); + if !is_solid(a) { + let d = 0.5 - a; + sdf[(x + pad, y + pad)] = Unorm8::encode(1.0 - (d / radius + cutoff)); + } + } + } +} + +/// 2D buffers, which get reused (see also `ReusableBuffers` itself). +#[derive(Default)] +struct ReusableBuffers2d { + // FIXME(eddyb) group `outer` with `{x,y}o`. + outer: Bitmap, + // FIXME(eddyb) group `inner` with `{x,y}i``. + inner: Bitmap, + + xo: Vec, + yo: Vec, + xi: Vec, + yi: Vec, +} + +struct State { + // FIXME(eddyb) do the grouping suggested in `ReusableBuffers2d`, to have + // `outer` and `inner` fields in here, to use instead of `ReusableBuffers2d`. + bufs_2d: ReusableBuffers2d, + reuse_bufs_1d: ReusableBuffers1d, +} + +impl State { + fn from_glyph( + mut glyph: Image2d, + params: Params, + reuse_bufs: Option, + ) -> Self { + let Params { + pad, + // FIXME(eddyb) should this still be taken as a separate `bool`? + preprocess: relax, + .. + } = params; + + let wp = glyph.width() + pad * 2; + let hp = glyph.height() + pad * 2; + let np = wp * hp; + + let ReusableBuffers(bufs_2d, reuse_bufs_1d) = reuse_bufs.unwrap_or_default(); + let mut state = Self { + bufs_2d, + reuse_bufs_1d, + }; + let ReusableBuffers2d { + outer, + inner, + xo, + yo, + xi, + yi, + } = &mut state.bufs_2d; + + outer.resize_and_fill_with(wp, hp, true); + inner.resize_and_fill_with(wp, hp, false); + for buf2d in [&mut *xo, yo, xi, yi] { + buf2d.clear(); + buf2d.resize(np, 0.0); + } + + for y in 0..glyph.height() { + for x in 0..glyph.width() { + let a = &mut glyph[(x, y)]; + if *a == Unorm8::MIN { + continue; + } + + // FIXME(eddyb) audit all comparisons with `254` and try removing them, + // especially this step that modifies the `glyph` itself. + if *a >= Unorm8::from_bits(254) { + // Fix for bad rasterizer rounding + *a = Unorm8::MAX; + + outer.at(x + pad, y + pad).set(false); + inner.at(x + pad, y + pad).set(true); + } else { + outer.at(x + pad, y + pad).set(false); + inner.at(x + pad, y + pad).set(false); + } + } + } + + // + // Generate subpixel offsets for all border pixels + // + + let get_data = |x: isize, y: isize| { + if x >= 0 && (x as usize) < glyph.width() && y >= 0 && (y as usize) < glyph.height() { + glyph[(x as usize, y as usize)].decode() + } else { + 0.0 + } + }; + + // Make vector from pixel center to nearest boundary + for y in 0..(glyph.height() as isize) { + for x in 0..(glyph.width() as isize) { + let c = get_data(x, y); + // NOTE(eddyb) `j - 1` (X-) / `j - wp` (Y-) positive (`pad >= 1`). + let j = ((y as usize) + pad) * wp + (x as usize) + pad; + + if !is_solid(c) { + let dc = c - 0.5; + + // NOTE(eddyb) l(eft) r(ight) t(op) b(ottom) + let l = get_data(x - 1, y); + let r = get_data(x + 1, y); + let t = get_data(x, y - 1); + let b = get_data(x, y + 1); + + let tl = get_data(x - 1, y - 1); + let tr = get_data(x + 1, y - 1); + let bl = get_data(x - 1, y + 1); + let br = get_data(x + 1, y + 1); + + let ll = (tl + l * 2.0 + bl) / 4.0; + let rr = (tr + r * 2.0 + br) / 4.0; + let tt = (tl + t * 2.0 + tr) / 4.0; + let bb = (bl + b * 2.0 + br) / 4.0; + + let (min, max) = [l, r, t, b, tl, tr, bl, br] + .into_iter() + .map(|x| (x, x)) + .reduce(|(a_min, a_max), (b_min, b_max)| { + (a_min.min(b_min), a_max.max(b_max)) + }) + .unwrap(); + + if min > 0.0 { + // Interior creases + inner.at(x as usize + pad, y as usize + pad).set(true); + continue; + } + if max < 1.0 { + // Exterior creases + outer.at(x as usize + pad, y as usize + pad).set(true); + continue; + } + + let mut dx = rr - ll; + let mut dy = bb - tt; + let dl = 1.0 / (dx.powi(2) + dy.powi(2)).sqrt(); + dx *= dl; + dy *= dl; + + xo[j] = -dc * dx; + yo[j] = -dc * dy; + } else if is_white(c) { + // NOTE(eddyb) l(eft) r(ight) t(op) b(ottom) + let l = get_data(x - 1, y); + let r = get_data(x + 1, y); + let t = get_data(x, y - 1); + let b = get_data(x, y + 1); + + if is_black(l) { + xo[j - 1] = 0.4999; + outer.at(x as usize + pad - 1, y as usize + pad).set(false); + inner.at(x as usize + pad - 1, y as usize + pad).set(false); + } + if is_black(r) { + xo[j + 1] = -0.4999; + outer.at(x as usize + pad + 1, y as usize + pad).set(false); + inner.at(x as usize + pad + 1, y as usize + pad).set(false); + } + + if is_black(t) { + yo[j - wp] = 0.4999; + outer.at(x as usize + pad, y as usize + pad - 1).set(false); + inner.at(x as usize + pad, y as usize + pad - 1).set(false); + } + if is_black(b) { + yo[j + wp] = -0.4999; + outer.at(x as usize + pad, y as usize + pad + 1).set(false); + inner.at(x as usize + pad, y as usize + pad + 1).set(false); + } + } + } + } + + // Blend neighboring offsets but preserve normal direction + // Uses xo as input, xi as output + // Improves quality slightly, but slows things down. + if relax { + let check_cross = |nx, ny, dc, dl, dr, dxl, dyl, dxr, dyr| { + ((dxl * nx + dyl * ny) * (dc * dl) > 0.0) + && ((dxr * nx + dyr * ny) * (dc * dr) > 0.0) + && ((dxl * dxr + dyl * dyr) * (dl * dr) > 0.0) + }; + + for y in 0..(glyph.height() as isize) { + for x in 0..(glyph.width() as isize) { + // NOTE(eddyb) `j - 1` (X-) / `j - wp` (Y-) positive (`pad >= 1`). + let j = ((y as usize) + pad) * wp + (x as usize) + pad; + + let nx = xo[j]; + let ny = yo[j]; + if nx == 0.0 && ny == 0.0 { + continue; + } + + // NOTE(eddyb) c(enter) l(eft) r(ight) t(op) b(ottom) + let c = get_data(x, y); + let l = get_data(x - 1, y); + let r = get_data(x + 1, y); + let t = get_data(x, y - 1); + let b = get_data(x, y + 1); + + let dxl = xo[j - 1]; + let dxr = xo[j + 1]; + let dxt = xo[j - wp]; + let dxb = xo[j + wp]; + + let dyl = yo[j - 1]; + let dyr = yo[j + 1]; + let dyt = yo[j - wp]; + let dyb = yo[j + wp]; + + let mut dx = nx; + let mut dy = ny; + let mut dw = 1.0; + + let dc = c - 0.5; + let dl = l - 0.5; + let dr = r - 0.5; + let dt = t - 0.5; + let db = b - 0.5; + + if !is_solid(l) && !is_solid(r) { + if check_cross(nx, ny, dc, dl, dr, dxl, dyl, dxr, dyr) { + dx += (dxl + dxr) / 2.0; + dy += (dyl + dyr) / 2.0; + dw += 1.0; + } + } + + if !is_solid(t) && !is_solid(b) { + if check_cross(nx, ny, dc, dt, db, dxt, dyt, dxb, dyb) { + dx += (dxt + dxb) / 2.0; + dy += (dyt + dyb) / 2.0; + dw += 1.0; + } + } + + if !is_solid(l) && !is_solid(t) { + if check_cross(nx, ny, dc, dl, dt, dxl, dyl, dxt, dyt) { + dx += (dxl + dxt - 1.0) / 2.0; + dy += (dyl + dyt - 1.0) / 2.0; + dw += 1.0; + } + } + + if !is_solid(r) && !is_solid(t) { + if check_cross(nx, ny, dc, dr, dt, dxr, dyr, dxt, dyt) { + dx += (dxr + dxt + 1.0) / 2.0; + dy += (dyr + dyt - 1.0) / 2.0; + dw += 1.0; + } + } + + if !is_solid(l) && !is_solid(b) { + if check_cross(nx, ny, dc, dl, db, dxl, dyl, dxb, dyb) { + dx += (dxl + dxb - 1.0) / 2.0; + dy += (dyl + dyb + 1.0) / 2.0; + dw += 1.0; + } + } + + if !is_solid(r) && !is_solid(b) { + if check_cross(nx, ny, dc, dr, db, dxr, dyr, dxb, dyb) { + dx += (dxr + dxb + 1.0) / 2.0; + dy += (dyr + dyb + 1.0) / 2.0; + dw += 1.0; + } + } + + let nn = (nx * nx + ny * ny).sqrt(); + let ll = (dx * nx + dy * ny) / nn; + + dx = nx * ll / dw / nn; + dy = ny * ll / dw / nn; + + xi[j] = dx; + yi[j] = dy; + } + } + } + + // Produce zero points for positive and negative DF, at +0.5 / -0.5. + // Splits xs into xo/xi + for y in 0..(glyph.height() as isize) { + for x in 0..(glyph.width() as isize) { + // NOTE(eddyb) `j - 1` (X-) / `j - wp` (Y-) positive (`pad >= 1`). + let j = ((y as usize) + pad) * wp + (x as usize) + pad; + + // NOTE(eddyb) `if relax` above changed `xs`/`ys` in the original. + let (nx, ny) = if relax { + (xi[j], yi[j]) + } else { + (xo[j], yo[j]) + }; + if nx == 0.0 && ny == 0.0 { + continue; + } + + let nn = (nx.powi(2) + ny.powi(2)).sqrt(); + + let sx = if ((nx / nn).abs() - 0.5) > 0.0 { + nx.signum() as isize + } else { + 0 + }; + let sy = if ((ny / nn).abs() - 0.5) > 0.0 { + ny.signum() as isize + } else { + 0 + }; + + let c = get_data(x, y); + let d = get_data(x + sx, y + sy); + // FIXME(eddyb) is this inefficient? (was `Math.sign(d - c)`) + let s = (d - c).total_cmp(&0.0) as i8 as f32; + + let dlo = (nn + 0.4999 * s) / nn; + let dli = (nn - 0.4999 * s) / nn; + + xo[j] = nx * dlo; + yo[j] = ny * dlo; + xi[j] = nx * dli; + yi[j] = ny * dli; + } + } + + state + } + + fn esdt_outer_and_inner(&mut self, w: usize, h: usize) { + { + let Self { + bufs_2d: + ReusableBuffers2d { + outer, + inner, + xo, + yo, + xi, + yi, + }, + reuse_bufs_1d, + } = self; + esdt(outer, xo, yo, w, h, reuse_bufs_1d); + esdt(inner, xi, yi, w, h, reuse_bufs_1d); + } + } +} + +// 2D subpixel distance transform by unconed +// extended from Felzenszwalb & Huttenlocher https://cs.brown.edu/~pff/papers/dt-final.pdf +fn esdt( + mask: &mut Bitmap, + xs: &mut [f32], + ys: &mut [f32], + w: usize, + h: usize, + reuse_bufs_1d: &mut ReusableBuffers1d, +) { + reuse_bufs_1d.critical_minima.clear(); + reuse_bufs_1d.critical_minima.reserve(w.max(h)); + + let mut xs = Image2d::from_storage(w, h, xs); + let mut ys = Image2d::from_storage(w, h, ys); + + for x in 0..w { + let mut mask_xy_cursor = mask + .cursor_at(0, 0) + .zip( + // FIXME(eddyb) combine `xs` and `ys` into the same `Image2d`. + ys.cursor_at(0, 0).zip(xs.cursor_at(0, 0)), + ) + .map_abs_and_rel(move |y| (x, y), |dy| (0, dy)); + mask_xy_cursor.reset(0); + + esdt1d(mask_xy_cursor, h, reuse_bufs_1d) + } + for y in 0..h { + let mut mask_xy_cursor = mask + .cursor_at(0, 0) + .zip( + // FIXME(eddyb) combine `xs` and `ys` into the same `Image2d`. + xs.cursor_at(0, 0).zip(ys.cursor_at(0, 0)), + ) + .map_abs_and_rel(move |x| (x, y), |dx| (dx, 0)); + mask_xy_cursor.reset(0); + + esdt1d(mask_xy_cursor, w, reuse_bufs_1d) + } +} + +/// 1D buffers (for `esdt1d`), which get reused between calls. +// +// FIXME(eddyb) the name is outdated now that there's only one buffer. +#[derive(Default)] +struct ReusableBuffers1d { + critical_minima: Vec, +} + +// FIXME(eddyb) clean up the names after all the refactors. +struct CriticalMinimum { + // FIXME(eddyb) this is really just a position, since it's not used to + // index anything indirectly anymore, but rather indicates the original `q`, + // and is used to compare against it in the second iteration of `esdt1d`. + v: usize, // Array index + + z: f32, // Voronoi threshold + f: f32, // Squared distance + b: f32, // Subpixel offset parallel + t: f32, // Subpixel offset perpendicular +} + +// 1D subpixel distance transform +fn esdt1d( + mut mask_xy_cursor: impl for<'a> NDCursor< + 'a, + usize, + RefMut = (super::img::BitmapEntry<'a>, (&'a mut f32, &'a mut f32)), + >, + // FIXME(eddyb) provide this through the cursor, maybe? + length: usize, + reuse_bufs_1d: &mut ReusableBuffers1d, +) { + // FIXME(eddyb) this is a pretty misleading name. + const INF: f32 = 1e10; + + let cm = &mut reuse_bufs_1d.critical_minima; + cm.clear(); + + { + let (mask, (&mut dx, &mut dy)) = mask_xy_cursor.get_mut(); + cm.push(CriticalMinimum { + v: 0, + z: -INF, + f: if mask.get() { INF } else { dy.powi(2) }, + + b: dx, + t: dy, + }); + mask_xy_cursor.advance(1); + } + + // Scan along array and build list of critical minima + for q in 1..length { + // Perpendicular + let (mask, (&mut dx, &mut dy)) = mask_xy_cursor.get_mut(); + let fq = if mask.get() { INF } else { dy.powi(2) }; + mask_xy_cursor.advance(1); + + // Parallel + let qs = q as f32 + dx; + let q2 = qs.powi(2); + + // Remove any minima eclipsed by this one + let mut s; + loop { + let r = &cm[cm.len() - 1]; + + s = (fq - r.f + q2 - r.b.powi(2)) / (qs - r.b) / 2.0; + + if !(s <= r.z) { + break; + } + + cm.pop(); + if cm.len() == 0 { + break; + } + } + + // Add to minima list + cm.push(CriticalMinimum { + v: q, + z: s, + f: fq, + b: qs, + t: dy, + }); + } + + mask_xy_cursor.reset(0); + + // Resample array based on critical minima + { + let mut k = 0; + for q in 0..length { + // Skip eclipsed minima + while k + 1 < cm.len() && cm[k + 1].z < q as f32 { + k += 1; + } + + let r = &cm[k]; + + // Distance from integer index to subpixel location of minimum + let rq = r.b - q as f32; + + let (mut mask, (dx, dy)) = mask_xy_cursor.get_mut(); + *dx = rq; + *dy = r.t; + // Mark cell as having propagated + if r.v != q { + mask.set(false); + } + mask_xy_cursor.advance(1); + } + } +} diff --git a/gi/src/graphics/font/esdt/img.rs b/gi/src/graphics/font/esdt/img.rs new file mode 100644 index 0000000..11af9b9 --- /dev/null +++ b/gi/src/graphics/font/esdt/img.rs @@ -0,0 +1,411 @@ +// NOTE(eddyb) this is a separate module so that privacy affects sibling modules. +// FIXME(eddyb) deduplicate with `image` crate? + +use std::marker::PhantomData; +use std::ops::{Index, IndexMut}; + +// HACK(eddyb) only exists to allow toggling precision for testing purposes. +#[cfg(sdfer_use_f64_instead_of_f32)] +type f32 = f64; + +/// `[0, 1]` represented by uniformly spaced `u8` values (`0..=255`), +/// i.e. `Unorm8(byte)` corresponds to the `f32` value `byte as f32 / 255.0`. +#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[repr(transparent)] +pub struct Unorm8(u8); + +impl Unorm8 { + pub const MIN: Self = Self::from_bits(0); + pub const MAX: Self = Self::from_bits(u8::MAX); + + #[inline(always)] + pub fn encode(x: f32) -> Self { + // NOTE(eddyb) manual `clamp` not needed, `(_: f32) as u8` will saturate: + // https://doc.rust-lang.org/reference/expressions/operator-expr.html#numeric-cast + Self((x * 255.0).round() as u8) + } + + #[inline(always)] + pub fn decode(self) -> f32 { + self.0 as f32 / 255.0 + } + + #[inline(always)] + pub const fn from_bits(bits: u8) -> Self { + Self(bits) + } + + #[inline(always)] + pub const fn to_bits(self) -> u8 { + self.0 + } +} + +#[derive(Default, Copy, Clone)] +pub struct Image2d = Vec> { + width: usize, + height: usize, + data: Storage, + _marker: PhantomData, +} + +impl> Image2d { + pub fn new(width: usize, height: usize) -> Self + where + T: Default, + Storage: FromIterator, + { + Self::from_fn(width, height, |_, _| T::default()) + } + + pub fn from_fn(width: usize, height: usize, mut f: impl FnMut(usize, usize) -> T) -> Self + where + Storage: FromIterator, + { + Self::from_storage( + width, + height, + (0..height) + .flat_map(|y| (0..width).map(move |x| (x, y))) + .map(|(x, y)| f(x, y)) + .collect(), + ) + } + + pub fn from_storage(width: usize, height: usize, storage: Storage) -> Self { + assert_eq!(storage.as_ref().len(), width * height); + Self { + width, + height, + data: storage, + _marker: PhantomData, + } + } + + pub fn width(&self) -> usize { + self.width + } + + pub fn height(&self) -> usize { + self.height + } + + pub fn reborrow(&self) -> Image2d { + Image2d { + width: self.width, + height: self.height, + data: self.data.as_ref(), + _marker: PhantomData, + } + } + + pub fn reborrow_mut(&mut self) -> Image2d + where + Storage: AsMut<[T]>, + { + Image2d { + width: self.width, + height: self.height, + data: self.data.as_mut(), + _marker: PhantomData, + } + } + + pub fn cursor_at(&mut self, x: usize, y: usize) -> Image2dCursor<'_, T> + where + Storage: AsMut<[T]>, + { + let mut cursor = Image2dCursor { + image: self.reborrow_mut(), + xy_offset: 0, + }; + cursor.reset((x, y)); + cursor + } +} + +impl> Index<(usize, usize)> for Image2d { + type Output = T; + + fn index(&self, (x, y): (usize, usize)) -> &T { + &self.data.as_ref()[y * self.width..][..self.width][x] + } +} + +impl + AsRef<[T]>> IndexMut<(usize, usize)> for Image2d { + fn index_mut(&mut self, (x, y): (usize, usize)) -> &mut T { + &mut self.data.as_mut()[y * self.width..][..self.width][x] + } +} + +impl From for Image2d { + fn from(img: image::GrayImage) -> Self { + Self { + width: img.width().try_into().unwrap(), + height: img.height().try_into().unwrap(), + // HACK(eddyb) this should be a noop if the right specializations + // all kick in, and LLVM optimizes out the in-place transformation. + data: img.into_vec().into_iter().map(Unorm8::from_bits).collect(), + _marker: PhantomData, + } + } +} + +impl From> for image::GrayImage { + fn from(img: Image2d) -> Self { + image::GrayImage::from_vec( + img.width().try_into().unwrap(), + img.height().try_into().unwrap(), + // HACK(eddyb) this should be a noop if the right specializations + // all kick in, and LLVM optimizes out the in-place transformation. + img.data.into_iter().map(Unorm8::to_bits).collect(), + ) + .unwrap() + } +} + +impl From> for ndarray::Array2 { + fn from(value: Image2d) -> Self { + ndarray::Array2::from_shape_vec( + [value.height(), value.width()], + value.data.into_iter().map(Unorm8::to_bits).collect(), + ) + .unwrap() + } +} + +impl Image2d { + fn resize_and_fill_with(&mut self, width: usize, height: usize, initial: T) { + self.width = width; + self.height = height; + self.data.clear(); + self.data.resize(width * height, initial); + } +} + +#[derive(Default)] +pub struct Bitmap { + width: usize, + height: usize, + bit_8x8_blocks: Image2d, +} + +pub struct BitmapEntry<'a> { + bit_8x8_block: &'a mut u64, + mask: u64, +} + +impl Bitmap { + #[inline(always)] + pub fn new(width: usize, height: usize) -> Self { + let mut r = Self::default(); + r.resize_and_fill_with(width, height, false); + r + } + + #[inline(always)] + pub(crate) fn resize_and_fill_with(&mut self, width: usize, height: usize, initial: bool) { + self.width = width; + self.height = height; + self.bit_8x8_blocks.resize_and_fill_with( + width.div_ceil(8), + height.div_ceil(8), + if initial { !0 } else { 0 }, + ); + } + + #[inline(always)] + pub fn width(&self) -> usize { + self.width + } + + #[inline(always)] + pub fn height(&self) -> usize { + self.height + } + + const BW: usize = 8; + const BH: usize = 8; + + #[inline(always)] + const fn bit_8x8_block_xy_and_mask(x: usize, y: usize) -> ((usize, usize), u64) { + ( + (x / Self::BW, y / Self::BH), + 1 << ((y % Self::BH) * Self::BW + x % Self::BW), + ) + } + + #[inline(always)] + pub fn get(&self, x: usize, y: usize) -> bool { + let (block_xy, mask) = Self::bit_8x8_block_xy_and_mask(x, y); + (self.bit_8x8_blocks[block_xy] & mask) != 0 + } + + #[inline(always)] + pub fn at(&mut self, x: usize, y: usize) -> BitmapEntry<'_> { + let (block_xy, mask) = Self::bit_8x8_block_xy_and_mask(x, y); + BitmapEntry { + bit_8x8_block: &mut self.bit_8x8_blocks[block_xy], + mask, + } + } + + #[inline(always)] + pub fn cursor_at(&mut self, x: usize, y: usize) -> BitmapCursor<'_> { + let mut cursor = BitmapCursor { + bit_8x8_blocks: self.bit_8x8_blocks.cursor_at(0, 0), + intra_block_xy: (0, 0), + }; + cursor.reset((x, y)); + cursor + } +} + +impl BitmapEntry<'_> { + #[inline(always)] + pub fn get(&self) -> bool { + (*self.bit_8x8_block & self.mask) != 0 + } + + #[inline(always)] + pub fn set(&mut self, value: bool) { + if value { + *self.bit_8x8_block |= self.mask; + } else { + *self.bit_8x8_block &= !self.mask; + } + } +} + +// FIXME(eddyb) this doesn't really belong here, and should use GATs. +pub trait NDCursor<'a, P> { + type RefMut; + fn reset(&'a mut self, position: P); + fn get_mut(&'a mut self) -> Self::RefMut; + fn advance(&'a mut self, delta: P); +} + +pub trait NDCursorExt

: for<'a> NDCursor<'a, P> { + fn zip>(self, other: C2) -> NDCursorZip + where + Self: Sized, + { + NDCursorZip(self, other) + } + + // FIXME(eddyb) this is a really bad API but a whole coordinate system would be overkill. + fn map_abs_and_rel P, FR: Fn(P2) -> P>( + self, + fa: FA, + fr: FR, + ) -> NDCursorMapPos + where + Self: Sized, + { + NDCursorMapPos(self, fa, fr) + } +} +impl NDCursor<'a, P>> NDCursorExt

for C {} + +pub struct NDCursorZip(C1, C2); +impl<'a, P: Copy, C1: NDCursor<'a, P>, C2: NDCursor<'a, P>> NDCursor<'a, P> + for NDCursorZip +{ + type RefMut = (C1::RefMut, C2::RefMut); + #[inline(always)] + fn reset(&'a mut self, position: P) { + self.0.reset(position); + self.1.reset(position); + } + #[inline(always)] + fn get_mut(&'a mut self) -> Self::RefMut { + (self.0.get_mut(), self.1.get_mut()) + } + #[inline(always)] + fn advance(&'a mut self, delta: P) { + self.0.advance(delta); + self.1.advance(delta); + } +} + +pub struct NDCursorMapPos(C, FA, FR); +impl<'a, C: NDCursor<'a, P>, P, P2, FA: Fn(P2) -> P, FR: Fn(P2) -> P> NDCursor<'a, P2> + for NDCursorMapPos +{ + type RefMut = C::RefMut; + #[inline(always)] + fn reset(&'a mut self, position: P2) { + self.0.reset((self.1)(position)); + } + #[inline(always)] + fn get_mut(&'a mut self) -> Self::RefMut { + self.0.get_mut() + } + #[inline(always)] + fn advance(&'a mut self, delta: P2) { + self.0.advance((self.2)(delta)); + } +} + +pub struct Image2dCursor<'a, T> { + // FIXME(eddyb) find a way to use something closer to `slice::IterMut` here. + image: Image2d, + xy_offset: usize, +} + +impl<'a, T: 'a> NDCursor<'a, (usize, usize)> for Image2dCursor<'_, T> { + type RefMut = &'a mut T; + #[inline(always)] + fn reset(&'a mut self, (x, y): (usize, usize)) { + self.xy_offset = y * self.image.width + x; + } + #[inline(always)] + fn get_mut(&'a mut self) -> Self::RefMut { + &mut self.image.data[self.xy_offset] + } + #[inline(always)] + fn advance(&'a mut self, (dx, dy): (usize, usize)) { + // FIXME(eddyb) check for edge conditions? (should be more like an iterator) + self.xy_offset += dy * self.image.width + dx; + } +} + +pub struct BitmapCursor<'a> { + bit_8x8_blocks: Image2dCursor<'a, u64>, + // FIXME(eddyb) because of this we can't just use `bit_8x8_block_xy_and_mask`. + intra_block_xy: (u8, u8), +} + +impl<'a> NDCursor<'a, (usize, usize)> for BitmapCursor<'_> { + type RefMut = BitmapEntry<'a>; + #[inline(always)] + fn reset(&'a mut self, (x, y): (usize, usize)) { + self.bit_8x8_blocks.reset((x / Bitmap::BW, y / Bitmap::BH)); + self.intra_block_xy = ((x % Bitmap::BW) as u8, (y % Bitmap::BH) as u8); + } + #[inline(always)] + fn get_mut(&'a mut self) -> Self::RefMut { + let bxy = self.intra_block_xy; + let (_, mask) = Bitmap::bit_8x8_block_xy_and_mask(bxy.0 as usize, bxy.1 as usize); + BitmapEntry { + bit_8x8_block: self.bit_8x8_blocks.get_mut(), + mask, + } + } + #[inline(always)] + fn advance(&'a mut self, (dx, dy): (usize, usize)) { + // FIXME(eddyb) check for edge conditions? (should be more like an iterator) + let bxy = self.intra_block_xy; + let new_bxy = (bxy.0 as usize + dx, bxy.1 as usize + dy); + + let whole_block_dxy = (new_bxy.0 / Bitmap::BW, new_bxy.1 / Bitmap::BH); + if whole_block_dxy != (0, 0) { + self.bit_8x8_blocks.advance(whole_block_dxy); + } + + self.intra_block_xy = ( + (new_bxy.0 % Bitmap::BW) as u8, + (new_bxy.1 % Bitmap::BH) as u8, + ); + } +} diff --git a/gi/src/graphics/font/esdt/mod.rs b/gi/src/graphics/font/esdt/mod.rs new file mode 100644 index 0000000..870fa07 --- /dev/null +++ b/gi/src/graphics/font/esdt/mod.rs @@ -0,0 +1,5 @@ +mod esdt; +mod img; + +pub use esdt::*; +pub use img::{Image2d, Unorm8}; diff --git a/gi/src/graphics/font/mod.rs b/gi/src/graphics/font/mod.rs new file mode 100644 index 0000000..d44478a --- /dev/null +++ b/gi/src/graphics/font/mod.rs @@ -0,0 +1,345 @@ +mod esdt; +use esdt::{Image2d, Unorm8}; +use glow::{HasContext, NativeTexture, TEXTURE_2D}; +use std::{cell::RefCell, collections::HashMap}; +use text_items::Text as TextTrait; +mod text_items; +pub use text_items::{Anchor, LineStyle, PositionText, TextLine}; + +use crate::{ + components::{Program, Shader}, + errors::*, + font_manager::{FontManager, FontStyle}, + resources::RcGlRcResource, + shaders::font::{FontFragment, FontGeometry, FontVertex}, + utils::resources::RcGlTexture, + GL, +}; + +use super::{AttaWithBuffer, Graphics}; +pub struct Text { + gl: GL, + font_manager: RefCell, + cache: RefCell>, + program: Program, +} + +pub struct Cache { + gl: GL, + cache: HashMap, + width: usize, + height: usize, + last_pos: [usize; 2], + tex: RcGlRcResource, +} + +impl Cache { + pub fn new(gl: GL) -> Self { + let tex = unsafe { + let tex = gl.create_texture().unwrap(); + gl.bind_texture(glow::TEXTURE_2D, Some(tex)); + gl.tex_parameter_i32( + glow::TEXTURE_2D, + glow::TEXTURE_MIN_FILTER, + glow::LINEAR as i32, + ); + gl.tex_parameter_i32( + glow::TEXTURE_2D, + glow::TEXTURE_MAG_FILTER, + glow::LINEAR as i32, + ); + + gl.tex_image_2d( + glow::TEXTURE_2D, + 0, + glow::R8 as i32, + 1024, + 1024, + 0, + glow::RED, + glow::UNSIGNED_BYTE, + None, + ); + tex + }; + + let tex = RcGlRcResource::new(gl.gl_rc(), tex); + + Self { + gl, + cache: HashMap::new(), + // cache_tex: vec![0; 1024 * 1024], + width: 1024, + height: 1024, + last_pos: [0, 0], + tex, + } + } + + fn get(&self, c: char) -> Option<&TextVType> { + self.cache.get(&c) + } + + fn insert_glyph(&mut self, tex: Image2d, c: char) -> &TextVType { + // use image::GrayImage; + + use ndarray::{s, Array2}; + let width = tex.width(); + let height = tex.height(); + + let data: Array2 = tex.into(); + + let x = self.last_pos[0]; + let y = self.last_pos[1]; + + use glow::PixelUnpackData; + + unsafe { + self.gl + .bind_texture(glow::TEXTURE_2D, Some(self.tex.native())); + self.gl.pixel_store_i32(glow::UNPACK_ALIGNMENT, 1); + + self.gl.tex_sub_image_2d( + glow::TEXTURE_2D, + 0, + x as i32, + y as i32, + width as i32, + height as i32, + glow::RED, + glow::UNSIGNED_BYTE, + PixelUnpackData::Slice(&data.as_slice().unwrap()), + ); + println!("{} {} {} {}", x, y, width, height); + println!("size: {}", &data.len()); + self.gl.bind_texture(glow::TEXTURE_2D, None); + } + + self.cache.insert( + c, + TextVType { + tex_coords: [ + x as f32, + (y + height - 1) as f32, + (x + width - 1) as f32, + y as f32, + ], + }, + ); + if x + width >= 1024 { + self.last_pos[0] = 0; + self.last_pos[1] += height; + } else { + self.last_pos[0] += width; + } + + if y + height > self.height { + self.height += 1024; + // self.cache_tex.extend(vec![0; 1024 * 1024]); + } + + self.cache.get(&c).unwrap() + } + + fn test(&self) { + let mut data = vec![0; 1024 * 1024]; + unsafe { + self.gl + .bind_texture(glow::TEXTURE_2D, Some(self.tex.native())); + self.gl.get_tex_image( + glow::TEXTURE_2D, + 0, + glow::RED, + glow::UNSIGNED_BYTE, + glow::PixelPackData::Slice(&mut data), + ); + self.gl.bind_texture(glow::TEXTURE_2D, None); + } + let img = image::GrayImage::from_raw(1024, 1024, data).unwrap(); + img.save("test.png").unwrap(); + } +} + +#[derive(Clone)] +pub struct TextVType { + tex_coords: [f32; 4], +} + +impl TextVType { + fn left_top(&self) -> [f32; 2] { + [self.tex_coords[0], self.tex_coords[1]] + } + + fn right_bottom(&self) -> [f32; 2] { + [self.tex_coords[2], self.tex_coords[3]] + } +} + +impl Text { + pub fn new(gl: GL, font_manager: FontManager) -> Result { + let vertex = Shader::new(glow::VERTEX_SHADER, FontVertex::new())?; + let geom = Shader::new(glow::GEOMETRY_SHADER, FontGeometry::new())?; + let fragment = Shader::new(glow::FRAGMENT_SHADER, FontFragment::new())?; + let mut program = Program::new(vertex, fragment, Some(geom), "330 core"); + + Ok(Self { + gl, + font_manager: RefCell::new(font_manager), + cache: RefCell::new(HashMap::new()), + program, + }) + } + + pub fn set_viewport(&self, gl: &glow::Context, viewport: [f32; 2]) { + let loc = self.program.get_uniform_location(gl, "viewport"); + unsafe { + gl.uniform_2_f32(loc.as_ref(), viewport[0], viewport[1]); + } + } + + pub fn set_config(&self, gl: &glow::Context, config: FontConfig) { + match config { + FontConfig::Textline(style, font) => { + let loc = self.program.get_uniform_location(&gl, "location"); + let anchor = self.program.get_uniform_location(&gl, "anchor"); + unsafe { + gl.uniform_3_f32(loc.as_ref(), 0.0, 0.0, 1.0); + gl.uniform_3_f32(anchor.as_ref(), 0.0, 0.0, 0.0); + } + } + } + } + + fn set_uniforms(&self, gl: &glow::Context) { + let conf = self.program.get_uniform_location(&gl, "uSdfConfig"); + let u_mode = self.program.get_uniform_location(&gl, "uMode"); + let u_border = self.program.get_uniform_location(&gl, "uBorder"); + let u_stroke = self.program.get_uniform_location(&gl, "uStroke"); + let u_fill = self.program.get_uniform_location(&gl, "uFill"); + + unsafe { + gl.uniform_4_f32(conf.as_ref(), 5.0, 3.0, 0.0, 0.0); + gl.uniform_1_i32(u_mode.as_ref(), -1); + gl.uniform_4_f32(u_border.as_ref(), 0.0, 0.0, 0.0, 0.0); + gl.uniform_4_f32(u_stroke.as_ref(), 1.0, 1.0, 1.0, 1.0); + gl.uniform_4_f32(u_fill.as_ref(), 1.0, 1.0, 1.0, 1.0); + } + } +} + +impl Graphics for Text { + const id: &'static str = "Text"; + type Config = FontConfig; + fn compile(&mut self, gl: &glow::Context) -> Result<()> { + self.program.compile(gl) + } + + fn destroy(&mut self, gl: &glow::Context) -> Result<()> { + self.program.destroy(gl); + Ok(()) + } + + fn draw(&self, gl: &glow::Context, count: i32) -> Result<()> { + unsafe { + let loc = self.program.get_uniform_location(gl, "atlas_data"); + gl.uniform_1_i32(loc.as_ref(), 0); + + gl.active_texture(glow::TEXTURE0); + gl.bind_texture( + glow::TEXTURE_2D, + self.cache + .borrow() + .get("resources/Roboto-Regular.ttf") + .map(|v| v.tex.native()), + ); + + let width_loc = self.program.get_uniform_location(gl, "atlas_shape"); + gl.uniform_2_f32(width_loc.as_ref(), 1024.0, 1024.0); + + self.set_uniforms(gl); + + gl.draw_arrays(glow::POINTS, 0, count); + } + Ok(()) + } + + fn program_mut(&mut self) -> &mut Program { + &mut self.program + } + + fn program_ref(&self) -> &Program { + &self.program + } + + fn set_config(&mut self, gl: &glow::Context, config: &Self::Config) -> Result<()> { + unsafe { + match config { + FontConfig::Textline(style, font) => { + let loc = self.program.get_uniform_location(gl, "location"); + let anchor = self.program.get_uniform_location(gl, "anchor"); + gl.uniform_3_f32(loc.as_ref(), 0.0, 0.0, 2.0); + gl.uniform_3_f32(anchor.as_ref(), 0.0, 0.0, 0.0); + } + } + } + Ok(()) + } +} + +impl AttaWithBuffer for Text { + type Data = PositionText; + + fn bake<'a, 'gl: 'a>( + &'a self, + gl: &'gl glow::Context, + data: &Self::Data, + config: &::Config, + ) -> Result<(Vec, Option>, i32)> { + let v = data.bake( + &self.gl, + &mut *self.font_manager.borrow_mut(), + &mut *self.cache.borrow_mut(), + )?; + + Ok((v.vertex(), None, v.len() as i32)) + } + + fn init( + &self, + gl: &glow::Context, + ) -> ( + glow::NativeVertexArray, + glow::NativeBuffer, + Option, + ) { + unsafe { + let vao = gl.create_vertex_array().unwrap(); + gl.bind_vertex_array(Some(vao)); + let vbo = gl.create_buffer().unwrap(); + gl.bind_buffer(glow::ARRAY_BUFFER, Some(vbo)); + gl.enable_vertex_attrib_array(0); + gl.vertex_attrib_pointer_f32(0, 4, glow::FLOAT, false, 48, 0); + + gl.enable_vertex_attrib_array(1); + gl.vertex_attrib_pointer_f32(1, 4, glow::FLOAT, false, 48, 16); + + gl.bind_vertex_array(None); + gl.bind_buffer(glow::ARRAY_BUFFER, None); + + (vao, vbo, None) + } + } +} + +#[derive(Clone, Debug)] +pub enum FontConfig { + Textline(LineStyle, FontStyle), +} + +mod test { + #[test] + fn test() { + use super::*; + let mut font_manager = FontManager::new().unwrap(); + } +} diff --git a/gi/src/graphics/font/text_items.rs b/gi/src/graphics/font/text_items.rs new file mode 100644 index 0000000..58d0415 --- /dev/null +++ b/gi/src/graphics/font/text_items.rs @@ -0,0 +1,258 @@ +use super::esdt::{Image2d, Params, Unorm8}; +use super::TextVType; +use super::{esdt::glyph_to_sdf, Cache}; +use crate::font_manager::{CharImg, FontManager, FontSize}; +use crate::GL; +use crate::{errors::*, font_manager::FontStyle}; +use bytemuck::{Pod, Zeroable}; +use geo::kernels; +use std::collections::HashMap; + +const SDF_PARAM: Params = Params { + radius: 5.0, + pad: 4, + cutoff: 0.25, + solidify: true, + preprocess: false, +}; + +#[derive(Debug, Default, Clone)] +pub struct LineStyle { + line_height: f32, + line_spacing: f32, +} + +#[derive(Clone)] +pub struct PositionText { + item: TextLine, + position: [f32; 3], + anchor: Anchor, +} + +impl PositionText { + pub fn new(item: TextLine, position: [f32; 3], anchor: Anchor) -> Self { + Self { + item, + position, + anchor, + } + } +} + +impl Text for PositionText { + fn bake<'a>( + &self, + gl: &'a GL, + font_manager: &mut FontManager, + cache: &mut HashMap, + ) -> Result { + self.item.bake(gl, font_manager, cache) + } +} + +#[derive(Clone)] +pub struct TextLine { + text: String, + font_style: FontStyle, + line_style: LineStyle, +} + +impl TextLine { + pub fn new>( + text: P, + font_style: Option, + line_style: Option, + ) -> Self { + Self { + text: text.into(), + font_style: font_style.unwrap_or_default(), + line_style: line_style.unwrap_or_default(), + } + } +} + +#[derive(Clone, Copy)] +pub enum Anchor { + TopLeft, + TopCenter, + TopRight, + CenterLeft, + Center, + CenterRight, + BottomLeft, + BottomCenter, + BottomRight, +} + +#[derive(Clone, Copy)] +pub enum TextAlign { + Left, + Center, + Right, +} + +impl Default for TextAlign { + fn default() -> Self { + Self::Left + } +} + +#[repr(C)] +#[derive(Clone, Copy, Zeroable, Pod)] +pub struct TextVertexItem { + tex_coords: [f32; 4], + position: [f32; 4], +} + +pub struct TextVertexArray { + points: Vec, +} + +impl TextVertexArray { + pub fn new() -> Self { + Self { + points: Vec::with_capacity(30), + } + } + + pub fn len(&self) -> usize { + self.points.len() + } + + pub fn push(&mut self, item: TextVertexItem) { + self.points.push(item); + } + + pub fn insert_text(&mut self, tex_coords: TextVType, position: [f32; 2], size: [f32; 2]) { + let tex_left_top = tex_coords.left_top(); + let tex_right_bottom = tex_coords.right_bottom(); + + self.push(TextVertexItem { + position: [position[0], position[1], size[0], size[1]], + tex_coords: [ + tex_left_top[0], + tex_left_top[1], + tex_right_bottom[0], + tex_right_bottom[1], + ], + }); + } + pub fn vertex(&self) -> Vec { + let mut result = Vec::with_capacity(self.len() * 8); + self.points.iter().for_each(|v| { + result.extend_from_slice(&v.tex_coords); + result.extend_from_slice(&v.position); + }); + result + } + + pub fn to_bits(&self) -> &[u8] { + bytemuck::cast_slice(&self.points) + } +} + +pub trait Text: Sized { + fn bake<'a>( + &self, + gl: &'a GL, + font_manager: &mut FontManager, + cache: &mut HashMap, + ) -> Result; +} + +impl Text for TextLine { + fn bake<'a>( + &self, + gl: &'a GL, + font_manager: &mut FontManager, + cache: &mut HashMap, + ) -> Result { + let font_style = &self.font_style; + let font = font_manager.get_font_or_insert(&font_style.postscript_name); + if let Some(font) = font { + cache + .entry(font_style.postscript_name.clone()) + .or_insert_with(|| Cache::new(gl.clone())); + + let cache = cache.get_mut(&font_style.postscript_name).unwrap(); + let mut baked = TextVertexArray::new(); + let mut pen = [0.0, 0.0]; + + let mut prev: Option = None; + + for char in self.text.chars() { + if char == '\n' { + break; + } + + if char == ' ' { + pen[0] += 10.0; + continue; + } + + let font_size = match &font_style.size { + FontSize::Absolute(s) => *s, + FontSize::DistanceScale(_) => panic!(""), + FontSize::WindowScale(_) => panic!(""), + }; + + font.set_char_size(font_size.floor() as isize); + font.set_char(char); + + let (x_advanced, y_advanced) = font.get_advance(); + let (x_kerning, _) = prev.map_or((0.0, 0.0), |v| { + let kerning = font.get_kerning(v, char); + kerning + }); + + let metrics = font.get_metrics(char); + let width = (metrics.width >> 6) as f32; + let height = (metrics.height >> 6) as f32; + + let bear_x = (metrics.horiBearingX >> 6) as f32; + let bear_y = (metrics.horiBearingY >> 6) as f32; + + let x0 = pen[0] + bear_x as f32 + x_kerning; + let y0 = pen[1] - bear_y as f32; + let x1 = pen[0] + metrics.width as f32 + x_kerning; + let y1 = pen[1] + metrics.height as f32; + + if let Some(cache) = cache.get(char) { + baked.insert_text(cache.to_owned(), [x0, y0], [width, height]); + } else { + let char_glyph = font.get_char(char, 64)?; + let mut img = char_glyph.into(); + let (result, _) = glyph_to_sdf(&mut img, SDF_PARAM, None); + let b = cache.insert_glyph(result, char); + baked.insert_text(b.to_owned(), [x0, y0], [width, height]); + } + + pen[0] += x_advanced; + pen[1] += y_advanced; + prev = Some(char); + } + Ok(baked) + } else { + Err(Error::FontError(format!( + "Font {} not found", + font_style.postscript_name + ))) + } + } +} + +impl From for Image2d { + fn from(value: CharImg) -> Self { + // let img = Image2d::new(value.width() as u32, value.height() as u32, value.pixels); + let img = Image2d::from_storage( + value.width(), + value.height(), + value + .pixels() + .iter() + .map(|v| Unorm8::from_bits(*v)) + .collect(), + ); + img + } +} diff --git a/gi/src/graphics/mod.rs b/gi/src/graphics/mod.rs new file mode 100644 index 0000000..3826d75 --- /dev/null +++ b/gi/src/graphics/mod.rs @@ -0,0 +1,147 @@ +pub mod collections; +pub mod colormap; +mod colormesh; +pub mod font; +pub mod ppi; +pub mod threed; +pub mod tools; +pub mod transforms; +pub mod ty; + +use crate::{ + camera::Camera, + components::Program, + errors::*, + graphics::font::FontConfig, + pg::layout_type::ViewPort, + ui::{operation::Projection, typ::CameraOP}, +}; + +use glow::{HasContext, NativeBuffer, NativeVertexArray}; + +pub trait Graphics { + const id: &'static str; + type Config; + + fn draw(&self, gl: &glow::Context, count: i32) -> Result<()>; + + fn compile(&mut self, gl: &glow::Context) -> Result<()>; + + fn destroy(&mut self, gl: &glow::Context) -> Result<()>; + + fn program_ref(&self) -> &Program; + + fn program_mut(&mut self) -> &mut Program; + + fn mount(&mut self, gl: &glow::Context) -> Result<()> { + unsafe { + gl.use_program(self.program_ref().native_program.clone()); + } + + Ok(()) + } + + fn unmount(&mut self, gl: &glow::Context) -> Result<()> { + unsafe { + gl.use_program(None); + } + + Ok(()) + } + + fn set_config(&mut self, gl: &glow::Context, config: &Self::Config) -> Result<()>; +} + +pub trait AttaWithProgram { + fn attach_with_program(&self, gl: &glow::Context, program: &Program) -> Result<()>; +} + +pub trait AttaWithBuffer: Graphics { + type Data; + + fn bake<'a, 'gl: 'a>( + &'a self, + gl: &'gl glow::Context, + data: &Self::Data, + config: &::Config, + ) -> Result<(Vec, Option>, i32)>; + fn init(&self, gl: &glow::Context) -> (NativeVertexArray, NativeBuffer, Option); +} + +macro_rules! config_for_everyitem { + ($({$conf:ty => $name:tt},)+) => { + $( + impl From<$conf> for Config { + fn from(value: $conf) -> Self { + Self::$name(value) + } + } + + impl From for $conf { + fn from(value: Config) -> Self { + if let Config::$name(value) = value { + value + } else { + panic!("error transfer"); + } + } + } + + impl<'a> From<&'a Config> for &'a $conf { + fn from(value: &'a Config) -> &'a $conf { + if let Config::$name(value) = value { + &value + } else { + panic!("error transfer"); + } + } + } + + + )+ + + impl From<()> for Config { + fn from(_: ()) -> Self { + Self::None + } + } + + }; +} + +// #[derive(Debug, Clone)] +// pub enum Config { +// PPI(PPIConfig), +// Font(FontConfig), +// None, +// } + +// config_for_everyitem!({PPIConfig => PPI},{FontConfig => Font}, ); + +pub trait AttachWithIO { + type State: CameraOP; + fn attach_with_mouse( + &mut self, + state: &Self::State, + camera: &mut Camera, + projection: &mut Projection, + viewport: &ViewPort, + ) -> bool; + + fn reset(&mut self); + + fn init_camera(&self) -> Camera; +} + +#[derive(Debug, Clone)] +pub enum MouseState { + Drag { from: [f32; 2], delta: [f32; 2] }, + Wheel(f32), + None, +} + +#[derive(Debug, Clone)] +pub struct MouseKeyboardState { + pub mouse_state: MouseState, + pub keyboard_state: [bool; 652], +} diff --git a/gi/src/graphics/plane.rs b/gi/src/graphics/plane.rs new file mode 100644 index 0000000..27b08a8 --- /dev/null +++ b/gi/src/graphics/plane.rs @@ -0,0 +1,7 @@ +pub struct Plane {} + +impl Plane { + pub fn new() -> Self { + Self {} + } +} diff --git a/gi/src/graphics/ppi.rs b/gi/src/graphics/ppi.rs new file mode 100644 index 0000000..ea3be65 --- /dev/null +++ b/gi/src/graphics/ppi.rs @@ -0,0 +1,243 @@ +use super::colormap::ColorMap; +use super::{transforms, AttaWithBuffer, AttaWithProgram, AttachWithIO, Graphics}; +use crate::components::{Program, Shader}; +use crate::data_loader::{CoordType, Data, DataType}; +use crate::errors::*; +use crate::graphics::colormap::linear::LinearColormap; +use glow::{HasContext, NativeBuffer, NativeVertexArray}; + +pub struct PPI { + program: Program, + cmap: LinearColormap, +} + +impl PPI { + pub fn new() -> Result { + use crate::shaders::ppi::*; + let vertex = Shader::new(glow::VERTEX_SHADER, PPIVertex::new())?; + let geom = Shader::new(glow::GEOMETRY_SHADER, PPIGeom::new())?; + let fragment = Shader::new(glow::FRAGMENT_SHADER, PPIFragment::new())?; + let mut cmap = LinearColormap::new()?; + let mut program = Program::new(vertex, fragment, Some(geom), "330 core"); + + Ok(Self { program, cmap }) + } + + pub fn program(&mut self) -> &mut Program { + &mut self.program + } + + fn set_conf(&mut self, gl: &glow::Context, config: &PPIConfig) { + let rdpi = config.rdpi; + let adpi = config.adpi; + let location = self.program.get_uniform_location(gl, "conf"); + self.cmap + .set_range(config.color_range[0], config.color_range[1]); + self.cmap.set_colors(config.colors.clone()); + self.cmap.set_unvalid_value(config.unvalid_value); + self.cmap.attach_with_program(gl, &self.program); + + unsafe { + gl.uniform_4_f32( + location.as_ref(), + rdpi, + adpi, + 0f32, + if config.three_d { 1.0 } else { 0.0 }, + ); + } + } + + pub fn data_info(&self, data: &Data) -> Result<(f32, f32, DataType, usize, f32)> { + let first_block = data.blocks.get(0).unwrap(); + if let CoordType::Polar { + azimuth, + r, + r_range, + elevation, + .. + } = &first_block.coord_type + { + let mut sorted_azimuth = azimuth.clone(); + sorted_azimuth.sort_by(|a, b| a.partial_cmp(b).unwrap_or(std::cmp::Ordering::Greater)); + let azi_step = max_step(&sorted_azimuth); + let r_step = min_step(r) / (r_range[1]) as f32; + + let unvalid = first_block.unvalid_value; + + return Ok(( + r_step, + azi_step, + first_block.data_type, + elevation.len(), + unvalid, + )); + } else { + return Err(Error::InvalidDataType); + } + } + + fn init(&mut self, gl: &glow::Context, config: &PPIConfig) { + self.set_conf(gl, config); + self.cmap.attach_with_program(gl, &self.program).unwrap(); + let origin = self.program.get_uniform_location(gl, "polar_origin"); + unsafe { + gl.uniform_1_f32(origin.as_ref(), 90.0f32.to_radians()); + } + } +} + +fn min_step(data: &Vec) -> f32 { + // 计算相邻元素之间的间距 + let mut min_gap = f32::MAX; + for window in data.windows(2) { + if let [a, b] = window { + let gap = b - a; + if gap < min_gap { + min_gap = gap; + } + } + } + return min_gap; +} + +fn max_step(data: &Vec) -> f32 { + // 计算相邻元素之间的间距 + let mut max_gap = f32::MIN; + for window in data.windows(2) { + if let [a, b] = window { + let gap = b - a; + if gap > max_gap { + max_gap = gap; + } + } + } + return max_gap; +} + +impl Graphics for PPI { + const id: &'static str = "PPI"; + type Config = PPIConfig; + fn compile(&mut self, gl: &glow::Context) -> Result<()> { + self.program.compile(gl)?; + Ok(()) + } + + fn destroy(&mut self, gl: &glow::Context) -> Result<()> { + self.program.destroy(gl); + + Ok(()) + } + + fn draw(&self, gl: &glow::Context, count: i32) -> Result<()> { + unsafe { + self.cmap.bind_texture(gl, &self.program)?; + gl.draw_arrays(glow::POINTS, 0, count); + } + Ok(()) + } + + fn program_ref(&self) -> &Program { + &self.program + } + + fn program_mut(&mut self) -> &mut Program { + &mut self.program + } + + fn set_config(&mut self, gl: &glow::Context, config: &Self::Config) -> Result<()> { + self.init(gl, config); + Ok(()) + } + + fn mount(&mut self, gl: &glow::Context) -> Result<()> { + unsafe { + gl.use_program(self.program.native_program); + } + Ok(()) + } + + fn unmount(&mut self, gl: &glow::Context) -> Result<()> { + unsafe { + gl.use_program(None); + } + Ok(()) + } +} + +impl AttaWithBuffer for PPI { + type Data = Data; + + fn bake<'a, 'gl: 'a>( + &'a self, + gl: &'gl glow::Context, + data: &Self::Data, + config: &::Config, + ) -> Result<(Vec, Option>, i32)> { + let layer = config.layer; + let first_block = data.blocks.get(0).unwrap(); + let first_block_data = first_block.data.view(); + if let CoordType::Polar { + r_range, + azimuth, + elevation, + r, + .. + } = &first_block.coord_type + { + let azimuth_len = azimuth.len(); + let r_len = r.len(); + + let mut vertices = Vec::with_capacity(azimuth_len * r_len); + let ele = elevation.get(layer).unwrap(); + + for azi_idx in 0..azimuth_len { + for r_idx in 0..r_len { + let azi = azimuth.get(azi_idx).unwrap(); + let r = r.get(r_idx).unwrap() / r_range[1] as f32; + // let r = *r.get(r_idx).unwrap(); + let dt = first_block_data.get([layer, azi_idx, r_idx]).unwrap(); + vertices.extend([r, *azi, *ele, *dt]); + } + } + let len = vertices.len() as i32 / 4; + return Ok((vertices, None, len)); + } else { + return Err(Error::InvalidDataType); + } + } + + fn init(&self, gl: &glow::Context) -> (NativeVertexArray, NativeBuffer, Option) { + unsafe { + let vao = gl.create_vertex_array().unwrap(); + gl.bind_vertex_array(Some(vao)); + let vbo = gl.create_buffer().unwrap(); + gl.bind_buffer(glow::ARRAY_BUFFER, Some(vbo)); + gl.enable_vertex_attrib_array(0); + gl.vertex_attrib_pointer_f32(0, 4, glow::FLOAT, false, 16, 0); + gl.bind_vertex_array(None); + gl.bind_buffer(glow::ARRAY_BUFFER, None); + + (vao, vbo, None) + } + } +} + +#[derive(Default, Clone, Debug)] +pub struct PPIConfig { + pub unvalid_value: f32, + pub layer: usize, + pub colors: Vec<[u8; 4]>, + pub color_range: [f32; 2], + pub rdpi: f32, + pub adpi: f32, + pub three_d: bool, +} + +mod test { + #[test] + fn test_ppi() { + use super::*; + // let ppi = PPI::new().unwrap(); + } +} diff --git a/gi/src/graphics/threed.rs b/gi/src/graphics/threed.rs new file mode 100644 index 0000000..f8e7c5c --- /dev/null +++ b/gi/src/graphics/threed.rs @@ -0,0 +1,77 @@ +use std::rc::Rc; +use tracker::track; + +use super::transforms::trackball::TrackballModel; +use super::{AttaWithProgram, AttachWithIO}; +use crate::camera::{self, Camera}; +use crate::errors::*; +use crate::pg::layout_type::ViewPort; +use crate::ui::operation::Projection; +use glow::HasContext; +use nalgebra_glm::{Mat4, Vec3}; + +#[derive(Clone)] +pub struct Trackball { + trackball: TrackballModel, +} + +impl Trackball { + pub fn new(aspect: f32, z_near: f32, z_far: f32, fov: f32) -> Result { + let trackball = TrackballModel::new(0.0, 90.0, 20.0); + + Ok(Self { trackball }) + } +} + +impl Default for Trackball { + fn default() -> Self { + Self::new(16.0 / 9.0, 0.1, 1000.0, 45.0).unwrap() + } +} + +impl AttaWithProgram for Trackball { + fn attach_with_program( + &self, + gl: &glow::Context, + program: &crate::components::Program, + ) -> Result<()> { + self.trackball.attach_with_program(gl, program); + Ok(()) + } +} + +impl AttachWithIO for Trackball { + type State = super::MouseState; + fn attach_with_mouse( + &mut self, + state: &Self::State, + camera: &mut Camera, + projection: &mut Projection, + viewport: &ViewPort, + ) -> bool { + match state { + &super::MouseState::Wheel(delta) => { + projection.set_fov((projection.fov() - delta).clamp(15.0, 120.0)); + true + } + super::MouseState::Drag { from, delta } => { + self.trackball.drag_to(from[0], from[1], delta[0], delta[1]); + true + } + _ => false, + } + } + + fn reset(&mut self) { + self.trackball.set_phi(90.0); + self.trackball.set_theta(0.0); + } + + fn init_camera(&self) -> Camera { + Camera::new( + Vec3::new(0.0, 30.0, 10.0), + Vec3::new(0.0, 1.0, 0.0), + Vec3::new(0.0, 0.0, 0.0), + ) + } +} diff --git a/src/widgets/dynamic_col/custom_layout/imp.rs b/gi/src/graphics/tools/mod.rs similarity index 100% rename from src/widgets/dynamic_col/custom_layout/imp.rs rename to gi/src/graphics/tools/mod.rs diff --git a/gi/src/graphics/transforms/mod.rs b/gi/src/graphics/transforms/mod.rs new file mode 100644 index 0000000..157f7a1 --- /dev/null +++ b/gi/src/graphics/transforms/mod.rs @@ -0,0 +1,59 @@ +pub mod plane; +pub mod trackball; +use crate::components::Program; + +use super::AttaWithProgram; + +// pub struct ChainedTransform { +// snippet: Snippet, +// chain: Vec>, +// } + +// impl ChainedTransform { +// pub fn from(transform: &T) -> Self { +// let snippet = transform.snippet().clone(); +// // let snippet = transform.snippet().to_owned(); +// Self { +// snippet, +// chain: vec![Box::new(transform.clone())], +// } +// } + +// pub fn chain(mut self, other: &P) -> Self { +// let new_snippet = self.snippet.clone().chain(other.snippet().to_owned()); +// self.snippet = new_snippet; +// self.chain.push(Box::new(other.clone())); +// self +// } +// } + +// impl Transform for ChainedTransform { +// fn snippet(&self) -> &Snippet { +// &self.snippet +// } +// } + +// impl AttaWithProgram for ChainedTransform { +// fn attach_with_program(&self, gl: &glow::Context, program: &Program) -> super::Result<()> { +// for transform in &self.chain { +// transform.attach_with_program(gl, program)?; +// } + +// Ok(()) +// } +// } + +// mod test { +// use super::*; + +// #[test] +// fn test_transform() { +// let polar = polar::Polar::new().unwrap(); +// // let trackball = trackball::Trackball::new().unwrap(); + +// // let chained = ChainedTransform::from(polar).chain(trackball); + +// // println!("{}", chained.snippet().prepare_code()); +// // println!("{}", chained.snippet().call(&vec![]).unwrap()); +// } +// } diff --git a/gi/src/graphics/transforms/plane.rs b/gi/src/graphics/transforms/plane.rs new file mode 100644 index 0000000..b096cad --- /dev/null +++ b/gi/src/graphics/transforms/plane.rs @@ -0,0 +1,127 @@ +use crate::components::Program; +use crate::errors::Result; +use crate::graphics::{AttaWithProgram, AttachWithIO, MouseKeyboardState, MouseState}; +use crate::pg::layout_type::ViewPort; +use crate::ui::operation::Projection; + +use glow::HasContext; +use nalgebra::{Matrix4, Quaternion, Translation3, Unit, UnitQuaternion, Vector3}; +use nalgebra_glm::vec3; +use serde::de; + +use super::trackball::{self, TrackballModel}; + +#[derive(Debug, Clone)] +pub struct PlaneTrans { + trackball: TrackballModel, +} + +impl PlaneTrans { + fn translate( + &self, + projection: &Projection, + camera: &mut crate::camera::Camera, + delta: &[f32; 2], + viewport_size: &[f32; 2], + ) { + let watch_vec = camera.front(); + let fov = projection.fov().to_radians(); + let aspect = projection.aspect(); + + // Z_near + let z_distance = camera.front().norm().abs(); + + let h = 2.0 * z_distance * (fov / 2.0).tan(); + let w = h * aspect; + + let move_width = (delta[0] * w) / viewport_size[0]; + let move_height = (delta[1] * h) / viewport_size[1]; + + let up = camera.get_upward(); + let right = watch_vec.cross(&up).normalize(); + let _move = move_width * right + move_height * up; + camera.set_position(camera.get_position() - _move); + camera.set_center(camera.get_center() - _move); + } +} + +impl AttachWithIO for PlaneTrans { + type State = MouseKeyboardState; + + fn attach_with_mouse( + &mut self, + state: &Self::State, + camera: &mut crate::camera::Camera, + projection: &mut crate::ui::operation::Projection, + viewport: &ViewPort, + ) -> bool { + let viewport_size = viewport.size(); + // let shift_key = state.keyboard_state[imgui::Key::LeftShift as usize]; + // let ctrl_key = state.keyboard_state[imgui::Key::LeftCtrl as usize]; + + let shift_key = true; + let ctrl_key = true; + + match &state.mouse_state { + MouseState::Drag { from, delta } => { + if shift_key { + self.trackball.drag_to( + from[0] - viewport_size[0] / 2.0, + from[1] - viewport_size[1] / 2.0, + 0.0, + -delta[1], + ); + } else if ctrl_key { + self.trackball.drag_to( + from[0] - viewport_size[0] / 2.0, + from[1] - viewport_size[1] / 2.0, + -delta[0], + 0.0, + ); + } else if shift_key && ctrl_key { + self.trackball.drag_to( + from[0] - viewport_size[0] / 2.0, + from[1] - viewport_size[1] / 2.0, + -delta[0], + -delta[1], + ) + } else { + self.translate(projection, camera, delta, &viewport_size); + } + true + } + MouseState::Wheel(delta) => { + projection.set_fov((projection.fov() - delta).clamp(15.0, 120.0)); + true + } + _ => false, + } + } + + fn init_camera(&self) -> crate::camera::Camera { + crate::camera::Camera::new( + vec3(0.0, 0.0, 20.0), + vec3(0.0, 1.0, 0.0), + vec3(0.0, 0.0, 0.0), + ) + } + + fn reset(&mut self) {} +} + +impl AttaWithProgram for PlaneTrans { + fn attach_with_program(&self, gl: &glow::Context, program: &Program) -> Result<()> { + unsafe { + let loc = program.get_uniform_location(gl, "trackball_model"); + self.trackball.attach_with_program(gl, program)?; + } + Ok(()) + } +} + +impl Default for PlaneTrans { + fn default() -> Self { + let trackball = TrackballModel::new(0.0, 0.0, 200.0); + Self { trackball } + } +} diff --git a/gi/src/graphics/transforms/trackball.rs b/gi/src/graphics/transforms/trackball.rs new file mode 100644 index 0000000..05e8584 --- /dev/null +++ b/gi/src/graphics/transforms/trackball.rs @@ -0,0 +1,182 @@ +use crate::components::Program; +use crate::errors::Result; +use crate::graphics::AttaWithProgram; + +use glow::HasContext; +use nalgebra::{Matrix4, Quaternion, Translation3, Unit, UnitQuaternion, Vector3}; + +#[derive(Debug, Clone)] +pub struct TrackballModel { + rotation: UnitQuaternion, + count: usize, + model: Matrix4, + renorm_count: usize, + trackball_size: f32, + x: f32, + y: f32, + theta: f32, + phi: f32, +} + +impl TrackballModel { + pub fn new(phi: f32, theta: f32, range: f32) -> Self { + let mut trackball = Self { + rotation: UnitQuaternion::identity(), + count: 0, + model: Matrix4::identity(), + renorm_count: 97, + trackball_size: range, + x: 0.0, + y: 0.0, + theta, + phi, + }; + trackball.set_orientation(theta, phi); + trackball + } + + pub fn rotate_z(&mut self, angle: f32) { + let q = UnitQuaternion::from_axis_angle(&Vector3::z_axis(), angle); + self.rotation *= q; + self.count += 1; + if self.count > self.renorm_count { + self.rotation = UnitQuaternion::new_normalize(*self.rotation.clone()); + self.count = 0; + } + self.model = self.rotation.to_homogeneous(); + } + + pub fn drag_to(&mut self, x: f32, y: f32, dx: f32, dy: f32) { + let q = self.rotate(x, y, dx, dy); + self.rotation *= q; + self.count += 1; + if self.count > self.renorm_count { + self.rotation = UnitQuaternion::new_normalize(*self.rotation.clone()); + self.count = 0; + } + self.model = self.rotation.to_homogeneous(); + } + + fn model(&self) -> &Matrix4 { + &self.model + } + + fn theta(&self) -> f32 { + self.theta + } + + pub fn set_theta(&mut self, theta: f32) { + self.set_orientation(theta % 360.0, self.phi % 360.0); + } + + fn phi(&self) -> f32 { + self.phi + } + + pub fn set_phi(&mut self, phi: f32) { + self.set_orientation(self.theta % 360.0, phi % 360.0); + } + + fn get_orientation(&self) -> (f32, f32) { + let q = self.rotation.quaternion(); + let ax = (2.0 * (q.w * q.i + q.j * q.k) / (1.0 - 2.0 * (q.i * q.i + q.j * q.j))).atan() + * 180.0 + / std::f32::consts::PI; + let az = (2.0 * (q.w * q.k + q.i * q.j) / (1.0 - 2.0 * (q.j * q.j + q.k * q.k))).atan() + * 180.0 + / std::f32::consts::PI; + (-az, ax) + } + + fn set_orientation(&mut self, theta: f32, phi: f32) { + self.theta = theta; + self.phi = phi; + + let angle = self.theta.to_radians(); + let sine = (0.5 * angle).sin(); + let xrot = + UnitQuaternion::from_quaternion(Quaternion::new((0.5 * angle).cos(), sine, 0.0, 0.0)); + + let angle = self.phi.to_radians(); + let sine = (0.5 * angle).sin(); + let zrot = + UnitQuaternion::from_quaternion(Quaternion::new((0.5 * angle).cos(), 0.0, 0.0, sine)); + + self.rotation = xrot * zrot; + self.model = self.rotation.to_homogeneous(); + } + + fn project(&self, r: f32, x: f32, y: f32) -> f32 { + let d = (x * x + y * y).sqrt(); + if d < r * 0.70710678118654752440 { + (r * r - d * d).sqrt() + } else { + let t = r / 1.41421356237309504880; + t * t / d + } + } + + fn rotate(&self, x: f32, y: f32, dx: f32, dy: f32) -> UnitQuaternion { + if dx == 0.0 && dy == 0.0 { + return UnitQuaternion::identity(); + } + + let last = Vector3::new(x, y, self.project(self.trackball_size, x, y)); + let new = Vector3::new( + x + dx, + y + dy, + self.project(self.trackball_size, x + dx, y + dy), + ); + + let a = new.cross(&last); + let d = last - new; + let t = d.norm() / (2.0 * self.trackball_size); + let t = t.clamp(-1.0, 1.0); + + let phi = 2.0 * t.asin(); + UnitQuaternion::from_axis_angle(&Unit::new_normalize(a), phi) + } +} + +// impl Trackball { +// pub fn new() -> Result { +// let model = TrackballModel::new(0.0, 0.0); + +// Ok(Self { model }) +// } + +// pub fn on_mouse_drag(&mut self, x: f32, y: f32, dx: f32, dy: f32) { +// self.model.drag_to(x, y, dx, dy); +// } + +// pub fn model(&self) -> &Matrix4 { +// self.model.model() +// } +// } + +impl AttaWithProgram for TrackballModel { + fn attach_with_program(&self, gl: &glow::Context, program: &Program) -> Result<()> { + unsafe { + let l = program.get_uniform_location(gl, "trackball_model"); + gl.uniform_matrix_4_f32_slice(l.as_ref(), false, self.model().as_slice()); + } + + Ok(()) + } +} + +mod test { + use super::*; + + #[test] + fn test_trackball() { + let mut trackball = TrackballModel::new(45.0, 45.0, 20.0); + println!("{:?}", trackball.model()); + + trackball.drag_to(0.0, 10.0, 15.0, 30.0); + println!("{:?}", trackball.model()); + + // let trackball = Trackball::new().unwrap(); + // println!("{}", trackball.snippet); + } +} diff --git a/gi/src/graphics/ty/mod.rs b/gi/src/graphics/ty/mod.rs new file mode 100644 index 0000000..f4967aa --- /dev/null +++ b/gi/src/graphics/ty/mod.rs @@ -0,0 +1,3 @@ +use bytemuck::{Pod, Zeroable}; + +pub trait Ty: Pod {} diff --git a/gi/src/lib.rs b/gi/src/lib.rs new file mode 100644 index 0000000..c6254fa --- /dev/null +++ b/gi/src/lib.rs @@ -0,0 +1,16 @@ +#![feature(proc_macro_hygiene)] +#![allow(unused)] +mod camera; +mod components; +mod data_loader; +mod errors; +mod font_manager; +mod graphics; +mod pg; +mod setting; +mod shaders; +pub mod ui; +mod utils; +pub use pg::App; +pub use ui::helper::Helper; +pub use utils::*; diff --git a/gi/src/pg/app.rs b/gi/src/pg/app.rs new file mode 100644 index 0000000..a2c3128 --- /dev/null +++ b/gi/src/pg/app.rs @@ -0,0 +1,65 @@ +use log::*; +use std::{cell::RefCell, path::PathBuf, rc::Rc}; + +use crate::{ + data_loader::Data, + errors::*, + graphics::{ + colormap::linear::LinearColormap, threed::Trackball, AttaWithBuffer, AttaWithProgram, + Graphics, + }, + ui::helper::{self, Helper}, + utils::{ + cache::{Cache, CachedData}, + resources::{ + ManagedResource, RcGlBuffer, RcGlFramebuffer, RcGlRcFramebuffer, RcGlRcRenderbuffer, + RcGlRcResource, RcGlRenderbuffer, RcGlResource, RcGlVertexArray, GL, + }, + }, +}; +use glow::HasContext; + +use super::layout_type; +use super::{ModulePackage, Programs}; +use crate::{font_manager::FontManager, graphics::font::Text}; + +pub struct App { + gl: GL, + context: Context, +} + +impl App { + pub fn new(gl: GL, helper: Helper) -> Result { + let programs = Programs::new(gl.clone()).unwrap(); + let context = Context::new(gl.clone(), helper, programs); + Ok(Self { gl, context }) + } + + pub fn prepare(&mut self) { + if let Err(e) = self.context.programs.prepare() { + error!("prepare failed: {:?}", e); + } + } + + pub fn render<'a>(&'a mut self) {} + pub fn destroy(&mut self) { + self.context.programs.destroy().unwrap(); + } +} + +pub struct Context { + pub gl: GL, + pub helper: Helper, + pub programs: Programs, +} + +impl Context { + fn new(gl: GL, helper: Helper, programs: Programs) -> Self { + let context = Context { + gl, + helper, + programs: programs, + }; + context + } +} diff --git a/gi/src/pg/layout_type.rs b/gi/src/pg/layout_type.rs new file mode 100644 index 0000000..c273dc1 --- /dev/null +++ b/gi/src/pg/layout_type.rs @@ -0,0 +1,242 @@ +use crate::errors::*; +use crate::graphics::ty; +use crate::pg::{Context, ModulePackage}; +use crate::resources::{RcGlFramebuffer, RcGlResource}; +use crate::ui::typ::{LayoutAttach, MainLoadAttach}; +use crate::utils::resources::{ + ManagedResource, RcGlRcFramebuffer, RcGlRcRenderbuffer, RcGlRcResource, Resource, GL, +}; +use glow::{HasContext, NativeRenderbuffer, NativeTexture}; + +const RBO_WIDTH: i32 = 3840; +const RBO_HEIGHT: i32 = 2160; + +// App Layout Type +macro_rules! impl_layout { + ($({$name:ident => $attach:ty}),+ $(,)?) => { + pub enum Layout { + $( + $name($attach), + )+ + } + + impl Layout { + pub fn launch_render_task(&mut self, mut context: &mut Context) -> Result<()> + { + let programs = &mut context.programs; + let gl = &context.gl; + let helper = &mut context.helper; + + match self { + $( + Self::$name(typ) => { + typ.render_task(&gl, programs, helper)?; + } + )+ + } + Ok(()) + } + + pub fn append_package(&mut self, package: ModulePackage) { + match self { + $( + Self::$name(typ) => { + typ.append(package); + } + )+ + } + } + + } + }; +} + +pub struct ViewPort { + renderer_size: [f32; 2], + main_fbo: RcGlRcFramebuffer, + _main_rbo: RcGlRcResource, + _main_depth_rbo: RcGlRcResource, +} + +impl ViewPort { + pub fn bind(&self, gl: &glow::Context) { + self.main_fbo.bind(glow::FRAMEBUFFER); + unsafe { + gl.viewport( + 0, + 0, + self.renderer_size[0] as i32, + self.renderer_size[1] as i32, + ); + } + } + + pub fn unbind(&self) { + self.main_fbo.unbind(glow::FRAMEBUFFER); + } + + pub fn set_size(&mut self, size: [f32; 2]) -> bool { + if size != self.renderer_size { + self.renderer_size = size; + true + } else { + false + } + } + + pub fn fbo(&self) -> &RcGlRcFramebuffer { + &self.main_fbo + } + + pub fn size(&self) -> [f32; 2] { + self.renderer_size + } +} + +impl ViewPort { + pub fn new(gl: &GL, depth: bool) -> Self { + let main_fbo: RcGlRcFramebuffer = gl.create_resource_rc(); + let main_rbo: RcGlRcResource = gl.create_resource_rc(); + let main_depth_rbo: RcGlRcResource = gl.create_resource_rc(); + + main_fbo.bind(glow::FRAMEBUFFER); + + unsafe { + // Color Attachment + gl.active_texture(glow::TEXTURE0); + main_rbo.bind(glow::TEXTURE_2D); + gl.tex_image_2d( + glow::TEXTURE_2D, + 0, + glow::RGBA8 as i32, + RBO_WIDTH, + RBO_HEIGHT, + 0, + glow::RGBA, + glow::UNSIGNED_BYTE, + None, + ); + + gl.tex_parameter_i32( + glow::TEXTURE_2D, + glow::TEXTURE_MIN_FILTER, + glow::LINEAR as i32, + ); + gl.tex_parameter_i32( + glow::TEXTURE_2D, + glow::TEXTURE_MAG_FILTER, + glow::LINEAR as i32, + ); + + gl.framebuffer_texture_2d( + glow::FRAMEBUFFER, + glow::COLOR_ATTACHMENT0, + glow::TEXTURE_2D, + Some(main_rbo.native()), + 0, + ); + + if depth { + // Depth Attachment + main_depth_rbo.bind(glow::RENDERBUFFER); + gl.renderbuffer_storage( + glow::RENDERBUFFER, + glow::DEPTH_COMPONENT24, + RBO_WIDTH, + RBO_HEIGHT, + ); + + gl.framebuffer_renderbuffer( + glow::FRAMEBUFFER, + glow::DEPTH_ATTACHMENT, + glow::RENDERBUFFER, + Some(main_depth_rbo.native()), + ); + main_depth_rbo.unbind(glow::RENDERBUFFER); + gl.enable(glow::DEPTH_TEST); + } + + gl.clear_color(0.0, 0.0, 0.0, 0.0); + gl.clear(glow::COLOR_BUFFER_BIT); + // 检查帧缓冲是否完整 + if gl.check_framebuffer_status(glow::FRAMEBUFFER) != glow::FRAMEBUFFER_COMPLETE { + panic!("Framebuffer is not complete!"); + } + } + main_fbo.unbind(glow::FRAMEBUFFER); + + Self { + renderer_size: [0.0, 0.0], + main_fbo, + _main_rbo: main_rbo, + _main_depth_rbo: main_depth_rbo, + } + } + + pub fn texture(&self) -> &RcGlRcResource { + &self._main_rbo + } +} + +impl ViewPort { + pub fn new(gl: &GL, depth: bool) -> Self { + let main_fbo: RcGlRcFramebuffer = gl.create_resource_rc(); + let main_rbo: RcGlRcResource = gl.create_resource_rc(); + let main_depth_rbo: RcGlRcResource = gl.create_resource_rc(); + + main_fbo.bind(glow::FRAMEBUFFER); + + unsafe { + // Color Attachment + main_rbo.bind(glow::RENDERBUFFER); + gl.renderbuffer_storage(glow::RENDERBUFFER, glow::RGBA8, RBO_WIDTH, RBO_HEIGHT); + gl.framebuffer_renderbuffer( + glow::FRAMEBUFFER, + glow::COLOR_ATTACHMENT0, + glow::RENDERBUFFER, + Some(main_rbo.native()), + ); + main_rbo.unbind(glow::RENDERBUFFER); + + if depth { + // Depth Attachment + main_depth_rbo.bind(glow::RENDERBUFFER); + gl.renderbuffer_storage( + glow::RENDERBUFFER, + glow::DEPTH_COMPONENT24, + RBO_WIDTH, + RBO_HEIGHT, + ); + + gl.framebuffer_renderbuffer( + glow::FRAMEBUFFER, + glow::DEPTH_ATTACHMENT, + glow::RENDERBUFFER, + Some(main_depth_rbo.native()), + ); + main_depth_rbo.unbind(glow::RENDERBUFFER); + + gl.enable(glow::DEPTH_TEST); + } + + gl.clear_color(0.0, 0.0, 0.0, 0.0); + gl.clear(glow::COLOR_BUFFER_BIT); + // 检查帧缓冲是否完整 + if gl.check_framebuffer_status(glow::FRAMEBUFFER) != glow::FRAMEBUFFER_COMPLETE { + panic!("Framebuffer is not complete!"); + } + } + main_fbo.unbind(glow::FRAMEBUFFER); + + Self { + renderer_size: [0.0, 0.0], + main_fbo, + _main_rbo: main_rbo, + _main_depth_rbo: main_depth_rbo, + } + } +} + +impl_layout!( + {MainLoad => MainLoadAttach}, +); diff --git a/gi/src/pg/mod.rs b/gi/src/pg/mod.rs new file mode 100644 index 0000000..d3aebc0 --- /dev/null +++ b/gi/src/pg/mod.rs @@ -0,0 +1,174 @@ +mod app; +use femtovg::renderer::OpenGl; +use femtovg::Canvas; +use glow::HasContext; +use layout_type::ViewPort; +pub mod layout_type; +mod modules; + +use crate::font_manager::FontManager; +use crate::graphics::collections::agg_fast_path::AggFastPath; +use crate::graphics::font::Text; +use crate::graphics::ppi::PPI; +use crate::graphics::threed::Trackball; +use crate::graphics::transforms::plane::PlaneTrans; +use crate::graphics::{AttaWithProgram, AttachWithIO}; +use crate::ui::operation::Operation; +use crate::ui::typ::LayoutAttach; +use crate::utils::cache::CachedData; +use crate::utils::resources::GL; +use crate::{errors::*, graphics::Graphics}; +pub use app::{App, Context}; +pub use modules::{Module, ModuleCursor, ModuleData, PPIModule, PPIPackage}; +use std::sync::atomic::AtomicUsize; + +static MODULE_PACKAGE_ID: AtomicUsize = AtomicUsize::new(0); + +pub(super) struct Programs { + gl: GL, + _ppi: PPI, + _text: Text, + _line: AggFastPath, +} + +impl Programs { + pub fn new(gl: GL) -> Result { + let font_manager = FontManager::new()?; + + Ok(Self { + gl: gl.clone(), + _ppi: PPI::new()?, + _text: Text::new(gl, font_manager)?, + _line: AggFastPath::new()?, + }) + } + + pub fn prepare(&mut self) -> Result<()> { + self._ppi.program().compile(&self.gl)?; + self._line.program().compile(&self.gl)?; + self._text.program_mut().compile(&self.gl)?; + Ok(()) + } + + // pub fn ppi<'b>(&'b mut self) -> modules::PPIModule<'b, 'gl> { + // modules::PPIModule::new(&self.gl, &mut self._ppi, &mut self._text, &mut self._line).unwrap() + // } + + pub fn destroy(&mut self) -> Result<()> { + self._ppi.destroy(&self.gl)?; + self._text.destroy(&self.gl)?; + self._line.destroy(&self.gl)?; + Ok(()) + } + + // pub fn load_data( + // &mut self, + // data: &CachedData, + // ) -> Result> { + // let cdata = data.borrow(); + // if cdata.blocks.len() == 0 { + // return Err(Error::InvalidDataType); + // } + // let first_block = cdata.blocks.first().unwrap(); + + // match first_block.coord_type { + // crate::data_loader::CoordType::Polar { .. } => { + // // let package: PPIPackage<'gl> = self.ppi().load_data(data)?; + // // return Ok(package.into()); + // } + // _ => { + // unimplemented!("Only polar data is supported for now"); + // } + // } + // } + + // pub fn draw_modules( + // &mut self, + // modules: &mut ModulePackage<'gl>, + // operation: &Operation, + // viewport: &ViewPort, + // ) -> Result<()> { + // match &mut modules.modules { + // _ModulePackage::PPI(ppi) => { + // self.ppi().render(ppi, operation, viewport)?; + // } + // } + // modules.need_update = false; + // Ok(()) + // } +} + +pub enum Data<'a> { + Data(&'a crate::data_loader::Data), + Other, +} + +macro_rules! impl_module_data { + ($({$t:ty => $b: tt}),+) => { + $( + impl ModuleData for $t { + fn to_data(&self) -> Data { + Data::$b(self) + } + + } + + )+ + }; +} + +macro_rules! impl_module_package { + ($({$t:ty => $b: tt}),+) => { + $( + + impl From<$t> for _ModulePackage { + fn from(t: $t) -> Self { + _ModulePackage::$b(t) + } + } + )+ + }; +} + +impl_module_data!({ + crate::data_loader::Data => Data +}); + +pub struct ModulePackage { + id: usize, + pub need_update: bool, + modules: _ModulePackage, +} + +pub enum _ModulePackage { + PPI(PPIPackage), +} + +impl_module_package!({ + PPIPackage => PPI +}); + +impl From for ModulePackage +where + T: ModuleCursor + Into<_ModulePackage>, +{ + fn from(t: T) -> Self { + Self { + id: MODULE_PACKAGE_ID.fetch_add(1, std::sync::atomic::Ordering::SeqCst), + modules: t.into(), + need_update: true, + } + } +} + +impl PartialEq for ModulePackage { + fn eq(&self, other: &Self) -> bool { + self.id == other.id + } +} + +impl ModulePackage { + pub fn dirty(&mut self) { + self.need_update = true; + } +} diff --git a/gi/src/pg/modules/mod.rs b/gi/src/pg/modules/mod.rs new file mode 100644 index 0000000..e229a76 --- /dev/null +++ b/gi/src/pg/modules/mod.rs @@ -0,0 +1,120 @@ +use crate::{ + graphics::AttachWithIO, + resources::{RcGlRcBuffer, RcGlRcVertexArray}, + ui::{ + operation::{self, Operation}, + typ::CameraOP, + }, + utils::{ + cache::CachedData, + resources::{ManagedResource, RcGlBuffer, RcGlVertexArray}, + }, + GL, +}; +use femtovg::{renderer::OpenGl, Canvas}; +use glow::{HasContext, NativeBuffer, NativeVertexArray}; +mod ppi; +use crate::errors::*; +pub use ppi::{PPIModule, PPIPackage}; + +use super::{layout_type::ViewPort, Data}; + +#[derive(Clone)] +struct Attach { + gl: GL, + pub vao: RcGlRcVertexArray, + pub vbo: RcGlRcBuffer, + pub ebo: Option, + pub len: i32, +} + +impl Attach { + fn new( + gl: GL, + vao: NativeVertexArray, + vbo: NativeBuffer, + ebo: Option, + len: Option, + ) -> Self { + let vao = gl.create_resource_rc_with(vao); + let vbo = gl.create_resource_rc_with(vbo); + let ebo = ebo.map(|ebo| gl.create_resource_rc_with(ebo)); + Self { + gl, + vao, + vbo, + ebo, + len: len.unwrap_or(0), + } + } + + fn bind_self(&self) { + self.vao.bind(glow::VERTEX_ARRAY); + self.vbo.bind(glow::ARRAY_BUFFER); + if let Some(ebo) = self.ebo.as_ref() { + ebo.bind(glow::ELEMENT_ARRAY_BUFFER); + } + } + + fn unbind_self(&self) { + self.vao.unbind(glow::VERTEX_ARRAY); + self.vbo.unbind(glow::ARRAY_BUFFER); + if let Some(ebo) = self.ebo.as_ref() { + ebo.unbind(glow::ELEMENT_ARRAY_BUFFER); + } + } + + fn bind_data(&mut self, vbo: &Vec, ebo: Option<&Vec>, len: i32, usage: u32) { + use bytemuck::cast_slice; + self.vbo.bind(glow::ARRAY_BUFFER); + unsafe { + self.gl + .buffer_data_u8_slice(glow::ARRAY_BUFFER, cast_slice(&vbo), usage); + if let Some(ebo) = ebo { + self.gl.bind_buffer( + glow::ELEMENT_ARRAY_BUFFER, + Some(self.ebo.as_ref().unwrap().native()), + ); + self.gl + .buffer_data_u8_slice(glow::ELEMENT_ARRAY_BUFFER, cast_slice(&ebo), usage); + + self.gl.bind_buffer(glow::ELEMENT_ARRAY_BUFFER, None); + } + } + self.vbo.unbind(glow::ARRAY_BUFFER); + self.len = len; + } + + fn len(&self) -> i32 { + self.len + } +} + +pub trait Module: Sized { + type Cursor: ModuleCursor; + type Data; + type Operation: AttachWithIO; + + fn render( + &mut self, + cursor: &mut Self::Cursor, + operation: &Operation, + viewport: &ViewPort, + ) -> Result<()>; + + fn load_data<'dt>(&self, data: &CachedData) -> Result; +} + +pub trait ModuleData: Sized { + fn to_data(&self) -> Data; +} + +pub trait ModuleCursor { + type Module<'rf, 'gl: 'rf>: Module; + type Data: ModuleData; + type Config; + + fn set_config(&mut self, f: F) + where + F: FnOnce(&mut Self::Config); +} diff --git a/gi/src/pg/modules/ppi.rs b/gi/src/pg/modules/ppi.rs new file mode 100644 index 0000000..01ccaf0 --- /dev/null +++ b/gi/src/pg/modules/ppi.rs @@ -0,0 +1,406 @@ +use crate::{ + graphics::{ + collections::agg_fast_path::{AggFastPath, AggFastPathConfig, Path}, + font::{Anchor, FontConfig, LineStyle, PositionText, Text, TextLine}, + ppi::{PPIConfig, PPI}, + transforms::plane::PlaneTrans, + AttaWithBuffer, Graphics, + }, + GL, +}; + +use core::f32; +use glow::HasContext; +use std::rc::Rc; +use tracker::track; + +use crate::font_manager::{FontSize, FontStyle}; + +use crate::pg::layout_type::ViewPort; +use crate::ui::operation::{self, Operation}; +use crate::{ + data_loader::Data, + errors::*, + font_manager::FontManager, + ui::typ, + utils::{cache::CachedData, resources::ManagedResource}, +}; + +use super::{Attach, Module, ModuleCursor}; +pub struct PPIModule<'b, 'gl: 'b> { + gl: &'gl GL, + ppi_program: &'b mut PPI, + line_program: &'b mut AggFastPath, + text_program: &'b mut Text, +} + +impl<'b, 'a: 'b> PPIModule<'b, 'a> { + pub fn new( + gl: &'a GL, + ppi: &'b mut PPI, + text: &'b mut Text, + line: &'b mut AggFastPath, + ) -> Result { + let config = PPIConfig::default(); + Ok(Self { + gl, + ppi_program: ppi, + text_program: text, + line_program: line, + }) + } + + fn bind_ppi_pg( + &self, + attach: &mut Attach, + data: &Data, + config: &PPIModuleConfig, + ) -> Result<()> { + let (vbo, ebo, len) = self + .ppi_program + .bake(&self.gl, data, &config.to_ppi_config())?; + attach.bind_data(&vbo, ebo.as_ref(), len, glow::DYNAMIC_DRAW); + Ok(()) + } + + fn bind_line_pg( + &self, + attach: &mut Attach, + data: &Data, + config: &PPIModuleConfig, + ) -> Result<()> { + let raw_config = config.to_line_config(); + + // Will be changed in the future + let outskirt = 10.0; + + let mut paths = vec![]; + + let range_line_num = config.range_line_num; + let r = outskirt / range_line_num as f32; + let seg_num = 200; + let angle = 2f32 * f32::consts::PI / seg_num as f32; + + for range in 1..=range_line_num { + // Create the path + let mut path = Path::new(true); + let r = r * range as f32; + // Draw the circle + for seg in 0..seg_num { + let angle = angle * seg as f32; + let x = (angle.cos() * r) as f32; + let y = (angle.sin() * r) as f32; + path.push([x, y, 0.01]); + } + path.finish(); + paths.push(path); + } + + let ath_lin_num = config.ath_line_num; + + let a = 2.0 * f32::consts::PI / ath_lin_num as f32; + for _a in 0..=ath_lin_num { + let mut path = Path::new(false); + let x = (a * _a as f32).cos() * outskirt; + let y = (a * _a as f32).sin() * outskirt; + path.push([0.0, 0.0, 0.01]); + path.push([x, y, 0.01]); + path.finish(); + paths.push(path); + } + + if config.vertical_axis { + let mut path = Path::new(false); + path.push([0.0, 0.0, 0.0]); + path.push([0.0, 0.0, outskirt]); + path.finish(); + paths.push(path); + } + + let (vbo, ebo, len) = self.line_program.bake(&self.gl, &paths, &raw_config)?; + attach.bind_data(&vbo, ebo.as_ref(), len, glow::STATIC_DRAW); + Ok(()) + } + + fn bind_tick(&self, attach: &mut Attach, data: &Data, config: &PPIModuleConfig) -> Result<()> { + let font_style = config.to_font_config(); + + match font_style { + FontConfig::Textline(line_style, font_style) => { + let new_text = TextLine::new("Hello,World", Some(font_style), None); + let position_text = + PositionText::new(new_text, [0.0, 0.0, 0.0], Anchor::BottomCenter); + let text_pg_config = config.to_font_config(); + let (vbo, ebo, len) = + self.text_program + .bake(&self.gl, &position_text, &text_pg_config)?; + attach.bind_data(&vbo, ebo.as_ref(), len, glow::STATIC_DRAW); + } + } + + Ok(()) + } +} + +impl<'b, 'a: 'b> Module for PPIModule<'b, 'a> { + type Cursor = PPIPackage; + type Data = Data; + type Operation = PlaneTrans; + + fn render<'dt>( + &mut self, + cursor: &mut Self::Cursor, + operation: &Operation, + viewport: &ViewPort, + ) -> Result<()> { + // Mount PPI Program + self.ppi_program.mount(&self.gl)?; + // Deal with the operation + operation.attach_with_program(&self.gl, self.ppi_program.program()); + // PPI Program + let ppi_attach = &mut cursor.ppi_attach; + let data = &cursor.ppi_data.borrow(); + let config = &mut cursor.ppi_config; + + // Update the config + self.ppi_program + .set_config(&self.gl, &config.to_ppi_config())?; + + // if the layer is changed, we need to rebind the data + if config.changed_layer() { + self.bind_ppi_pg(ppi_attach, data, config); + } + + if config.changed_range_line_num() + || config.changed_ath_line_num() + || config.changed_vertical_axis() + { + self.bind_line_pg(&mut cursor.line_attach, data, config)?; + } + + // PPI Draw + ppi_attach.bind_self(); + self.ppi_program.draw(&self.gl, ppi_attach.len())?; + ppi_attach.unbind_self(); + + // Unmount PPI Program + self.ppi_program.unmount(&self.gl)?; + + // Mount Line Program + self.line_program.mount(&self.gl)?; + + // Deal with the operation + operation.attach_with_program(&self.gl, self.line_program.program()); + + // Set the viewport, this is important + self.line_program.set_viewport(&self.gl, viewport.size()); + + // Update the config + self.line_program + .set_config(&self.gl, &config.to_line_config()); + + // PPI Tick Draw + let attach = &mut cursor.line_attach; + attach.bind_self(); + self.line_program.draw(&self.gl, attach.len())?; + attach.unbind_self(); + + self.line_program.unmount(&self.gl)?; + + self.text_program.mount(&self.gl); + + let tick_attach = &mut cursor.tick_attach; + // Deal with the operation + operation.attach_with_program(&self.gl, self.text_program.program_mut()); + self.text_program.set_viewport(&self.gl, viewport.size()); + self.text_program + .set_config(&self.gl, &config.to_font_config()); + + tick_attach.bind_self(); + self.text_program.draw(&self.gl, tick_attach.len())?; + tick_attach.unbind_self(); + + config.reset(); + + Ok(()) + } + + fn load_data<'dt>(&self, data: &CachedData) -> Result { + let _data = data.borrow(); + + // Check if the data is valid + if _data.blocks.len() == 0 { + return Err(Error::InvalidDataType); + } + + // Init the memory + let (vao, vbo, ebo) = self.ppi_program.init(&self.gl); + let mut ppi_attach = Attach::new(self.gl.clone(), vao, vbo, ebo, None); + + // Get the data info + let (r, a, t, max_layer, unvalid) = self.ppi_program.data_info(&_data)?; + + // Find the color map + // let cmap = SETTING.find(&t); + + // let cmap = None; + + // Check if the color map is valid + // if cmap.is_none() { + // return Err(Error::InvalidDataType); + // } + // let cmap = cmap.unwrap(); + + // Init the memory for the line program + let (vao, vbo, ebo) = self.line_program.init(&self.gl); + let mut line_attach = Attach::new(self.gl.clone(), vao, vbo, ebo, None); + + // Tick Label + let (vao, vbo, ebo) = self.text_program.init(&self.gl); + let mut tick_attach = Attach::new(self.gl.clone(), vao, vbo, ebo, None); + + let mut config = PPIModuleConfig::default(); + config.rdpi = r; + config.adpi = a; + config.max_layer = max_layer; + config.unvalid_value = unvalid; + // config.colors = cmap.color()?; + // config.color_range = cmap.value_range(); + + // Bind the data + self.bind_ppi_pg(&mut ppi_attach, &data.borrow(), &config); + self.bind_line_pg(&mut line_attach, &data.borrow(), &config); + // self.bind_tick(&mut tick_attach, &data.borrow(), &config); + + Ok(PPIPackage::new( + config, + ppi_attach, + line_attach, + tick_attach, + data, + )) + } +} + +pub struct PPIPackage { + draw_helper: bool, + ppi_config: PPIModuleConfig, + ppi_attach: Attach, + line_attach: Attach, + tick_attach: Attach, + ppi_data: CachedData, +} + +impl PPIPackage { + fn new( + ppi_config: PPIModuleConfig, + ppi_attach: Attach, + line_attach: Attach, + tick_attach: Attach, + data: &CachedData, + ) -> Self { + Self { + draw_helper: true, + ppi_config, + ppi_attach, + line_attach, + tick_attach, + ppi_data: Rc::clone(data), + } + } +} + +#[track] +#[derive(PartialEq)] +pub struct PPIModuleConfig { + pub ticks: bool, + pub line_color: [f32; 4], + pub line_width: f32, + pub line_antialias: f32, + pub range_line_num: usize, + pub ath_line_num: usize, + pub vertical_axis: bool, + pub layer: usize, + pub colors: Vec<[u8; 4]>, + pub color_range: [f32; 2], + pub is_three_d: bool, + + pub tick_label_color: [f32; 4], + pub tick_label_size: f32, + #[do_not_track] + pub unvalid_value: f32, + #[do_not_track] + pub max_layer: usize, + #[do_not_track] + pub rdpi: f32, + #[do_not_track] + pub adpi: f32, +} + +impl Default for PPIModuleConfig { + fn default() -> Self { + Self { + ticks: true, + line_color: [1.0, 1.0, 1.0, 1.0], + line_width: 1.5, + line_antialias: 0.5, + layer: 0, + vertical_axis: false, + range_line_num: 5, + ath_line_num: 6, + colors: vec![], + color_range: [0.0, 0.0], + is_three_d: true, + unvalid_value: 0.0, + tick_label_color: [1.0, 1.0, 1.0, 1.0], + tick_label_size: 24.0, + max_layer: 0, + rdpi: 0.0, + adpi: 0.0, + tracker: 0, + } + } +} + +impl PPIModuleConfig { + fn to_ppi_config(&self) -> PPIConfig { + PPIConfig { + unvalid_value: self.unvalid_value, + color_range: self.color_range, + colors: self.colors.clone(), + layer: self.layer, + rdpi: self.rdpi, + adpi: self.adpi, + three_d: self.is_three_d, + } + } + + fn to_line_config(&self) -> AggFastPathConfig { + AggFastPathConfig { + color: self.line_color, + linewidth: self.line_width, + antialias: self.line_antialias, + } + } + + fn to_font_config(&self) -> FontConfig { + let line_style = LineStyle::default(); + let mut font_style = FontStyle::default(); + font_style.size = FontSize::Absolute(self.tick_label_size); + font_style.color = self.tick_label_color; + FontConfig::Textline(line_style, font_style) + } +} + +impl ModuleCursor for PPIPackage { + type Module<'rf, 'gl: 'rf> = PPIModule<'rf, 'gl>; + type Config = PPIModuleConfig; + type Data = Data; + + fn set_config(&mut self, f: F) + where + F: FnOnce(&mut Self::Config), + { + f(&mut self.ppi_config); + } +} diff --git a/gi/src/setting.rs b/gi/src/setting.rs new file mode 100644 index 0000000..842f85d --- /dev/null +++ b/gi/src/setting.rs @@ -0,0 +1,117 @@ +use crate::errors::*; +use serde::{Deserialize, Serialize}; +use std::{ + env, + fs::{read, read_to_string}, + io::Write, +}; + +use crate::{data_loader::DataType, utils::color_tools::hex_to_rgba_u8}; + +macro_rules! find_cmap { + ($c:ident,$find_on:ident,$({$b:tt => $name:literal}),*) => { + + { + let mut cmap = None; + match $c { + $( + $b => { + let find_v = $find_on.iter().find(|cb| cb.type_name == $name).map(|cb| cb); + cmap = find_v; + } + )* + _ => {} + } + cmap + } + + + }; +} + +#[derive(Deserialize, Serialize)] +pub struct Setting { + pub cmap: Vec, +} + +impl Setting { + pub fn find(&self, name: &DataType) -> Option<&CB> { + let cmap = &self.cmap; + use DataType::*; + find_cmap!( + name, cmap, + {DBZ => "DBZ"}, + {VEl => "VEL"}, + {VIL => "VIL"} + ) + } +} + +impl Setting { + pub fn new() -> Self { + let current_dir = env::current_dir().unwrap(); + + // if !current_dir.join("radar.toml").exists() { + // let default_config = Asset::get("radar.toml").unwrap(); + + // let mut folder_path = current_dir.clone(); + // let mut conf = folder_path.join("radar.toml"); + + // let mut file = std::fs::File::create_new(&conf).unwrap(); + // file.write_all(&default_config.data).unwrap(); + // } + + let file = read_to_string(current_dir.join("radar.toml")).unwrap(); + let setting: Setting = toml::from_str(&file).unwrap(); + setting + } +} + +#[derive(Deserialize, Serialize)] +pub struct CB { + #[serde(rename = "type")] + pub type_name: String, + pub colors: Vec, + pub levels: Vec, +} + +impl CB { + pub fn value_range(&self) -> [f32; 2] { + let mut range = [0.0, 0.0]; + let levels = &self.levels; + range[0] = levels[0]; + range[1] = levels[levels.len() - 1]; + range + } + + pub fn color(&self) -> Result> { + if self.colors.len() != self.levels.len() - 1 { + return Err(Error::SettingError("Color and level mismatch".to_string())); + } + + let mut result = self + .colors + .iter() + .map(|v| hex_to_rgba_u8(v)) + .collect::, String>>() + .map_err(|v| Error::SettingError(v.to_string()))?; + + let mut span = Vec::with_capacity(self.levels.len() - 1); + + for idx in 0..self.levels.len() - 1 { + let start = self.levels[idx]; + let end = self.levels[idx + 1]; + let range = end - start; + span.push(range); + } + + let range = self.value_range(); + let all_range = range[1] - range[0]; + + for (level, r) in span.iter().zip(result.iter_mut()) { + r[3] = ((*level / all_range) * 255.0) as u8; + } + + Ok(result) + } +} diff --git a/gi/src/shaders/agg_path.rs b/gi/src/shaders/agg_path.rs new file mode 100644 index 0000000..b683b97 --- /dev/null +++ b/gi/src/shaders/agg_path.rs @@ -0,0 +1,126 @@ +use glsl::syntax::ShaderStage; +use glsl::syntax::TranslationUnit; +use glsl::transpiler::glsl::show_translation_unit; +use glsl_quasiquote::glsl; + +use crate::impl_code_piece; + +use super::{trackball::Trackball, CodePiece}; + +pub struct AggPathVertex(ShaderStage); + +pub struct AggPathFragment(ShaderStage); + +impl AggPathVertex { + pub fn new() -> Self { + let mut transform = Trackball::new().0; + let raw = glsl! { + + layout(location = 0) in vec3 prev; + layout(location = 1) in vec3 curr; + layout(location = 2) in vec3 next; + layout(location = 3) in float id; + + uniform float antialias; + uniform float thickness; + uniform vec2 viewport; + uniform vec4 color; + + out float v_distance; + out vec4 v_color; + + void main() { + vec4 ndc_prev = transform(position(prev)); + vec4 ndc_curr = transform(position(curr)); + vec4 ndc_next = transform(position(next)); + + // screen space + vec2 screen_prev = viewport * ((ndc_prev.xy/ndc_prev.w) + 1.0)/2.0; + vec2 screen_curr = viewport * ((ndc_curr.xy/ndc_curr.w) + 1.0)/2.0; + vec2 screen_next = viewport * ((ndc_next.xy/ndc_next.w) + 1.0)/2.0; + + + vec2 P; + float w = thickness/2.0 + antialias; + + if (prev.xy == curr.xy) { + vec2 v = normalize(screen_next.xy - screen_curr.xy); + vec2 normal = normalize(vec2(-v.y, v.x)); + P = screen_curr.xy + w*normal*id; + } else if (curr.xy == next.xy) { + vec2 v = normalize(screen_curr.xy - screen_prev.xy); + vec2 normal = normalize(vec2(-v.y, v.x)); + P = screen_curr.xy + w*normal*id; + } else { + + vec2 v0 = normalize(screen_curr.xy - screen_prev.xy); + vec2 v1 = normalize(screen_next.xy - screen_curr.xy); + vec2 normal = normalize(vec2(-v0.y, v0.x)); + vec2 tangent = normalize(v0 + v1); + + vec2 miter = vec2(-tangent.y, tangent.x); + + float l = abs(w/dot(miter,normal)); + P = screen_curr.xy + l*miter*sign(id); + } + + v_color = color; + + if (abs(id) > 1.5) v_color.a = 0.0; + v_distance = w * id; + + // Back to NDC coordinates + gl_Position = vec4(2.0*P/viewport-1.0, ndc_curr.z / ndc_curr.w, 1.0); + } + }; + + transform.extend(raw); + + Self(transform) + } +} + +impl AggPathFragment { + pub fn new() -> Self { + let raw = glsl! { + uniform float antialias; + uniform float thickness; + + in float v_distance; + in vec4 v_color; + out vec4 fragColor; + + + vec4 stroke(float distance, float linewidth, float antialias, vec4 fg_color) + { + vec4 frag_color; + float t = linewidth/2.0 - antialias; + float signed_distance = distance; + float border_distance = abs(signed_distance) - t; + float alpha = border_distance/antialias; + alpha = exp(-alpha*alpha); + + if( border_distance < 0.0 ) + frag_color = fg_color; + else + frag_color = vec4(fg_color.rgb, fg_color.a * alpha); + + return frag_color; + } + + vec4 stroke(float distance, float linewidth, float antialias, vec4 fg_color, vec4 bg_color) + { + return stroke(distance, linewidth, antialias, fg_color); + } + + void main() { + if (v_color.a == 0) {discard;} + fragColor = stroke(v_distance, thickness, antialias, v_color); + } + }; + Self(raw) + } +} + +impl_code_piece!(AggPathVertex, 0); +impl_code_piece!(AggPathFragment, 0); diff --git a/gi/src/shaders/colormap.rs b/gi/src/shaders/colormap.rs new file mode 100644 index 0000000..1dc7825 --- /dev/null +++ b/gi/src/shaders/colormap.rs @@ -0,0 +1,50 @@ +use super::CodePiece; +use crate::impl_code_piece; +use glsl::syntax::ShaderStage; +use glsl::syntax::TranslationUnit; +use glsl::transpiler::glsl::show_translation_unit; +use glsl_quasiquote::glsl; + +pub struct ColorMap(pub ShaderStage); + +impl ColorMap { + pub fn new() -> Self { + let raw = glsl! { + uniform sampler1D colormap; + uniform vec4 colormap_conf; + + float find_idx(float ratio) { + float i = 0; + float count = colormap_conf.z - 1.0; + float sum = 0.0; + + while (ratio > sum) { + sum += texture(colormap, float(i++) / count).w; + } + return i / count; + } + + vec4 linear_colormap(float value) + { + float vmin = colormap_conf.x; + float vmax = colormap_conf.y; + float count = colormap_conf.z - 1.0; + + float invalid = colormap_conf.w; + + if (abs(value - invalid) < 0.0001) { + return vec4(0.0, 0.0, 0.0, 0.0); + } + + float v = clamp((value - vmin), vmin, vmax) / (vmax - vmin); + float idx = find_idx(v); + vec4 result = texture(colormap, idx); + return result; + } + }; + + Self(raw) + } +} + +impl_code_piece!(ColorMap, 0); diff --git a/gi/src/shaders/font.rs b/gi/src/shaders/font.rs new file mode 100644 index 0000000..230f048 --- /dev/null +++ b/gi/src/shaders/font.rs @@ -0,0 +1,213 @@ +use super::trackball::Trackball; +use super::CodePiece; +use crate::impl_code_piece; +use glsl::syntax::ShaderStage; +use glsl::syntax::TranslationUnit; +use glsl::transpiler::glsl::show_translation_unit; +use glsl_quasiquote::glsl; + +pub struct FontVertex(pub ShaderStage); + +pub struct FontFragment(pub ShaderStage); + +pub struct FontGeometry(pub ShaderStage); + +impl FontVertex { + pub fn new() -> Self { + let raw = glsl! { + + // texcoord (left top, right bottom) + layout(location = 0) in vec4 texcoord; + // Relative position (x, y, width, height) + layout(location = 1) in vec4 relative_position; + + out VS_OUT { + vec4 texcoord; + vec4 pos; + } vs_out; + + + void main() { + vs_out.texcoord = texcoord; + vs_out.pos = relative_position; + } + }; + + Self(raw) + } +} + +impl FontGeometry { + pub fn new() -> Self { + let mut transform = Trackball::new().0; + let raw = glsl! { + + layout(points) in; + layout(triangle_strip, max_vertices = 4) out; + + // Uniforms + uniform vec3 location; + uniform vec3 anchor; + uniform vec2 viewport; + + // Texture Shape + uniform vec2 atlas_shape; + + out vec2 v_texCoord; + out vec2 UV_coord; + + in VS_OUT { + vec4 texcoord; + vec4 pos; + } gs_in[]; + + void main() { + + vec4 pos = gs_in[0].pos; + float x, y, width, hgt; + + // Char position and size + x = pos.x; + y = pos.y; + width = pos.z; + hgt = pos.w; + + // texcoord + vec2 tex_coord_lt = gs_in[0].texcoord.xy / atlas_shape; + vec2 tex_coord_rb = gs_in[0].texcoord.zw / atlas_shape; + + // uv_coord + vec2 uv_coord_lt = gs_in[0].texcoord.xy; + vec2 uv_coord_rb = gs_in[0].texcoord.zw; + + // Char Size + vec2 size = vec2(width, hgt); + + // Base Text Location + vec3 base_pos = location + anchor; + + // base_pos in NDC + vec4 ndc_base_pos = transform(position(base_pos)); + + // Screen Space + vec2 screen_base_pos = viewport * ((ndc_base_pos.xy / ndc_base_pos.w) + 1.0) / 2.0; + + // Billboard Type + vec2 left_top = screen_base_pos + vec2(x, y); + vec2 right_bottom = left_top + size; + + vec2 ndc_left_top = (2.0 * left_top / viewport - 1.0); + vec2 ndc_right_bottom = (2.0 * right_bottom / viewport - 1.0); + + // Emit vertices + gl_Position = vec4(ndc_left_top.x, ndc_right_bottom.y, ndc_base_pos.z / ndc_base_pos.w, 1.0); + v_texCoord = vec2(tex_coord_lt.x, tex_coord_rb.y); + UV_coord = vec2(uv_coord_lt.x, uv_coord_rb.y); + EmitVertex(); + + gl_Position = vec4(ndc_right_bottom.xy, ndc_base_pos.z / ndc_base_pos.w, 1.0); + v_texCoord = tex_coord_rb; + UV_coord = uv_coord_rb; + EmitVertex(); + + gl_Position = vec4(ndc_left_top.xy, ndc_base_pos.z / ndc_base_pos.w, 1.0); + v_texCoord = tex_coord_lt; + UV_coord = uv_coord_lt; + EmitVertex(); + + gl_Position = vec4(ndc_right_bottom.x, ndc_left_top.y, ndc_base_pos.z / ndc_base_pos.w, 1.0); + v_texCoord = vec2(tex_coord_rb.x, tex_coord_lt.y); + UV_coord = vec2(uv_coord_rb.x, uv_coord_lt.y); + EmitVertex(); + + EndPrimitive(); + } + + }; + + transform.extend(raw); + + Self(transform) + } +} + +impl FontFragment { + pub fn new() -> Self { + let raw = glsl! { + uniform sampler2D atlas_data; + in vec2 v_texCoord; + in vec2 UV_coord; + + uniform vec4 uClipUV; + uniform vec4 uSdfConfig; + uniform int uMode; + uniform vec4 uBorder; + uniform vec4 uStroke; + uniform vec4 uFill; + + float getUVScale(vec2 sdfUV) { + float dx = dFdx(sdfUV.x); + float dy = dFdy(sdfUV.y); + return (sqrt(dx * dx + dy * dy) + sqrt(dy * dy + dx * dx)) * 0.5; + } + + struct SDF { + float outer; + float inner; + }; + + vec4 getTexture(vec2 uv) { + return texture(atlas_data, uv); + } + + vec4 getMask(vec4 color, vec2 uv, vec2 st) { + return color; // 默认不修改颜色 + } + + out vec4 fragColor; + + void main() { + vec4 fillColor = uFill; + vec4 strokeColor = uStroke; + + float scale = getUVScale(UV_coord); + + vec4 texture = getTexture(v_texCoord); + + float dis = texture.r; + + // float sdfRaw = 0.0; + // float mark = 0.0; + // float sdf; + + // float sdfRadius = uSdfConfig.x; + // float expand = uBorder.x; + // float bleed = uBorder.y; + + // float d = (texture.r - 0.75) * sdfRadius; + // float s = (d + expand / uSdfConfig.y) / scale + 0.5 + bleed; + // sdf = s; // Assuming SDF returns a single float, adjust as necessary + + // if (uMode == -2) { + // fillColor = vec4(texture.rgb, fillColor.a); + // } + + // // Compute mask based on SDF + // float mask = clamp(sdf, 0.0, 1.0); + // Final color blending logic here + + // fragColor = vec4(fillColor.rgb + mark, mask + mark); + + fragColor = vec4(dis,dis,dis,dis); + + + } + }; + + Self(raw) + } +} + +impl_code_piece!(FontVertex, 0); +impl_code_piece!(FontGeometry, 0); +impl_code_piece!(FontFragment, 0); diff --git a/gi/src/shaders/math.rs b/gi/src/shaders/math.rs new file mode 100644 index 0000000..49dbd9f --- /dev/null +++ b/gi/src/shaders/math.rs @@ -0,0 +1,73 @@ +use glsl::syntax::ShaderStage; +use glsl_quasiquote::glsl; + +use super::CodePiece; +use glsl::syntax::TranslationUnit; +use glsl::transpiler::glsl::show_translation_unit; + +use crate::impl_code_piece; + +pub struct Constants { + pub raw: ShaderStage, +} + +impl Constants { + pub fn new() -> Constants { + let raw = glsl! { + + #ifndef _GLUMPY__CONSTANTS__ + #define _GLUMPY__CONSTANTS__ + + // The base of natural logarithms (e) + const float M_E = 2.71828182845904523536028747135266250; + + // The logarithm to base 2 of M_E (log2(e)) + const float M_LOG2E = 1.44269504088896340735992468100189214; + + // The logarithm to base 10 of M_E (log10(e)) + const float M_LOG10E = 0.434294481903251827651128918916605082; + + // The natural logarithm of 2 (loge(2)) + const float M_LN2 = 0.693147180559945309417232121458176568; + + // The natural logarithm of 10 (loge(10)) + const float M_LN10 = 2.30258509299404568401799145468436421; + + // Pi, the ratio of a circle's circumference to its diameter. + const float M_PI = 3.14159265358979323846264338327950288; + + // Pi divided by two (pi/2) + const float M_PI_2 = 1.57079632679489661923132169163975144; + + // Pi divided by four (pi/4) + const float M_PI_4 = 0.785398163397448309615660845819875721; + + // The reciprocal of pi (1/pi) + const float M_1_PI = 0.318309886183790671537767526745028724; + + // Two times the reciprocal of pi (2/pi) + const float M_2_PI = 0.636619772367581343075535053490057448; + + // Two times the reciprocal of the square root of pi (2/sqrt(pi)) + const float M_2_SQRTPI = 1.12837916709551257389615890312154517; + + // The square root of two (sqrt(2)) + const float M_SQRT2 = 1.41421356237309504880168872420969808; + + // The reciprocal of the square root of two (1/sqrt(2)) + const float M_SQRT1_2 = 0.707106781186547524400844362104849039; + + // 1 degree in radians + const float degree = 180.0/M_PI; + + // 1 radian in degrees + const float radian = M_PI/180.0; + + #endif + }; + + Constants { raw } + } +} + +impl_code_piece!(Constants, raw); diff --git a/gi/src/shaders/mod.rs b/gi/src/shaders/mod.rs new file mode 100644 index 0000000..84ca983 --- /dev/null +++ b/gi/src/shaders/mod.rs @@ -0,0 +1,99 @@ +pub mod agg_path; +pub mod colormap; +pub mod font; +pub mod math; +pub mod polar; +pub mod ppi; +pub mod trackball; +use glsl::{ + syntax::{ShaderStage, TranslationUnit}, + transpiler::glsl::{show_struct, show_translation_unit}, +}; +use glsl_quasiquote::glsl; + +use crate::components::Shader; + +struct PPI { + vertex: ShaderStage, +} + +impl PPI { + fn new() -> Self { + let vertex: ShaderStage = glsl! { + layout(location = 0) in vec3 position; + out float in_value; + + void main() { + gl_Position = vec4(position.x, position.y, 0.5, 1.0); + in_value = position.z; + } + }; + + Self { vertex } + } +} + +impl std::fmt::Display for PPI { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + show_translation_unit(f, &self.vertex); + Ok(()) + } +} + +#[derive(std::fmt::Debug)] +pub struct EmptyPiece(pub TranslationUnit); + +pub trait CodePiece: std::fmt::Display { + fn raw(&self) -> &TranslationUnit; + + fn include(i: T, raw: TranslationUnit) -> TranslationUnit { + let mut s = i.raw().clone(); + s.extend(raw); + s + } +} + +impl CodePiece for EmptyPiece { + fn raw(&self) -> &TranslationUnit { + &self.0 + } +} + +impl std::fmt::Display for EmptyPiece { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + Ok(()) + } +} + +#[macro_export] +macro_rules! impl_code_piece { + ($t:ty, $c:tt) => { + impl CodePiece for $t { + fn raw(&self) -> &TranslationUnit { + &self.$c + } + } + + impl std::fmt::Display for $t { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + show_translation_unit(f, &self.$c); + Ok(()) + } + } + }; +} + +mod test { + + use glsl::transpiler::glsl::show_translation_unit; + + use super::math::Constants; + use super::polar::PolarTransform; + use super::PPI; + + #[test] + fn test() { + let polar = PolarTransform::new(); + println!("{}", polar); + } +} diff --git a/gi/src/shaders/polar.rs b/gi/src/shaders/polar.rs new file mode 100644 index 0000000..34e178c --- /dev/null +++ b/gi/src/shaders/polar.rs @@ -0,0 +1,58 @@ +use super::CodePiece; +use crate::impl_code_piece; +use glsl::syntax::ShaderStage; +use glsl::syntax::TranslationUnit; +use glsl::transpiler::glsl::show_translation_unit; + +use super::math::Constants; +use glsl_quasiquote::glsl; + +pub struct PolarTransform { + pub raw: ShaderStage, +} + +impl PolarTransform { + pub fn new() -> PolarTransform { + let raw = glsl! { + + uniform float polar_origin; + + vec4 forward(float rho, float theta, float z, float w) + { + return vec4(rho * cos(theta + polar_origin), + rho * sin(theta + polar_origin), + rho * sin(z), w); + } + + vec4 forward(float x, float y) {return forward(x, y, 0.0, 1.0);} + vec4 forward(float x, float y, float z) {return forward(x, y, z, 1.0);} + vec4 forward(vec2 P) { return forward(P.x, P.y); } + vec4 forward(vec3 P) { return forward(P.x, P.y, P.z, 1.0); } + vec4 forward(vec4 P) { return forward(P.x, P.y, P.z, P.w); } + + vec4 inverse(float x, float y, float z, float w) + { + float rho = length(vec2(x,y)); + float theta = atan(y,x); + if( theta < 0.0 ) + theta = 2.0*M_PI+theta; + return vec4(rho, theta-polar_origin, z, w); + } + + + vec4 inverse(float x, float y) {return inverse(x,y,0.0,1.0); } + vec4 inverse(float x, float y, float z) {return inverse(x,y,z,1.0); } + vec4 inverse(vec2 P) { return inverse(P.x, P.y, 0.0, 1.0); } + vec4 inverse(vec3 P) { return inverse(P.x, P.y, P.z, 1.0); } + vec4 inverse(vec4 P) { return inverse(P.x, P.y, P.z, P.w); } + }; + + let mut constant = Constants::new().raw; + + constant.extend(raw); + + PolarTransform { raw: constant } + } +} + +impl_code_piece!(PolarTransform, raw); diff --git a/gi/src/shaders/ppi.rs b/gi/src/shaders/ppi.rs new file mode 100644 index 0000000..fb4d600 --- /dev/null +++ b/gi/src/shaders/ppi.rs @@ -0,0 +1,147 @@ +use super::trackball::Trackball; +use super::CodePiece; +use crate::impl_code_piece; +use glsl::syntax::ShaderStage; +use glsl::syntax::TranslationUnit; +use glsl::transpiler::glsl::show_translation_unit; +use glsl_quasiquote::glsl; + +pub struct PPIVertex(pub ShaderStage); +pub struct PPIGeom(pub ShaderStage); +pub struct PPIFragment(pub ShaderStage); + +impl PPIVertex { + pub fn new() -> Self { + let raw = glsl! { + layout(location = 0) in vec4 position; + out float in_value; + + void main() { + gl_Position = vec4(position.x * 10.0, position.y, position.z, 1.0); + in_value = position.w; + } + }; + + Self(raw) + } +} + +impl PPIGeom { + pub fn new() -> Self { + let mut trackball = Trackball::new().0; + let polar = super::polar::PolarTransform::new().raw; + let raw = glsl! { + layout(points) in; + layout(triangle_strip, max_vertices = 4) out; + + // conf: Range, Elevation, Resolution, mode + uniform vec4 conf; + in float in_value[]; + + out float x; + out float y; + out float value; + + flat out vec4 vrange; + + + void main() { + float rdpi = conf.x * 10.0; + float mode = conf.w; + vec4 reso = vec4(rdpi/2.0, conf.y/2.0 * radian, 0.0, 0.0); + vec4 loc; + float c = cos(reso.y); + + vec4 po = gl_in[0].gl_Position; + po.y *= radian; + po.z *= radian * mode; + + vrange = vec4(po.x - reso.x, po.y - reso.y, po.x + reso.x, po.y + reso.y); + value = in_value[0]; + + gl_Position = po - reso; + loc = forward(gl_Position); + x = loc.x; + y = loc.y; + gl_Position = transform(loc); + EmitVertex(); + + gl_Position = po + vec4(reso.x, -reso.y, 0.0, 0.0); + gl_Position.x = gl_Position.x / c; + loc = forward(gl_Position); + x = loc.x; + y = loc.y; + gl_Position = transform(loc); + EmitVertex(); + + gl_Position = po + vec4(-reso.x, reso.y, 0.0, 0.0); + loc = forward(gl_Position); + x = loc.x; + y = loc.y; + gl_Position = transform(loc); + EmitVertex(); + + gl_Position = po + reso; + gl_Position.x = gl_Position.x / c; + loc = forward(gl_Position); + x = loc.x; + y = loc.y; + gl_Position = transform(loc); + EmitVertex(); + + EndPrimitive(); + + } + + }; + + trackball.extend(polar); + trackball.extend(raw); + + Self(trackball) + } +} + +impl PPIFragment { + pub fn new() -> Self { + use super::polar::PolarTransform; + let mut include = PolarTransform::new().raw; + let mut colormap = super::colormap::ColorMap::new().0; + let raw = glsl! { + in float x; + in float y; + + in float value; + flat in vec4 vrange; + + out vec4 FragColor; + + void main() { + + vec4 inversed = inverse(x, y); + + + if (inversed.x < vrange.x || inversed.x > vrange.z) { + discard; + } + + vec4 result = linear_colormap(value); + + if (result.w == 0.0) { + discard; + } + + FragColor = result; + } + }; + + include.extend(colormap); + include.extend(raw); + + Self(include) + } +} + +impl_code_piece!(PPIVertex, 0); +impl_code_piece!(PPIGeom, 0); +impl_code_piece!(PPIFragment, 0); diff --git a/gi/src/shaders/trackball.rs b/gi/src/shaders/trackball.rs new file mode 100644 index 0000000..eb900af --- /dev/null +++ b/gi/src/shaders/trackball.rs @@ -0,0 +1,70 @@ +use super::CodePiece; +use glsl::syntax::ShaderStage; +use glsl::syntax::TranslationUnit; +use glsl::transpiler::glsl::show_translation_unit; + +use crate::impl_code_piece; + +pub struct Trackball(pub ShaderStage); + +impl Trackball { + pub fn new() -> Self { + let raw = glsl_quasiquote::glsl! { + uniform mat4 trackball_view; + uniform mat4 trackball_model; + uniform mat4 trackball_projection; + + vec4 transform(vec4 position) + { + return trackball_projection + * trackball_view + * trackball_model + * position; + } + + vec4 position(float x) + { + return vec4(x, 0.0, 0.0, 1.0); + } + + vec4 position(float x, float y) + { + return vec4(x, y, 0.0, 1.0); + } + + vec4 position(vec2 xy) + { + return vec4(xy, 0.0, 1.0); + } + + vec4 position(float x, float y, float z) + { + return vec4(x, y, z, 1.0); + } + + vec4 position(vec3 xyz) + { + return vec4(xyz, 1.0); + } + + vec4 position(vec4 xyzw) + { + return xyzw; + } + + vec4 position(vec2 xy, float z) + { + return vec4(xy, z, 1.0); + } + + vec4 position(float x, vec2 yz) + { + return vec4(x, yz, 1.0); + } + }; + + Self(raw) + } +} + +impl_code_piece!(Trackball, 0); diff --git a/gi/src/ui/helper.rs b/gi/src/ui/helper.rs new file mode 100644 index 0000000..41f017d --- /dev/null +++ b/gi/src/ui/helper.rs @@ -0,0 +1,52 @@ +use crate::{ + pg::{layout_type::ViewPort, ModulePackage}, + utils::resources::GL, +}; +use femtovg::{renderer::OpenGl, Canvas}; +use glow::{NativeRenderbuffer, NativeTexture}; + +pub struct Helper { + canvas: Canvas, + viewport: ViewPort, +} + +impl Helper { + pub fn new(gl: &GL, mut renderer: OpenGl) -> Self { + let mut viewport = ViewPort::::new(&gl, false); + renderer.set_screen_target(Some(viewport.fbo().native())); + let mut canvas = Canvas::new(renderer).expect("Cannot create canvas"); + + viewport.set_size([3840.0, 2160.0]); + canvas.set_size(3840, 2160, 1.0); + + Self { canvas, viewport } + } + + pub fn canvas(&mut self) -> &mut Canvas { + &mut self.canvas + } + + pub fn set_size(&mut self, size: [f32; 2], dpi: f32) { + self.viewport.set_size([size[0] * dpi, size[1] * dpi]); + self.canvas.set_size(size[0] as u32, size[1] as u32, dpi); + } + + pub fn render_task(&mut self, gl: &glow::Context, f: impl FnOnce(&mut Canvas)) { + self.viewport.bind(gl); + f(&mut self.canvas); + self.canvas.flush(); + self.viewport.unbind(); + } + + pub fn viewport(&self) -> &ViewPort { + &self.viewport + } + + pub fn draw_modules(&mut self, gl: &glow::Context, modules: &Vec) { + self.render_task(gl, |canvas| { + for module in modules { + // module.helper_task(canvas); + } + }); + } +} diff --git a/gi/src/ui/io.rs b/gi/src/ui/io.rs new file mode 100644 index 0000000..bccba1b --- /dev/null +++ b/gi/src/ui/io.rs @@ -0,0 +1,17 @@ +pub struct MouseIO { + pub position: [f32; 2], // 鼠标当前位置 + pub drag_delta: Option<[f32; 2]>, // 拖动开始时的鼠标位置 + pub is_dragging: bool, // 是否正在拖动 + pub left_button_pressed: bool, // 左键是否被按下 + pub right_button_pressed: bool, // 右键是否被按下 + pub wheel_delta: f32, // 鼠标滚轮变化值 +} + +pub struct KeyboardIO { + pub keys: [bool; 652], // 键盘按键状态 +} + +pub struct IO { + pub mouse: MouseIO, + pub keyboard: KeyboardIO, +} diff --git a/gi/src/ui/mod.rs b/gi/src/ui/mod.rs new file mode 100644 index 0000000..1211693 --- /dev/null +++ b/gi/src/ui/mod.rs @@ -0,0 +1,16 @@ +use std::path::PathBuf; + +use log::*; + +use crate::data_loader::Data; +use crate::errors::*; +use crate::pg::{ModulePackage, Programs}; +use crate::utils::cache::Cache; +use crate::utils::resources::{RcGlRcFramebuffer, RcGlRcRenderbuffer, RcGlRcResource, GL}; +use glow::HasContext; +use glow::{NativeFramebuffer, NativeRenderbuffer}; + +pub mod helper; +pub mod io; +pub mod operation; +pub mod typ; diff --git a/gi/src/ui/operation.rs b/gi/src/ui/operation.rs new file mode 100644 index 0000000..ac35a66 --- /dev/null +++ b/gi/src/ui/operation.rs @@ -0,0 +1,137 @@ +use super::typ::CameraOP; +use crate::{ + camera::Camera, + components::Program, + graphics::{AttaWithProgram, AttachWithIO}, + pg::layout_type::ViewPort, +}; + +pub struct Operation { + camera: Camera, + projection: Projection, + operation: T, + need_update: bool, +} + +impl Operation { + pub fn new(operation: T, aspect: f32, fov: f32, z_near: f32, z_far: f32) -> Self { + let projection = Projection::new(aspect, fov, z_near, z_far); + Self { + projection, + camera: operation.init_camera(), + operation, + need_update: true, + } + } + + pub fn deal_io(&mut self, viewport: &ViewPort, io: &super::io::IO) { + self.need_update = self.operation.attach_with_mouse( + &T::State::from_context(io), + &mut self.camera, + &mut self.projection, + viewport, + ); + } + + pub fn set_camera(&mut self, f: impl Fn(&mut Camera)) { + f(&mut self.camera); + self.need_update = true; + } + + pub fn set_projection(&mut self, f: impl Fn(&mut Projection)) { + f(&mut self.projection); + self.need_update = true; + } + + pub fn attach_with_program(&self, gl: &glow::Context, program: &mut Program) { + use glow::HasContext; + unsafe { + let projection = program.get_uniform_location(gl, "trackball_projection"); + gl.uniform_matrix_4_f32_slice(projection.as_ref(), false, self.projection.as_slice()); + let view = program.get_uniform_location(gl, "trackball_view"); + gl.uniform_matrix_4_f32_slice( + view.as_ref(), + false, + self.camera.get_view_matrix().as_slice(), + ); + } + self.operation.attach_with_program(gl, program); + } + + pub fn is_need_update(&self) -> bool { + self.need_update + } + + pub fn reset(&mut self) { + self.operation.reset(); + self.need_update = true; + } + + pub fn clean(&mut self) { + self.need_update = false; + } +} + +pub struct Projection { + fov: f32, + z_near: f32, + z_far: f32, + aspect: f32, + projection: nalgebra_glm::Mat4, +} + +impl Projection { + fn new(aspect: f32, fov: f32, z_near: f32, z_far: f32) -> Self { + let projection = nalgebra_glm::perspective(aspect, fov.to_radians(), z_near, z_far); + Self { + aspect, + fov, + z_far, + z_near, + projection, + } + } + fn new_perspective(&self) -> nalgebra_glm::Mat4 { + nalgebra_glm::perspective(self.aspect, self.fov.to_radians(), self.z_near, self.z_far) + } + + pub fn set_aspect(&mut self, aspect: f32) { + self.aspect = aspect; + self.projection = self.new_perspective(); + } + + pub fn set_fov(&mut self, fov: f32) { + self.fov = fov; + self.projection = self.new_perspective(); + } + + pub fn set_z_near(&mut self, z_near: f32) { + self.z_near = z_near; + self.projection = self.new_perspective(); + } + + pub fn set_z_far(&mut self, z_far: f32) { + self.z_far = z_far; + self.projection = self.new_perspective(); + } + + pub fn fov(&self) -> f32 { + self.fov + } + + pub fn z_far(&self) -> f32 { + self.z_far + } + + pub fn z_near(&self) -> f32 { + self.z_near + } + + pub fn aspect(&self) -> f32 { + self.aspect + } + + fn as_slice(&self) -> &[f32] { + self.projection.as_slice() + } +} diff --git a/gi/src/ui/typ/main_load.rs b/gi/src/ui/typ/main_load.rs new file mode 100644 index 0000000..ffb2b53 --- /dev/null +++ b/gi/src/ui/typ/main_load.rs @@ -0,0 +1,122 @@ +use std::thread::panicking; + +use super::{CameraOP, LayoutAttach}; +use crate::camera::Camera; +use crate::graphics::threed::Trackball; +use crate::graphics::transforms::plane::PlaneTrans; +use crate::graphics::{AttaWithProgram, AttachWithIO, MouseKeyboardState, MouseState}; +use crate::pg::ModulePackage; +use crate::pg::{_ModulePackage, layout_type::ViewPort}; +use crate::ui::helper::Helper; +use crate::ui::io::IO; +use crate::ui::operation::Operation; +use crate::utils::resources::GL; +use bytemuck::Contiguous; +use glow::{HasContext, NativeRenderbuffer}; +use nalgebra_glm::Vec3; + +pub struct MainLoadAttach { + operation: Operation, + packages: Vec, +} + +pub struct ProjectionValues { + pub near: f32, + pub far: f32, + pub fovy: f32, + pub aspect: f32, +} + +impl Default for ProjectionValues { + fn default() -> Self { + Self { + near: 0.1, + far: 1000.0, + fovy: 45.0, + aspect: 16.0 / 9.0, + } + } +} + +impl MainLoadAttach { + pub fn new(projection: Option) -> Self { + let projection = projection.unwrap_or_default(); + Self { + operation: Operation::new( + PlaneTrans::default(), + projection.aspect, + projection.fovy, + projection.near, + projection.far, + ), + packages: Vec::new(), + } + } +} + +impl CameraOP for MouseState { + fn from_context(context: &IO) -> Self { + if context.mouse.is_dragging { + Self::Drag { + from: context.mouse.position, + delta: context.mouse.drag_delta.unwrap(), + } + } else { + if context.mouse.wheel_delta != 0.0 { + Self::Wheel(context.mouse.wheel_delta) + } else { + Self::None + } + } + } +} + +impl CameraOP for MouseKeyboardState { + fn from_context(context: &IO) -> Self { + Self { + mouse_state: MouseState::from_context(context), + keyboard_state: context.keyboard.keys, + } + } +} + +impl LayoutAttach for MainLoadAttach { + fn append(&mut self, package: ModulePackage) { + self.packages.push(package); + } + + fn render_task( + &mut self, + gl: &glow::Context, + programs: &mut crate::pg::Programs, + helper: &mut Helper, + ) -> crate::errors::Result<()> { + // helper.draw_modules(gl, &self.packages); + + let need_launch = + self.packages.iter().any(|v| v.need_update) || self.operation.is_need_update(); + if need_launch { + // Helper task + // self.main_viewport.bind(gl); + + unsafe { + gl.clear(glow::COLOR_BUFFER_BIT | glow::DEPTH_BUFFER_BIT); + } + + for package in self.packages.iter_mut() { + // programs.draw_modules(package, &self.operation, &self.main_viewport)?; + } + + self.operation.clean(); + } + + if self.packages.is_empty() { + unsafe { + gl.clear(glow::COLOR_BUFFER_BIT); + } + } + // self.main_viewport.unbind(); + + Ok(()) + } +} diff --git a/gi/src/ui/typ/mod.rs b/gi/src/ui/typ/mod.rs new file mode 100644 index 0000000..4c0cbd5 --- /dev/null +++ b/gi/src/ui/typ/mod.rs @@ -0,0 +1,66 @@ +use std::fmt::Debug; + +use super::helper; +use super::io::IO; +mod main_load; +use crate::pg::{self, ModuleCursor, ModulePackage, Programs}; +use crate::utils::resources::GL; +pub use main_load::*; + +// macro_rules! app_type_into { +// ($({$t: ty => $b:tt},)+) => { +// $( +// impl From<$t> for _Layout { +// fn from(t: $t) -> Self { +// Self::$b(t) +// } +// } + +// impl<'a> From<&'a _Layout> for &'a $t { +// fn from(t: &'a _Layout) -> Self { +// if let _Layout::$b(t) = t { +// t +// } else { +// panic!("_Layout is not {}", stringify!($b)); +// } +// } +// } + +// impl<'a> From<&'a mut _Layout> for &'a mut $t { +// fn from(t: &'a mut _Layout) -> Self { +// if let _Layout::$b(t) = t { +// t +// } else { +// panic!("_Layout is not {}", stringify!($b)); +// } +// } +// } + +// )+ +// }; +// } + +pub trait LayoutAttach { + fn append(&mut self, package: ModulePackage); + + fn render_task( + &mut self, + gl: &glow::Context, + programs: &mut Programs, + helper: &mut helper::Helper, + ) -> crate::errors::Result<()>; +} + +pub trait CameraOP { + fn from_context(context: &IO) -> Self; +} + +impl CameraOP for () { + fn from_context(context: &IO) -> Self { + () + } +} + +// app_type_into!({ +// MainLoadAttach => MainLoad +// },); diff --git a/gi/src/utils/cache.rs b/gi/src/utils/cache.rs new file mode 100644 index 0000000..9149d3e --- /dev/null +++ b/gi/src/utils/cache.rs @@ -0,0 +1,61 @@ +use crate::errors::*; +use std::{cell::RefCell, hash::Hash, num::NonZeroUsize, rc::Rc}; + +use lru::LruCache; + +use crate::data_loader::Data; +pub struct Cache { + cache: LruCache, +} + +impl Cache { + pub fn new() -> Self { + Self { + cache: LruCache::new(NonZeroUsize::new(10).unwrap()), + } + } + pub fn get(&mut self, key: &K) -> Option<&V> { + self.cache.get(key) + } + + pub fn get_mut(&mut self, key: &K) -> Option<&mut V> { + self.cache.get_mut(key) + } +} + +impl Cache +where + K: AsRef + Hash + Eq + Clone, + V: CacheData, +{ + pub fn insert(&mut self, key: K) -> Result<()> { + let value = V::from_path(&key)?; + self.cache.put(key, value); + Ok(()) + } + + pub fn get_or_insert(&mut self, key: K) -> Result<&V> { + if !self.cache.contains(&key) { + self.insert(key.clone())?; + } + Ok(self.cache.get(&key).unwrap()) + } +} + +pub type CachedData = Rc>; + +pub trait CacheData: Sized { + fn from_path(path: impl AsRef) -> Result; +} + +impl CacheData for Data { + fn from_path(path: impl AsRef) -> Result { + Data::from_path(path) + } +} + +impl CacheData for CachedData { + fn from_path(path: impl AsRef) -> Result { + Ok(Rc::new(RefCell::new(T::from_path(path)?))) + } +} diff --git a/gi/src/utils/color_tools.rs b/gi/src/utils/color_tools.rs new file mode 100644 index 0000000..afc5bb4 --- /dev/null +++ b/gi/src/utils/color_tools.rs @@ -0,0 +1,18 @@ +pub fn hex_to_rgba_u8(hex: &str) -> Result<[u8; 4], String> { + let hex = hex.trim_start_matches('#'); + + if hex.len() != 6 && hex.len() != 8 { + return Err("Hex color should be in #RRGGBB or #RRGGBBAA format".to_string()); + } + + let r = u8::from_str_radix(&hex[0..2], 16).map_err(|e| e.to_string())?; + let g = u8::from_str_radix(&hex[2..4], 16).map_err(|e| e.to_string())?; + let b = u8::from_str_radix(&hex[4..6], 16).map_err(|e| e.to_string())?; + let a = if hex.len() == 8 { + u8::from_str_radix(&hex[6..8], 16).map_err(|e| e.to_string())? + } else { + 255 // 默认不透明 + }; + + Ok([r, g, b, a]) +} diff --git a/gi/src/utils/geo_tools.rs b/gi/src/utils/geo_tools.rs new file mode 100644 index 0000000..a5558fa --- /dev/null +++ b/gi/src/utils/geo_tools.rs @@ -0,0 +1,17 @@ +use geo::{algorithm::haversine_destination::HaversineDestination, Point}; +pub fn calculate_coverage(lat_deg: f64, lon_deg: f64, radius_km: f64) -> (f64, f64, f64, f64) { + let center = Point::new(lon_deg, lat_deg); + + // 计算四个方向(北、南、东、西)的点 + let north = center.haversine_destination(0.0, radius_km); + let south = center.haversine_destination(180.0, radius_km); + let east = center.haversine_destination(90.0, radius_km); + let west = center.haversine_destination(270.0, radius_km); + + let min_lat = south.y(); + let max_lat = north.y(); + let min_lon = west.x(); + let max_lon = east.x(); + + (min_lat, max_lat, min_lon, max_lon) +} diff --git a/gi/src/utils/mod.rs b/gi/src/utils/mod.rs new file mode 100644 index 0000000..10d5c74 --- /dev/null +++ b/gi/src/utils/mod.rs @@ -0,0 +1,22 @@ +pub mod color_tools; +pub mod resources; +use include_dir::{include_dir, Dir}; +use std::{num::NonZeroU32, path::Path}; +pub mod cache; +pub mod geo_tools; + +use glow::HasContext; +use glutin::{ + config::ConfigTemplateBuilder, + context::{ContextApi, ContextAttributesBuilder, NotCurrentGlContext, PossiblyCurrentContext}, + display::{GetGlDisplay, GlDisplay}, + surface::{GlSurface, Surface, SurfaceAttributesBuilder, SwapInterval, WindowSurface}, +}; +use raw_window_handle::HasRawWindowHandle; +pub use resources::GL; + +pub fn glow_context(context: &PossiblyCurrentContext) -> glow::Context { + unsafe { + glow::Context::from_loader_function_cstr(|s| context.display().get_proc_address(s).cast()) + } +} diff --git a/gi/src/utils/resources.rs b/gi/src/utils/resources.rs new file mode 100644 index 0000000..8121995 --- /dev/null +++ b/gi/src/utils/resources.rs @@ -0,0 +1,320 @@ +use glow::{ + HasContext, NativeBuffer, NativeFramebuffer, NativeRenderbuffer, NativeTexture, + NativeVertexArray, +}; +use log::info; +use std::{borrow::Borrow, ops::Deref, rc::Rc}; + +pub type RcGlFramebuffer<'a> = RcGlResource<'a, NativeFramebuffer>; +pub type RcGlRenderbuffer<'a> = RcGlResource<'a, NativeRenderbuffer>; +pub type RcGlRcFramebuffer = RcGlRcResource; +pub type RcGlRcRenderbuffer = RcGlRcResource; +pub type RcGlTexture<'a> = RcGlResource<'a, NativeTexture>; +pub type RcGlVertexArray<'a> = RcGlResource<'a, NativeVertexArray>; +pub type RcGlBuffer<'a> = RcGlResource<'a, NativeBuffer>; +pub type RcGlRcVertexArray = RcGlRcResource; +pub type RcGlRcBuffer = RcGlRcResource; + +// pub type RcGlResource<'a, T> = Rc>; +pub trait ManagedResource { + fn bind(&self, target: u32); + fn unbind(&self, target: u32); +} +#[derive(Debug, Clone)] +pub struct RcGlResource<'a, T: Resource>(Rc>); + +#[derive(Clone)] +pub struct RcGlRcResource(Rc>); + +impl<'a, T: Resource> RcGlResource<'a, T> { + pub fn new(gl: &'a glow::Context, resource: T) -> Self { + Self(Rc::new(GlResource::new(resource, gl))) + } + + pub fn native(&self) -> T { + self.0.resource.clone() + } +} + +impl<'a, T> From<&'a GlRcResource> for GlResource<'a, T> +where + T: Resource, +{ + fn from(value: &'a GlRcResource) -> Self { + GlResource::new(value.resource.clone(), &value.gl) + } +} + +impl<'a, T: Resource> Deref for RcGlResource<'a, T> { + type Target = T; + fn deref(&self) -> &Self::Target { + self.0.deref() + } +} + +impl RcGlRcResource { + pub fn new(gl: Rc, resource: T) -> Self { + Self(Rc::new(GlRcResource::new(resource, gl))) + } + + pub fn native(&self) -> T { + self.0.resource.clone() + } +} + +impl Deref for RcGlRcResource { + type Target = T; + fn deref(&self) -> &Self::Target { + self.0.deref() + } +} + +pub trait Resource: Clone + std::fmt::Debug { + fn drop_self(&self, gl: &glow::Context); + + fn create(gl: &glow::Context) -> Self; + + fn bind(&self, gl: &glow::Context, target: u32); + + fn unbind(&self, gl: &glow::Context, target: u32); +} + +impl Resource for NativeVertexArray { + fn drop_self(&self, gl: &glow::Context) { + unsafe { + gl.delete_vertex_array(*self); + } + } + + fn create(gl: &glow::Context) -> Self { + unsafe { gl.create_vertex_array().unwrap() } + } + + fn bind(&self, gl: &glow::Context, target: u32) { + unsafe { + gl.bind_vertex_array(Some(*self)); + } + } + + fn unbind(&self, gl: &glow::Context, target: u32) { + unsafe { + gl.bind_vertex_array(Some(*self)); + } + } +} + +impl Resource for NativeBuffer { + fn drop_self(&self, gl: &glow::Context) { + unsafe { + gl.delete_buffer(*self); + } + } + + fn create(gl: &glow::Context) -> Self { + unsafe { gl.create_buffer().unwrap() } + } + + fn bind(&self, gl: &glow::Context, target: u32) { + unsafe { + gl.bind_buffer(target, Some(*self)); + } + } + + fn unbind(&self, gl: &glow::Context, target: u32) { + unsafe { + gl.bind_buffer(target, None); + } + } +} + +impl Resource for NativeFramebuffer { + fn drop_self(&self, gl: &glow::Context) { + unsafe { + gl.delete_framebuffer(*self); + } + } + + fn create(gl: &glow::Context) -> Self { + unsafe { gl.create_framebuffer().unwrap() } + } + fn bind(&self, gl: &glow::Context, target: u32) { + unsafe { + gl.bind_framebuffer(target, Some(*self)); + } + } + fn unbind(&self, gl: &glow::Context, target: u32) { + unsafe { + gl.bind_framebuffer(target, None); + } + } +} + +impl Resource for NativeRenderbuffer { + fn drop_self(&self, gl: &glow::Context) { + unsafe { + gl.delete_renderbuffer(*self); + } + } + + fn create(gl: &glow::Context) -> Self { + unsafe { gl.create_renderbuffer().unwrap() } + } + + fn bind(&self, gl: &glow::Context, target: u32) { + unsafe { + gl.bind_renderbuffer(target, Some(*self)); + } + } + fn unbind(&self, gl: &glow::Context, target: u32) { + unsafe { + gl.bind_renderbuffer(target, None); + } + } +} + +impl Resource for NativeTexture { + fn drop_self(&self, gl: &glow::Context) { + unsafe { + gl.delete_texture(*self); + } + } + + fn create(gl: &glow::Context) -> Self { + unsafe { gl.create_texture().unwrap() } + } + + fn bind(&self, gl: &glow::Context, target: u32) { + unsafe { + gl.bind_texture(target, Some(*self)); + } + } + + fn unbind(&self, gl: &glow::Context, target: u32) { + unsafe { + gl.bind_texture(target, None); + } + } +} + +#[derive(Debug)] +struct GlResource<'a, T: Resource> { + gl: &'a glow::Context, + resource: T, +} + +struct GlRcResource { + gl: Rc, + resource: T, +} +impl Deref for GlRcResource { + type Target = T; + fn deref(&self) -> &Self::Target { + &self.resource + } +} + +impl<'a, T> AsRef> for RcGlResource<'a, T> +where + T: Resource, +{ + fn as_ref(&self) -> &GlResource<'a, T> { + &self.0 + } +} + +impl GlRcResource { + pub fn new(resource: T, gl: Rc) -> Self { + Self { resource, gl } + } +} + +impl Drop for GlRcResource { + fn drop(&mut self) { + self.resource.drop_self(&*self.gl); + info!("Dropping resource: {:?}", self.resource); + } +} + +impl Deref for GlResource<'_, T> { + type Target = T; + fn deref(&self) -> &Self::Target { + &self.resource + } +} + +impl<'a, T: Resource> GlResource<'a, T> { + pub fn new(resource: T, gl: &'a glow::Context) -> Self { + Self { resource, gl } + } +} + +impl Drop for GlResource<'_, T> { + fn drop(&mut self) { + self.resource.drop_self(self.gl); + info!("Dropping resource: {:?}", self.resource); + } +} + +impl<'a> RcGlResource<'a, NativeTexture> {} + +#[derive(Debug, Clone)] +pub struct GL { + gl: Rc, +} + +impl GL { + pub fn new(gl: glow::Context) -> Self { + Self { gl: Rc::new(gl) } + } + pub fn gl<'a>(&'a self) -> &'a glow::Context { + &self.gl + } + + pub fn gl_rc(&self) -> Rc { + self.gl.clone() + } + + pub fn create_resource(&self) -> RcGlResource<'_, T> { + RcGlResource::new(self.gl(), T::create(self.gl())) + } + + pub fn create_resource_rc(&self) -> RcGlRcResource { + RcGlRcResource::new(self.gl_rc(), T::create(self.gl())) + } + + pub fn create_resource_rc_with(&self, resource: T) -> RcGlRcResource { + RcGlRcResource::new(self.gl_rc(), resource) + } + + pub fn create_resource_with(&self, resource: T) -> RcGlResource<'_, T> { + RcGlResource::new(self.gl(), resource) + } +} + +impl Deref for GL { + type Target = glow::Context; + + fn deref(&self) -> &Self::Target { + &self.gl + } +} + +impl ManagedResource for RcGlResource<'_, T> { + fn bind(&self, target: u32) { + self.0.resource.bind(self.0.gl, target); + } + + fn unbind(&self, target: u32) { + self.0.resource.unbind(&self.0.gl, target); + } +} + +impl ManagedResource for RcGlRcResource { + fn bind(&self, target: u32) { + self.0.resource.bind(&self.0.gl, target); + } + + fn unbind(&self, target: u32) { + self.0.resource.unbind(&self.0.gl, target); + } +} diff --git a/.schema.xml b/radar-g/.schema.xml similarity index 100% rename from .schema.xml rename to radar-g/.schema.xml diff --git a/radar-g/Cargo.lock b/radar-g/Cargo.lock new file mode 100644 index 0000000..68ece6e --- /dev/null +++ b/radar-g/Cargo.lock @@ -0,0 +1,5529 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ab_glyph" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80179d7dd5d7e8c285d67c4a1e652972a92de7475beddfb92028c76463b13225" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" + +[[package]] +name = "abi_stable" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69d6512d3eb05ffe5004c59c206de7f99c34951504056ce23fc953842f12c445" +dependencies = [ + "abi_stable_derive", + "abi_stable_shared", + "const_panic", + "core_extensions", + "crossbeam-channel", + "generational-arena", + "libloading 0.7.4", + "lock_api", + "parking_lot", + "paste 1.0.14", + "repr_offset", + "rustc_version", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "abi_stable_derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7178468b407a4ee10e881bc7a328a65e739f0863615cca4429d43916b05e898" +dependencies = [ + "abi_stable_shared", + "as_derive_utils", + "core_extensions", + "proc-macro2 1.0.86", + "quote 1.0.35", + "rustc_version", + "syn 1.0.109", + "typed-arena", +] + +[[package]] +name = "abi_stable_shared" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b5df7688c123e63f4d4d649cba63f2967ba7f7861b1664fca3f77d3dad2b63" +dependencies = [ + "core_extensions", +] + +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "android-activity" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64529721f27c2314ced0890ce45e469574a73e5e6fdd6e9da1860eb29285f5e0" +dependencies = [ + "android-properties", + "bitflags 1.3.2", + "cc", + "jni-sys", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "num_enum 0.6.1", +] + +[[package]] +name = "android-properties" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "as_derive_utils" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff3c96645900a44cf11941c111bd08a6573b0e2f9f69bc9264b179d8fae753c4" +dependencies = [ + "core_extensions", + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 1.0.109", +] + +[[package]] +name = "async-trait" +version = "0.1.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "atomic-polyfill" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bindgen" +version = "0.59.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "clap", + "env_logger", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2 1.0.86", + "quote 1.0.35", + "regex", + "rustc-hash", + "shlex", + "which", +] + +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-sys" +version = "0.1.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" +dependencies = [ + "objc-sys", +] + +[[package]] +name = "block2" +version = "0.2.0-alpha.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" +dependencies = [ + "block-sys", + "objc2-encode", +] + +[[package]] +name = "bork" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3902fc846b836c3c020710520d985de20449aa341a43e8f5b698cd25bbd8b5f2" + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "bytemuck" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cairo-rs" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3603c4028a5e368d09b51c8b624b9a46edcd7c3778284077a6125af73c9f0a" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs 0.17.10", + "glib 0.17.10", + "libc", + "once_cell", + "thiserror", +] + +[[package]] +name = "cairo-rs" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a0ea147c94108c9613235388f540e4d14c327f7081c9e471fc8ee8a2533e69" +dependencies = [ + "bitflags 2.6.0", + "cairo-sys-rs 0.20.0", + "glib 0.20.1", + "libc", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "691d0c66b1fb4881be80a760cb8fe76ea97218312f9dfe2c9cc0f496ca279cb1" +dependencies = [ + "glib-sys 0.17.10", + "libc", + "system-deps 6.1.1", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "428290f914b9b86089f60f5d8a9f6e440508e1bcff23b25afd51502b0a2da88f" +dependencies = [ + "glib-sys 0.20.1", + "libc", + "system-deps 7.0.2", +] + +[[package]] +name = "calloop" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e0d00eb1ea24371a97d2da6201c6747a633dc6dc1988ef503403b4c59504a8" +dependencies = [ + "bitflags 1.3.2", + "log", + "nix 0.25.1", + "slotmap", + "thiserror", + "vec_map", +] + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-expr" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "215c0072ecc28f92eeb0eea38ba63ddfcb65c2828c46311d646f1a3ff5f9841c" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-expr" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345c78335be0624ed29012dc10c49102196c6882c12dde65d9f35b02da2aada8" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "cgl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" +dependencies = [ + "libc", +] + +[[package]] +name = "chrono" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.52.0", +] + +[[package]] +name = "cinrad_g" +version = "0.1.0" +dependencies = [ + "abi_stable", + "anyhow", + "async-trait", + "cairo-rs 0.17.10", + "chrono", + "core_extensions", + "crossbeam", + "dirs", + "enum_dispatch", + "epoxy", + "euclid", + "femtovg", + "flate2", + "fns", + "futures", + "geo 0.26.0", + "geo-macros", + "geo-types", + "geojson 0.24.1", + "gl", + "glib-build-tools", + "glib-macros 0.19.2", + "glow", + "glue", + "gtk4", + "image", + "imgref", + "indexmap", + "lazy_static", + "libadwaita", + "libloading 0.8.3", + "ndarray", + "npyz", + "num-traits", + "once_cell", + "plotters", + "plotters-backend", + "proj", + "proj-sys", + "quadtree_rs", + "quick_cache", + "radarg_plugin_interface", + "rayon", + "regex", + "relm4", + "relm4-components", + "relm4-icons", + "reqwest", + "rgb", + "rstar 0.11.0", + "serde", + "serde_json", + "shapefile", + "slippy-map-tiles", + "smallvec", + "sorted-vec", + "surfman", + "svg", + "thiserror", + "tokio", + "tokio-condvar", + "toml 0.8.19", + "topojson", + "tracing", + "tracing-subscriber", + "tracker", + "url", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clang-sys" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +dependencies = [ + "glob", + "libc", + "libloading 0.7.4", +] + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim 0.8.0", + "textwrap", + "unicode-width", + "vec_map", +] + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + +[[package]] +name = "cocoa" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +dependencies = [ + "bitflags 1.3.2", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-foundation", + "core-graphics-types", + "libc", + "objc", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "const-cstr" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3d0b5ff30645a68f35ece8cea4556ca14ef8a1651455f789a099a0513532a6" + +[[package]] +name = "const_panic" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6051f239ecec86fde3410901ab7860d458d160371533842974fc61f96d15879b" + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "core-text" +version = "19.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" +dependencies = [ + "core-foundation", + "core-graphics", + "foreign-types", + "libc", +] + +[[package]] +name = "core_extensions" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c71dc07c9721607e7a16108336048ee978c3a8b129294534272e8bac96c0ee" +dependencies = [ + "core_extensions_proc_macros", +] + +[[package]] +name = "core_extensions_proc_macros" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f3b219d28b6e3b4ac87bc1fc522e0803ab22e055da177bff0068c4150c61a6" + +[[package]] +name = "cpufeatures" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "critical-section" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" + +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcfbcb0c5961907597a7d1148e3af036268f2b773886b8bb3eeb1e1281d3d3d6" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6afc018370c3bff3eb51f89256a6bdb18b4fdcda72d577982a14954a7a0b402c" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 0.4.30", + "quote 0.6.13", + "strsim 0.7.0", + "syn 0.15.44", +] + +[[package]] +name = "darling_macro" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6d8dac1c6f1d29a41c4712b4400f878cb4fcc4c7628f298dd75038e024998d1" +dependencies = [ + "darling_core", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "dbase" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c1a2a9e9238982f599f25b54ec2c7cf1518cc97084cf0c8da475f8a3727fe7" +dependencies = [ + "byteorder", + "time", +] + +[[package]] +name = "derive_builder" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ac53fa6a3cda160df823a9346442525dcaf1e171999a1cf23e67067e4fd64d4" +dependencies = [ + "darling", + "derive_builder_core", + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "derive_builder_core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0288a23da9333c246bb18c143426074a6ae96747995c5819d2947b64cd942b37" +dependencies = [ + "darling", + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading 0.8.3", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "dwrote" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" +dependencies = [ + "lazy_static", + "libc", + "winapi", + "wio", +] + +[[package]] +name = "earcutr" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0812b44697951d35fde8fcb0da81c9de7e809e825a66bbf1ecb79d9829d4ca3d" +dependencies = [ + "itertools", + "num-traits", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + +[[package]] +name = "enum_dispatch" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" +dependencies = [ + "once_cell", + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "epoxy" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b96028ce3ff03972312fd8243281858e80fc0f9838b1f035676b6c199214d9e" +dependencies = [ + "gl_generator 0.9.0", + "libc", + "pkg-config", + "shared_library", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "etws_loader" +version = "0.1.0" +dependencies = [ + "abi_stable", + "anyhow", + "byteorder", + "chrono", + "flate2", + "geo 0.28.0", + "nom", + "nom-derive", + "num-traits", + "radarg_plugin_interface", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "euclid" +version = "0.22.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f253bc5c813ca05792837a0ff4b3a580336b224512d48f7eda1d7dd9210787" +dependencies = [ + "num-traits", +] + +[[package]] +name = "exr" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1e481eb11a482815d3e9d618db8c42a93207134662873809335a92327440c18" +dependencies = [ + "bit_field", + "flume 0.10.14", + "half", + "lebe", + "miniz_oxide", + "rayon-core", + "smallvec", + "zune-inflate", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "fdeflate" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "femtovg" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad3cf7e8f8e3c684b418c2640c931afc8bbc7ebe547bed6bf64170f1f51d57c9" +dependencies = [ + "bitflags 2.6.0", + "fnv", + "glow", + "image", + "imgref", + "log", + "lru", + "rgb", + "rustybuzz", + "slotmap", + "unicode-bidi", + "unicode-segmentation", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset 0.9.0", + "rustc_version", +] + +[[package]] +name = "filetime" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.2.16", + "windows-sys 0.48.0", +] + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "float-ord" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bad48618fdb549078c333a7a8528acb57af271d0433bdecd523eb620628364e" + +[[package]] +name = "float_next_after" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8" + +[[package]] +name = "flume" +version = "0.10.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "pin-project", + "spin", +] + +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "spin", +] + +[[package]] +name = "fns" +version = "0.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d318f82a68feac152dab48e8a6f1eb665a915ea6a0c76e4ad5ed137f80c368" +dependencies = [ + "log", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "font-kit" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21fe28504d371085fae9ac7a3450f0b289ab71e07c8e57baa3fb68b9e57d6ce5" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "core-foundation", + "core-graphics", + "core-text", + "dirs-next", + "dwrote", + "float-ord", + "freetype", + "lazy_static", + "libc", + "log", + "pathfinder_geometry", + "pathfinder_simd", + "walkdir", + "winapi", + "yeslogic-fontconfig-sys", +] + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fragile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" + +[[package]] +name = "freetype" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee38378a9e3db1cc693b4f88d166ae375338a0ff75cb8263e1c601d51f35dc6" +dependencies = [ + "freetype-sys", + "libc", +] + +[[package]] +name = "freetype-sys" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" +dependencies = [ + "cmake", + "libc", + "pkg-config", +] + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8730751991b97419fc3f0c2dca2c9e45b48edf46e48e0f965964ecf33889812f" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib 0.20.1", + "libc", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffbf649fd5b1c8c0f0feeb015b7533c3ef92da2887fb95ddd338bc2b1644a7c" +dependencies = [ + "gio-sys 0.20.1", + "glib-sys 0.20.1", + "gobject-sys 0.20.1", + "libc", + "system-deps 7.0.2", +] + +[[package]] +name = "gdk4" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b7d7237c1487ed4b300aac7744efcbf1319e12d60d7afcd6f505414bd5b5dea" +dependencies = [ + "cairo-rs 0.20.1", + "gdk-pixbuf", + "gdk4-sys", + "gio", + "glib 0.20.1", + "libc", + "pango", +] + +[[package]] +name = "gdk4-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a67576c8ec012156d7f680e201a807b4432a77babb3157e0555e990ab6bcd878" +dependencies = [ + "cairo-sys-rs 0.20.0", + "gdk-pixbuf-sys", + "gio-sys 0.20.1", + "glib-sys 0.20.1", + "gobject-sys 0.20.1", + "libc", + "pango-sys", + "pkg-config", + "system-deps 7.0.2", +] + +[[package]] +name = "generational-arena" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877e94aff08e743b651baaea359664321055749b398adff8740a7399af7796e7" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "geo" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1645cf1d7fea7dac1a66f7357f3df2677ada708b8d9db8e9b043878930095a96" +dependencies = [ + "earcutr", + "float_next_after", + "geo-types", + "geographiclib-rs", + "log", + "num-traits", + "robust", + "rstar 0.11.0", +] + +[[package]] +name = "geo" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f811f663912a69249fa620dcd2a005db7254529da2d8a0b23942e81f47084501" +dependencies = [ + "earcutr", + "float_next_after", + "geo-types", + "geographiclib-rs", + "log", + "num-traits", + "robust", + "rstar 0.12.0", + "spade", +] + +[[package]] +name = "geo-macros" +version = "0.1.0" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "regex", + "syn 2.0.75", +] + +[[package]] +name = "geo-types" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff16065e5720f376fbced200a5ae0f47ace85fd70b7e54269790281353b6d61" +dependencies = [ + "approx", + "num-traits", + "rstar 0.11.0", + "rstar 0.12.0", + "serde", +] + +[[package]] +name = "geographiclib-rs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea804e7bd3c6a4ca6a01edfa35231557a8a81d4d3f3e1e2b650d028c42592be" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "geojson" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c1147be22f66284de4387c43e4abab872e525a528f4d0af4e4e0f231895ea4" +dependencies = [ + "geo-types", + "serde", + "serde_derive", + "serde_json", + "thiserror", +] + +[[package]] +name = "geojson" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d728c1df1fbf328d74151efe6cb0586f79ee813346ea981add69bd22c9241b" +dependencies = [ + "geo-types", + "log", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gif" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + +[[package]] +name = "gio" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcacaa37401cad0a95aadd266bc39c72a131d454fc012f6dfd217f891d76cc52" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys 0.20.1", + "glib 0.20.1", + "libc", + "pin-project-lite", + "smallvec", +] + +[[package]] +name = "gio-sys" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ccf87c30a12c469b6d958950f6a9c09f2be20b7773f7e70d20b867fdf2628c3" +dependencies = [ + "glib-sys 0.17.10", + "gobject-sys 0.17.10", + "libc", + "system-deps 6.1.1", + "winapi", +] + +[[package]] +name = "gio-sys" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5237611e97e9b86ab5768adc3eef853ae713ea797aa3835404acdfacffc9fb38" +dependencies = [ + "glib-sys 0.20.1", + "gobject-sys 0.20.1", + "libc", + "system-deps 7.0.2", + "windows-sys 0.52.0", +] + +[[package]] +name = "gl" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a94edab108827d67608095e269cf862e60d920f144a5026d3dbcfd8b877fb404" +dependencies = [ + "gl_generator 0.14.0", +] + +[[package]] +name = "gl_generator" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a795170cbd85b5a7baa58d6d7525cae6a03e486859860c220f7ebbbdd379d0a" +dependencies = [ + "khronos_api 2.2.0", + "log", + "xml-rs 0.7.0", +] + +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api 3.1.0", + "log", + "xml-rs 0.8.19", +] + +[[package]] +name = "glib" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fad45ba8d4d2cea612b432717e834f48031cd8853c8aaf43b2c79fec8d144b" +dependencies = [ + "bitflags 1.3.2", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys 0.17.10", + "glib-macros 0.17.10", + "glib-sys 0.17.10", + "gobject-sys 0.17.10", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror", +] + +[[package]] +name = "glib" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19429cb83fcbf1f00b31ae3a123fab5cd3761bdd15b0cc07905804742f0d0e4" +dependencies = [ + "bitflags 2.6.0", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys 0.20.1", + "glib-macros 0.20.1", + "glib-sys 0.20.1", + "gobject-sys 0.20.1", + "libc", + "memchr", + "smallvec", +] + +[[package]] +name = "glib-build-tools" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a65d79efe318ef2cbbbb37032b125866fd82c34ea44c816132621bbc552e716" + +[[package]] +name = "glib-macros" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca5c79337338391f1ab8058d6698125034ce8ef31b72a442437fa6c8580de26" +dependencies = [ + "anyhow", + "heck 0.4.1", + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 1.0.109", +] + +[[package]] +name = "glib-macros" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f5897ca27a83e4cdc7b4666850bade0a2e73e17689aabafcc9acddad9d823b8" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 3.1.0", + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "glib-macros" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960349f56469b75794157e93bf04f0bc8a622d0a6612d6a8f8d7eac41e0e1ee1" +dependencies = [ + "heck 0.5.0", + "proc-macro-crate 3.1.0", + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "glib-sys" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d80aa6ea7bba0baac79222204aa786a6293078c210abe69ef1336911d4bdc4f0" +dependencies = [ + "libc", + "system-deps 6.1.1", +] + +[[package]] +name = "glib-sys" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44edae63bea922f18f7e63977ee60a257ec27c4613aff1a6a9bb572ad0d88269" +dependencies = [ + "libc", + "system-deps 7.0.2", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "glow" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glue" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0051e4d4b01c6e853d7db02f181d08ee0e19d6a53e91bdf80543ceb062f0b57" +dependencies = [ + "bork", + "paste 0.1.18", +] + +[[package]] +name = "gobject-sys" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd34c3317740a6358ec04572c1bcfd3ac0b5b6529275fae255b237b314bb8062" +dependencies = [ + "glib-sys 0.17.10", + "libc", + "system-deps 6.1.1", +] + +[[package]] +name = "gobject-sys" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa3d1dcd8a1eb2e7c22be3d5e792b14b186f3524f79b25631730f9a8c169d49a" +dependencies = [ + "glib-sys 0.20.1", + "libc", + "system-deps 7.0.2", +] + +[[package]] +name = "graphene-rs" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80aac87f74e81c0e13433e892a047237abdc37945c86887f5eed905038356e69" +dependencies = [ + "glib 0.20.1", + "graphene-sys", + "libc", +] + +[[package]] +name = "graphene-sys" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2f91ecd32989efad60326cc20a8fb252bd2852239a08e4e70cde8c100de9ca" +dependencies = [ + "glib-sys 0.20.1", + "libc", + "pkg-config", + "system-deps 7.0.2", +] + +[[package]] +name = "gsk4" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3cf2091e1af185b347b3450817d93dea6fe435df7abd4c2cd7fb5bcb4cfda8" +dependencies = [ + "cairo-rs 0.20.1", + "gdk4", + "glib 0.20.1", + "graphene-rs", + "gsk4-sys", + "libc", + "pango", +] + +[[package]] +name = "gsk4-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aa69614a26d8760c186c3690f1b0fbb917572ca23ef83137445770ceddf8cde" +dependencies = [ + "cairo-sys-rs 0.20.0", + "gdk4-sys", + "glib-sys 0.20.1", + "gobject-sys 0.20.1", + "graphene-sys", + "libc", + "pango-sys", + "system-deps 7.0.2", +] + +[[package]] +name = "gtk4" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaffc6c743c9160514cc9b67eace364e5dc5798369fa809cdb04e035c21c5c5d" +dependencies = [ + "cairo-rs 0.20.1", + "field-offset", + "futures-channel", + "gdk-pixbuf", + "gdk4", + "gio", + "glib 0.20.1", + "graphene-rs", + "gsk4", + "gtk4-macros", + "gtk4-sys", + "libc", + "pango", +] + +[[package]] +name = "gtk4-macros" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "188211f546ce5801f6d0245c37b6249143a2cb4fa040e54829ca1e76796e9f09" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "gtk4-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1114a207af8ada02cf4658a76692f4190f06f093380d5be07e3ca8b43aa7c666" +dependencies = [ + "cairo-sys-rs 0.20.0", + "gdk-pixbuf-sys", + "gdk4-sys", + "gio-sys 0.20.1", + "glib-sys 0.20.1", + "gobject-sys 0.20.1", + "graphene-sys", + "gsk4-sys", + "libc", + "pango-sys", + "system-deps 7.0.2", +] + +[[package]] +name = "gvdb" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acfa8cd2aa58da96876eb6276afe617c414d5846d1229274a821c1f8e8aa9e02" +dependencies = [ + "byteorder", + "flate2", + "quick-xml", + "safe-transmute", + "serde", + "serde_json", + "walkdir", + "zvariant", +] + +[[package]] +name = "h2" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "half" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "heapless" +version = "0.7.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" +dependencies = [ + "atomic-polyfill", + "hash32 0.2.1", + "rustc_version", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "image" +version = "0.24.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "exr", + "gif", + "jpeg-decoder", + "num-rational 0.4.1", + "num-traits", + "png", + "qoi", + "tiff", +] + +[[package]] +name = "imgref" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" + +[[package]] +name = "indexmap" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "io-surface" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "861c6093cbc05599e66436aedf380bb0a23cec2180738393d3a340b80dd135ef" +dependencies = [ + "cgl", + "core-foundation", + "leaky-cow", + "libc", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jobserver" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +dependencies = [ + "libc", +] + +[[package]] +name = "jpeg-decoder" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" +dependencies = [ + "rayon", +] + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "khronos_api" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037ab472c33f67b5fbd3e9163a2645319e5356fcd355efa6d4eb7fff4bbcb554" + +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "leak" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd100e01f1154f2908dfa7d02219aeab25d0b9c7fa955164192e3245255a0c73" + +[[package]] +name = "leaky-cow" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40a8225d44241fd324a8af2806ba635fc7c8a7e9a7de4d5cf3ef54e71f5926fc" +dependencies = [ + "leak", +] + +[[package]] +name = "lebe" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" + +[[package]] +name = "libadwaita" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ff9c222b5c783729de45185f07b2fec2d43a7f9c63961e777d3667e20443878" +dependencies = [ + "gdk4", + "gio", + "glib 0.20.1", + "gtk4", + "libadwaita-sys", + "libc", + "pango", +] + +[[package]] +name = "libadwaita-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c44d8bdbad31d6639e1f20cc9c1424f1a8e02d751fc28d44659bf743fb9eca6" +dependencies = [ + "gdk4-sys", + "gio-sys 0.20.1", + "glib-sys 0.20.1", + "gobject-sys 0.20.1", + "gtk4-sys", + "libc", + "pango-sys", + "system-deps 7.0.2", +] + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libloading" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +dependencies = [ + "cfg-if", + "windows-targets 0.52.0", +] + +[[package]] +name = "libm" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.6.0", + "libc", + "redox_syscall 0.4.1", +] + +[[package]] +name = "libredox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" +dependencies = [ + "bitflags 2.6.0", + "libc", + "redox_syscall 0.4.1", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + +[[package]] +name = "lru" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "matrixmultiply" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "metal" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "ndarray" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +dependencies = [ + "matrixmultiply", + "num-complex 0.4.3", + "num-integer", + "num-traits", + "rawpointer", + "rayon", +] + +[[package]] +name = "ndk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" +dependencies = [ + "bitflags 1.3.2", + "jni-sys", + "ndk-sys", + "num_enum 0.5.11", + "raw-window-handle", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.4.1+23.1.7779620" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.6.5", +] + +[[package]] +name = "nix" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.6.5", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom-derive" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ff943d68b88d0b87a6e0d58615e8fa07f9fd5a1319fa0a72efc1f62275c79a7" +dependencies = [ + "nom", + "nom-derive-impl", + "rustversion", +] + +[[package]] +name = "nom-derive-impl" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b9a93a84b0d3ec3e70e02d332dc33ac6dfac9cde63e17fcb77172dededa62" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 1.0.109", +] + +[[package]] +name = "npyz" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5d7d7b4142b8ad36ba84122b91491276a4e9f7104e7f51c8c56f16a7a3825ef" +dependencies = [ + "byteorder", + "num-bigint 0.4.3", + "py_literal", + "zip", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +dependencies = [ + "num-bigint 0.2.6", + "num-complex 0.2.4", + "num-integer", + "num-iter", + "num-rational 0.2.4", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint 0.2.6", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 1.0.109", +] + +[[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc-sys" +version = "0.2.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" + +[[package]] +name = "objc2" +version = "0.3.0-beta.3.patch-leaks.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" +dependencies = [ + "block2", + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-encode" +version = "2.0.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" +dependencies = [ + "objc-sys", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "object" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "orbclient" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166" +dependencies = [ + "libredox 0.0.2", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owned_ttf_parser" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" +dependencies = [ + "ttf-parser 0.20.0", +] + +[[package]] +name = "pango" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5764e5a174a5a0ec054fe5962ce6d4fc7052e2d0dcc23bbc77202b40a4a403d3" +dependencies = [ + "gio", + "glib 0.20.1", + "libc", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd317e1de76b14b3d3efe05518c08b360327f1ab7fec150473a89ffcad4b072d" +dependencies = [ + "glib-sys 0.20.1", + "gobject-sys 0.20.1", + "libc", + "system-deps 7.0.2", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.4.1", + "smallvec", + "windows-targets 0.48.1", +] + +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "paste" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" +dependencies = [ + "paste-impl", + "proc-macro-hack", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "paste-impl" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" +dependencies = [ + "proc-macro-hack", +] + +[[package]] +name = "pathfinder_geometry" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b7e7b4ea703700ce73ebf128e1450eb69c3a8329199ffbfb9b2a0418e5ad3" +dependencies = [ + "log", + "pathfinder_simd", +] + +[[package]] +name = "pathfinder_simd" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0444332826c70dc47be74a7c6a5fc44e23a7905ad6858d4162b658320455ef93" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest", + "hmac", + "password-hash", + "sha2", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef623c9bbfa0eedf5a0efba11a5ee83209c326653ca31ff019bec3a95bfff2b" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3e8cba4ec22bada7fc55ffe51e2deb6a0e0db2d0b7ab0b103acc80d2510c190" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "pest_meta" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01f71cb40bd8bb94232df14b946909e14660e33fc05db3e50ae2a82d7ea0ca0" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "plotters" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +dependencies = [ + "chrono", + "font-kit", + "image", + "lazy_static", + "num-traits", + "pathfinder_geometry", + "plotters-backend", + "plotters-bitmap", + "plotters-svg", + "ttf-parser 0.17.1", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" + +[[package]] +name = "plotters-bitmap" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cebbe1f70205299abc69e8b295035bb52a6a70ee35474ad10011f0a4efb8543" +dependencies = [ + "gif", + "image", + "plotters-backend", +] + +[[package]] +name = "plotters-svg" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "png" +version = "0.17.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.11", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.0", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proj" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ad1830ad8966eba22c76e78440458f07bd812bef5c3efdf335dec55cd1085ab" +dependencies = [ + "geo-types", + "libc", + "num-traits", + "proj-sys", + "thiserror", +] + +[[package]] +name = "proj-sys" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "921ae7fa2556cbb23d13ba8f166eb47641c76d8e4b7ee867540921b36ec0fda9" +dependencies = [ + "bindgen", + "cmake", + "flate2", + "pkg-config", + "tar", +] + +[[package]] +name = "py_literal" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "102df7a3d46db9d3891f178dcc826dc270a6746277a9ae6436f8d29fd490a8e1" +dependencies = [ + "num-bigint 0.4.3", + "num-complex 0.4.3", + "num-traits", + "pest", + "pest_derive", +] + +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "quadtree_rs" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba363923b69b8ae7b125648e48c3b31ae6e5305567fb6b5a9a08987dc62019a9" +dependencies = [ + "derive_builder", + "num", +] + +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "quick_cache" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c20af3800cee5134b79a3bd4a3d4b583c16ccfa5f53338f46400851a5b3819" +dependencies = [ + "ahash", + "equivalent", + "hashbrown", + "parking_lot", +] + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2 1.0.86", +] + +[[package]] +name = "radarg_plugin_interface" +version = "0.1.0" +dependencies = [ + "abi_stable", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "raw-window-handle" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +dependencies = [ + "getrandom", + "libredox 0.0.1", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "relm4" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf0363f92b6a7eefd985b47f27b7ae168dd2fd5cd4013a338c9b111c33744d1f" +dependencies = [ + "flume 0.11.0", + "fragile", + "futures", + "gtk4", + "libadwaita", + "once_cell", + "relm4-css", + "relm4-macros", + "tokio", + "tracing", +] + +[[package]] +name = "relm4-components" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb3d67f2982131c5e6047af4278d8fe750266767e57b58bc15f2e11e190eef36" +dependencies = [ + "once_cell", + "relm4", + "tracker", +] + +[[package]] +name = "relm4-css" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d3b924557df1cddc687b60b313c4b76620fdbf0e463afa4b29f67193ccf37f9" + +[[package]] +name = "relm4-icons" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15242978b4e65431be4ccd5cf539d3c142518e114b7ecfa72ffd02cd6432e6e3" +dependencies = [ + "gtk4", + "gvdb", + "serde", + "toml 0.8.19", +] + +[[package]] +name = "relm4-macros" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc5885640821d60062497737dd42fd04248d13c7ecccee620caaa4b210fe9905" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "repr_offset" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb1070755bd29dffc19d0971cab794e607839ba2ef4b69a9e6fbc8733c1b72ea" +dependencies = [ + "tstr", +] + +[[package]] +name = "reqwest" +version = "0.11.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rgb" +version = "0.8.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "robust" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf4a6aa5f6d6888f39e980649f3ad6b666acdce1d78e95b8a2cb076e687ae30" + +[[package]] +name = "rstar" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73111312eb7a2287d229f06c00ff35b51ddee180f017ab6dec1f69d62ac098d6" +dependencies = [ + "heapless 0.7.16", + "num-traits", + "smallvec", +] + +[[package]] +name = "rstar" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "133315eb94c7b1e8d0cb097e5a710d850263372fd028fff18969de708afc7008" +dependencies = [ + "heapless 0.8.0", + "num-traits", + "smallvec", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "rustybuzz" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88117946aa1bfb53c2ae0643ceac6506337f44887f8c9fbfb43587b1cc52ba49" +dependencies = [ + "bitflags 2.6.0", + "bytemuck", + "smallvec", + "ttf-parser 0.20.0", + "unicode-bidi-mirroring", + "unicode-ccc", + "unicode-properties", + "unicode-script", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "safe-transmute" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98a01dab6acf992653be49205bdd549f32f17cb2803e8eacf1560bf97259aae8" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sctk-adwaita" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda4e97be1fd174ccc2aae81c8b694e803fa99b34e8fd0f057a9d70698e3ed09" +dependencies = [ + "ab_glyph", + "log", + "memmap2", + "smithay-client-toolkit", + "tiny-skia", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" + +[[package]] +name = "serde" +version = "1.0.208" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.208" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "serde_json" +version = "1.0.112" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d1bd37ce2324cf3bf85e5a25f96eb4baf0d5aa6eba43e7ae8958870c4ec48ed" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "servo-display-link" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1060be2a0bbc35e712ec35ae98119b8def1071a5f2edbe392fd4c899bc2a5f4" +dependencies = [ + "foreign-types", + "objc", + "objc-foundation", + "thiserror", + "time-point", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shapefile" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f77dc980d3b70a602ad40a20e9a5137800d5271ce25ec9e2a2826ca24a4be18" +dependencies = [ + "byteorder", + "dbase", + "geo-types", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shared_library" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" +dependencies = [ + "lazy_static", + "libc", +] + +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slippy-map-tiles" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca0bb81e6365882ec0e68a114f08c1c126d1fca2faafee1c82d2d95b0f07099" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "slotmap" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" + +[[package]] +name = "smithay-client-toolkit" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870427e30b8f2cbe64bf43ec4b86e88fe39b0a84b3f15efd9c9c2d020bc86eb9" +dependencies = [ + "bitflags 1.3.2", + "calloop", + "dlib", + "lazy_static", + "log", + "memmap2", + "nix 0.24.3", + "pkg-config", + "wayland-client", + "wayland-cursor", + "wayland-protocols", +] + +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "sorted-vec" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6734caf0b6f51addd5eeacca12fb39b2c6c14e8d4f3ac42f3a78955c0467458" + +[[package]] +name = "spade" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd14cf9e23b5241e1b1289ed3b9afc7746c95ead8df52d9254f5ed2d40c561b" +dependencies = [ + "hashbrown", + "num-traits", + "robust", + "smallvec", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strict-num" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" + +[[package]] +name = "strsim" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "surfman" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2e4280229411d6eb8a8f873152dece1904df2682003bdc748adc181e003568" +dependencies = [ + "bitflags 1.3.2", + "cfg_aliases", + "cgl", + "cocoa", + "core-foundation", + "core-graphics", + "euclid", + "gl_generator 0.14.0", + "io-surface", + "lazy_static", + "libc", + "log", + "mach", + "metal", + "objc", + "raw-window-handle", + "servo-display-link", + "wayland-sys 0.30.1", + "winapi", + "winit", + "wio", +] + +[[package]] +name = "svg" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d815ad337e8449d2374d4248448645edfe74e699343dd5719139d93fa87112" + +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "system-configuration" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "system-deps" +version = "6.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30c2de8a4d8f4b823d634affc9cd2a74ec98c53a756f317e529a48046cbf71f3" +dependencies = [ + "cfg-expr 0.15.3", + "heck 0.4.1", + "pkg-config", + "toml 0.7.5", + "version-compare 0.1.1", +] + +[[package]] +name = "system-deps" +version = "7.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "070a0a5e7da2d24be457809c4b3baa57a835fd2829ad8b86f9a049052fe71031" +dependencies = [ + "cfg-expr 0.16.0", + "heck 0.5.0", + "pkg-config", + "toml 0.8.19", + "version-compare 0.2.0", +] + +[[package]] +name = "tar" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tempfile" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tiff" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + +[[package]] +name = "time" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +dependencies = [ + "serde", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + +[[package]] +name = "time-point" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06535c958d6abe68dc4b4ef9e6845f758fc42fe463d0093d0aca40254f03fb14" + +[[package]] +name = "tiny-skia" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8493a203431061e901613751931f047d1971337153f96d0e5e363d6dbf6a67" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "png", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adbfb5d3f3dd57a0e11d12f4f13d4ebbbc1b5c15b7ab0a156d030b21da5f677c" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.39.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio 1.0.2", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-condvar" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7233b09174540ef9bf9fc8326bcad6ccebc631e7c9a1e2e48d956a133056f9d" +dependencies = [ + "tokio", +] + +[[package]] +name = "tokio-macros" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebafdf5ad1220cb59e7d17cf4d2c72015297b75b19a10472f99b89225089240" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.11", +] + +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.20", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.4.7", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow 0.5.35", +] + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.18", +] + +[[package]] +name = "topojson" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed0491c918a501d49a5da86736c9e27666b6f5794fadec0ff8d4842c642b73" +dependencies = [ + "geojson 0.23.0", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "tracker" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff9636d15e370187f6bf55b79ce62ebf4221998bc0ba1774d7fa208b007f6bf8" +dependencies = [ + "tracker-macros", +] + +[[package]] +name = "tracker-macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca029746fbe0efda3298205de77bf759d7fef23ac97902641e0b49a623b0455f" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tstr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cca3264971090dec0feef3b455a3c178f02762f7550cf4592991ac64b3be2d7e" +dependencies = [ + "tstr_proc_macros", +] + +[[package]] +name = "tstr_proc_macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78122066b0cb818b8afd08f7ed22f7fdbc3e90815035726f0840d0d26c0747a" + +[[package]] +name = "ttf-parser" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "375812fa44dab6df41c195cd2f7fecb488f6c09fbaafb62807488cefab642bff" + +[[package]] +name = "ttf-parser" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" + +[[package]] +name = "typed-arena" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-bidi-mirroring" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86" + +[[package]] +name = "unicode-ccc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" + +[[package]] +name = "unicode-ident" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" + +[[package]] +name = "unicode-script" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d817255e1bed6dfd4ca47258685d14d2bdcfbc64fdc9e3819bd5848057b8ecc" + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version-compare" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" + +[[package]] +name = "version-compare" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote 1.0.35", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "wayland-client" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715" +dependencies = [ + "bitflags 1.3.2", + "downcast-rs", + "libc", + "nix 0.24.3", + "scoped-tls", + "wayland-commons", + "wayland-scanner", + "wayland-sys 0.29.5", +] + +[[package]] +name = "wayland-commons" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8691f134d584a33a6606d9d717b95c4fa20065605f798a3f350d78dced02a902" +dependencies = [ + "nix 0.24.3", + "once_cell", + "smallvec", + "wayland-sys 0.29.5", +] + +[[package]] +name = "wayland-cursor" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" +dependencies = [ + "nix 0.24.3", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6" +dependencies = [ + "bitflags 1.3.2", + "wayland-client", + "wayland-commons", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f4303d8fa22ab852f789e75a967f0a2cdc430a607751c0499bada3e451cbd53" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "xml-rs 0.8.19", +] + +[[package]] +name = "wayland-sys" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be12ce1a3c39ec7dba25594b97b42cb3195d54953ddb9d3d95a7c3902bc6e9d4" +dependencies = [ + "dlib", + "lazy_static", + "pkg-config", +] + +[[package]] +name = "wayland-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b2a02ac608e07132978689a6f9bf4214949c85998c247abadd4f4129b1aa06" +dependencies = [ + "dlib", + "lazy_static", + "log", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "weezl" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" + +[[package]] +name = "which" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +dependencies = [ + "either", + "libc", + "once_cell", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.1", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winit" +version = "0.28.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9596d90b45384f5281384ab204224876e8e8bf7d58366d9b795ad99aa9894b94" +dependencies = [ + "android-activity", + "bitflags 1.3.2", + "cfg_aliases", + "core-foundation", + "core-graphics", + "dispatch", + "instant", + "libc", + "log", + "mio 0.8.11", + "ndk", + "objc2", + "once_cell", + "orbclient", + "percent-encoding", + "raw-window-handle", + "redox_syscall 0.3.5", + "sctk-adwaita", + "smithay-client-toolkit", + "wasm-bindgen", + "wayland-client", + "wayland-commons", + "wayland-protocols", + "wayland-scanner", + "web-sys", + "windows-sys 0.45.0", + "x11-dl", +] + +[[package]] +name = "winnow" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.5.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wio" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" +dependencies = [ + "winapi", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "xattr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +dependencies = [ + "libc", +] + +[[package]] +name = "xcursor" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" + +[[package]] +name = "xml-rs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c1cb601d29fe2c2ac60a2b2e5e293994d87a1f6fa9687a31a15270f909be9c2" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "xml-rs" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" + +[[package]] +name = "yeslogic-fontconfig-sys" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2bbd69036d397ebbff671b1b8e4d918610c181c5a16073b96f984a38d08c386" +dependencies = [ + "const-cstr", + "dlib", + "once_cell", + "pkg-config", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 2.0.75", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2", + "sha1", + "time", + "zstd", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.8+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[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 = "zvariant" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c1b3ca6db667bfada0f1ebfc94b2b1759ba25472ee5373d4551bb892616389a" +dependencies = [ + "endi", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7a4b236063316163b69039f77ce3117accb41a09567fd24c168e43491e521bc" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00bedb16a193cc12451873fee2a1bc6550225acece0e36f333e68326c73c8172" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.35", + "syn 1.0.109", +] diff --git a/radar-g/Cargo.toml b/radar-g/Cargo.toml new file mode 100644 index 0000000..1315764 --- /dev/null +++ b/radar-g/Cargo.toml @@ -0,0 +1,95 @@ +[package] +name = "cinrad_g" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + + +[dependencies] +cairo-rs = { version = "0.17.0" } +gtk = { version = "0.9", package = "gtk4", features = ["v4_14"] } +geo-types = "0.7.9" +shapefile = { version = "0.4", features = ["geo-types"] } +thiserror = "1.0.40" +num-traits = "0.2.15" +npyz = { version = "0.8.0", features = ["npz"] } +ndarray = { version = "0.15.6", features = ["rayon"] } +quadtree_rs = "0.1.2" +proj-sys = "0.23.1" +glib-macros = "0.19.2" +svg = "0.13.1" +libloading = "0.8.3" +glue = "0.8.7" +epoxy = "0.1.0" +femtovg = "0.9.0" +glow = "0.13.1" +proj = "0.27.2" +image = "0.24.7" +anyhow = "1.0.72" +relm4 = { version = "0.9", features = ["libadwaita"] } +relm4-components = "0.9" +rstar = "*" +geo = "0.26.0" +topojson = "0.5.1" +geojson = "0.24.1" +# plotters = "0.3.5" +core_extensions = { version = "1.5.2", default_features = false, features = [ + "std", +] } +# plotters-backend = "0.3.5" +tokio = { version = "1.36.0", features = ["full"] } +async-trait = "0.1.77" +lazy_static = "1.4.0" +once_cell = "1.19.0" +relm4-icons = { version = "0.9" } +surfman = "0.8.1" +euclid = "0.22.9" +gl = "0.14.0" +crossbeam = "0.8.4" +chrono = "0.4.32" +tracker = "0.2.1" +abi_stable = "0.11.3" +serde = "1.0.196" +serde_json = "1.0.112" +flate2 = "1.0.28" +toml = "0.8.8" +dirs = "5.0.1" +regex = "1.10.3" +smallvec = "1.13.1" +rayon = "1.8.1" +futures = "0.3.30" +sorted-vec = "0.8.3" +tracing = "0.1.40" +tracing-subscriber = "0.3.18" +indexmap = "2.2.2" +tokio-condvar = "0.1.0" +imgref = "1.10.1" +rgb = "0.8.37" +slippy-map-tiles = "0.16.0" +reqwest = "0.11.25" +url = "2.5.0" +quick_cache = "0.4.1" +fns = "0.0.7" +enum_dispatch = "0.3.12" + + +[build-dependencies] +glib-build-tools = "0.17.0" + +[dependencies.geo-macros] +path = "../geo-macros" + +[dependencies.radarg_plugin_interface] +path = "../radarg_plugin_interface" + +[dependencies.gi] +path = "../gi" + +#[dependencies.etws_loader] +#path = "etws_loader" + +[dependencies.adw] +package = "libadwaita" +version = "0.7.0" +features = ["v1_4"] diff --git a/build.rs b/radar-g/build.rs similarity index 100% rename from build.rs rename to radar-g/build.rs diff --git a/config.toml b/radar-g/config.toml similarity index 100% rename from config.toml rename to radar-g/config.toml diff --git a/data/css.gresource.xml b/radar-g/data/css.gresource.xml similarity index 100% rename from data/css.gresource.xml rename to radar-g/data/css.gresource.xml diff --git a/data/css/main.css b/radar-g/data/css/main.css similarity index 100% rename from data/css/main.css rename to radar-g/data/css/main.css diff --git a/src/actions.rs b/radar-g/src/actions.rs similarity index 100% rename from src/actions.rs rename to radar-g/src/actions.rs diff --git a/src/assets/Roboto-Bold.ttf b/radar-g/src/assets/Roboto-Bold.ttf similarity index 100% rename from src/assets/Roboto-Bold.ttf rename to radar-g/src/assets/Roboto-Bold.ttf diff --git a/src/assets/Roboto-Light.ttf b/radar-g/src/assets/Roboto-Light.ttf similarity index 100% rename from src/assets/Roboto-Light.ttf rename to radar-g/src/assets/Roboto-Light.ttf diff --git a/src/assets/Roboto-Regular.ttf b/radar-g/src/assets/Roboto-Regular.ttf similarity index 100% rename from src/assets/Roboto-Regular.ttf rename to radar-g/src/assets/Roboto-Regular.ttf diff --git a/src/assets/amiri-regular.ttf b/radar-g/src/assets/amiri-regular.ttf similarity index 100% rename from src/assets/amiri-regular.ttf rename to radar-g/src/assets/amiri-regular.ttf diff --git a/src/assets/entypo.ttf b/radar-g/src/assets/entypo.ttf similarity index 100% rename from src/assets/entypo.ttf rename to radar-g/src/assets/entypo.ttf diff --git a/src/components/app.rs b/radar-g/src/components/app.rs similarity index 99% rename from src/components/app.rs rename to radar-g/src/components/app.rs index ef91b94..c358ee8 100644 --- a/src/components/app.rs +++ b/radar-g/src/components/app.rs @@ -48,6 +48,7 @@ use relm4_components::open_dialog::{ }; use smallvec::SmallVec; use std::marker::PhantomData; +use std::num::NonZeroU32; use std::{ any::Any, borrow::{Borrow, BorrowMut}, @@ -339,6 +340,7 @@ impl Component for AppModel { }; group.add_action(action); group.register_for_widget(&widgets.main_window); + ComponentParts { model, widgets } } diff --git a/src/components/control_panel/control_panel.rs b/radar-g/src/components/control_panel/control_panel.rs similarity index 100% rename from src/components/control_panel/control_panel.rs rename to radar-g/src/components/control_panel/control_panel.rs diff --git a/src/components/control_panel/messages.rs b/radar-g/src/components/control_panel/messages.rs similarity index 100% rename from src/components/control_panel/messages.rs rename to radar-g/src/components/control_panel/messages.rs diff --git a/src/components/control_panel/mod.rs b/radar-g/src/components/control_panel/mod.rs similarity index 100% rename from src/components/control_panel/mod.rs rename to radar-g/src/components/control_panel/mod.rs diff --git a/src/components/control_panel/thumbnail.rs b/radar-g/src/components/control_panel/thumbnail.rs similarity index 100% rename from src/components/control_panel/thumbnail.rs rename to radar-g/src/components/control_panel/thumbnail.rs diff --git a/src/components/mod.rs b/radar-g/src/components/mod.rs similarity index 100% rename from src/components/mod.rs rename to radar-g/src/components/mod.rs diff --git a/src/components/monitor/messages.rs b/radar-g/src/components/monitor/messages.rs similarity index 100% rename from src/components/monitor/messages.rs rename to radar-g/src/components/monitor/messages.rs diff --git a/src/components/monitor/mod.rs b/radar-g/src/components/monitor/mod.rs similarity index 100% rename from src/components/monitor/mod.rs rename to radar-g/src/components/monitor/mod.rs diff --git a/src/components/monitor/monitor.rs b/radar-g/src/components/monitor/monitor.rs similarity index 72% rename from src/components/monitor/monitor.rs rename to radar-g/src/components/monitor/monitor.rs index 03de90e..d044666 100644 --- a/src/components/monitor/monitor.rs +++ b/radar-g/src/components/monitor/monitor.rs @@ -27,6 +27,7 @@ use crate::utils::estimate_zoom_level; use adw::prelude::*; use femtovg::ImageId; use fns::debounce; +use gi::ui::typ::MainLoadAttach; use relm4::{component::Component, *}; use slippy_map_tiles::Tile; use tokio::task; @@ -45,6 +46,8 @@ pub struct MonitorModel { sidebar_width: i32, zoom: u8, #[do_not_track] + mainload: MainLoadAttach, + #[do_not_track] last_call: Rc>, #[do_not_track] map_tile_getter: Rc, @@ -78,9 +81,9 @@ impl Component for MonitorModel { set_child = &Render{ #[track = "model.changed(MonitorModel::render_cfg())"] set_cfg: model.render_cfg, - #[track = "model.changed(MonitorModel::render_range())"] - set_view: model.render_range, - set_tiles: model.map_tile_getter.clone(), + // #[track = "model.changed(MonitorModel::render_range())"] + // set_view: model.render_range, + // set_tiles: model.map_tile_getter.clone(), connect_render_status_notify[sender] => move |r| { sender.output(MonitorOutputMsg::LayerRenderFinished); }, @@ -89,14 +92,14 @@ impl Component for MonitorModel { }, connect_scale_notify[sender] => move |r| { let scale = r.scale(); - { - let initial = r.scale_rate(); - let mut rate_start = initial_rate.lock().unwrap(); - if rate_start.is_none() { - *rate_start = Some(scale); - } - } - debouncer.call(scale); + // { + // let initial = r.scale_rate(); + // let mut rate_start = initial_rate.lock().unwrap(); + // if rate_start.is_none() { + // *rate_start = Some(scale); + // } + // } + // debouncer.call(scale); }, set_interior_layers: model.layers.clone(), }, @@ -126,34 +129,14 @@ impl Component for MonitorModel { MonitorInputMsg::RefreshRender => { widgets.renderer.queue_render(); } - MonitorInputMsg::SetRenderRange(lon_start, lon_end, lat_start, lat_end) => { - let current_rate = widgets.renderer.scale_rate(); - self.set_render_range((lat_start, lat_end, lon_start, lon_end)); - let new_rate = widgets.renderer.scale_rate(); - let zoom: f64 = (new_rate / current_rate).log2(); - sender.input(MonitorInputMsg::ChangeZoom(zoom)); - } - MonitorInputMsg::RefreshTiles => { - let ((x1, x2), (y1, y2)) = widgets.renderer.render_range(); - self.load_tile(&sender, ((y1 as f32, y2 as f32), (x1 as f32, x2 as f32))); - } + MonitorInputMsg::SetRenderRange(lon_start, lon_end, lat_start, lat_end) => {} + MonitorInputMsg::RefreshTiles => {} MonitorInputMsg::AddWidget(widget) => match widget.widget_type() { - WidgetType::Cairo => { - let frame = WidgetFrame::new(); - frame.set_widget(widget); - self.widgets.push(frame); - } + WidgetType::Cairo => {} WidgetType::OpenGl => {} _ => {} }, - MonitorInputMsg::ChangeZoom(zoom) => { - let new_zoom = (self.zoom as f64 + zoom).clamp(0.0, 19.0).round() as u8; - if self.zoom != new_zoom { - self.zoom = new_zoom; - self.map_tile_getter.set_zoom(new_zoom); - sender.input(MonitorInputMsg::RefreshTiles); - } - } + MonitorInputMsg::ChangeZoom(zoom) => {} MonitorInputMsg::RemoveWidget => {} MonitorInputMsg::None => {} _ => {} @@ -167,24 +150,15 @@ impl Component for MonitorModel { root: Self::Root, sender: ComponentSender, ) -> ComponentParts { - // let sidebar_sender = sender.clone(); - // let sidebar: Controller = SideBarModel::builder() - // .launch(init.clone()) - // .forward(sender.input_sender(), move |msg| match msg { - // SideBarOutputMsg::SwitchToTimeSeries(layer) => { - // sidebar_sender.output(MonitorOutputMsg::LayerSwitchToTime(layer)); - // MonitorInputMsg::None - // } - // _ => MonitorInputMsg::None, - // }); - let render_cfg = RenderConfig { padding: [0.0, 0.0, 0.0, 0.0], }; let new_sender = sender.clone(); + let mainload = MainLoadAttach::new(None); let mut model = MonitorModel { + mainload, render_range: (4.0, 53.3, 73.3, 135.0), new_layer: 0, widgets: vec![], diff --git a/src/components/monitor/widget/mod.rs b/radar-g/src/components/monitor/widget/mod.rs similarity index 100% rename from src/components/monitor/widget/mod.rs rename to radar-g/src/components/monitor/widget/mod.rs diff --git a/src/components/monitor/widget/widget.rs b/radar-g/src/components/monitor/widget/widget.rs similarity index 100% rename from src/components/monitor/widget/widget.rs rename to radar-g/src/components/monitor/widget/widget.rs diff --git a/src/components/setting/dispatcher_list.rs b/radar-g/src/components/setting/dispatcher_list.rs similarity index 100% rename from src/components/setting/dispatcher_list.rs rename to radar-g/src/components/setting/dispatcher_list.rs diff --git a/src/components/setting/messages.rs b/radar-g/src/components/setting/messages.rs similarity index 100% rename from src/components/setting/messages.rs rename to radar-g/src/components/setting/messages.rs diff --git a/src/components/setting/mod.rs b/radar-g/src/components/setting/mod.rs similarity index 100% rename from src/components/setting/mod.rs rename to radar-g/src/components/setting/mod.rs diff --git a/src/components/setting/setting.rs b/radar-g/src/components/setting/setting.rs similarity index 100% rename from src/components/setting/setting.rs rename to radar-g/src/components/setting/setting.rs diff --git a/src/components/sidebar/bottom_bar.rs b/radar-g/src/components/sidebar/bottom_bar.rs similarity index 100% rename from src/components/sidebar/bottom_bar.rs rename to radar-g/src/components/sidebar/bottom_bar.rs diff --git a/src/components/sidebar/meta_data_list.rs b/radar-g/src/components/sidebar/meta_data_list.rs similarity index 100% rename from src/components/sidebar/meta_data_list.rs rename to radar-g/src/components/sidebar/meta_data_list.rs diff --git a/src/components/sidebar/mod.rs b/radar-g/src/components/sidebar/mod.rs similarity index 100% rename from src/components/sidebar/mod.rs rename to radar-g/src/components/sidebar/mod.rs diff --git a/src/components/sidebar/sidebar.rs b/radar-g/src/components/sidebar/sidebar.rs similarity index 98% rename from src/components/sidebar/sidebar.rs rename to radar-g/src/components/sidebar/sidebar.rs index 202de06..d6c43e1 100644 --- a/src/components/sidebar/sidebar.rs +++ b/radar-g/src/components/sidebar/sidebar.rs @@ -20,7 +20,7 @@ use relm4::{ use std::{cell::RefCell, collections::HashMap, rc::Rc}; use crate::components::app::AppMsg; -use crate::{chart::Chart, predefined::color_mapper::BoundaryNorm, widgets::render::Layer}; +use crate::{predefined::color_mapper::BoundaryNorm, widgets::render::Layer}; use super::{ bottom_bar::BottomBarModel, @@ -117,7 +117,7 @@ impl SimpleComponent for SideBarModel { }, bottom_panel.append_page(&layer_page, Some(>k::Label::new(Some("Layers")))), meta_panel.append_page(meta_view, Some(>k::Label::new(Some("Meta")))), - meta_panel.append_page(&Chart::new(), Some(>k::Label::new(Some("Chart")))), + // meta_panel.append_page(&Chart::new(), Some(>k::Label::new(Some("Chart")))), #[local_ref] info_c -> gtk::ColumnViewColumn{ set_expand: true diff --git a/src/config.rs b/radar-g/src/config.rs similarity index 100% rename from src/config.rs rename to radar-g/src/config.rs diff --git a/src/coords/cms.rs b/radar-g/src/coords/cms.rs similarity index 100% rename from src/coords/cms.rs rename to radar-g/src/coords/cms.rs diff --git a/src/coords/mapper.rs b/radar-g/src/coords/mapper.rs similarity index 100% rename from src/coords/mapper.rs rename to radar-g/src/coords/mapper.rs diff --git a/src/coords/mod.rs b/radar-g/src/coords/mod.rs similarity index 100% rename from src/coords/mod.rs rename to radar-g/src/coords/mod.rs diff --git a/src/coords/proj/mercator.rs b/radar-g/src/coords/proj/mercator.rs similarity index 100% rename from src/coords/proj/mercator.rs rename to radar-g/src/coords/proj/mercator.rs diff --git a/src/coords/proj/mod.rs b/radar-g/src/coords/proj/mod.rs similarity index 100% rename from src/coords/proj/mod.rs rename to radar-g/src/coords/proj/mod.rs diff --git a/src/coords/wgs84.rs b/radar-g/src/coords/wgs84.rs similarity index 100% rename from src/coords/wgs84.rs rename to radar-g/src/coords/wgs84.rs diff --git a/src/data/meta.rs b/radar-g/src/data/meta.rs similarity index 100% rename from src/data/meta.rs rename to radar-g/src/data/meta.rs diff --git a/src/data/mod.rs b/radar-g/src/data/mod.rs similarity index 100% rename from src/data/mod.rs rename to radar-g/src/data/mod.rs diff --git a/src/data_utils.rs b/radar-g/src/data_utils.rs similarity index 100% rename from src/data_utils.rs rename to radar-g/src/data_utils.rs diff --git a/src/errors.rs b/radar-g/src/errors.rs similarity index 100% rename from src/errors.rs rename to radar-g/src/errors.rs diff --git a/src/main.rs b/radar-g/src/main.rs similarity index 98% rename from src/main.rs rename to radar-g/src/main.rs index 805834d..382a61e 100644 --- a/src/main.rs +++ b/radar-g/src/main.rs @@ -12,7 +12,6 @@ use std::sync::RwLock; use std::{ptr, sync::Mutex}; use tokio::runtime::Runtime; mod actions; -mod chart; mod components; mod config; mod coords; @@ -28,12 +27,13 @@ use surfman::declare_surfman; use tracing::info; use tracing_subscriber; +use gi::{App as GI, Helper, GL}; + mod data_utils; mod map_tile; mod map_tile_utils; mod predefined; mod widgets; -// mod element_imp; declare_surfman!(); @@ -68,13 +68,15 @@ fn main() { }); } + // gi.prepare(); + let app = adw::Application::builder().application_id(APP_ID).build(); let relm: RelmApp = relm4::RelmApp::from_app(app.clone()); relm4_icons::initialize_icons(); info!("Init plugin system"); let pluginmanager = PluginManager::new(); - initialize_custom_css(); + initialize_custom_css(); relm.run::(()); } diff --git a/src/map_tile.rs b/radar-g/src/map_tile.rs similarity index 100% rename from src/map_tile.rs rename to radar-g/src/map_tile.rs diff --git a/src/map_tile_utils.rs b/radar-g/src/map_tile_utils.rs similarity index 100% rename from src/map_tile_utils.rs rename to radar-g/src/map_tile_utils.rs diff --git a/src/pipeline/dispatcher.rs b/radar-g/src/pipeline/dispatcher.rs similarity index 100% rename from src/pipeline/dispatcher.rs rename to radar-g/src/pipeline/dispatcher.rs diff --git a/src/pipeline/element.rs b/radar-g/src/pipeline/element.rs similarity index 95% rename from src/pipeline/element.rs rename to radar-g/src/pipeline/element.rs index 9ace5ad..4ad2b85 100644 --- a/src/pipeline/element.rs +++ b/radar-g/src/pipeline/element.rs @@ -279,7 +279,11 @@ pub struct RenderResult { impl RenderResult { pub fn new(target: DataTarget, meta_info: MetaInfo, unique_key: Option) -> Self { - Self { target, meta_info,unique_key } + Self { + target, + meta_info, + unique_key, + } } pub fn get_meta_info(&self) -> MetaInfo { self.meta_info.clone() @@ -288,7 +292,7 @@ impl RenderResult { &mut self.target.target } - pub fn get_key(&self) -> Option<&String>{ + pub fn get_key(&self) -> Option<&String> { self.unique_key.as_ref() } } @@ -385,14 +389,14 @@ impl Element { if let Some(current) = self.current_target.as_ref() { let mut img = current.write().unwrap(); let mut img = img.get_mut_target(); - render.draw_img(img); + // render.draw_img(img); } else { _init(self, need_cache, output_type, render); if let ElementOutput::Target = output_type { let mut _img = self.current_target.as_ref().unwrap(); let mut img = _img.write().unwrap(); let mut img = img.get_mut_target(); - render.draw_img(img); + // render.draw_img(img); } } } @@ -435,19 +439,16 @@ impl Element { let mut runner = Runner::new(imp, config, context); let (target, unique_key) = runner.run(&data); let meta = data.meta.clone().into(); - Some(RenderResult::new(DataTarget::new(Some(data), target), meta, unique_key)) + Some(RenderResult::new( + DataTarget::new(Some(data), target), + meta, + unique_key, + )) }); RUNTIME.block_on(handle).ok().flatten() } - _ => { - let mut canvas = render.get_canvas(); - let mut canvas = canvas.as_mut().unwrap(); - let mut context = Context::new(self.cms.clone(), &mut canvas); - let mut runner = Runner::new(self.imp, self.config.clone(), context); - runner.run_without_target(&data); - None - } + _ => None, } } diff --git a/src/pipeline/element_imp.rs b/radar-g/src/pipeline/element_imp.rs similarity index 100% rename from src/pipeline/element_imp.rs rename to radar-g/src/pipeline/element_imp.rs diff --git a/src/pipeline/mod.rs b/radar-g/src/pipeline/mod.rs similarity index 100% rename from src/pipeline/mod.rs rename to radar-g/src/pipeline/mod.rs diff --git a/src/pipeline/offscreen_renderer.rs b/radar-g/src/pipeline/offscreen_renderer.rs similarity index 90% rename from src/pipeline/offscreen_renderer.rs rename to radar-g/src/pipeline/offscreen_renderer.rs index 9fef50e..6438744 100644 --- a/src/pipeline/offscreen_renderer.rs +++ b/radar-g/src/pipeline/offscreen_renderer.rs @@ -19,8 +19,8 @@ use super::Target; pub struct OffscreenRenderer { context: Arc>, device: Device, - fbo: NonZeroU32, - glow_ctx: Option, + // fbo: NonZeroU32, + // glow_ctx: Option, size: (i32, i32), // canvas: Arc>, } @@ -58,21 +58,20 @@ impl OffscreenRenderer { .expect("Failed to bind surface to context"); device.make_context_current(&context).unwrap(); + // let surface_info = device.context_surface_info(&context).unwrap().unwrap(); + // gl::load_with(|symbol_name| device.get_proc_address(&context, symbol_name)); - let surface_info = device.context_surface_info(&context).unwrap().unwrap(); - gl::load_with(|symbol_name| device.get_proc_address(&context, symbol_name)); - - unsafe { - gl::BindFramebuffer(gl::FRAMEBUFFER, surface_info.framebuffer_object); - gl::Viewport(0, 0, width, height); - debug_assert_eq!(gl::GetError(), gl::NO_ERROR); - } + // unsafe { + // gl::BindFramebuffer(gl::FRAMEBUFFER, surface_info.framebuffer_object); + // gl::Viewport(0, 0, width, height); + // debug_assert_eq!(gl::GetError(), gl::NO_ERROR); + // } Ok(Self { context: Arc::new(RwLock::new(context)), device, - fbo: NonZeroU32::new(surface_info.framebuffer_object).unwrap(), - glow_ctx: None, + // fbo: NonZeroU32::new(surface_info.framebuffer_object).unwrap(), + // glow_ctx: None, size: (width, height), }) } diff --git a/src/pipeline/predefined/grid_field_renderer.rs b/radar-g/src/pipeline/predefined/grid_field_renderer.rs similarity index 100% rename from src/pipeline/predefined/grid_field_renderer.rs rename to radar-g/src/pipeline/predefined/grid_field_renderer.rs diff --git a/src/pipeline/predefined/mod.rs b/radar-g/src/pipeline/predefined/mod.rs similarity index 100% rename from src/pipeline/predefined/mod.rs rename to radar-g/src/pipeline/predefined/mod.rs diff --git a/src/pipeline/renders.rs b/radar-g/src/pipeline/renders.rs similarity index 100% rename from src/pipeline/renders.rs rename to radar-g/src/pipeline/renders.rs diff --git a/src/pipeline/runner.rs b/radar-g/src/pipeline/runner.rs similarity index 100% rename from src/pipeline/runner.rs rename to radar-g/src/pipeline/runner.rs diff --git a/src/pipeline/utils.rs b/radar-g/src/pipeline/utils.rs similarity index 100% rename from src/pipeline/utils.rs rename to radar-g/src/pipeline/utils.rs diff --git a/src/plugin_system/mod.rs b/radar-g/src/plugin_system/mod.rs similarity index 100% rename from src/plugin_system/mod.rs rename to radar-g/src/plugin_system/mod.rs diff --git a/src/plugin_system/utils.rs b/radar-g/src/plugin_system/utils.rs similarity index 100% rename from src/plugin_system/utils.rs rename to radar-g/src/plugin_system/utils.rs diff --git a/src/predefined/color_mapper.rs b/radar-g/src/predefined/color_mapper.rs similarity index 100% rename from src/predefined/color_mapper.rs rename to radar-g/src/predefined/color_mapper.rs diff --git a/src/predefined/map_tile.rs b/radar-g/src/predefined/map_tile.rs similarity index 100% rename from src/predefined/map_tile.rs rename to radar-g/src/predefined/map_tile.rs diff --git a/src/predefined/mod.rs b/radar-g/src/predefined/mod.rs similarity index 100% rename from src/predefined/mod.rs rename to radar-g/src/predefined/mod.rs diff --git a/src/predefined/widgets.rs b/radar-g/src/predefined/widgets.rs similarity index 100% rename from src/predefined/widgets.rs rename to radar-g/src/predefined/widgets.rs diff --git a/src/resources/Roboto-Bold.ttf b/radar-g/src/resources/Roboto-Bold.ttf similarity index 100% rename from src/resources/Roboto-Bold.ttf rename to radar-g/src/resources/Roboto-Bold.ttf diff --git a/src/resources/Roboto-Light.ttf b/radar-g/src/resources/Roboto-Light.ttf similarity index 100% rename from src/resources/Roboto-Light.ttf rename to radar-g/src/resources/Roboto-Light.ttf diff --git a/src/resources/Roboto-Regular.ttf b/radar-g/src/resources/Roboto-Regular.ttf similarity index 100% rename from src/resources/Roboto-Regular.ttf rename to radar-g/src/resources/Roboto-Regular.ttf diff --git a/src/resources/amiri-regular.ttf b/radar-g/src/resources/amiri-regular.ttf similarity index 100% rename from src/resources/amiri-regular.ttf rename to radar-g/src/resources/amiri-regular.ttf diff --git a/src/resources/entypo.ttf b/radar-g/src/resources/entypo.ttf similarity index 100% rename from src/resources/entypo.ttf rename to radar-g/src/resources/entypo.ttf diff --git a/src/resources/resources.gresource.xml b/radar-g/src/resources/resources.gresource.xml similarity index 100% rename from src/resources/resources.gresource.xml rename to radar-g/src/resources/resources.gresource.xml diff --git a/src/utils.rs b/radar-g/src/utils.rs similarity index 100% rename from src/utils.rs rename to radar-g/src/utils.rs diff --git a/radar-g/src/widgets/dynamic_col/custom_layout/imp.rs b/radar-g/src/widgets/dynamic_col/custom_layout/imp.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/radar-g/src/widgets/dynamic_col/custom_layout/imp.rs @@ -0,0 +1 @@ + diff --git a/src/widgets/dynamic_col/custom_layout/mod.rs b/radar-g/src/widgets/dynamic_col/custom_layout/mod.rs similarity index 100% rename from src/widgets/dynamic_col/custom_layout/mod.rs rename to radar-g/src/widgets/dynamic_col/custom_layout/mod.rs diff --git a/src/widgets/dynamic_col/imp.rs b/radar-g/src/widgets/dynamic_col/imp.rs similarity index 100% rename from src/widgets/dynamic_col/imp.rs rename to radar-g/src/widgets/dynamic_col/imp.rs diff --git a/src/widgets/dynamic_col/mod.rs b/radar-g/src/widgets/dynamic_col/mod.rs similarity index 100% rename from src/widgets/dynamic_col/mod.rs rename to radar-g/src/widgets/dynamic_col/mod.rs diff --git a/src/widgets/mod.rs b/radar-g/src/widgets/mod.rs similarity index 100% rename from src/widgets/mod.rs rename to radar-g/src/widgets/mod.rs diff --git a/src/widgets/render/cms.rs b/radar-g/src/widgets/render/cms.rs similarity index 100% rename from src/widgets/render/cms.rs rename to radar-g/src/widgets/render/cms.rs diff --git a/src/widgets/render/exterior/imp.rs b/radar-g/src/widgets/render/exterior/imp.rs similarity index 100% rename from src/widgets/render/exterior/imp.rs rename to radar-g/src/widgets/render/exterior/imp.rs diff --git a/radar-g/src/widgets/render/exterior/mod.rs b/radar-g/src/widgets/render/exterior/mod.rs new file mode 100644 index 0000000..7f0b5d5 --- /dev/null +++ b/radar-g/src/widgets/render/exterior/mod.rs @@ -0,0 +1,93 @@ +mod imp; +use super::super::Render; +use crate::coords::Range; +use femtovg::{renderer::OpenGl, Canvas, Color, Paint, Path}; +use gtk::glib; +use gtk::prelude::*; +use gtk::subclass::prelude::ObjectSubclassIsExt; + +glib::wrapper! { + pub struct ExteriorWidget(ObjectSubclass); +} + +impl Default for ExteriorWidget { + fn default() -> Self { + Self::new() + } +} + +impl ExteriorWidget { + pub fn new() -> Self { + let this: Self = glib::Object::new(); + this + } + + pub fn draw(&self, canvas: &mut Canvas, render: &Render) { + let padding = render.imp().config.borrow().padding; + let (w, h) = render.window_size(); + let (w, h) = (w as f32, h as f32); + let origins = [ + (0.0, 0.0), + (w - padding[1], 0.0), + (0.0, h - padding[2]), + (0.0, 0.0), + ]; + let whs = [ + (w, padding[0]), + (padding[1], h), + (w, padding[2]), + (padding[3], h), + ]; + + let painter = Paint::color(Color::rgb(0, 0, 0)); + + for edge in 0..4 { + let mut path = Path::new(); + let (ox, oy) = origins[edge]; + let (w, h) = whs[edge]; + path.rect(ox, oy, w, h); + canvas.fill_path(&path, &painter); + } + + // let (lon_range, lat_range) = render.render_range(); + // let (lon_range, lat_range): (Range, Range) = (lon_range.into(), lat_range.into()); + + // let lon_keypoints = lon_range.key_points(10); + // let lat_keypoints = lat_range.key_points(5); + // let mut paint = Paint::color(Color::white()); // 黑色字体 + // let dpi = render.scale_factor(); + // paint.set_font_size((dpi * 12) as f32); + + // for lon in lon_keypoints.iter() { + // let (x, _) = render.map((*lon, lat_range.0)).unwrap(); + + // let text = format!("{:.2}", lon); + // let metrics = canvas + // .measure_text(x, 0.0, text.as_str(), &paint) + // .expect("Cannot measure text"); + + // let text_x = x - metrics.width() / 2.0; + // let text_y = h - metrics.height() / 2.0; + + // canvas + // .fill_text(text_x, text_y, text.as_str(), &paint) + // .expect("Cannot draw text"); + // } + + // for lat in lat_keypoints.iter() { + // let (_, y) = render.map((lon_range.0, *lat)).unwrap(); + + // let text = format!("{:.2}", lat); + // let metrics = canvas + // .measure_text(0.0, y, text.as_str(), &paint) + // .expect("Cannot measure text"); + + // let text_x = 0.0; + // let text_y = y - metrics.height() / 2.0; + + // canvas + // .fill_text(text_x, text_y, text.as_str(), &paint) + // .expect("Cannot draw text"); + // } + } +} diff --git a/src/widgets/render/imp.rs b/radar-g/src/widgets/render/imp.rs similarity index 52% rename from src/widgets/render/imp.rs rename to radar-g/src/widgets/render/imp.rs index da400dd..58bc56d 100644 --- a/src/widgets/render/imp.rs +++ b/radar-g/src/widgets/render/imp.rs @@ -6,6 +6,7 @@ use crate::coords::Mapper; use crate::map_tile::MapTile; use crate::pipeline::element::{Target, TargetType}; use femtovg::{Canvas, Color, FontId, Paint, Renderer}; +use gi::{App as GI, Helper, GL}; use glow::HasContext; use gtk::glib::{self, prelude::*, Properties}; use gtk::prelude::*; @@ -60,8 +61,9 @@ pub struct Render { scale: Cell, pub(super) exterior: RefCell, pub(super) interior: RefCell, - pub(super) canvas: RefCell>>, - pub(super) glow_context: RefCell>, + // pub(super) canvas: RefCell>>, + pub(super) gi: RefCell>, + // pub(super) glow_context: RefCell>, pub(super) tiles: RefCell>>, pub config: RefCell, pub status: RefCell, @@ -77,13 +79,14 @@ impl Default for Render { render_status: Cell::new(0), exterior: RefCell::new(ExteriorWidget::default()), interior: RefCell::new(InteriorWidget::default()), - glow_context: RefCell::new(None), + // glow_context: RefCell::new(None), interior_layers: RefCell::new(Rc::new(RefCell::new(Vec::new()))), config: RefCell::new(RenderConfig::default()), status: RefCell::new(RenderStatus::default()), tiles: RefCell::new(None), mapper: RefCell::new(Mercator::default().into()), - canvas: RefCell::new(None), + // canvas: RefCell::new(None), + gi: RefCell::new(None), } } } @@ -121,7 +124,8 @@ impl WidgetImpl for Render { } fn unrealize(&self) { self.obj().make_current(); - self.canvas.replace(None); + self.gi.borrow_mut().as_mut().unwrap().destroy(); + info!("Destroying canvas - GI"); self.parent_unrealize(); } } @@ -132,24 +136,11 @@ impl GLAreaImpl for Render { let mut status = self.status.borrow_mut(); status.window_size = Some((width, height)); } - self.ensure_canvas(); - let mut canvas = self.canvas.borrow_mut(); - let canvas = canvas.as_mut().unwrap(); - canvas.set_size( - width as u32, - height as u32, - self.obj().scale_factor() as f32, - ); let scale_rate = self.status.borrow_mut().scale_rate; if let Some(scale) = scale_rate { let ((x1, x2), (y1, y2)) = self.view_range().unwrap(); - // let (x1, y1) = self.map((x1, y1)).unwrap(); - // let (x2, y2) = self.map((x2, y2)).unwrap(); - // let scale = ((y2 - y1) / height as f32).min((x2 - x1) / width as f32) as f64; - // let mut status = self.status.borrow_mut(); - // status.scale_rate = Some(scale); } else { let mut status = self.status.borrow_mut(); let ((y1, y2), (x1, x2)) = status.init_lat_lon; @@ -163,86 +154,31 @@ impl GLAreaImpl for Render { fn render(&self, context: >k::gdk::GLContext) -> glib::Propagation { self.ensure_canvas(); - - { - let mut canvas = self.canvas.borrow_mut(); - let canvas = canvas.as_mut().unwrap(); - let dpi = self.obj().scale_factor(); - let w = canvas.width(); - let h = canvas.height(); - canvas.clear_rect( - 0, - 0, - (w as i32 * dpi) as u32, - (h as i32 * dpi) as u32, - Color::rgba(0, 0, 0, 255), - ); - }; - - let binding = self.tiles.borrow(); - if let Some(tiles) = binding.as_ref() { - let ((x1, x2), (y1, y2)) = self.view_range().unwrap(); - let mut tiles = tiles.current_tiles(((y1 as f32, y2 as f32), (x1 as f32, x2 as f32))); - for tile in tiles.iter_mut() { - let mut binding = (*tile).lock().unwrap(); - self.draw_target(&mut *binding); - } - } - - { - let configs = self.config.borrow(); - let c = self.interior_layers.borrow(); - let c = &mut *c.borrow_mut(); - self.interior - .borrow() - .draw(c, &self.obj(), self.status.borrow(), configs); - } - - { - let mut canvas = self.canvas.borrow_mut(); - let canvas = canvas.as_mut().unwrap(); - self.exterior.borrow().draw(canvas, &self.obj()); - canvas.flush(); - } - glib::Propagation::Proceed } } impl Render { fn ensure_canvas(&self) { - use femtovg::{renderer, Canvas}; - use glow::HasContext; + use gi::{App as GI, Helper, GL}; + if self.gi.borrow().is_none() { + info!("Creating canvas"); + let mut gi = unsafe { + static LOAD_FN: fn(&str) -> *const std::ffi::c_void = + |s| epoxy::get_proc_addr(s) as *const _; + use femtovg::renderer::OpenGl; + let ctx = glow::Context::from_loader_function(LOAD_FN); + let gl = GL::new(ctx); - if self.canvas.borrow().is_some() { - return; + let renderer = OpenGl::new_from_function(LOAD_FN).expect("Cannot create renderer"); + let helper = Helper::new(&gl, renderer); + let gi = GI::new(gl, helper).unwrap(); + gi + }; + + gi.prepare(); + self.gi.replace(Some(gi)); } - - let widget = self.obj(); - widget.attach_buffers(); - - static LOAD_FN: fn(&str) -> *const std::ffi::c_void = - |s| epoxy::get_proc_addr(s) as *const _; - // SAFETY: Need to get the framebuffer id that gtk expects us to draw into, so femtovg - // knows which framebuffer to bind. This is safe as long as we call attach_buffers - // beforehand. Also unbind it here just in case, since this can be called outside render. - let (mut renderer, fbo) = unsafe { - let renderer = - renderer::OpenGl::new_from_function(LOAD_FN).expect("Cannot create renderer"); - let ctx = glow::Context::from_loader_function(LOAD_FN); - let id = NonZeroU32::new(ctx.get_parameter_i32(glow::DRAW_FRAMEBUFFER_BINDING) as u32) - .expect("No GTK provided framebuffer binding"); - ctx.bind_framebuffer(glow::FRAMEBUFFER, None); - self.glow_context.replace(Some(ctx)); - (renderer, glow::NativeFramebuffer(id)) - }; - renderer.set_screen_target(Some(fbo)); - let mut canvas = Canvas::new(renderer).expect("Cannot create canvas"); - canvas - .add_font_dir(std::path::Path::new("./src/assets")) - .unwrap(); - - self.canvas.replace(Some(canvas)); } pub(super) fn window_size(&self) -> Option<(i32, i32)> { @@ -302,63 +238,4 @@ impl Render { let (_, h) = self.window_size().unwrap(); (x, h as f32 - y) } - - pub(super) fn set_view(&self, range: (f64, f64, f64, f64)) { - let (lat1, lat2, lon1, lon2) = range; - let mapper = self.mapper.borrow(); - let lb = mapper.map((lon1, lat1)).unwrap(); - let rt = mapper.map((lon2, lat2)).unwrap(); - let mut s = self.status.borrow_mut(); - s.translation = (lb.0, lb.1); - s.init_translation = (lb.0, lb.1); - s.init_lat_lon = ((lat1, lat2), (lon1, lon2)); - - if let Some((w, h)) = s.window_size { - let scale = ((rt.0 - lb.0) / w as f64).min((rt.1 - lb.1) / h as f64); - s.scale_rate = Some(scale); - } else { - s.scale_rate = None; - } - s.view_range = ((lat1, lat2), (lon1, lon2)); - } - - pub(super) fn draw_target(&self, target: &mut Target) { - let mut canvas = self.canvas.borrow_mut(); - let canvas = canvas.as_mut().unwrap(); - - let obj = self.obj(); - - let (ox, oy) = target.origin(&obj); - let (x, y) = target.size(&obj); - - let id = match target.target { - TargetType::ImageId(id) => id, - TargetType::Mem(ref mem) => { - let converted = canvas - .load_image_mem(mem, femtovg::ImageFlags::empty()) - .unwrap(); - target.set_target(TargetType::ImageId(converted)); - converted - } - TargetType::NativeBuffer(ref mem) => { - let gl_bind = self.glow_context.borrow(); - let gl = gl_bind.as_ref().unwrap(); - let flags = femtovg::ImageFlags::empty(); - let texture = target.native_buffer_to_native_texture(gl, flags); - let converted = canvas - .create_image_from_native_texture( - texture, - femtovg::ImageInfo::new(flags, 3000, 3000, femtovg::PixelFormat::Rgba8), - ) - .unwrap(); - target.set_target(TargetType::ImageId(converted)); - converted - } - }; - - let painter = Paint::image(id, ox, oy, x, y, 0.0, 1.0); - let mut path = femtovg::Path::new(); - path.rect(ox, oy, x, y); - canvas.fill_path(&path, &painter); - } } diff --git a/src/widgets/render/interior/imp.rs b/radar-g/src/widgets/render/interior/imp.rs similarity index 100% rename from src/widgets/render/interior/imp.rs rename to radar-g/src/widgets/render/interior/imp.rs diff --git a/src/widgets/render/interior/layers.rs b/radar-g/src/widgets/render/interior/layers.rs similarity index 100% rename from src/widgets/render/interior/layers.rs rename to radar-g/src/widgets/render/interior/layers.rs diff --git a/src/widgets/render/interior/mod.rs b/radar-g/src/widgets/render/interior/mod.rs similarity index 100% rename from src/widgets/render/interior/mod.rs rename to radar-g/src/widgets/render/interior/mod.rs diff --git a/src/widgets/render/mod.rs b/radar-g/src/widgets/render/mod.rs similarity index 73% rename from src/widgets/render/mod.rs rename to radar-g/src/widgets/render/mod.rs index ea88d17..38fee19 100644 --- a/src/widgets/render/mod.rs +++ b/radar-g/src/widgets/render/mod.rs @@ -1,3 +1,5 @@ +use gi::App as GI; +use gtk::glib::{self, clone}; mod cms; mod exterior; mod imp; @@ -14,7 +16,6 @@ use crate::pipeline::{Target, TargetType}; use adw::prelude::{GLAreaExt, GestureDragExt}; use femtovg::ImageFlags; use geo_types::LineString; -use gtk::glib::{self, clone}; use gtk::prelude::*; use gtk::subclass::prelude::ObjectSubclassIsExt; use gtk::EventControllerScrollFlags; @@ -124,12 +125,9 @@ impl Render { f(&mut cfg); } - pub fn get_canvas(&self) -> RefMut<'_, Option>> { - self.imp().canvas.borrow_mut() - } - - pub fn get_context(&self) -> RefMut<'_, Option> { - self.imp().glow_context.borrow_mut() + pub fn get_gi(&self, f: F) { + let mut gi = self.imp().gi.borrow_mut(); + f(&mut gi.as_mut().unwrap()); } pub fn set_cfg(&self, cfg: RenderConfig) { @@ -188,18 +186,6 @@ impl Render { self.imp().window_size().unwrap() } - pub fn create_drawer(&self, range: (f64, f64, f64, f64), window_size: (f32, f32), mut f: F) - where - F: FnMut(&CMS), - { - let (lon1, lon2, lat1, lat2) = range; - let mut mapper = self.get_mapper().clone(); - mapper.set_lat_range(lat1..lat2); - mapper.set_lon_range(lon1..lon2); - let cms = CMS::new(mapper, window_size); - f(&cms); - } - pub fn pointer_loc(&self, transed: bool) -> (f64, f64) { let raw = self.imp().status.borrow().pointer_location.clone(); if transed { @@ -208,62 +194,4 @@ impl Render { (raw.0 as f64, raw.1 as f64) } } - - pub fn render_range(&self) -> ((f64, f64), (f64, f64)) { - self.imp().view_range().unwrap() - } - - pub fn create_cms(&self) -> CMS { - let borrowed_mapper = &*self.imp().mapper.borrow(); - let new_mapper = borrowed_mapper.clone(); - CMS::new(new_mapper, (500.0, 500.0)) - } - - pub fn set_view(&self, range: (f64, f64, f64, f64)) { - self.imp().set_view(range); - self.set_range_changing(range.0 + range.1); - self.queue_render(); - } - - pub fn set_tiles(&self, tiles: Rc) { - self.imp().tiles.replace(Some(tiles)); - self.queue_render(); - } - - pub fn load_img_mem( - &self, - img: &[u8], - origin: (f64, f64), - size: (f32, f32), - bounds: (Range, Range), - ) -> Result { - let mut canvas = self.get_canvas(); - let cvs = canvas.as_mut().unwrap(); - let img_id = cvs.load_image_mem(img, ImageFlags::empty()).unwrap(); - let (width, height) = size; - Ok(Target::new( - TargetType::ImageId(img_id), - width, - height, - bounds, - None, - )) - } - - pub fn delete_img(&self, img: Target) { - let mut canvas = self.get_canvas(); - let cvs = canvas.as_mut().unwrap(); - if let TargetType::ImageId(id) = img.target { - cvs.delete_image(id); - } - } - - pub fn draw_img(&self, img: &mut Target) { - self.imp().draw_target(img); - } - - pub fn scale_rate(&self) -> f64 { - let status = self.imp().status.borrow(); - status.scale_rate.unwrap() - } } diff --git a/src/widgets/render/predefined/gis.rs b/radar-g/src/widgets/render/predefined/gis.rs similarity index 100% rename from src/widgets/render/predefined/gis.rs rename to radar-g/src/widgets/render/predefined/gis.rs diff --git a/src/widgets/render/predefined/grid_field_renderer.rs b/radar-g/src/widgets/render/predefined/grid_field_renderer.rs similarity index 100% rename from src/widgets/render/predefined/grid_field_renderer.rs rename to radar-g/src/widgets/render/predefined/grid_field_renderer.rs diff --git a/src/widgets/render/predefined/layers.rs b/radar-g/src/widgets/render/predefined/layers.rs similarity index 100% rename from src/widgets/render/predefined/layers.rs rename to radar-g/src/widgets/render/predefined/layers.rs diff --git a/src/widgets/render/predefined/mod.rs b/radar-g/src/widgets/render/predefined/mod.rs similarity index 100% rename from src/widgets/render/predefined/mod.rs rename to radar-g/src/widgets/render/predefined/mod.rs diff --git a/src/widgets/render/renders.rs b/radar-g/src/widgets/render/renders.rs similarity index 100% rename from src/widgets/render/renders.rs rename to radar-g/src/widgets/render/renders.rs diff --git a/src/widgets/timeline/imp.rs b/radar-g/src/widgets/timeline/imp.rs similarity index 100% rename from src/widgets/timeline/imp.rs rename to radar-g/src/widgets/timeline/imp.rs diff --git a/src/widgets/timeline/mod.rs b/radar-g/src/widgets/timeline/mod.rs similarity index 100% rename from src/widgets/timeline/mod.rs rename to radar-g/src/widgets/timeline/mod.rs diff --git a/src/widgets/widget_frame/imp.rs b/radar-g/src/widgets/widget_frame/imp.rs similarity index 100% rename from src/widgets/widget_frame/imp.rs rename to radar-g/src/widgets/widget_frame/imp.rs diff --git a/src/widgets/widget_frame/mod.rs b/radar-g/src/widgets/widget_frame/mod.rs similarity index 100% rename from src/widgets/widget_frame/mod.rs rename to radar-g/src/widgets/widget_frame/mod.rs diff --git a/src/chart/backend.rs b/src/chart/backend.rs deleted file mode 100644 index f99f768..0000000 --- a/src/chart/backend.rs +++ /dev/null @@ -1,340 +0,0 @@ -use gtk::cairo::{Context as CairoContext, FontSlant, FontWeight}; - -use plotters_backend::text_anchor::{HPos, VPos}; -#[allow(unused_imports)] -use plotters_backend::{ - BackendColor, BackendCoord, BackendStyle, BackendTextStyle, DrawingBackend, DrawingErrorKind, - FontStyle, FontTransform, -}; - -/// The drawing backend that is backed with a Cairo context -pub struct CairoBackend<'a> { - context: &'a CairoContext, - width: u32, - height: u32, - init_flag: bool, -} - -#[derive(Debug)] -pub struct CairoError; - -impl std::fmt::Display for CairoError { - fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(fmt, "{:?}", self) - } -} - -impl std::error::Error for CairoError {} - -impl<'a> CairoBackend<'a> { - fn set_color(&self, color: &BackendColor) { - self.context.set_source_rgba( - f64::from(color.rgb.0) / 255.0, - f64::from(color.rgb.1) / 255.0, - f64::from(color.rgb.2) / 255.0, - color.alpha, - ); - } - - fn set_stroke_width(&self, width: u32) { - self.context.set_line_width(f64::from(width)); - } - - fn set_font(&self, font: &S) { - match font.style() { - FontStyle::Normal => self.context.select_font_face( - font.family().as_str(), - FontSlant::Normal, - FontWeight::Normal, - ), - FontStyle::Bold => self.context.select_font_face( - font.family().as_str(), - FontSlant::Normal, - FontWeight::Bold, - ), - FontStyle::Oblique => self.context.select_font_face( - font.family().as_str(), - FontSlant::Oblique, - FontWeight::Normal, - ), - FontStyle::Italic => self.context.select_font_face( - font.family().as_str(), - FontSlant::Italic, - FontWeight::Normal, - ), - }; - self.context.set_font_size(font.size()); - } - - pub fn new(context: &'a CairoContext, (w, h): (u32, u32)) -> Result { - Ok(Self { - context, - width: w, - height: h, - init_flag: false, - }) - } -} - -impl<'a> DrawingBackend for CairoBackend<'a> { - type ErrorType = gtk::cairo::Error; - - fn get_size(&self) -> (u32, u32) { - (self.width, self.height) - } - - fn ensure_prepared(&mut self) -> Result<(), DrawingErrorKind> { - if !self.init_flag { - let (x0, y0, x1, y1) = self - .context - .clip_extents() - .map_err(DrawingErrorKind::DrawingError)?; - - self.context.scale( - (x1 - x0) / f64::from(self.width), - (y1 - y0) / f64::from(self.height), - ); - - self.init_flag = true; - } - - Ok(()) - } - - fn present(&mut self) -> Result<(), DrawingErrorKind> { - Ok(()) - } - - fn draw_pixel( - &mut self, - point: BackendCoord, - color: BackendColor, - ) -> Result<(), DrawingErrorKind> { - self.context - .rectangle(f64::from(point.0), f64::from(point.1), 1.0, 1.0); - self.context.set_source_rgba( - f64::from(color.rgb.0) / 255.0, - f64::from(color.rgb.1) / 255.0, - f64::from(color.rgb.2) / 255.0, - color.alpha, - ); - - self.context - .fill() - .map_err(DrawingErrorKind::DrawingError)?; - - Ok(()) - } - - fn draw_line( - &mut self, - from: BackendCoord, - to: BackendCoord, - style: &S, - ) -> Result<(), DrawingErrorKind> { - self.set_color(&style.color()); - self.set_stroke_width(style.stroke_width()); - - self.context.move_to(f64::from(from.0), f64::from(from.1)); - self.context.line_to(f64::from(to.0), f64::from(to.1)); - - self.context - .stroke() - .map_err(DrawingErrorKind::DrawingError)?; - - Ok(()) - } - - fn draw_rect( - &mut self, - upper_left: BackendCoord, - bottom_right: BackendCoord, - style: &S, - fill: bool, - ) -> Result<(), DrawingErrorKind> { - self.set_color(&style.color()); - self.set_stroke_width(style.stroke_width()); - - self.context.rectangle( - f64::from(upper_left.0), - f64::from(upper_left.1), - f64::from(bottom_right.0 - upper_left.0), - f64::from(bottom_right.1 - upper_left.1), - ); - - if fill { - self.context - .fill() - .map_err(DrawingErrorKind::DrawingError)?; - } else { - self.context - .stroke() - .map_err(DrawingErrorKind::DrawingError)?; - } - - Ok(()) - } - - fn draw_path>( - &mut self, - path: I, - style: &S, - ) -> Result<(), DrawingErrorKind> { - self.set_color(&style.color()); - self.set_stroke_width(style.stroke_width()); - - let mut path = path.into_iter(); - if let Some((x, y)) = path.next() { - self.context.move_to(f64::from(x), f64::from(y)); - } - - for (x, y) in path { - self.context.line_to(f64::from(x), f64::from(y)); - } - - self.context - .stroke() - .map_err(DrawingErrorKind::DrawingError)?; - - Ok(()) - } - - fn fill_polygon>( - &mut self, - path: I, - style: &S, - ) -> Result<(), DrawingErrorKind> { - self.set_color(&style.color()); - self.set_stroke_width(style.stroke_width()); - - let mut path = path.into_iter(); - - if let Some((x, y)) = path.next() { - self.context.move_to(f64::from(x), f64::from(y)); - - for (x, y) in path { - self.context.line_to(f64::from(x), f64::from(y)); - } - - self.context.close_path(); - self.context - .fill() - .map_err(DrawingErrorKind::DrawingError)?; - } - - Ok(()) - } - - fn draw_circle( - &mut self, - center: BackendCoord, - radius: u32, - style: &S, - fill: bool, - ) -> Result<(), DrawingErrorKind> { - self.set_color(&style.color()); - self.set_stroke_width(style.stroke_width()); - - self.context.new_sub_path(); - self.context.arc( - f64::from(center.0), - f64::from(center.1), - f64::from(radius), - 0.0, - std::f64::consts::PI * 2.0, - ); - - if fill { - self.context - .fill() - .map_err(DrawingErrorKind::DrawingError)?; - } else { - self.context - .stroke() - .map_err(DrawingErrorKind::DrawingError)?; - } - - Ok(()) - } - - fn estimate_text_size( - &self, - text: &str, - font: &S, - ) -> Result<(u32, u32), DrawingErrorKind> { - self.set_font(font); - - let extents = self - .context - .text_extents(text) - .map_err(DrawingErrorKind::DrawingError)?; - - Ok((extents.width() as u32, extents.height() as u32)) - } - - fn draw_text( - &mut self, - text: &str, - style: &S, - pos: BackendCoord, - ) -> Result<(), DrawingErrorKind> { - let color = style.color(); - let (mut x, mut y) = (pos.0, pos.1); - - let degree = match style.transform() { - FontTransform::None => 0.0, - FontTransform::Rotate90 => 90.0, - FontTransform::Rotate180 => 180.0, - FontTransform::Rotate270 => 270.0, - //FontTransform::RotateAngle(angle) => angle as f64, - } / 180.0 - * std::f64::consts::PI; - - if degree != 0.0 { - self.context - .save() - .map_err(DrawingErrorKind::DrawingError)?; - self.context.translate(f64::from(x), f64::from(y)); - self.context.rotate(degree); - - x = 0; - y = 0; - } - - self.set_font(style); - self.set_color(&color); - - let extents = self - .context - .text_extents(text) - .map_err(DrawingErrorKind::DrawingError)?; - - let dx = match style.anchor().h_pos { - HPos::Left => 0.0, - HPos::Right => -extents.width(), - HPos::Center => -extents.width() / 2.0, - }; - let dy = match style.anchor().v_pos { - VPos::Top => extents.height(), - VPos::Center => extents.height() / 2.0, - VPos::Bottom => 0.0, - }; - - self.context.move_to( - f64::from(x) + dx - extents.x_bearing(), - f64::from(y) + dy - extents.y_bearing() - extents.height(), - ); - - self.context - .show_text(text) - .map_err(DrawingErrorKind::DrawingError)?; - - if degree != 0.0 { - self.context - .restore() - .map_err(DrawingErrorKind::DrawingError)?; - } - - Ok(()) - } -} diff --git a/src/chart/imp.rs b/src/chart/imp.rs deleted file mode 100644 index caf42bb..0000000 --- a/src/chart/imp.rs +++ /dev/null @@ -1,19 +0,0 @@ -use gtk::subclass::prelude::*; -use gtk::{glib, prelude::WidgetExtManual}; -use std::cell::{Cell, RefCell}; - -#[derive(Default)] -pub struct Chart {} - -#[glib::object_subclass] -impl ObjectSubclass for Chart { - const NAME: &'static str = "Chart"; - type Type = super::Chart; - type ParentType = gtk::DrawingArea; -} - -impl ObjectImpl for Chart {} - -impl WidgetImpl for Chart {} - -impl DrawingAreaImpl for Chart {} diff --git a/src/chart/mod.rs b/src/chart/mod.rs deleted file mode 100644 index f1a21fc..0000000 --- a/src/chart/mod.rs +++ /dev/null @@ -1,109 +0,0 @@ -mod backend; -mod imp; -use self::backend::CairoBackend; -use crate::widgets::render::{Render, RenderConfig, RenderMotion}; -use gtk::prelude::*; -use gtk::{glib, AspectFrame}; -use plotters::prelude::*; - -glib::wrapper! { - pub struct Chart(ObjectSubclass) - @extends gtk::DrawingArea, gtk::Widget; -} - -impl Chart { - pub fn new() -> Self { - let this: Self = glib::Object::new(); - this.set_hexpand(true); - this.set_vexpand(true); - - this.set_draw_func(|_s, context, w, h| { - let root_area = CairoBackend::new(context, (w as u32, h as u32)) - .expect("Can't create backend") - .into_drawing_area(); - root_area.fill(&BLACK).unwrap(); - - let root_area = root_area.titled("Image Title", ("sans-serif", 60)).unwrap(); - - let (upper, lower) = root_area.split_vertically(512); - - let x_axis = (-3.4f32..3.4).step(0.1); - - let mut cc = ChartBuilder::on(&upper) - .margin(5) - .set_all_label_area_size(50) - .caption("Sine and Cosine", ("sans-serif", 40)) - .build_cartesian_2d(-3.4f32..3.4, -1.2f32..1.2f32).unwrap(); - - cc.configure_mesh() - .x_labels(20) - .y_labels(10) - .disable_mesh() - .x_label_formatter(&|v| format!("{:.1}", v)) - .y_label_formatter(&|v| format!("{:.1}", v)) - .draw().unwrap(); - - cc.draw_series(LineSeries::new(x_axis.values().map(|x| (x, x.sin())), &RED)).unwrap() - .label("Sine") - .legend(|(x, y)| PathElement::new(vec![(x, y), (x + 20, y)], RED)); - - cc.draw_series(LineSeries::new( - x_axis.values().map(|x| (x, x.cos())), - &BLUE, - )).unwrap() - .label("Cosine") - .legend(|(x, y)| PathElement::new(vec![(x, y), (x + 20, y)], BLUE)); - - cc.configure_series_labels().border_style(WHITE).draw().unwrap(); - - /* - // It's possible to use a existing pointing element - cc.draw_series(PointSeries::<_, _, Circle<_>>::new( - (-3.0f32..2.1f32).step(1.0).values().map(|x| (x, x.sin())), - 5, - Into::::into(&RGBColor(255,0,0)).filled(), - )).unwrap();*/ - - // Otherwise you can use a function to construct your pointing element yourself - cc.draw_series(PointSeries::of_element( - (-3.0f32..2.1f32).step(1.0).values().map(|x| (x, x.sin())), - 5, - ShapeStyle::from(&RED).filled(), - &|coord, size, style| { - EmptyElement::at(coord) - + Circle::new((0, 0), size, style) - + Text::new(format!("{:.?}", coord), (0, 15), ("sans-serif", 15)) - }, - )).unwrap(); - - let drawing_areas = lower.split_evenly((1, 2)); - - for (drawing_area, idx) in drawing_areas.iter().zip(1..) { - let mut cc = ChartBuilder::on(drawing_area) - .x_label_area_size(30) - .y_label_area_size(30) - .margin_right(20) - .caption(format!("y = x^{}", 1 + 2 * idx), ("sans-serif", 40)) - .build_cartesian_2d(-1f32..1f32, -1f32..1f32).unwrap(); - cc.configure_mesh() - .x_labels(5) - .y_labels(3) - .max_light_lines(4) - .draw().unwrap(); - - cc.draw_series(LineSeries::new( - (-1f32..1f32) - .step(0.01) - .values() - .map(|x| (x, x.powf(idx as f32 * 2.0 + 1.0))), - &BLUE, - )).unwrap(); - } - - // To avoid the IO failure being ignored silently, we manually call the present function - root_area.present().expect("Unable to write result to file, please make sure 'plotters-doc-data' dir exists under current dir"); - }); - - this - } -} diff --git a/src/widgets/render/exterior/mod.rs b/src/widgets/render/exterior/mod.rs deleted file mode 100644 index 3a1de16..0000000 --- a/src/widgets/render/exterior/mod.rs +++ /dev/null @@ -1,93 +0,0 @@ -mod imp; -use super::super::Render; -use crate::coords::Range; -use femtovg::{renderer::OpenGl, Canvas, Color, Paint, Path}; -use gtk::glib; -use gtk::prelude::*; -use gtk::subclass::prelude::ObjectSubclassIsExt; - -glib::wrapper! { - pub struct ExteriorWidget(ObjectSubclass); -} - -impl Default for ExteriorWidget { - fn default() -> Self { - Self::new() - } -} - -impl ExteriorWidget { - pub fn new() -> Self { - let this: Self = glib::Object::new(); - this - } - - pub fn draw(&self, canvas: &mut Canvas, render: &Render) { - let padding = render.imp().config.borrow().padding; - let (w, h) = render.window_size(); - let (w, h) = (w as f32, h as f32); - let origins = [ - (0.0, 0.0), - (w - padding[1], 0.0), - (0.0, h - padding[2]), - (0.0, 0.0), - ]; - let whs = [ - (w, padding[0]), - (padding[1], h), - (w, padding[2]), - (padding[3], h), - ]; - - let painter = Paint::color(Color::rgb(0, 0, 0)); - - for edge in 0..4 { - let mut path = Path::new(); - let (ox, oy) = origins[edge]; - let (w, h) = whs[edge]; - path.rect(ox, oy, w, h); - canvas.fill_path(&path, &painter); - } - - let (lon_range, lat_range) = render.render_range(); - let (lon_range, lat_range): (Range, Range) = (lon_range.into(), lat_range.into()); - - let lon_keypoints = lon_range.key_points(10); - let lat_keypoints = lat_range.key_points(5); - let mut paint = Paint::color(Color::white()); // 黑色字体 - let dpi = render.scale_factor(); - paint.set_font_size((dpi * 12) as f32); - - for lon in lon_keypoints.iter() { - let (x, _) = render.map((*lon, lat_range.0)).unwrap(); - - let text = format!("{:.2}", lon); - let metrics = canvas - .measure_text(x, 0.0, text.as_str(), &paint) - .expect("Cannot measure text"); - - let text_x = x - metrics.width() / 2.0; - let text_y = h - metrics.height() / 2.0; - - canvas - .fill_text(text_x, text_y, text.as_str(), &paint) - .expect("Cannot draw text"); - } - - for lat in lat_keypoints.iter() { - let (_, y) = render.map((lon_range.0, *lat)).unwrap(); - - let text = format!("{:.2}", lat); - let metrics = canvas - .measure_text(0.0, y, text.as_str(), &paint) - .expect("Cannot measure text"); - - let text_x = 0.0; - let text_y = y - metrics.height() / 2.0; - - canvas - .fill_text(text_x, text_y, text.as_str(), &paint) - .expect("Cannot draw text"); - } - } -} diff --git a/test.js b/test.js deleted file mode 100644 index f6e6c71..0000000 --- a/test.js +++ /dev/null @@ -1,102 +0,0 @@ -import {cartesian} from "../cartesian.js"; -import {abs, asin, atan2, cos, epsilon, radians, sqrt} from "../math.js"; -import {transformer} from "../transform.js"; - -var maxDepth = 16, // maximum depth of subdivision - cosMinDistance = cos(30 * radians); // cos(minimum angular distance) - -export default function(project, delta2) { - return +delta2 ? resample(project, delta2) : resampleNone(project); -} - -function resampleNone(project) { - return transformer({ - point: function(x, y) { - x = project(x, y); - this.stream.point(x[0], x[1]); - } - }); -} - -function resample(project, delta2) { - - function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) { - var dx = x1 - x0, - dy = y1 - y0, - d2 = dx * dx + dy * dy; - if (d2 > 4 * delta2 && depth--) { - var a = a0 + a1, - b = b0 + b1, - c = c0 + c1, - m = sqrt(a * a + b * b + c * c), - phi2 = asin(c /= m), - lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a), - p = project(lambda2, phi2), - x2 = p[0], - y2 = p[1], - dx2 = x2 - x0, - dy2 = y2 - y0, - dz = dy * dx2 - dx * dy2; - if (dz * dz / d2 > delta2 // perpendicular projected distance - || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end - || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance - resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream); - stream.point(x2, y2); - resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream); - } - } - } - return function(stream) { - var lambda00, x00, y00, a00, b00, c00, // first point - lambda0, x0, y0, a0, b0, c0; // previous point - - var resampleStream = { - point: point, - lineStart: lineStart, - lineEnd: lineEnd, - polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; }, - polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; } - }; - - function point(x, y) { - x = project(x, y); - stream.point(x[0], x[1]); - } - - function lineStart() { - x0 = NaN; - resampleStream.point = linePoint; - stream.lineStart(); - } - - function linePoint(lambda, phi) { - var c = cartesian([lambda, phi]), p = project(lambda, phi); - resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream); - stream.point(x0, y0); - } - - function lineEnd() { - resampleStream.point = point; - stream.lineEnd(); - } - - function ringStart() { - lineStart(); - resampleStream.point = ringPoint; - resampleStream.lineEnd = ringEnd; - } - - function ringPoint(lambda, phi) { - linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0; - resampleStream.point = linePoint; - } - - function ringEnd() { - resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream); - resampleStream.lineEnd = lineEnd; - lineEnd(); - } - - return resampleStream; - }; -} \ No newline at end of file diff --git a/tile.js b/tile.js deleted file mode 100644 index ba14ed1..0000000 --- a/tile.js +++ /dev/null @@ -1,95 +0,0 @@ -function redraw() { - var t = (0 | Math.log(projection.scale()) / Math.LN2) - 5 - , e = d3.quadTiles(projection, t) - , n = projection.clipExtent(); - tiles_ = d3.quadTiles(projection.clipExtent([[1, 1], [width - 1, height - 1]]), t); - var a = svg.selectAll(".tile").data(tiles_, key); - a.enter().append("path").attr("class", "tile"), - a.exit().remove(), - a.attr("class", "tile").attr("d", path), - svg.selectAll(".tile").data(e, key).classed("highlight", !0).exit().classed("highlight", !1); - var r = svg.selectAll("text").data(e, key); - r.enter().append("text").attr("text-anchor", "middle").text(key), - r.exit().remove(), - r.attr("transform", function (t) { - return "translate(" + projection(t.centroid) + ")" - }), - projection.clipExtent(n) -} -function key(t) { - return t.key.join(", ") -} -!function () { - function t() { } - function e(t) { - return 360 * Math.atan(Math.exp(-t * Math.PI / 180)) / Math.PI - 90 - } - d3.quadTiles = function (n, a) { - function r(t, n, p, d) { - var h = p - t - , g = e(n) - , u = e(d) - , v = l * h; - i = !0, - s.polygonStart(), - s.lineStart(); - for (var f = t; p + v / 2 > f && i; f += v) - s.point(f, g); - for (var m = g; (m += v) < u && i;) - s.point(p, m); - for (var f = p; f > t - v / 2 && i; f -= v) - s.point(f, u); - for (var m = u; (m -= v) > g && i;) - s.point(t, m); - if (i && s.point(t, g), - s.lineEnd(), - s.polygonEnd(), - 360 / c >= h) - i || o.push({ - type: "Polygon", - coordinates: [d3.range(t, p + v / 2, v).map(function (t) { - return [t, n] - }).concat([[p, .5 * (n + d)]]).concat(d3.range(p, t - v / 2, -v).map(function (t) { - return [t, d] - })).concat([[t, .5 * (n + d)]]).concat([[t, n]]).map(function (t) { - return [t[0], e(t[1])] - })], - key: [0 | (180 + t) / 360 * c, 0 | (180 + n) / 360 * c, a], - centroid: [.5 * (t + p), .5 * (g + u)] - }); - else if (!i) { - var f = .5 * (t + p) - , m = .5 * (n + d); - r(t, n, f, m), - r(f, n, p, m), - r(t, m, f, d), - r(f, m, p, d) - } - } - var i, o = [], c = 1 << (a = Math.max(0, a)), l = Math.max(.2, Math.min(1, .01 * a)), p = n.precision(), s = n.precision(960).stream({ - point: function () { - i = !1 - }, - lineStart: t, - lineEnd: t, - polygonStart: t, - polygonEnd: t - }); - return r(-180, -180, 180, 180), - n.precision(p), - o - } -}(); -var width = 960 - , height = 600 - , p = 100 - , projection = d3.geo.albers().rotate([0, 0]).center([0, 38.7]).scale(1280).translate([width / 2, height / 2]).precision(.1).clipExtent([[p, p], [width - p, height - p]]) - , path = d3.geo.path().projection(projection) - , svg = d3.select("#map").append("svg").attr("width", width).attr("height", height).style("pointer-events", "all").call(d3.behavior.zoom().translate(projection.translate()).scale(projection.scale()).scaleExtent([50, 1e7]).on("zoom", function () { - projection.scale(d3.event.scale).translate(d3.event.translate), - redraw() - })); -svg.append("path").datum({ - type: "Sphere" -}).attr("class", "outline").attr("d", path), - redraw();