From 618970317ebc431f9f88d27f9cb838963a1e72c3 Mon Sep 17 00:00:00 2001 From: Juan Pizarro Date: Sat, 4 Oct 2025 10:09:45 +0200 Subject: [PATCH 1/3] add display example image from zenoh --- ego-vehicle/uprotocol-sensors/Cargo.lock | 1175 ++++++++++++++++- ego-vehicle/uprotocol-sensors/Cargo.toml | 3 + .../examples/display_example_zenoh.rs | 281 ++++ 3 files changed, 1437 insertions(+), 22 deletions(-) create mode 100644 ego-vehicle/uprotocol-sensors/examples/display_example_zenoh.rs diff --git a/ego-vehicle/uprotocol-sensors/Cargo.lock b/ego-vehicle/uprotocol-sensors/Cargo.lock index ded51dd..4ab7feb 100644 --- a/ego-vehicle/uprotocol-sensors/Cargo.lock +++ b/ego-vehicle/uprotocol-sensors/Cargo.lock @@ -2,6 +2,22 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "ab_glyph" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c0457472c38ea5bd1c3b5ada5e368271cb550be7a4ca4a0b4634e9913f6cc2" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" + [[package]] name = "addr2line" version = "0.24.2" @@ -56,6 +72,30 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +[[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" @@ -164,6 +204,27 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "ash" +version = "0.37.3+1.3.251" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" +dependencies = [ + "libloading 0.7.4", +] + [[package]] name = "asn1-rs" version = "0.6.2" @@ -382,6 +443,21 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitflags" version = "1.3.2" @@ -397,6 +473,12 @@ dependencies = [ "serde", ] +[[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" @@ -406,6 +488,25 @@ 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 = "bumpalo" version = "3.19.0" @@ -430,6 +531,20 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +[[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 1.0.69", + "vec_map", +] + [[package]] name = "carla" version = "0.11.1" @@ -450,7 +565,7 @@ dependencies = [ [[package]] name = "carla-data-serde" version = "0.1.0" -source = "git+ssh://git@github.com/Eclipse-SDV-Hackathon-Chapter-Three/carla-data-serde.git?branch=main#8ee282e6cb120dc27bef6ff5429c75eb1b04785b" +source = "git+https://github.com/Eclipse-SDV-Hackathon-Chapter-Three/carla-data-serde.git?branch=main#8ee282e6cb120dc27bef6ff5429c75eb1b04785b" dependencies = [ "carla", "nalgebra", @@ -533,6 +648,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "cfg_aliases" version = "0.2.1" @@ -570,7 +691,7 @@ checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", - "libloading", + "libloading 0.8.8", ] [[package]] @@ -622,6 +743,16 @@ dependencies = [ "cc", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width 0.1.14", +] + [[package]] name = "codespan-reporting" version = "0.12.0" @@ -639,6 +770,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +[[package]] +name = "com-rs" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" + [[package]] name = "combine" version = "4.6.7" @@ -710,6 +847,30 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[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 0.9.4", + "core-graphics-types", + "foreign-types 0.3.2", + "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 0.9.4", + "libc", +] + [[package]] name = "cpufeatures" version = "0.2.17" @@ -824,7 +985,7 @@ version = "0.7.163" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "216c2844f46bd95f6069add37cd30df728044575b95495a91b056948525f1afe" dependencies = [ - "codespan-reporting", + "codespan-reporting 0.12.0", "indexmap 2.10.0", "proc-macro2", "quote", @@ -838,7 +999,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c74939fe6eb7435df32b135a23b17ef7e51fe812b8f822f79d0db69ef4bf17e" dependencies = [ "clap", - "codespan-reporting", + "codespan-reporting 0.12.0", "indexmap 2.10.0", "proc-macro2", "quote", @@ -864,6 +1025,17 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "d3d12" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20" +dependencies = [ + "bitflags 2.9.1", + "libloading 0.8.8", + "winapi", +] + [[package]] name = "darling" version = "0.20.11" @@ -984,6 +1156,12 @@ dependencies = [ "windows-sys 0.60.2", ] +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + [[package]] name = "displaydoc" version = "0.2.5" @@ -995,6 +1173,21 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading 0.8.8", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + [[package]] name = "dyn-clone" version = "1.0.20" @@ -1006,6 +1199,7 @@ name = "ego-vehicle" version = "0.1.0" dependencies = [ "async-trait", + "base64 0.21.7", "carla", "carla-data-serde", "clap", @@ -1016,6 +1210,7 @@ dependencies = [ "pretty_env_logger", "serde", "serde_json", + "show-image", "tokio", "up-rust", "up-transport-zenoh", @@ -1099,6 +1294,15 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + [[package]] name = "filetime" version = "0.2.25" @@ -1157,7 +1361,28 @@ 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", + "quote", + "syn 2.0.104", ] [[package]] @@ -1166,6 +1391,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" @@ -1333,12 +1564,82 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "glam" +version = "0.30.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12d847aeb25f41be4c0ec9587d624e9cd631bc007a8fd7ce3f5851e064c6460" + [[package]] name = "glob" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +[[package]] +name = "glow" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gpu-alloc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" +dependencies = [ + "bitflags 2.9.1", + "gpu-alloc-types", +] + +[[package]] +name = "gpu-alloc-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "gpu-allocator" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +dependencies = [ + "backtrace", + "log", + "thiserror 1.0.69", + "winapi", + "windows", +] + +[[package]] +name = "gpu-descriptor" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" +dependencies = [ + "bitflags 2.9.1", + "gpu-descriptor-types", + "hashbrown 0.14.5", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" +dependencies = [ + "bitflags 2.9.1", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -1361,6 +1662,21 @@ version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +[[package]] +name = "hassle-rs" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" +dependencies = [ + "bitflags 1.3.2", + "com-rs", + "libc", + "libloading 0.7.4", + "thiserror 1.0.69", + "widestring", + "winapi", +] + [[package]] name = "heck" version = "0.4.1" @@ -1397,6 +1713,12 @@ dependencies = [ "serde", ] +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + [[package]] name = "hmac" version = "0.12.1" @@ -1621,6 +1943,18 @@ dependencies = [ "generic-array", ] +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "io-uring" version = "0.7.9" @@ -1760,6 +2094,17 @@ dependencies = [ "hashbrown 0.14.5", ] +[[package]] +name = "khronos-egl" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" +dependencies = [ + "libc", + "libloading 0.7.4", + "pkg-config", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -1781,6 +2126,16 @@ version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +[[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.8" @@ -1805,7 +2160,7 @@ checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3" dependencies = [ "bitflags 2.9.1", "libc", - "redox_syscall", + "redox_syscall 0.5.17", ] [[package]] @@ -1866,6 +2221,15 @@ dependencies = [ "twox-hash", ] +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + [[package]] name = "matchers" version = "0.1.0" @@ -1898,15 +2262,48 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] -name = "miette" -version = "5.10.0" +name = "memmap2" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ - "miette-derive", - "once_cell", - "thiserror 1.0.69", - "unicode-width 0.1.14", + "libc", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "metal" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "623b5e6cefd76e58f774bd3cc0c6f5c7615c58c03a97815245a25c3c9bdee318" +dependencies = [ + "bitflags 2.9.1", + "block", + "core-graphics-types", + "foreign-types 0.5.0", + "log", + "objc", + "paste", +] + +[[package]] +name = "miette" +version = "5.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +dependencies = [ + "miette-derive", + "once_cell", + "thiserror 1.0.69", + "unicode-width 0.1.14", ] [[package]] @@ -1933,6 +2330,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", + "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 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.48.0", ] [[package]] @@ -1955,6 +2365,27 @@ dependencies = [ "cxx", ] +[[package]] +name = "naga" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e" +dependencies = [ + "bit-set", + "bitflags 2.9.1", + "codespan-reporting 0.11.1", + "hexf-parse", + "indexmap 1.9.3", + "log", + "num-traits", + "petgraph", + "rustc-hash 1.1.0", + "spirv", + "termcolor", + "thiserror 1.0.69", + "unicode-xid", +] + [[package]] name = "nalgebra" version = "0.32.6" @@ -2023,6 +2454,60 @@ dependencies = [ "serde", ] +[[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 1.0.69", +] + +[[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", +] + +[[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", +] + [[package]] name = "nix" version = "0.29.0" @@ -2031,7 +2516,7 @@ checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags 2.9.1", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.2.1", "libc", ] @@ -2043,7 +2528,7 @@ checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" dependencies = [ "bitflags 2.9.1", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.2.1", "libc", ] @@ -2175,6 +2660,93 @@ dependencies = [ "libc", ] +[[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", + "proc-macro2", + "quote", + "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", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[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-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 = "object" version = "0.36.7" @@ -2213,7 +2785,7 @@ checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ "bitflags 2.9.1", "cfg-if", - "foreign-types", + "foreign-types 0.3.2", "libc", "once_cell", "openssl-macros", @@ -2255,6 +2827,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "orbclient" +version = "0.3.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba0b26cec2e24f08ed8bb31519a9333140a6599b867dac464bb150bdb796fd43" +dependencies = [ + "libredox", +] + [[package]] name = "outref" version = "0.5.2" @@ -2267,6 +2848,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "owned_ttf_parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b" +dependencies = [ + "ttf-parser", +] + [[package]] name = "parking" version = "2.2.1" @@ -2291,7 +2881,7 @@ checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.17", "smallvec", "windows-targets 0.52.6", ] @@ -2490,6 +3080,19 @@ dependencies = [ "winapi", ] +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + [[package]] name = "potential_utf" version = "0.1.2" @@ -2534,6 +3137,16 @@ dependencies = [ "syn 2.0.104", ] +[[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", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -2567,6 +3180,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "profiling" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" + [[package]] name = "protobuf" version = "3.7.2" @@ -2696,7 +3315,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "626214629cda6781b6dc1d316ba307189c85ba657213ce642d9c77670f8202c8" dependencies = [ "bytes", - "cfg_aliases", + "cfg_aliases 0.2.1", "pin-project-lite", "quinn-proto", "quinn-udp", @@ -2738,7 +3357,7 @@ version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcebb1209ee276352ef14ff8732e24cc2b02bbac986cd74a4c81bcb2f9881970" dependencies = [ - "cfg_aliases", + "cfg_aliases 0.2.1", "libc", "once_cell", "socket2 0.5.10", @@ -2820,12 +3439,33 @@ dependencies = [ "getrandom 0.3.3", ] +[[package]] +name = "range-alloc" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde" + +[[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 = "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.5.17" @@ -2910,6 +3550,12 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +[[package]] +name = "renderdoc-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" + [[package]] name = "ring" version = "0.17.14" @@ -3217,12 +3863,31 @@ dependencies = [ "syn 2.0.104", ] +[[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.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[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 = "secrecy" version = "0.8.0" @@ -3419,6 +4084,32 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "show-image" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9867cbb8c3ae72f4d23ba01a17f96c639a10ca73a6cc750542bc8487642ddf38" +dependencies = [ + "futures", + "glam", + "indexmap 2.10.0", + "rustc_version", + "show-image-macros", + "wgpu", + "winit", +] + +[[package]] +name = "show-image-macros" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcc70c0d64419601cee5ef5977947d01e4f3b85ccc14eca959f5405392dae747" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "signal-hook-registry" version = "1.4.6" @@ -3451,6 +4142,12 @@ dependencies = [ "wide", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "siphasher" version = "1.0.1" @@ -3463,12 +4160,40 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" +[[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.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +[[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.10" @@ -3504,6 +4229,16 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591" +[[package]] +name = "spirv" +version = "0.2.0+1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +dependencies = [ + "bitflags 1.3.2", + "num-traits", +] + [[package]] name = "spki" version = "0.7.3" @@ -3526,6 +4261,12 @@ 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.11.1" @@ -3697,6 +4438,31 @@ dependencies = [ "time-core", ] +[[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 = "tinystr" version = "0.8.1" @@ -3754,7 +4520,7 @@ dependencies = [ "bytes", "io-uring", "libc", - "mio", + "mio 1.0.4", "parking_lot", "pin-project-lite", "signal-hook-registry", @@ -3811,6 +4577,23 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.10.0", + "toml_datetime", + "winnow", +] + [[package]] name = "tracing" version = "0.1.41" @@ -3886,6 +4669,12 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" + [[package]] name = "tungstenite" version = "0.24.0" @@ -4201,6 +4990,18 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.100" @@ -4233,6 +5034,89 @@ dependencies = [ "unicode-ident", ] +[[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", +] + +[[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", +] + +[[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", + "quote", + "xml-rs", +] + +[[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 = "web-sys" +version = "0.3.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "web-time" version = "1.1.0" @@ -4279,6 +5163,105 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "wgpu" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "752e44d3998ef35f71830dd1ad3da513e628e2e4d4aedb0ab580f850827a0b41" +dependencies = [ + "arrayvec", + "cfg-if", + "js-sys", + "log", + "naga", + "parking_lot", + "profiling", + "raw-window-handle", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f8a44dd301a30ceeed3c27d8c0090433d3da04d7b2a4042738095a424d12ae7" +dependencies = [ + "arrayvec", + "bit-vec", + "bitflags 2.9.1", + "codespan-reporting 0.11.1", + "log", + "naga", + "parking_lot", + "profiling", + "raw-window-handle", + "rustc-hash 1.1.0", + "smallvec", + "thiserror 1.0.69", + "web-sys", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a80bf0e3c77399bb52850cb0830af9bad073d5cfcb9dd8253bef8125c42db17" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set", + "bitflags 2.9.1", + "block", + "core-graphics-types", + "d3d12", + "glow", + "gpu-alloc", + "gpu-allocator", + "gpu-descriptor", + "hassle-rs", + "js-sys", + "khronos-egl", + "libc", + "libloading 0.8.8", + "log", + "metal", + "naga", + "objc", + "parking_lot", + "profiling", + "range-alloc", + "raw-window-handle", + "renderdoc-sys", + "rustc-hash 1.1.0", + "smallvec", + "thiserror 1.0.69", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "winapi", +] + +[[package]] +name = "wgpu-types" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee64d7398d0c2f9ca48922c902ef69c42d000c759f3db41e355f4a570b052b67" +dependencies = [ + "bitflags 2.9.1", + "js-sys", + "web-sys", +] + [[package]] name = "which" version = "4.4.2" @@ -4301,6 +5284,12 @@ dependencies = [ "safe_arch", ] +[[package]] +name = "widestring" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" + [[package]] name = "winapi" version = "0.3.9" @@ -4332,6 +5321,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-core" version = "0.61.2" @@ -4400,6 +5398,15 @@ 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.5", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -4442,6 +5449,21 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "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.6" @@ -4481,6 +5503,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -4499,6 +5527,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" @@ -4517,6 +5551,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -4547,6 +5587,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -4565,6 +5611,12 @@ 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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" @@ -4583,6 +5635,12 @@ 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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" @@ -4601,6 +5659,12 @@ 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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -4613,6 +5677,50 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" +[[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 0.1.1", + "core-foundation 0.9.4", + "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.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + [[package]] name = "wit-bindgen-rt" version = "0.39.0" @@ -4628,6 +5736,17 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" +[[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 = "x509-parser" version = "0.16.0" @@ -4655,6 +5774,18 @@ dependencies = [ "rustix 1.0.8", ] +[[package]] +name = "xcursor" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec9e4a500ca8864c5b47b8b482a73d62e4237670e5b5f1d6b9e3cae50f28f2b" + +[[package]] +name = "xml-rs" +version = "0.8.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fd8403733700263c6eb89f192880191f1b83e332f7a20371ddcf421c4a337c7" + [[package]] name = "yoke" version = "0.8.0" @@ -5056,7 +6187,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f86311664116f7d215b58b96fda18c20b800cab3ce6bec97ad23f05222ad534c" dependencies = [ "git-version", - "libloading", + "libloading 0.8.8", "serde", "tracing", "zenoh-config", @@ -5182,7 +6313,7 @@ dependencies = [ "humantime 2.2.0", "lazy_static", "libc", - "libloading", + "libloading 0.8.8", "pnet_datalink", "serde", "serde_json", diff --git a/ego-vehicle/uprotocol-sensors/Cargo.toml b/ego-vehicle/uprotocol-sensors/Cargo.toml index 46e5405..6e1a4da 100644 --- a/ego-vehicle/uprotocol-sensors/Cargo.toml +++ b/ego-vehicle/uprotocol-sensors/Cargo.toml @@ -31,11 +31,14 @@ ndarray = { version = "=0.15.6", features = ["serde"] } pretty_env_logger = "0.4" serde = { version = "1.0" } serde_json = { version = "1" } +show-image = "0.14" +base64 = "0.21" tokio = { version = "1", features = ["full"] } up-rust = { version = "0.7.0" } up-transport-zenoh = { version = "0.8" } zenoh = { version = "1.0.0-rc.2" } + [patch.crates-io] # point the carla crate at your fork/branch carla = { git = "https://github.com/Eclipse-SDV-Hackathon-Chapter-Three/carla-rust.git", branch = "action-buffer-fix", package = "carla" } diff --git a/ego-vehicle/uprotocol-sensors/examples/display_example_zenoh.rs b/ego-vehicle/uprotocol-sensors/examples/display_example_zenoh.rs new file mode 100644 index 0000000..4cae88b --- /dev/null +++ b/ego-vehicle/uprotocol-sensors/examples/display_example_zenoh.rs @@ -0,0 +1,281 @@ +// Example demonstrating image display functionality from Zenoh +// This example shows how to receive and display CARLA sensor images from uProtocol/Zenoh + +use carla_data_serde::ImageEventSerDe; +use show_image::WindowOptions; +use std::sync::{Arc, OnceLock}; +use up_rust::{UTransport, UUri}; +use up_rust::{UListener, UMessage}; +use up_transport_zenoh::UPTransportZenoh; +use std::str::FromStr; +use std::sync::atomic::{AtomicU64, Ordering}; + + +// // Rate limiting for image display +// static LAST_DISPLAY_TIME: OnceLock> = OnceLock::new(); +static IMAGE_WINDOW: OnceLock>> = OnceLock::new(); +// const DISPLAY_INTERVAL_MS: u64 = 50; // Display every 50ms (20 FPS) + +const FPS_LOG_INTERVAL_SECONDS: u64 = 1; // Log FPS every 1 second + +struct ImageListener { + frame_count: AtomicU64, + received_frame_count: AtomicU64, + fps_start_time: std::sync::Mutex, + last_fps_log_time: std::sync::Mutex, +} + +impl ImageListener { + fn new() -> Self { + let now = std::time::Instant::now(); + Self { + frame_count: AtomicU64::new(0), + received_frame_count: AtomicU64::new(0), + fps_start_time: std::sync::Mutex::new(now), + last_fps_log_time: std::sync::Mutex::new(now), + } + } +} + +#[async_trait::async_trait] +impl UListener for ImageListener { + async fn on_receive(&self, msg: UMessage) { + // if let Some(payload) = msg.payload { + let Some(payload) = msg.payload.as_deref() else { + return; + }; + if payload.is_empty() { + return; + } + + // Track received frames + let received_frame_number = self.received_frame_count.fetch_add(1, Ordering::Relaxed) + 1; + println!("Received image data payload of {} bytes (Received Frame #{})", payload.len(), received_frame_number); + + // Use proper deserialization with ImageEventSerDe + match serde_json::from_slice::(&payload) { + Ok(image_data) => { + println!("Successfully deserialized ImageEventSerDe"); + println!("Image dimensions: {}x{}", image_data.width, image_data.height); + println!("FOV angle: {}", image_data.fov_angle); + println!("Array length: {}", image_data.array.len()); + + let width = image_data.width as u32; + let height = image_data.height as u32; + + // The array contains FfiColor structs in an ndarray format + let pixel_array = &image_data.array; + + println!("Pixel array shape: {:?}", pixel_array.shape()); + println!("Array dimensions: height={}, width={}", pixel_array.nrows(), pixel_array.ncols()); + + // Convert ndarray of FfiColor to RGB data + let mut rgb_data = Vec::with_capacity((width * height * 3) as usize); + let mut non_zero_count = 0; + + // Iterate through the 2D array + for row in 0..pixel_array.nrows() { + for col in 0..pixel_array.ncols() { + let pixel = &pixel_array[[row, col]]; + + // FfiColor has fields: b, g, r, a + let r = pixel.r; + let g = pixel.g; + let b = pixel.b; + + // Count non-zero pixels for debugging + if r != 0 || g != 0 || b != 0 { + non_zero_count += 1; + } + + // Add RGB values (convert BGRA to RGB) + rgb_data.push(r); + rgb_data.push(g); + rgb_data.push(b); + } + } + + println!("Converted {} pixels to RGB data", pixel_array.len()); + println!("Non-zero pixels: {} out of {}", non_zero_count, pixel_array.len()); + + // Check first few RGB pixels for debugging + if rgb_data.len() >= 12 { + println!("First 4 pixels RGB values: {:?}", &rgb_data[0..12]); + + // Check if image is all black + let non_zero_rgb_count = rgb_data.iter().filter(|&&x| x != 0).count(); + println!("Non-zero RGB pixels: {} out of {}", non_zero_rgb_count, rgb_data.len()); + } + + // Ensure we have the right amount of data + let expected_size = (width * height * 3) as usize; + if rgb_data.len() != expected_size { + eprintln!("Warning: RGB data size mismatch. Expected: {}, Got: {}", expected_size, rgb_data.len()); + // Resize or pad data if necessary + rgb_data.resize(expected_size, 0); + } + + if let Err(e) = display_carla_image_from_raw( + width, + height, + rgb_data, + "CARLA Image from Zenoh", + self + ).await { + eprintln!("Failed to display image: {}", e); + } + } + Err(e) => { + eprintln!("Failed to deserialize ImageEventSerDe: {}", e); + // Print first 100 bytes of payload for debugging + let preview = if payload.len() > 100 { &payload[..100] } else { &payload }; + eprintln!("Payload preview: {:?}", String::from_utf8_lossy(preview)); + } + } + // } + } +} + +// Function to display CARLA image data using show-image from raw data (rate limited) +async fn display_carla_image_from_raw(width: u32, height: u32, rgb_data: Vec, window_title: &str, image_listener: &ImageListener) -> Result<(), Box> { + // Rate limiting - only display every DISPLAY_INTERVAL_MS milliseconds + // let last_time = LAST_DISPLAY_TIME.get_or_init(|| std::sync::Mutex::new(std::time::Instant::now())); + // let mut last_time_guard = match last_time.lock() { + // Ok(guard) => guard, + // Err(poisoned) => { + // eprintln!("Warning: Last time mutex was poisoned, recovering..."); + // poisoned.into_inner() + // } + // }; + + // let now = std::time::Instant::now(); + // if now.duration_since(*last_time_guard) < std::time::Duration::from_millis(DISPLAY_INTERVAL_MS) { + // // Skip this frame due to rate limiting + // return Ok(()); + // } + // *last_time_guard = now; + // drop(last_time_guard); + + // Create image view + let image_view = show_image::ImageView::new( + show_image::ImageInfo::rgb8(width, height), + &rgb_data, + ); + + // Get or create window + let window_storage = IMAGE_WINDOW.get_or_init(|| std::sync::Mutex::new(None)); + let mut window_guard = match window_storage.lock() { + Ok(guard) => guard, + Err(poisoned) => { + eprintln!("Warning: Window mutex was poisoned, recovering..."); + poisoned.into_inner() + } + }; + + if window_guard.is_none() { + // Create new window + let new_window = show_image::create_window(window_title, WindowOptions { + size: Some([width, height]), + ..WindowOptions::default() + })?; + window_guard.replace(new_window); + } + + if let Some(window) = window_guard.as_ref() { + window.set_image("carla_image", &image_view)?; + } + + // Increment frame counter and calculate FPS + let frame_number = image_listener.frame_count.fetch_add(1, Ordering::Relaxed) + 1; + + // Log FPS periodically + let mut last_log_guard = match image_listener.last_fps_log_time.lock() { + Ok(guard) => guard, + Err(poisoned) => { + eprintln!("Warning: FPS log time mutex was poisoned, recovering..."); + poisoned.into_inner() + } + }; + + let now = std::time::Instant::now(); + if now.duration_since(*last_log_guard) >= std::time::Duration::from_secs(FPS_LOG_INTERVAL_SECONDS) { + let start_guard = match image_listener.fps_start_time.lock() { + Ok(guard) => guard, + Err(poisoned) => { + eprintln!("Warning: FPS start time mutex was poisoned, recovering..."); + poisoned.into_inner() + } + }; + + let elapsed = now.duration_since(*start_guard); + let display_fps = frame_number as f64 / elapsed.as_secs_f64(); + let received_frames = image_listener.received_frame_count.load(Ordering::Relaxed); + let receive_fps = received_frames as f64 / elapsed.as_secs_f64(); + + println!("FPS - Display: {:.2}, Receive: {:.2} (Display Frame #{}, Received Frame #{}, Elapsed: {:.2}s)", + display_fps, receive_fps, frame_number, received_frames, elapsed.as_secs_f64()); + *last_log_guard = now; + } + + println!("Image displayed in window: {} (Frame #{})", window_title, frame_number); + + Ok(()) +} + +fn main() -> Result<(), Box> { + // Initialize show-image context - this function doesn't return! + show_image::run_context(|| { + // Create a tokio runtime for our async operations + let rt = tokio::runtime::Runtime::new().expect("Failed to create tokio runtime"); + rt.block_on(run_display_app()).unwrap(); + }); +} + +async fn run_display_app() -> Result<(), Box> { + println!("CARLA Image Display Example - Receiving from Zenoh/uProtocol"); + + // Initialize logging + pretty_env_logger::init(); + + // Create the uProtocol transport using Zenoh as the underlying transport + let transport = UPTransportZenoh::builder("hpc") + .expect("authority not accepted!") + .build(/* ... building for now without configuration ... */) + .await + .expect("unable to build UPTransportZenoh"); + + // Subscribe to image sensor data from EGOVehicle + let image_uri = UUri::from_str("//EGOVehicle/0/2/8013")?; // IMAGE_SENSOR resource + + println!("Subscribing to image data from: {}", image_uri.to_uri(false)); + + // Register the image listener + transport + .register_listener( + &image_uri, + None, + Arc::new(ImageListener::new()), + ) + .await + .expect("Failed to register image listener"); + + println!("Listening for image data... Press Ctrl+C to exit"); + + // Keep the program running using a proper async loop + let running = Arc::new(std::sync::atomic::AtomicBool::new(true)); + let running_clone = running.clone(); + + ctrlc::set_handler(move || { + println!("Cancelled by user. Bye!"); + running_clone.store(false, Ordering::SeqCst); + }) + .expect("Error setting Ctrl-C handler"); + + while running.load(Ordering::SeqCst) { + tokio::time::sleep(tokio::time::Duration::from_millis(100)).await; + } + + println!("Exiting..."); + + Ok(()) +} From ec84331866d186e850f8564d4c59c2f65df7e535 Mon Sep 17 00:00:00 2001 From: Juan Pizarro Date: Sat, 4 Oct 2025 13:00:24 +0200 Subject: [PATCH 2/3] reset FPS counters --- .../examples/display_example_zenoh.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ego-vehicle/uprotocol-sensors/examples/display_example_zenoh.rs b/ego-vehicle/uprotocol-sensors/examples/display_example_zenoh.rs index 4cae88b..3d09573 100644 --- a/ego-vehicle/uprotocol-sensors/examples/display_example_zenoh.rs +++ b/ego-vehicle/uprotocol-sensors/examples/display_example_zenoh.rs @@ -40,6 +40,7 @@ impl ImageListener { #[async_trait::async_trait] impl UListener for ImageListener { async fn on_receive(&self, msg: UMessage) { + // if let Some(payload) = msg.payload { let Some(payload) = msg.payload.as_deref() else { return; @@ -51,7 +52,7 @@ impl UListener for ImageListener { // Track received frames let received_frame_number = self.received_frame_count.fetch_add(1, Ordering::Relaxed) + 1; println!("Received image data payload of {} bytes (Received Frame #{})", payload.len(), received_frame_number); - + // Use proper deserialization with ImageEventSerDe match serde_json::from_slice::(&payload) { Ok(image_data) => { @@ -199,7 +200,7 @@ async fn display_carla_image_from_raw(width: u32, height: u32, rgb_data: Vec let now = std::time::Instant::now(); if now.duration_since(*last_log_guard) >= std::time::Duration::from_secs(FPS_LOG_INTERVAL_SECONDS) { - let start_guard = match image_listener.fps_start_time.lock() { + let mut start_guard = match image_listener.fps_start_time.lock() { Ok(guard) => guard, Err(poisoned) => { eprintln!("Warning: FPS start time mutex was poisoned, recovering..."); @@ -211,9 +212,15 @@ async fn display_carla_image_from_raw(width: u32, height: u32, rgb_data: Vec let display_fps = frame_number as f64 / elapsed.as_secs_f64(); let received_frames = image_listener.received_frame_count.load(Ordering::Relaxed); let receive_fps = received_frames as f64 / elapsed.as_secs_f64(); - + println!("FPS - Display: {:.2}, Receive: {:.2} (Display Frame #{}, Received Frame #{}, Elapsed: {:.2}s)", display_fps, receive_fps, frame_number, received_frames, elapsed.as_secs_f64()); + + // Reset counters and start time for next interval + image_listener.frame_count.store(0, Ordering::Relaxed); + image_listener.received_frame_count.store(0, Ordering::Relaxed); + *start_guard = now; + *last_log_guard = now; } From bab2d072f571e30c9ebb7ef0067178e304408c69 Mon Sep 17 00:00:00 2001 From: Juan Pizarro Date: Sun, 5 Oct 2025 12:08:58 +0200 Subject: [PATCH 3/3] 35FPS using vec instead nested dict --- .../examples/display_example_zenoh.rs | 120 +++++++++++------- ego-vehicle/uprotocol-sensors/src/main.rs | 42 +++++- 2 files changed, 114 insertions(+), 48 deletions(-) diff --git a/ego-vehicle/uprotocol-sensors/examples/display_example_zenoh.rs b/ego-vehicle/uprotocol-sensors/examples/display_example_zenoh.rs index 3d09573..7597d1c 100644 --- a/ego-vehicle/uprotocol-sensors/examples/display_example_zenoh.rs +++ b/ego-vehicle/uprotocol-sensors/examples/display_example_zenoh.rs @@ -1,7 +1,8 @@ // Example demonstrating image display functionality from Zenoh // This example shows how to receive and display CARLA sensor images from uProtocol/Zenoh -use carla_data_serde::ImageEventSerDe; +// use carla_data_serde::ImageEventSerDe; +use carla::sensor::data::{Color}; use show_image::WindowOptions; use std::sync::{Arc, OnceLock}; use up_rust::{UTransport, UUri}; @@ -9,6 +10,8 @@ use up_rust::{UListener, UMessage}; use up_transport_zenoh::UPTransportZenoh; use std::str::FromStr; use std::sync::atomic::{AtomicU64, Ordering}; +use std::mem; +use carla::sensor::data::{Image as ImageEvent}; // // Rate limiting for image display @@ -37,6 +40,67 @@ impl ImageListener { } } +// TODO: Borrowed, zero-copy serializer for Image + +use serde::{Deserialize, Serialize}; +use ndarray::{Array2, ArrayView1, ArrayView2}; + +pub struct ImageEventSerBorrowed { + pub height: usize, + pub width: usize, + pub len: usize, + pub is_empty: bool, + pub fov_angle: f32, + // #[serde(with = "self::arrayview2_color_remote")] + // pub array: ArrayView2<'a, Color>, + pub array: Vec, // Flat RGB array: shape (height, width*4) +} + +/// Owned, round-trip serializer for Image +#[derive(Serialize, Deserialize)] +pub struct ImageEventSerDe { + pub height: usize, + pub width: usize, + pub len: usize, + pub is_empty: bool, + pub fov_angle: f32, + pub array: Vec, // Flat RGB array: shape (height, width*4) + // pub array: ndarray::Array2, // Flat RGB array: shape (height, width*3) +} + +impl From for ImageEventSerDe { + fn from(value: ImageEventSerBorrowed) -> Self { + // let height = value.height(); + // let width = value.width(); + // let view = value.as_array(); + + // // Create flat RGBA array + // let mut vec = Vec::with_capacity(view.len() * 4); + // for pixel in view.iter() { + // vec.push(pixel.r); // Red + // vec.push(pixel.g); // Green + // vec.push(pixel.b); // Blue + // vec.push(pixel.a); // Alpha + // } + // let array = ndarray::Array2::from_shape_vec((value.height, value.width), value.array).unwrap(); + + Self { + // height: value.height(), + // width: value.width(), + // len: value.len(), + // is_empty: value.is_empty(), + // fov_angle: value.fov_angle(), + // array, + height: value.height, + width: value.width, + len: value.len, + is_empty: value.is_empty, + fov_angle: value.fov_angle, + array: value.array, // owned, copied + } + } +} + #[async_trait::async_trait] impl UListener for ImageListener { async fn on_receive(&self, msg: UMessage) { @@ -53,7 +117,7 @@ impl UListener for ImageListener { let received_frame_number = self.received_frame_count.fetch_add(1, Ordering::Relaxed) + 1; println!("Received image data payload of {} bytes (Received Frame #{})", payload.len(), received_frame_number); - // Use proper deserialization with ImageEventSerDe + // // Use proper deserialization with ImageEventSerDe match serde_json::from_slice::(&payload) { Ok(image_data) => { println!("Successfully deserialized ImageEventSerDe"); @@ -63,50 +127,12 @@ impl UListener for ImageListener { let width = image_data.width as u32; let height = image_data.height as u32; - - // The array contains FfiColor structs in an ndarray format - let pixel_array = &image_data.array; - - println!("Pixel array shape: {:?}", pixel_array.shape()); - println!("Array dimensions: height={}, width={}", pixel_array.nrows(), pixel_array.ncols()); - - // Convert ndarray of FfiColor to RGB data - let mut rgb_data = Vec::with_capacity((width * height * 3) as usize); - let mut non_zero_count = 0; - - // Iterate through the 2D array - for row in 0..pixel_array.nrows() { - for col in 0..pixel_array.ncols() { - let pixel = &pixel_array[[row, col]]; - - // FfiColor has fields: b, g, r, a - let r = pixel.r; - let g = pixel.g; - let b = pixel.b; - - // Count non-zero pixels for debugging - if r != 0 || g != 0 || b != 0 { - non_zero_count += 1; - } - - // Add RGB values (convert BGRA to RGB) - rgb_data.push(r); - rgb_data.push(g); - rgb_data.push(b); - } - } - - println!("Converted {} pixels to RGB data", pixel_array.len()); - println!("Non-zero pixels: {} out of {}", non_zero_count, pixel_array.len()); - - // Check first few RGB pixels for debugging - if rgb_data.len() >= 12 { - println!("First 4 pixels RGB values: {:?}", &rgb_data[0..12]); - - // Check if image is all black - let non_zero_rgb_count = rgb_data.iter().filter(|&&x| x != 0).count(); - println!("Non-zero RGB pixels: {} out of {}", non_zero_rgb_count, rgb_data.len()); - } + + + // skip the alpha channel + let mut rgb_data = image_data.array.into_iter().enumerate() + .filter_map(|(i, byte)| if (i + 1) % 4 != 0 { Some(byte) } else { None }) + .collect::>(); // Ensure we have the right amount of data let expected_size = (width * height * 3) as usize; @@ -120,7 +146,7 @@ impl UListener for ImageListener { width, height, rgb_data, - "CARLA Image from Zenoh", + "CARLA Image from uProtocol over Zenoh Rust", self ).await { eprintln!("Failed to display image: {}", e); diff --git a/ego-vehicle/uprotocol-sensors/src/main.rs b/ego-vehicle/uprotocol-sensors/src/main.rs index 2323fa1..fc04ac7 100644 --- a/ego-vehicle/uprotocol-sensors/src/main.rs +++ b/ego-vehicle/uprotocol-sensors/src/main.rs @@ -34,6 +34,7 @@ use ego_vehicle::sensors::{ }; use log; use serde_json; +use serde::{Deserialize, Serialize}; use std::str::FromStr; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex}; @@ -135,6 +136,45 @@ impl UListener for EngageListener { } } +/// TODO: Borrowed, zero-copy serializer for Image +#[derive(Serialize)] +pub struct ImageEventVecSer { + pub height: usize, + pub width: usize, + pub len: usize, + pub is_empty: bool, + pub fov_angle: f32, + // #[serde(with = "self::arrayview2_color_remote")] + // pub array: ArrayView2<'a, Color>, + pub array: Vec, // Flat RGB array: shape (height, width*4) +} + +impl<'a> From<&'a ImageEvent> for ImageEventVecSer { + fn from(value: &'a ImageEvent) -> Self { + let height = value.height(); + let width = value.width(); + let view = value.as_array(); + + // Create flat RGB array + let mut array = Vec::with_capacity(view.len() * 4); + for pixel in view.iter() { + array.push(pixel.r); // Red + array.push(pixel.g); // Green + array.push(pixel.b); // Blue + array.push(pixel.a); // Alpha + } + Self { + height: value.height(), + width: value.width(), + len: value.len(), + is_empty: value.is_empty(), + fov_angle: value.fov_angle(), + // array: value.as_array(), // borrow, zero-copy + array, // owned, copied + } + } +} + #[tokio::main] async fn main() -> Result<(), Box> { // -- Parse command line arguments -- @@ -490,7 +530,7 @@ async fn main() -> Result<(), Box> { // Encoder: ImageEvent -> Vec (borrow-only) let encode = |evt: ImageEvent| { // Borrow the event so the payload can serialize without copying the image buffer - let serde_evt: ImageEventSerBorrowed<'_> = (&evt).into(); + let serde_evt: ImageEventVecSer = (&evt).into(); serde_json::to_vec(&serde_evt) .map_err(|e| -> Box { Box::new(e) }) };