keyframe-1.1.1/.cargo_vcs_info.json0000644000000001360000000000100126370ustar { "git": { "sha1": "309885a98c25707ac7b2c9ca24f138da885b61ab" }, "path_in_vcs": "" }keyframe-1.1.1/.editorconfig000064400000000000000000000002241046102023000141020ustar 00000000000000root = true [*] charset = utf-8 indent_style = tab indent_size = 4 end_of_line = lf insert_final_newline = false trim_trailing_whitespace = truekeyframe-1.1.1/.gitignore000064400000000000000000000000351046102023000134150ustar 00000000000000/target **/*.rs.bk Cargo.lockkeyframe-1.1.1/Cargo.lock0000644000002037130000000000100106200ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "ab_glyph" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24606928a235e73cdef55a0c909719cadd72fce573e5713d58cb2952d8f5794c" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser 0.15.0", ] [[package]] name = "ab_glyph_rasterizer" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" [[package]] name = "adler" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "adler32" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "alsa" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5915f52fe2cf65e83924d037b6c5290b7cee097c6b5c8700746e6168a343fd6b" dependencies = [ "alsa-sys", "bitflags", "libc", "nix 0.23.1", ] [[package]] name = "alsa-sys" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" dependencies = [ "libc", "pkg-config", ] [[package]] name = "andrew" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" dependencies = [ "bitflags", "rusttype", "walkdir", "xdg", "xml-rs", ] [[package]] name = "android_glue" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" [[package]] name = "approx" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" dependencies = [ "num-traits", ] [[package]] name = "arrayvec" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base-x" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" [[package]] name = "bindgen" version = "0.59.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" dependencies = [ "bitflags", "cexpr", "clang-sys", "lazy_static", "lazycell", "peeking_take_while", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", ] [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "bumpalo" version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" [[package]] name = "bytecount" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" [[package]] name = "bytemuck" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c53dfa917ec274df8ed3c572698f381a24eef2efba9492d797301b72b6db408a" [[package]] name = "byteorder" version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "bzip2" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0" 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 = "calloop" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" dependencies = [ "log", "nix 0.18.0", ] [[package]] name = "camino" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "869119e97797867fd90f5e22af7d0bd274bd4635ebb9eb68c04f3f513ae6c412" dependencies = [ "serde", ] [[package]] name = "cargo-platform" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" dependencies = [ "serde", ] [[package]] name = "cargo_metadata" version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", "semver 1.0.12", "serde", "serde_json", ] [[package]] name = "cc" version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" dependencies = [ "jobserver", ] [[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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ "nom", ] [[package]] name = "cfg-if" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cgl" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" dependencies = [ "libc", ] [[package]] name = "clang-sys" version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" dependencies = [ "glob", "libc", "libloading 0.7.3", ] [[package]] name = "claxon" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bfbf56724aa9eca8afa4fcfadeb479e722935bb2a0900c2d37e0cc477af0688" [[package]] name = "cocoa" version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" dependencies = [ "bitflags", "block", "cocoa-foundation", "core-foundation 0.9.3", "core-graphics 0.22.3", "foreign-types", "libc", "objc", ] [[package]] name = "cocoa-foundation" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" dependencies = [ "bitflags", "block", "core-foundation 0.9.3", "core-graphics-types", "foreign-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 = "combine" version = "4.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948" dependencies = [ "bytes", "memchr", ] [[package]] name = "core-foundation" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" dependencies = [ "core-foundation-sys 0.6.2", "libc", ] [[package]] name = "core-foundation" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" dependencies = [ "core-foundation-sys 0.7.0", "libc", ] [[package]] name = "core-foundation" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys 0.8.3", "libc", ] [[package]] name = "core-foundation-sys" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" [[package]] name = "core-foundation-sys" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "core-foundation-sys" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "core-graphics" version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" dependencies = [ "bitflags", "core-foundation 0.7.0", "foreign-types", "libc", ] [[package]] name = "core-graphics" version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ "bitflags", "core-foundation 0.9.3", "core-graphics-types", "foreign-types", "libc", ] [[package]] name = "core-graphics-types" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ "bitflags", "core-foundation 0.9.3", "foreign-types", "libc", ] [[package]] name = "core-video-sys" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" dependencies = [ "cfg-if 0.1.10", "core-foundation-sys 0.7.0", "core-graphics 0.19.2", "libc", "objc", ] [[package]] name = "coreaudio-rs" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11894b20ebfe1ff903cbdc52259693389eea03b94918a2def2c30c3bf227ad88" dependencies = [ "bitflags", "coreaudio-sys", ] [[package]] name = "coreaudio-sys" version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dff444d80630d7073077d38d40b4501fd518bd2b922c2a55edcc8b0f7be57e6" dependencies = [ "bindgen", ] [[package]] name = "cpal" version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74117836a5124f3629e4b474eed03e479abaf98988b4bb317e29f08cfe0e4116" dependencies = [ "alsa", "core-foundation-sys 0.8.3", "coreaudio-rs", "jni", "js-sys", "lazy_static", "libc", "mach 0.3.2", "ndk 0.6.0", "ndk-glue 0.6.2", "nix 0.23.1", "oboe", "parking_lot", "stdweb 0.1.3", "thiserror", "web-sys", "winapi", ] [[package]] name = "crc32fast" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "crossbeam" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" dependencies = [ "cfg-if 1.0.0", "crossbeam-channel", "crossbeam-deque", "crossbeam-epoch", "crossbeam-queue", "crossbeam-utils", ] [[package]] name = "crossbeam-channel" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c02a4d71819009c192cf4872265391563fd6a84c81ff2c0f2a7026ca4c1d85c" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" dependencies = [ "cfg-if 1.0.0", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07db9d94cbd326813772c968ccd25999e5f8ae22f4f8d1b11effa37ef6ce281d" dependencies = [ "autocfg", "cfg-if 1.0.0", "crossbeam-utils", "memoffset", "once_cell", "scopeguard", ] [[package]] name = "crossbeam-queue" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f25d8400f4a7a5778f0e4e52384a48cbd9b5c495d110786187fc750075277a2" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" dependencies = [ "cfg-if 1.0.0", "once_cell", ] [[package]] name = "cty" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "darling" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" dependencies = [ "darling_core 0.10.2", "darling_macro 0.10.2", ] [[package]] name = "darling" version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ "darling_core 0.13.4", "darling_macro 0.13.4", ] [[package]] name = "darling_core" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.9.3", "syn", ] [[package]] name = "darling_core" version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.10.0", "syn", ] [[package]] name = "darling_macro" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" dependencies = [ "darling_core 0.10.2", "quote", "syn", ] [[package]] name = "darling_macro" version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core 0.13.4", "quote", "syn", ] [[package]] name = "deflate" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" dependencies = [ "adler32", "byteorder", ] [[package]] name = "directories" version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7" dependencies = [ "dirs-sys", ] [[package]] name = "dirs" version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", "redox_users", "winapi", ] [[package]] name = "discard" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" [[package]] name = "dispatch" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" [[package]] name = "dlib" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" dependencies = [ "libloading 0.6.7", ] [[package]] name = "dlib" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" dependencies = [ "libloading 0.7.3", ] [[package]] name = "downcast-rs" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "draw_state" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33cf9537e2d06891448799b96d5a8c8083e0e90522a7fdabe6ebf4f41d79d651" dependencies = [ "bitflags", ] [[package]] name = "either" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" [[package]] name = "error-chain" version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" dependencies = [ "version_check", ] [[package]] name = "euclid" version = "0.22.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b52c2ef4a78da0ba68fbe1fd920627411096d2ac478f7f4c9f3a54ba6705bade" dependencies = [ "num-traits", ] [[package]] name = "fastrand" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" dependencies = [ "instant", ] [[package]] name = "float_next_after" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fc612c5837986b7104a87a0df74a5460931f1c5274be12f8d0f40aa2f30d632" dependencies = [ "num-traits", ] [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[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 = "getrandom" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if 1.0.0", "libc", "wasi", ] [[package]] name = "gfx" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01de46f9508a5c259aef105f0bff760ceddca832ea9c87ce03d1923e22ee155b" dependencies = [ "draw_state", "gfx_core", "log", ] [[package]] name = "gfx_core" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75fbddaef2e12b4995900539d7209d947b988a3d87ee8737484d049b526e5441" dependencies = [ "bitflags", "draw_state", "log", ] [[package]] name = "gfx_device_gl" version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "109c385fa380c18888633aa27d1e16cbae518469702a2f69dcb5f52d5378bebc" dependencies = [ "gfx_core", "gfx_gl", "log", ] [[package]] name = "gfx_gl" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2d38164670920cfb7491bc0cf6f49f0554bd1c44cdbedc6c78d2bf91691ff5e" dependencies = [ "gl_generator", ] [[package]] name = "ggez" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2481c5fcf83c5d51172850a3ee2ae36d86f9961d39851c6bec99108f87f085d" dependencies = [ "approx", "bitflags", "bytemuck", "directories", "gfx", "gfx_core", "gfx_device_gl", "gilrs", "glam", "glutin", "glyph_brush", "image", "log", "lyon", "mint", "old_school_gfx_glutin_ext", "rodio", "serde", "serde_derive", "skeptic", "smart-default", "toml", "winit", "zip", ] [[package]] name = "gif" version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3edd93c6756b4dfaf2709eafcc345ba2636565295c198a9cfbf75fa5e3e00b06" dependencies = [ "color_quant", "weezl", ] [[package]] name = "gilrs" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1550c8bdebc993576e343d600a954654708a9a1182396ee1e805d6fe60c72909" dependencies = [ "fnv", "gilrs-core", "log", "uuid", "vec_map", ] [[package]] name = "gilrs-core" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c7262ce1e88429c9b1d847820c9d2ba00adafc955218393d9c0861d5aaab88" dependencies = [ "core-foundation 0.6.4", "io-kit-sys", "libc", "libudev-sys", "log", "nix 0.23.1", "rusty-xinput", "stdweb 0.4.20", "uuid", "vec_map", "winapi", ] [[package]] name = "gl_generator" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" dependencies = [ "khronos_api", "log", "xml-rs", ] [[package]] name = "glam" version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" dependencies = [ "mint", ] [[package]] name = "glob" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "glutin" version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "762d6cd2e1b855d99668ebe591cc9058659d85ac39a9a2078000eb122ddba8f0" dependencies = [ "android_glue", "cgl", "cocoa", "core-foundation 0.9.3", "glutin_egl_sys", "glutin_emscripten_sys", "glutin_gles2_sys", "glutin_glx_sys", "glutin_wgl_sys", "lazy_static", "libloading 0.7.3", "log", "objc", "osmesa-sys", "parking_lot", "wayland-client", "wayland-egl", "winapi", "winit", ] [[package]] name = "glutin_egl_sys" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2abb6aa55523480c4adc5a56bbaa249992e2dddb2fc63dc96e04a3355364c211" dependencies = [ "gl_generator", "winapi", ] [[package]] name = "glutin_emscripten_sys" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80de4146df76e8a6c32b03007bc764ff3249dcaeb4f675d68a06caf1bac363f1" [[package]] name = "glutin_gles2_sys" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094e708b730a7c8a1954f4f8a31880af00eb8a1c5b5bf85d28a0a3c6d69103" dependencies = [ "gl_generator", "objc", ] [[package]] name = "glutin_glx_sys" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e393c8fc02b807459410429150e9c4faffdb312d59b8c038566173c81991351" dependencies = [ "gl_generator", "x11-dl", ] [[package]] name = "glutin_wgl_sys" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3da5951a1569dbab865c6f2a863efafff193a93caf05538d193e9e3816d21696" dependencies = [ "gl_generator", ] [[package]] name = "glyph_brush" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a69c65dd1f1fbb6209aa00f78636e436ad0a55b7d8e5de886d00720dcad9c6e2" dependencies = [ "glyph_brush_draw_cache", "glyph_brush_layout", "log", "ordered-float", "rustc-hash", "twox-hash", ] [[package]] name = "glyph_brush_draw_cache" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6010675390f6889e09a21e2c8b575b3ee25667ea8237a8d59423f73cb8c28610" dependencies = [ "ab_glyph", "crossbeam-channel", "crossbeam-deque", "linked-hash-map", "rayon", "rustc-hash", ] [[package]] name = "glyph_brush_layout" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc32c2334f00ca5ac3695c5009ae35da21da8c62d255b5b96d56e2597a637a38" dependencies = [ "ab_glyph", "approx", "xi-unicode", ] [[package]] name = "hermit-abi" version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "hound" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" [[package]] name = "ident_case" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "image" version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" dependencies = [ "bytemuck", "byteorder", "color_quant", "gif", "num-iter", "num-rational", "num-traits", "png", "tiff", ] [[package]] name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "io-kit-sys" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f21dcc74995dd4cd090b147e79789f8d65959cbfb5f0b118002db869ea3bd0a0" dependencies = [ "core-foundation-sys 0.6.2", "mach 0.2.3", ] [[package]] name = "itoa" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" [[package]] name = "jni" version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" dependencies = [ "cesu8", "combine", "jni-sys", "log", "thiserror", "walkdir", ] [[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.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" dependencies = [ "libc", ] [[package]] name = "jpeg-decoder" version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" [[package]] name = "js-sys" version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" dependencies = [ "wasm-bindgen", ] [[package]] name = "keyframe" version = "1.1.1" dependencies = [ "ggez", "mint", "num-derive", "num-traits", ] [[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 = "lewton" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030" dependencies = [ "byteorder", "ogg", "tinyvec", ] [[package]] name = "libc" version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "libloading" version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" dependencies = [ "cfg-if 1.0.0", "winapi", ] [[package]] name = "libloading" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ "cfg-if 1.0.0", "winapi", ] [[package]] name = "libm" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" [[package]] name = "libudev-sys" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c8469b4a23b962c1396b9b451dda50ef5b283e8dd309d69033475fa9b334324" dependencies = [ "libc", "pkg-config", ] [[package]] name = "linked-hash-map" version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "lock_api" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" dependencies = [ "autocfg", "scopeguard", ] [[package]] name = "log" version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "lyon" version = "0.17.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf0510ed5e3e2fb80f3db2061ef5ca92d87bfda1a624bb1eacf3bd50226e4cbb" dependencies = [ "lyon_algorithms", "lyon_tessellation", ] [[package]] name = "lyon_algorithms" version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8037f716541ba0d84d3de05c0069f8068baf73990d55980558b84d944c8a244a" dependencies = [ "lyon_path", "sid", ] [[package]] name = "lyon_geom" version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d89ccbdafd83d259403e22061be27bccc3254bba65cdc5303250c4227c8c8e" dependencies = [ "arrayvec", "euclid", "num-traits", ] [[package]] name = "lyon_path" version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b0a59fdf767ca0d887aa61d1b48d4bbf6a124c1a45503593f7d38ab945bfbc0" dependencies = [ "lyon_geom", ] [[package]] name = "lyon_tessellation" version = "0.17.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7230e08dd0638048e46f387f255dbe7a7344a3e6705beab53242b5af25635760" dependencies = [ "float_next_after", "lyon_path", ] [[package]] name = "mach" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" dependencies = [ "libc", ] [[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 = "memchr" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" 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 = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "minimp3" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "985438f75febf74c392071a975a29641b420dd84431135a6e6db721de4b74372" dependencies = [ "minimp3-sys", "slice-deque", "thiserror", ] [[package]] name = "minimp3-sys" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e21c73734c69dc95696c9ed8926a2b393171d98b3f5f5935686a26a487ab9b90" dependencies = [ "cc", ] [[package]] name = "miniz_oxide" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" dependencies = [ "adler32", ] [[package]] name = "miniz_oxide" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ "adler", "autocfg", ] [[package]] name = "mint" version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" [[package]] name = "mio" version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", "miow", "ntapi", "winapi", ] [[package]] name = "mio-misc" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b47412f3a52115b936ff2a229b803498c7b4d332adeb87c2f1498c9da54c398c" dependencies = [ "crossbeam", "crossbeam-queue", "log", "mio", ] [[package]] name = "miow" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" dependencies = [ "winapi", ] [[package]] name = "ndk" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" dependencies = [ "jni-sys", "ndk-sys 0.2.2", "num_enum", "thiserror", ] [[package]] name = "ndk" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" dependencies = [ "bitflags", "jni-sys", "ndk-sys 0.3.0", "num_enum", "thiserror", ] [[package]] name = "ndk-context" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" [[package]] name = "ndk-glue" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5caf0c24d51ac1c905c27d4eda4fa0635bbe0de596b8f79235e0b17a4d29385" dependencies = [ "lazy_static", "libc", "log", "ndk 0.3.0", "ndk-macro 0.2.0", "ndk-sys 0.2.2", ] [[package]] name = "ndk-glue" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d0c4a7b83860226e6b4183edac21851f05d5a51756e97a1144b7f5a6b63e65f" dependencies = [ "lazy_static", "libc", "log", "ndk 0.6.0", "ndk-context", "ndk-macro 0.3.0", "ndk-sys 0.3.0", ] [[package]] name = "ndk-macro" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" dependencies = [ "darling 0.10.2", "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", ] [[package]] name = "ndk-macro" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" dependencies = [ "darling 0.13.4", "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", ] [[package]] name = "ndk-sys" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" [[package]] name = "ndk-sys" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" dependencies = [ "jni-sys", ] [[package]] name = "nix" version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" dependencies = [ "bitflags", "cc", "cfg-if 0.1.10", "libc", ] [[package]] name = "nix" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" dependencies = [ "bitflags", "cc", "cfg-if 1.0.0", "libc", ] [[package]] name = "nix" version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" dependencies = [ "bitflags", "cc", "cfg-if 1.0.0", "libc", "memoffset", ] [[package]] name = "nom" version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" dependencies = [ "memchr", "minimal-lexical", ] [[package]] name = "ntapi" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" dependencies = [ "winapi", ] [[package]] name = "num-derive" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2", "quote", "syn", ] [[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.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" dependencies = [ "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-traits" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", "libm", ] [[package]] name = "num_cpus" version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", ] [[package]] name = "num_enum" version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn", ] [[package]] name = "objc" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" dependencies = [ "malloc_buf", ] [[package]] name = "oboe" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27f63c358b4fa0fbcfefd7c8be5cfc39c08ce2389f5325687e7762a48d30a5c1" dependencies = [ "jni", "ndk 0.6.0", "ndk-context", "num-derive", "num-traits", "oboe-sys", ] [[package]] name = "oboe-sys" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3370abb7372ed744232c12954d920d1a40f1c4686de9e79e800021ef492294bd" dependencies = [ "cc", ] [[package]] name = "ogg" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6951b4e8bf21c8193da321bcce9c9dd2e13c858fe078bf9054a288b419ae5d6e" dependencies = [ "byteorder", ] [[package]] name = "old_school_gfx_glutin_ext" version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1026bdd085523158bd5a1cf0ccbf39b7753c96ccbd54e7f6144ed1518f0046b3" dependencies = [ "gfx_core", "gfx_device_gl", "glutin", ] [[package]] name = "once_cell" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" [[package]] name = "ordered-float" version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96bcbab4bfea7a59c2c0fe47211a1ac4e3e96bea6eb446d704f310bc5c732ae2" dependencies = [ "num-traits", ] [[package]] name = "osmesa-sys" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" dependencies = [ "shared_library", ] [[package]] name = "owned_ttf_parser" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" dependencies = [ "ttf-parser 0.6.2", ] [[package]] name = "owned_ttf_parser" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb1e509cfe7a12db2a90bfa057dfcdbc55a347f5da677c506b53dd099cfec9d" dependencies = [ "ttf-parser 0.15.2", ] [[package]] name = "parking_lot" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ "cfg-if 1.0.0", "instant", "libc", "redox_syscall", "smallvec", "winapi", ] [[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.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pkg-config" version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "png" version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" dependencies = [ "bitflags", "crc32fast", "deflate", "miniz_oxide 0.3.7", ] [[package]] name = "ppv-lite86" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "proc-macro-crate" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ "toml", ] [[package]] name = "proc-macro-crate" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ "thiserror", "toml", ] [[package]] name = "proc-macro2" version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34f197a544b0c9ab3ae46c359a7ec9cbbb5c7bf97054266fecb7ead794a181d6" dependencies = [ "bitflags", "memchr", "unicase", ] [[package]] name = "quote" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" dependencies = [ "proc-macro2", ] [[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.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ "getrandom", ] [[package]] name = "raw-window-handle" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e28f55143d0548dad60bb4fbdc835a3d7ac6acc3324506450c5fdd6e42903a76" dependencies = [ "libc", "raw-window-handle 0.4.3", ] [[package]] name = "raw-window-handle" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" dependencies = [ "cty", ] [[package]] name = "rayon" version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" dependencies = [ "autocfg", "crossbeam-deque", "either", "rayon-core", ] [[package]] name = "rayon-core" version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" dependencies = [ "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", "num_cpus", ] [[package]] name = "redox_syscall" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ "bitflags", ] [[package]] name = "redox_users" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", "redox_syscall", "thiserror", ] [[package]] name = "regex" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "regex-syntax", ] [[package]] name = "regex-syntax" version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "remove_dir_all" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ "winapi", ] [[package]] name = "rodio" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d98f5e557b61525057e2bc142c8cd7f0e70d75dc32852309bec440e6e046bf9" dependencies = [ "claxon", "cpal", "hound", "lewton", "minimp3", ] [[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.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ "semver 0.9.0", ] [[package]] name = "rusttype" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser 0.6.0", ] [[package]] name = "rusty-xinput" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2aa654bc32eb9ca14cce1a084abc9dfe43949a4547c35269a094c39272db3bb" dependencies = [ "lazy_static", "log", "winapi", ] [[package]] name = "ryu" version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" [[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 = "scoped-tls" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ "semver-parser", ] [[package]] name = "semver" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" dependencies = [ "serde", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1578c6245786b9d168c5447eeacfb96856573ca56c9d68fdcf394be134882a47" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_json" version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" dependencies = [ "itoa", "ryu", "serde", ] [[package]] name = "sha1" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" dependencies = [ "sha1_smol", ] [[package]] name = "sha1_smol" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[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 = "sid" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd5ac56c121948b4879bba9e519852c211bcdd8f014efff766441deff0b91bdb" dependencies = [ "num-traits", ] [[package]] name = "skeptic" version = "0.13.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" dependencies = [ "bytecount", "cargo_metadata", "error-chain", "glob", "pulldown-cmark", "tempfile", "walkdir", ] [[package]] name = "slice-deque" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31ef6ee280cdefba6d2d0b4b78a84a1c1a3f3a4cec98c2d4231c8bc225de0f25" dependencies = [ "libc", "mach 0.3.2", "winapi", ] [[package]] name = "smallvec" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" [[package]] name = "smart-default" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "smithay-client-toolkit" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80" dependencies = [ "andrew", "bitflags", "calloop", "dlib 0.4.2", "lazy_static", "log", "memmap2", "nix 0.18.0", "wayland-client", "wayland-cursor", "wayland-protocols", ] [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stdweb" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" [[package]] name = "stdweb" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" dependencies = [ "discard", "rustc_version", "serde", "serde_json", "stdweb-derive", "stdweb-internal-macros", "stdweb-internal-runtime", "wasm-bindgen", ] [[package]] name = "stdweb-derive" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" dependencies = [ "proc-macro2", "quote", "serde", "serde_derive", "syn", ] [[package]] name = "stdweb-internal-macros" version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" dependencies = [ "base-x", "proc-macro2", "quote", "serde", "serde_derive", "serde_json", "sha1", "syn", ] [[package]] name = "stdweb-internal-runtime" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" [[package]] name = "strsim" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "strsim" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "tempfile" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if 1.0.0", "fastrand", "libc", "redox_syscall", "remove_dir_all", "winapi", ] [[package]] name = "thiserror" version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "tiff" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a53f4706d65497df0c4349241deddf35f84cee19c87ed86ea8ca590f4464437" dependencies = [ "jpeg-decoder", "miniz_oxide 0.4.4", "weezl", ] [[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "toml" version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] [[package]] name = "ttf-parser" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" [[package]] name = "ttf-parser" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b3e06c9b9d80ed6b745c7159c40b311ad2916abb34a49e9be2653b90db0d8dd" [[package]] name = "twox-hash" version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if 1.0.0", "rand", "static_assertions", ] [[package]] name = "unicase" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" dependencies = [ "version_check", ] [[package]] name = "unicode-ident" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" [[package]] name = "uuid" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "vec_map" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[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.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", "winapi", "winapi-util", ] [[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.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" dependencies = [ "bumpalo", "lazy_static", "log", "proc-macro2", "quote", "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" dependencies = [ "proc-macro2", "quote", "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" [[package]] name = "wayland-client" version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3ab332350e502f159382201394a78e3cc12d0f04db863429260164ea40e0355" dependencies = [ "bitflags", "downcast-rs", "libc", "nix 0.20.0", "scoped-tls", "wayland-commons", "wayland-scanner", "wayland-sys", ] [[package]] name = "wayland-commons" version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a21817947c7011bbd0a27e11b17b337bfd022e8544b071a2641232047966fbda" dependencies = [ "nix 0.20.0", "once_cell", "smallvec", "wayland-sys", ] [[package]] name = "wayland-cursor" version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a" dependencies = [ "nix 0.20.0", "wayland-client", "xcursor", ] [[package]] name = "wayland-egl" version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99ba1ab1e18756b23982d36f08856d521d7df45015f404a2d7c4f0b2d2f66956" dependencies = [ "wayland-client", "wayland-sys", ] [[package]] name = "wayland-protocols" version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f" dependencies = [ "bitflags", "wayland-client", "wayland-commons", "wayland-scanner", ] [[package]] name = "wayland-scanner" version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce923eb2deb61de332d1f356ec7b6bf37094dc5573952e1c8936db03b54c03f1" dependencies = [ "proc-macro2", "quote", "xml-rs", ] [[package]] name = "wayland-sys" version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8" dependencies = [ "dlib 0.5.0", "lazy_static", "pkg-config", ] [[package]] name = "web-sys" version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" 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 = "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 = "winit" version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79610794594d5e86be473ef7763f604f2159cbac8c94debd00df8fb41e86c2f8" dependencies = [ "bitflags", "cocoa", "core-foundation 0.9.3", "core-graphics 0.22.3", "core-video-sys", "dispatch", "instant", "lazy_static", "libc", "log", "mio", "mio-misc", "ndk 0.3.0", "ndk-glue 0.3.0", "ndk-sys 0.2.2", "objc", "parking_lot", "percent-encoding", "raw-window-handle 0.3.4", "scopeguard", "smithay-client-toolkit", "wayland-client", "winapi", "x11-dl", ] [[package]] name = "x11-dl" version = "2.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" dependencies = [ "lazy_static", "libc", "pkg-config", ] [[package]] name = "xcursor" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" dependencies = [ "nom", ] [[package]] name = "xdg" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4583db5cbd4c4c0303df2d15af80f0539db703fa1c68802d4cbbd2dd0f88f6" dependencies = [ "dirs", ] [[package]] name = "xi-unicode" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" [[package]] name = "xml-rs" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" [[package]] name = "zip" version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" dependencies = [ "byteorder", "bzip2", "crc32fast", "thiserror", ] keyframe-1.1.1/Cargo.toml0000644000000024530000000000100106410ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" rust-version = "1.51" name = "keyframe" version = "1.1.1" authors = ["Hannes Mann "] description = "A simple library for animation in Rust" readme = "README.md" keywords = [ "animation", "transitions", "easing", "gamedev", "graphics", ] categories = [ "mathematics", "graphics", ] license = "MIT" repository = "https://github.com/HannesMann/keyframe" [package.metadata.docs.rs] rustdoc-args = [ "--html-in-header", "docs/preview.html", ] [dependencies.mint] version = "0.5.9" optional = true [dependencies.num-traits] version = "0.2.15" features = ["libm"] default-features = false [dev-dependencies.ggez] version = "0.7.0" [dev-dependencies.num-derive] version = "0.3.3" [features] alloc = [] default = [ "mint_types", "alloc", ] mint_types = ["mint"] keyframe-1.1.1/Cargo.toml.orig000064400000000000000000000015641046102023000143240ustar 00000000000000[package] name = "keyframe" description = "A simple library for animation in Rust" readme = "README.md" repository = "https://github.com/HannesMann/keyframe" license = "MIT" version = "1.1.1" edition = "2018" rust-version = "1.51" authors = ["Hannes Mann "] keywords = ["animation", "transitions", "easing", "gamedev", "graphics"] categories = ["mathematics", "graphics"] [dependencies] num-traits = {version = "0.2.15", default-features = false, features = ["libm"]} mint = { version = "0.5.9", optional = true } [dev-dependencies] ggez = "0.7.0" num-derive = "0.3.3" [features] default = ["mint_types", "alloc"] # Defines easing functions for mint's Vector2, Vector3, Vector4, Point2 and Point3 # Also required for BezierFunction mint_types = ["mint"] alloc = [] [package.metadata.docs.rs] rustdoc-args = [ "--html-in-header", "docs/preview.html" ]keyframe-1.1.1/LICENSE000064400000000000000000000020531046102023000124340ustar 00000000000000MIT License Copyright (c) 2019 Hannes Mann Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.keyframe-1.1.1/README.md000064400000000000000000000053461046102023000127160ustar 00000000000000# keyframe A simple library for animation in Rust [![Crate](https://img.shields.io/crates/v/keyframe.svg)](https://crates.io/crates/keyframe) [![Downloads](https://img.shields.io/crates/d/keyframe.svg)](https://crates.io/crates/keyframe) [![Documentation](https://docs.rs/keyframe/badge.svg)](https://docs.rs/keyframe) ![License](https://img.shields.io/crates/l/keyframe.svg) ## Features * Several [easing functions](https://easings.net/en), including user-defined Bézier curves (like CSS [cubic-bezier](https://www.w3.org/TR/css-easing-1/#cubic-bezier-easing-functions)) and keyframable curves * Animation sequences (like CSS [@keyframes](https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes)) * [mint](https://github.com/kvark/mint) integration for 2D/3D/4D support (points, rectangles, colors, etc) ## Usage Tweening between two values is done with `keyframe::ease(function, from, to, time)`. `from` and `to` can be any type that implements `CanTween`, such as `f64` or `mint::Vector2`, while `time` needs to be a floating-point value between zero and one. `function` specifies the transition between `from` and `to` and is any type that implements `EasingFunction`. `keyframe::AnimationSequence` can be used to create more complex animations that keep track of keyframes, time, etc. You can create animation sequences with the `keyframes![...]` macro, from an iterator or from a vector. ## Examples An example visualizer is included in `examples/`. Run `cargo run --example visualizer --release` to start it. (ggez is really slow in debug mode!) Tweening: ```rust use keyframe::{ease, functions::EaseInOut}; fn example() -> f64 { let a = 0.0; let b = 2.0; let time = 0.5; ease(EaseInOut, a, b, time) } ``` Animation sequences: ```rust use keyframe::{keyframes, Keyframe, AnimationSequence}; fn example() { // (value, time) or (value, time, function) let mut sequence = keyframes![ (0.5, 0.0), // <-- EaseInOut used from 0.0 to 0.3 (1.5, 0.3, Linear), // <-- Linear used from 0.3 to 1.0 (2.5, 1.0) // <-- Easing function here is never used, since we're at the end ]; sequence.advance_by(0.65); assert_eq!(sequence.now(), 2.0); assert_eq!(sequence.duration(), 1.0); } ``` Custom structures: ```rust use keyframe::mint::Point2; // This macro works with any structure as long as it only consists of types that implement "CanTween" use keyframe_derive::CanTween; #[derive(CanTween)] struct MySubStructure { a: f32 } #[derive(CanTween)] struct MyStructure { a: f64, b: Point2, c: f32, d: [MySubStructure; N] // Array length matching is guaranteed by the type system } // Also works with unnamed structures #[derive(CanTween)] struct UnnamedStructure(MyStructure, f64); ```keyframe-1.1.1/docs/preview.html000064400000000000000000000106131046102023000147270ustar 00000000000000 keyframe-1.1.1/examples/visualizer.rs000064400000000000000000000166721046102023000160240ustar 00000000000000use num_derive::FromPrimitive; use num_traits::FromPrimitive; use ggez::{Context, ContextBuilder, GameError, GameResult}; use ggez::conf::{WindowMode, WindowSetup}; use ggez::event::EventHandler; use ggez::graphics::*; use ggez::mint::Point2; use keyframe::{functions::*, keyframes, AnimationSequence}; fn main() -> GameResult { let (ctx, event_loop) = ContextBuilder::new("visualizer", "Hannes Mann") .window_mode( WindowMode::default() .dimensions(848.0, 480.0) .min_dimensions(500.0, 340.0) .resizable(true), ) .window_setup( WindowSetup::default() .title("Sequence Visualizer") .samples(ggez::conf::NumSamples::Four) .vsync(false), ) .build()?; let vis = Visualizer { example: VisualizerExample::EaseInOutFourPoint, keyframes: match_sequence(&VisualizerExample::EaseInOutFourPoint), time_in_crate: 0.0, }; ggez::event::run(ctx, event_loop, vis) } #[derive(Debug, FromPrimitive, Clone, PartialEq)] #[repr(i32)] enum VisualizerExample { LinearTwoPoint, LinearFourPoint, EaseInOutFourPoint, LinearCircle30Point, BezierFourPoint, KeyframesFunctionFourPoint, Last, } fn match_sequence(example: &VisualizerExample) -> AnimationSequence> { match example { VisualizerExample::LinearTwoPoint => { keyframes![([0.0, 0.0].into(), 0.0, Linear), ([1.0, 1.0].into(), 1.0, Linear)] } VisualizerExample::LinearFourPoint => keyframes![ ([0.0, 0.0].into(), 0.0, Linear), ([0.2, 0.4].into(), 0.3, Linear), ([0.8, 0.4].into(), 0.8, Linear), ([1.0, 1.0].into(), 1.0, Linear) ], VisualizerExample::EaseInOutFourPoint => keyframes![ ([0.0, 0.0].into(), 0.0), ([0.2, 0.4].into(), 0.3), ([0.8, 0.4].into(), 0.8), ([1.0, 1.0].into(), 1.0) ], VisualizerExample::LinearCircle30Point => { let mut keyframes = Vec::new(); for i in 0..=30 { let sin = ((i as f32 / 30.0) * std::f32::consts::PI * 2.0).sin(); let cos = ((i as f32 / 30.0) * std::f32::consts::PI * 2.0).cos(); keyframes.push(([sin * 0.5 + 0.5, cos * 0.5 + 0.5].into(), i as f64 / 30.0, Linear).into()); } AnimationSequence::from(keyframes) } VisualizerExample::BezierFourPoint => { // https://easings.net/en#easeInCirc let bezier = BezierCurve::from([0.6, 0.04].into(), [0.98, 0.335].into()); keyframes![ ([0.0, 0.0].into(), 0.0, bezier), ([0.2, 0.4].into(), 0.3, bezier), ([0.8, 0.4].into(), 0.8, bezier), ([1.0, 1.0].into(), 1.0, bezier) ] } VisualizerExample::KeyframesFunctionFourPoint => { // The easing function is normalized after creation, this is the same as specifying: // (0.0, 0.0, Linear) // (0.4, 0.4, Linear) // (0.4, 0.8, Linear) // (1.0, 1.0, Linear) let function = keyframes![ (-0.0, 0.0, Linear), (-0.8, 0.4, Linear), (-0.8, 0.8, Linear), (-2.0, 1.0, Linear) ] .to_easing_function(); keyframes![ ([0.0, 0.0].into(), 0.0, function), ([0.2, 0.4].into(), 0.3, function), ([0.8, 0.4].into(), 0.8, function), ([1.0, 1.0].into(), 1.0, function) ] } _ => keyframes![], } } struct Visualizer { example: VisualizerExample, keyframes: AnimationSequence>, time_in_crate: f64, } impl EventHandler for Visualizer { fn update(&mut self, ctx: &mut Context) -> GameResult<()> { self.time_in_crate = 0.0; let now = std::time::Instant::now(); self.keyframes .advance_and_maybe_reverse(ggez::timer::delta(ctx).as_secs_f64() * 0.5); self.time_in_crate += (std::time::Instant::now() - now).as_secs_f64(); Ok(()) } fn draw(&mut self, ctx: &mut Context) -> GameResult<()> { let screen_size = drawable_size(ctx); clear(ctx, Color::WHITE); let t = Text::new(TextFragment { text: format!( "{:?} {:.2}/{:.2} s", self.example, self.keyframes.time() * 2.0, self.keyframes.duration() * 2.0 ), font: None, scale: Some(PxScale::from(40.0)), ..Default::default() }); let size = t.dimensions(ctx); draw( ctx, &t, DrawParam::default() .dest([(screen_size.0 / 2.0 - size.w as f32 / 2.0).round(), 20.0]) .color(Color::BLACK), )?; let t = Text::new(TextFragment { text: format!("{:?} -> {:?}", self.keyframes.pair().0, self.keyframes.pair().1), font: None, scale: Some(PxScale::from(15.0)), ..Default::default() }); let size = t.dimensions(ctx); draw( ctx, &t, DrawParam::default() .dest([(screen_size.0 / 2.0 - size.w as f32 / 2.0).round(), 60.0]) .color(Color::BLACK), )?; let t = Text::new(TextFragment { text: "Press left or right to switch example".to_owned(), font: None, scale: Some(PxScale::from(30.0)), ..Default::default() }); let size = t.dimensions(ctx); draw( ctx, &t, DrawParam::default() .dest([ (screen_size.0 / 2.0 - size.w as f32 / 2.0).round(), screen_size.1 - 60.0, ]) .color(Color::BLACK), )?; let area = [100.0, 160.0, screen_size.0 - 100.0 * 2.0, screen_size.1 - 160.0 * 2.0]; let now = std::time::Instant::now(); let kf_now = self.keyframes.now_strict().unwrap(); let point: Point2 = [area[0] + kf_now.x * area[2], area[1] + (1.0 - kf_now.y) * area[3]].into(); self.time_in_crate += (std::time::Instant::now() - now).as_secs_f64(); let circle = Mesh::new_circle( ctx, DrawMode::Fill(FillOptions::DEFAULT), point, 4.0, 2.0, Color::new(0.83, 0.17, 0.12, 1.0), )?; draw(ctx, &circle, DrawParam::default())?; for k in &self.keyframes { let text = Text::new(TextFragment { text: format!("({:.1}, {:.1}) at {:.1} s", k.value().x, k.value().y, k.time() * 2.0), font: None, scale: Some(PxScale::from(14.0)), ..Default::default() }); let p: Point2 = [ (area[0] + k.value().x * area[2] - text.dimensions(ctx).w as f32 / 2.0).round(), (area[1] + (1.0 - k.value().y) * area[3] - 20.0).round(), ] .into(); draw( ctx, &text, DrawParam::default().dest(p).color(Color::new(0.83, 0.17, 0.12, 1.0)), )?; } let t = Text::new(TextFragment { text: format!( "FPS: {:.1} (ft: {:.2} ms, c: {:.2} ms)", ggez::timer::fps(ctx), ggez::timer::delta(ctx).as_secs_f64() * 1000.0, self.time_in_crate * 1000.0 ), font: None, scale: Some(PxScale::from(20.0)), ..Default::default() }); draw( ctx, &t, DrawParam::default() .dest([10.0, 10.0]) .color(Color::new(0.1, 0.9, 0.1, 1.0)), )?; present(ctx) } fn resize_event(&mut self, ctx: &mut Context, width: f32, height: f32) { set_screen_coordinates(ctx, [0.0, 0.0, width, height].into()).expect("Couldn't resize screen"); } fn key_down_event( &mut self, _ctx: &mut Context, keycode: ggez::input::keyboard::KeyCode, _keymods: ggez::input::keyboard::KeyMods, _repeat: bool, ) { let now = std::time::Instant::now(); let mut example: i32 = unsafe { std::mem::transmute(self.example.clone()) }; example += match keycode { ggez::input::keyboard::KeyCode::Left => -1, ggez::input::keyboard::KeyCode::Right => 1, _ => 0, }; if example < 0 { example = unsafe { std::mem::transmute::(VisualizerExample::Last) - 1 }; } else if example >= unsafe { std::mem::transmute::(VisualizerExample::Last) } { example = 0; } if self.example != FromPrimitive::from_i32(example).unwrap_or(VisualizerExample::LinearTwoPoint) { self.example = FromPrimitive::from_i32(example).unwrap_or(VisualizerExample::LinearTwoPoint); self.keyframes = match_sequence(&self.example); self.time_in_crate += (std::time::Instant::now() - now).as_secs_f64(); } } } keyframe-1.1.1/rustfmt.toml000064400000000000000000000000401046102023000140220ustar 00000000000000hard_tabs = true max_width = 120keyframe-1.1.1/src/easing.rs000064400000000000000000000115451046102023000140400ustar 00000000000000use core::borrow::Borrow; use core::mem::MaybeUninit; pub(crate) use crate::*; #[cfg(feature = "mint_types")] pub use mint_type_impls::*; /// Implementation of a 2D curve function for easing between two points pub trait EasingFunction { /// For an X position on the curve, calculate the Y position. /// 0.0-1.0 is start and end on both axes but values can go out of bounds. /// /// # Note /// /// Because this method has a `&self` argument this trait can be used to both implement a "static" curve function (e.g. a linear interpolation) /// or a "dynamic" curve function (e.g. a bezier curve with user defined inputs). /// /// Since a static curve function will have zero size the size of a `dyn EasingFunction` will be the same size as a vtable. /// This also means you can specify a static curve function with only the name of the type (e.g. `ease(EaseInOut, 0.0, 1.0, 0.5)`). fn y(&self, x: f64) -> f64; } /// Type that can be used with an easing function pub trait CanTween { /// Returns the interpolated value between `from` and `to` at the specified time. /// /// # Note /// This function will always create a new value, so calling it on very large structures is not a good idea. fn ease(from: Self, to: Self, time: impl Float) -> Self; } impl CanTween for f32 { #[inline] fn ease(from: Self, to: Self, time: impl Float) -> Self { as_t(as_f64(from) + as_f64(to - from) * as_f64(time)) } } impl CanTween for f64 { #[inline] fn ease(from: Self, to: Self, time: impl Float) -> Self { as_t(as_f64(from) + as_f64(to - from) * as_f64(time)) } } impl CanTween for [T; N] { fn ease(from: Self, to: Self, time: impl Float) -> Self { // This is safe, see: https://doc.rust-lang.org/core/mem/union.MaybeUninit.html#initializing-an-array-element-by-element let mut result_uninit: [MaybeUninit; N] = unsafe { MaybeUninit::uninit().assume_init() }; for (i, (f, t)) in IntoIterator::into_iter(from) .zip(IntoIterator::into_iter(to)) .enumerate() { // Initialize the array while moving elements out of from and to... result_uninit[i].write(T::ease(f, t, time)); } unsafe { // MaybeUninit is guaranteed to have the same size, alignment, and ABI as T. let ptr = result_uninit.as_mut_ptr() as *mut [T; N]; let result = ptr.read(); core::mem::forget(result_uninit); result } } } /// Returns the value at a specified X position on the curve between point A and point B. /// The time argument is expected to stay within a range of 0.0 to 1.0 but bounds checking is not enforced. #[inline] pub fn ease_with_unbounded_time( function: impl Borrow, from: V, to: V, time: impl Float, ) -> V { V::ease(from, to, function.borrow().y(as_f64(time))) } /// Returns the value at a specified X position on the curve between point A and point B. /// Time is limited to a range between 0.0 and 1.0. #[inline] pub fn ease(function: impl Borrow, from: V, to: V, time: T) -> V { ease_with_unbounded_time( function, from, to, match time { _ if time < T::zero() => T::zero(), _ if time > T::one() => T::one(), _ => time, }, ) } /// Returns the value at a specified X position on the curve between point A and point B. /// Time is limited to a range between 0.0 and `max_time`. #[inline] pub fn ease_with_scaled_time( function: impl Borrow, from: V, to: V, time: T, max_time: T, ) -> V { ease( function, from, to, match time { _ if time < T::zero() => T::zero(), _ if time > max_time => T::one(), _ => time / max_time, }, ) } #[cfg(feature = "mint_types")] mod mint_type_impls { use crate::easing::*; impl CanTween for Vector2 { #[inline] fn ease(from: Self, to: Self, time: impl Float) -> Self { Self { x: V::ease(from.x, to.x, time), y: V::ease(from.y, to.y, time), } } } impl CanTween for Vector3 { #[inline] fn ease(from: Self, to: Self, time: impl Float) -> Self { Self { x: V::ease(from.x, to.x, time), y: V::ease(from.y, to.y, time), z: V::ease(from.z, to.z, time), } } } impl CanTween for Vector4 { #[inline] fn ease(from: Self, to: Self, time: impl Float) -> Self { Self { x: V::ease(from.x, to.x, time), y: V::ease(from.y, to.y, time), z: V::ease(from.z, to.z, time), w: V::ease(from.w, to.w, time), } } } impl CanTween for Point2 { #[inline] fn ease(from: Self, to: Self, time: impl Float) -> Self { Self { x: V::ease(from.x, to.x, time), y: V::ease(from.y, to.y, time), } } } impl CanTween for Point3 { #[inline] fn ease(from: Self, to: Self, time: impl Float) -> Self { Self { x: V::ease(from.x, to.x, time), y: V::ease(from.y, to.y, time), z: V::ease(from.z, to.z, time), } } } } keyframe-1.1.1/src/functions/dynamic_functions.rs000064400000000000000000000132241046102023000203120ustar 00000000000000use crate::*; pub(crate) const SAMPLE_TABLE_SIZE: usize = 20; #[cfg(feature = "mint_types")] mod bezier { use crate::functions::dynamic_functions::*; const NEWTON_ITERTIONS: usize = 4; const NEWTON_MIN_SLOPE: f32 = 0.001; const SUBDIVISION_PRECISION: f32 = 0.0000001; const SUBDIVISION_MAX_ITERATIONS: usize = 10; /// User-defined cubic Bézier curve #[derive(Copy, Clone, Debug)] pub struct BezierCurve { sample_table: [f32; SAMPLE_TABLE_SIZE], p1: Vector2, p2: Vector2, } // Directly translated from https://github.com/gre/bezier-easing impl BezierCurve { #[inline] fn a(x1: f32, x2: f32) -> f32 { 1.0 - 3.0 * x2 + 3.0 * x1 } #[inline] fn b(x1: f32, x2: f32) -> f32 { 3.0 * x2 - 6.0 * x1 } #[inline] fn c(x1: f32) -> f32 { 3.0 * x1 } #[inline] fn at(t: f32, x1: f32, x2: f32) -> f32 { ((Self::a(x1, x2) * t + Self::b(x1, x2)) * t + Self::c(x1)) * t } #[inline] fn slope(t: f32, x1: f32, x2: f32) -> f32 { 3.0 * Self::a(x1, x2) * t * t + 2.0 * Self::b(x1, x2) * t + Self::c(x1) } fn newton_raphson(x: f32, guess: f32, x1: f32, x2: f32) -> f32 { let mut guess = guess; for _ in 0..NEWTON_ITERTIONS { let current_slope = Self::slope(guess, x1, x2); if current_slope == 0.0 { break; } let current_x = Self::at(guess, x1, x2) - x; guess -= current_x / current_slope; } guess } fn binary_subdivide(x: f32, mut a: f32, mut b: f32, x1: f32, x2: f32) -> f32 { let mut current_x = 0.0; let mut current_t = 0.0; let mut i = 0; let mut has_run_once = false; while !has_run_once || current_x.abs() > SUBDIVISION_PRECISION && i + 1 < SUBDIVISION_MAX_ITERATIONS { has_run_once = true; current_t = a + (b - a) / 2.0; current_x = Self::at(current_t, x1, x2) - x; if current_x > 0.0 { b = current_t; } else { a = current_t; } i += 1; } current_t } fn t_for_x(&self, x: f32) -> f32 { let mut interval_start = 0.0; let mut current_sample = 1; let last_sample = SAMPLE_TABLE_SIZE - 1; let sample_step_size = 1.0 / (SAMPLE_TABLE_SIZE as f32 - 1.0); while current_sample != last_sample && self.sample_table[current_sample] <= x { interval_start += sample_step_size; current_sample += 1; } current_sample -= 1; let dist = (x - self.sample_table[current_sample]) / (self.sample_table[current_sample + 1] - self.sample_table[current_sample]); let guess_for_t = interval_start + dist * sample_step_size; match Self::slope(guess_for_t, self.p1.x, self.p2.x) { inital_slope if inital_slope >= NEWTON_MIN_SLOPE => { Self::newton_raphson(x, guess_for_t, self.p1.x, self.p2.x) } inital_slope if inital_slope == 0.0 => guess_for_t, _ => Self::binary_subdivide( x, interval_start, interval_start + sample_step_size, self.p1.x, self.p2.x, ), } } fn convert_vector(c: Vector2) -> Vector2 { Vector2:: { x: as_t::(as_f64(c.x)), y: as_t::(as_f64(c.y)), } } /// Calculates a new cubic Bézier curve. Mimics `transition-timing-function: cubic-bezier` as defined [here](https://www.w3.org/TR/css-easing-1/#cubic-bezier-easing-functions) /// /// # Arguments /// /// * `p1` - The first of the two control points /// * `p2` - The second of the two control points pub fn from(p1: Vector2, p2: Vector2) -> Self { let p1 = Self::convert_vector(p1); let p2 = Self::convert_vector(p2); let mut arr = [0.0; SAMPLE_TABLE_SIZE]; for (i, value) in (0..SAMPLE_TABLE_SIZE) .enumerate() .map(|x| (x.0, Self::at(x.1 as f32 * SAMPLE_TABLE_SIZE as f32, p1.x, p2.x))) { arr[i] = value; } BezierCurve { sample_table: arr, p1, p2, } } } impl EasingFunction for BezierCurve { #[inline] fn y(&self, x: f64) -> f64 { match x { _ if x == 0.0 => 0.0, _ if x == 1.0 => 1.0, _ => BezierCurve::at(self.t_for_x(x as f32), self.p1.y, self.p2.y) as f64, } } } } #[cfg(feature = "mint_types")] pub use bezier::*; /// User-defined easing function which wraps a normalized [`AnimationSequence`] #[derive(Copy, Clone, Debug)] pub struct Keyframes([f64; SAMPLE_TABLE_SIZE]); impl Keyframes { #[cfg(feature = "alloc")] pub(crate) fn from_easing_function(mut s: AnimationSequence) -> Self { let mut low_point = s.sequence.get(0).and_then(|kf| kf.value().to_f64()).unwrap_or(0.0); let mut high_point = s .sequence .get(s.keyframes() - 1) .and_then(|kf| kf.value().to_f64()) .unwrap_or(1.0); let max_time = s.duration(); if high_point == 0.0 || high_point == low_point { low_point = 0.0; high_point = 1.0; // no dividing by zero } let mut sample_table = [0.0; SAMPLE_TABLE_SIZE]; for (i, item) in sample_table.iter_mut().enumerate() { s.advance_to((i as f64 / (SAMPLE_TABLE_SIZE - 1) as f64) * max_time); *item = (s.now_strict().and_then(|v| v.to_f64()).unwrap_or(0.5) - low_point) / (high_point - low_point); } Keyframes(sample_table) } } impl EasingFunction for Keyframes { fn y(&self, x: f64) -> f64 { let sample_table_size = SAMPLE_TABLE_SIZE as f64 - 1.0; let current_sample = (x * sample_table_size).floor() as i64; let difference = x * sample_table_size - (x * sample_table_size).floor(); let next_sample = current_sample + 1; if next_sample >= SAMPLE_TABLE_SIZE as i64 { self.0[current_sample as usize] } else if current_sample < -1 { -self.0[0] } /* same as self.0[0] * -1 */ else if current_sample < 0 { self.0[0] * difference } else { self.0[current_sample as usize] + (self.0[next_sample as usize] - self.0[current_sample as usize]) * difference } } } keyframe-1.1.1/src/functions/mod.rs000064400000000000000000000001511046102023000153500ustar 00000000000000mod static_functions; pub use static_functions::*; mod dynamic_functions; pub use dynamic_functions::*; keyframe-1.1.1/src/functions/static_functions.rs000064400000000000000000000144101046102023000201530ustar 00000000000000use crate::easing::*; // Based on https://gist.githubusercontent.com/gre/1650294/raw/01bf897e14c41f90c8fcda739fdc793790138446/easing.js // and https://github.com/warrenm/AHEasing/blob/master/AHEasing/easing.c /// Linear interpolation from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct Linear; impl EasingFunction for Linear { #[inline] fn y(&self, x: f64) -> f64 { x } } /// Step function, returns the closest to either point A or B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct Step; impl EasingFunction for Step { #[inline] fn y(&self, x: f64) -> f64 { x.round() } } /// Hold function, always returns A /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct Hold; impl EasingFunction for Hold { #[inline] fn y(&self, _x: f64) -> f64 { 0.0 } } /// Accelerating quadratically from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseInQuad; impl EasingFunction for EaseInQuad { #[inline] fn y(&self, x: f64) -> f64 { x * x } } /// Decelerating quadratically from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseOutQuad; impl EasingFunction for EaseOutQuad { #[inline] fn y(&self, x: f64) -> f64 { x * (2.0 - x) } } /// Accelerating then decelerating quadratically from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseInOutQuad; impl EasingFunction for EaseInOutQuad { #[inline] fn y(&self, x: f64) -> f64 { if x < 0.5 { 2.0 * x * x } else { -1.0 + (4.0 - 2.0 * x) * x } } } /// Accelerating cubically from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseInCubic; impl EasingFunction for EaseInCubic { #[inline] fn y(&self, x: f64) -> f64 { x * x * x } } /// Decelerating cubically from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseOutCubic; impl EasingFunction for EaseOutCubic { #[inline] fn y(&self, x: f64) -> f64 { let x_minus_one = x - 1.0; 1.0 + x_minus_one * x_minus_one * x_minus_one } } /// Accelerating then decelerating cubically from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseInOutCubic; impl EasingFunction for EaseInOutCubic { #[inline] fn y(&self, x: f64) -> f64 { if x < 0.5 { 4.0 * x * x * x } else { let x_minus_one = x - 1.0; x_minus_one * (2.0 * x - 2.0) * (2.0 * x - 2.0) + 1.0 } } } /// Accelerating quartically from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseInQuart; impl EasingFunction for EaseInQuart { #[inline] fn y(&self, x: f64) -> f64 { x * x * x * x } } /// Decelerating quartically from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseOutQuart; impl EasingFunction for EaseOutQuart { #[inline] fn y(&self, x: f64) -> f64 { let x_minus_one = x - 1.0; 1.0 - x_minus_one * x_minus_one * x_minus_one * x_minus_one } } /// Accelerating then decelerating quartically from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseInOutQuart; impl EasingFunction for EaseInOutQuart { #[inline] fn y(&self, x: f64) -> f64 { if x < 0.5 { 8.0 * x * x * x * x } else { let x_minus_one = x - 1.0; 1.0 - 8.0 * x_minus_one * x_minus_one * x_minus_one * x_minus_one } } } /// Accelerating quintically from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseInQuint; impl EasingFunction for EaseInQuint { #[inline] fn y(&self, x: f64) -> f64 { x * x * x * x * x } } /// Decelerating quintically from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseOutQuint; impl EasingFunction for EaseOutQuint { #[inline] fn y(&self, x: f64) -> f64 { let x_minus_one = x - 1.0; 1.0 + x_minus_one * x_minus_one * x_minus_one * x_minus_one * x_minus_one } } /// Accelerating then decelerating quintically from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseInOutQuint; impl EasingFunction for EaseInOutQuint { #[inline] fn y(&self, x: f64) -> f64 { if x < 0.5 { 16.0 * x * x * x * x * x } else { let x_minus_one = x - 1.0; 1.0 + 16.0 * x_minus_one * x_minus_one * x_minus_one * x_minus_one * x_minus_one } } } /// Accelerating on 1/4 of a sine wave from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseIn; impl EasingFunction for EaseIn { #[inline] fn y(&self, x: f64) -> f64 { ((x - 1.0) * core::f64::consts::FRAC_PI_2).sin() + 1.0 } } /// Decelerating on 1/4 of a sine wave from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseOut; impl EasingFunction for EaseOut { #[inline] fn y(&self, x: f64) -> f64 { (x * core::f64::consts::FRAC_PI_2).sin() } } /// Accelerating then decelerating on 1/2 of a sine wave from point A to point B /// ///
#[derive(Copy, Clone, Debug, Default)] pub struct EaseInOut; impl EasingFunction for EaseInOut { #[inline] fn y(&self, x: f64) -> f64 { 0.5 * (1.0 - (x * core::f64::consts::PI).cos()) } } keyframe-1.1.1/src/keyframe.rs000064400000000000000000000111251046102023000143670ustar 00000000000000use alloc::{boxed::Box, fmt, sync::Arc}; use num_traits::Float; use crate::{ as_f64, ease_with_scaled_time, easing::{EaseInOut, Linear}, CanTween, EasingFunction, }; /// Intermediate step in an animation sequence #[derive(Clone)] pub struct Keyframe { value: T, pub(crate) time: f64, function: Arc, } impl Keyframe { /// Creates a new keyframe from the specified values. /// If the time value is negative the keyframe will start at 0.0. /// /// # Arguments /// * `value` - The value that this keyframe will be tweened to/from /// * `time` - The start time in seconds of this keyframe /// * `function` - The easing function to use from the start of this keyframe to the start of the next keyframe #[inline] pub fn new(value: T, time: F, function: impl EasingFunction + 'static + Send + Sync) -> Self { Keyframe:: { value, time: if time < F::zero() { 0.0 } else { as_f64(time) }, function: Arc::new(function), } } /// Same as [`new`](#method.new), but allows you to supply an easing function which size is not known at compile time. /// /// # Arguments /// * `value` - The value that this keyframe will be tweened to/from /// * `time` - The start time in seconds of this keyframe /// * `function` - The easing function to use from the start of this keyframe to the start of the next keyframe #[inline] pub fn new_dynamic(value: T, time: F, function: Box) -> Self { Keyframe:: { value, time: if time < F::zero() { 0.0 } else { as_f64(time) }, function: function.into(), } } /// The value of this keyframe #[inline] pub fn value(&self) -> T where T: Clone, { self.value.clone() } /// The time in seconds at which this keyframe starts in a sequence #[inline] pub fn time(&self) -> f64 { self.time } /// The easing function that will be used when tweening to another keyframe #[inline] pub fn function(&self) -> &dyn EasingFunction { self.function.as_ref() } /// Returns the value between this keyframe and the next keyframe at the specified time /// /// # Note /// /// The following applies if: /// * The requested time is before the start time of this keyframe: the value of this keyframe is returned /// * The requested time is after the start time of next keyframe: the value of the next keyframe is returned /// * The start time of the next keyframe is before the start time of this keyframe: the value of the next keyframe is returned #[inline] pub fn tween_to(&self, next: &Keyframe, time: impl Float) -> T where T: CanTween + Clone, { match as_f64(time) { // If the requested time starts before this keyframe time if time < self.time => self.value.clone(), // If the requested time starts after the next keyframe time if time > next.time => next.value.clone(), // If the next keyframe starts before this keyframe _ if next.time < self.time => next.value.clone(), time => T::ease( self.value.clone(), next.value.clone(), self.function.y(ease_with_scaled_time( Linear, 0.0, 1.0, time - self.time, next.time - self.time, )), ), } } } impl From<(V, T)> for Keyframe { /// Creates a new keyframe from a tuple of (value, time). /// `EaseInOut` will be used as the easing function. /// If the time value is negative the keyframe will start at 0.0. #[inline] fn from(tuple: (V, T)) -> Self { Keyframe::new(tuple.0, as_f64(tuple.1), EaseInOut) } } impl From<(V, T, F)> for Keyframe { /// Creates a new keyframe from a tuple of (value, time, function). /// If the time value is negative the keyframe will start at 0.0. #[inline] fn from(tuple: (V, T, F)) -> Self { Keyframe::new(tuple.0, as_f64(tuple.1), tuple.2) } } impl From<(V, T, Box)> for Keyframe { /// Creates a new keyframe from a tuple of (value, time, function). /// If the time value is negative the keyframe will start at 0.0. #[inline] fn from(tuple: (V, T, Box)) -> Self { Keyframe::new_dynamic(tuple.0, as_f64(tuple.1), tuple.2) } } impl fmt::Display for Keyframe { #[inline] fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { write!(f, "Keyframe at {:.2} s: {}", self.time, self.value) } } impl fmt::Debug for Keyframe { #[inline] fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { write!(f, "Keyframe {{ value: {:?}, time: {:.2} }}", self.value, self.time) } } keyframe-1.1.1/src/lib.rs000064400000000000000000000102641046102023000133350ustar 00000000000000//! A simple library for animation in Rust //! //! ## Usage //! //! Tweening between two values is done with [`ease(function, from, to, time)`](fn.ease.html). //! `from` and `to` can be any type that implements [`CanTween`], such as `f64` or `mint::Vector2`, while `time` needs to be a floating-point value between zero and one. //! `function` specifies the transition between `from` and `to` and is any type that implements [`EasingFunction`]. //! //! [`AnimationSequence`] can be used to create more complex animations that keep track of keyframes, time, etc. //! You can create animation sequences with the [`keyframes![...]`](macro.keyframes.html) macro, from an iterator or from a vector. //! //! ## Embedded //! //! This library is embedded compatible. As default it uses the `alloc` crate for dynamic memory usage. So, if the `alloc` feature is turned off, //! by setting `default-features = false`, this `crate` can be used without dynamic memory usage. Keep in mind that this will disable the feature `mint_types` //! as well. This must be enabled by hand again. //! //! Disabled features: //! - [`Keyframe`] //! - [`AnimationSequence`] //! //! //! ## Examples //! //! An example visualizer is included in `examples/`. Run `cargo run --example visualizer --release` to start it. (ggez is really slow in debug mode!) //! //! Tweening: //! //! ```rust //! use keyframe::{ease, functions::EaseInOut}; //! //! fn example() -> f64 { //! let a = 0.0; //! let b = 2.0; //! let time = 0.5; //! //! ease(EaseInOut, a, b, time) //! } //! ``` //! //! Animation sequences: //! //! ```rust //! use keyframe::{keyframes, Keyframe, AnimationSequence, functions::Linear}; //! //! fn example() { //! // (value, time) or (value, time, function) //! let mut sequence = keyframes![ //! (0.5, 0.0), // <-- EaseInOut used from 0.0 to 0.3 //! (1.5, 0.3, Linear), // <-- Linear used from 0.3 to 1.0 //! (2.5, 1.0) // <-- Easing function here is never used, since we're at the end //! ]; //! //! sequence.advance_by(0.65); //! //! assert_eq!(sequence.now(), 2.0); //! assert_eq!(sequence.duration(), 1.0); //! } //! ``` //! //! Custom structures: //! //! ```rust //! use keyframe::mint::Point2; //! // This macro works with any structure as long as it only consists of types that implement "CanTween" //! use keyframe_derive::CanTween; //! //! #[derive(CanTween)] //! struct MySubStructure { //! a: f32 //! } //! //! #[derive(CanTween)] //! struct MyStructure { //! a: f64, //! b: Point2, //! c: f32, //! d: [MySubStructure; N] // Array length matching is guaranteed by the type system //! } //! //! // Also works with unnamed structures //! #[derive(CanTween)] //! struct UnnamedStructure(MyStructure, f64); //! ``` #![no_std] #[cfg(feature = "mint_types")] pub use mint; pub use num_traits; #[cfg(feature = "mint_types")] pub(crate) use mint::{Point2, Point3, Vector2, Vector3, Vector4}; pub(crate) use num_traits::Float; #[cfg(feature = "alloc")] extern crate alloc; pub(crate) fn as_f64(value: impl Float) -> f64 { value.to_f64().expect("Value not representable in f64") } pub(crate) fn as_t(value: f64) -> T { match value { _ if value > as_f64(T::max_value()) => T::max_value(), _ if value < as_f64(T::min_value()) => T::min_value(), #[cfg(feature = "alloc")] _ => T::from(value).unwrap_or_else(|| panic!("{} not representable in chosen float type", value)), #[cfg(not(feature = "alloc"))] _ => T::from(value).expect("value not representable in chosen float type"), } } /// Definitions for various easing functions /// ///
///
///
///
pub mod functions; use functions::*; mod easing; pub use easing::*; #[cfg(feature = "alloc")] mod keyframe; #[cfg(feature = "alloc")] pub use keyframe::*; #[cfg(feature = "alloc")] mod sequence; #[cfg(feature = "alloc")] pub use sequence::*; keyframe-1.1.1/src/sequence.rs000064400000000000000000000265571046102023000144130ustar 00000000000000use alloc::vec::Vec; use core::iter::FromIterator; use num_traits::Float; use crate::{ easing::{Keyframes, Linear}, CanTween, Keyframe, }; /// Category of animation sequence error #[derive(Debug)] pub enum AnimationSequenceError { /// An attempt was made to insert a keyframe into the sequence when another keyframe already exists with the same start time TimeCollision(f64), } /// A collection of keyframes that can be played back in sequence #[derive(Clone, Default)] pub struct AnimationSequence { pub(crate) sequence: Vec>, // Current item we're animating keyframe: Option, // Current time time: f64, } impl AnimationSequence { /// Creates a new empty animation sequence #[inline] pub fn new() -> Self { AnimationSequence:: { sequence: Vec::new(), keyframe: None, time: 0.0, } } fn update_current_keyframe(&mut self) { // Common cases, reversing/wrapping if !self.sequence.is_empty() && self.time == 0.0 { self.keyframe = Some(0); return; } if !self.sequence.is_empty() && self.time == self.duration() { self.keyframe = Some(self.sequence.len() - 1); return; } if let Some(k) = self.keyframe { if self.keyframes() <= k { self.keyframe = None; } if self.sequence[k].time() > self.time { for i in (0..self.keyframe.unwrap_or(0)).rev() { if self.sequence[i].time <= self.time { self.keyframe = Some(i); return; } self.keyframe = None; } } else { let copy = self.keyframe; self.keyframe = None; for i in copy.unwrap_or(0)..self.keyframes() { if self.sequence[i].time > self.time { break; } else { self.keyframe = Some(i) } } } } else if self.keyframes() > 0 { self.keyframe = Some(0); self.update_current_keyframe(); } } fn insert_into_vec(&mut self, keyframe: Keyframe) -> Result<(), AnimationSequenceError> { if self.has_keyframe_at(keyframe.time()) { Err(AnimationSequenceError::TimeCollision(keyframe.time())) } else { self.sequence.push(keyframe); Ok(()) } } /// Inserts a new keyframe into the animation sequence pub fn insert(&mut self, keyframe: Keyframe) -> Result<(), AnimationSequenceError> { if self.has_keyframe_at(keyframe.time()) { Err(AnimationSequenceError::TimeCollision(keyframe.time())) } else { match self.sequence.last() { Some(last) if keyframe.time() > last.time() => { self.sequence.insert(self.sequence.len(), keyframe); } Some(last) if keyframe.time() < last.time() => { self.sequence.insert(0, keyframe); } _ => { self.sequence.push(keyframe); // Gives us the following guarantees: // * the item that comes next also has a later time // * the first item has the earliest time // * the last item has the last time (useful for remove_at) self.sequence .sort_unstable_by(|k, k2| k.time.partial_cmp(&k2.time).unwrap_or(core::cmp::Ordering::Equal)); } } self.update_current_keyframe(); Ok(()) } } /// Inserts several keyframes from an iterator all at once. /// This is faster because sorting only needs to be done after all the keyframes have been inserted. pub fn insert_many( &mut self, keyframes: impl IntoIterator>>, ) -> Result<(), AnimationSequenceError> { for k in keyframes { self.insert_into_vec(k.into())?; } self.sequence .sort_unstable_by(|k, k2| k.time.partial_cmp(&k2.time).unwrap_or(core::cmp::Ordering::Equal)); self.update_current_keyframe(); Ok(()) } /// Removes the keyframe from the sequence at the specified time. Returns true if a keyframe was actually removed pub fn remove(&mut self, timestamp: f64) -> bool { self.retain(|t| t != timestamp) } /// Removes all keyframes from this sequence pub fn clear(&mut self) { self.retain(|_| false); } /// Retains only the keyframes specified by the predicate. Works the same as `Vec::retain`. /// Returns true only if a keyframe was actually removed. pub fn retain bool>(&mut self, mut f: F) -> bool { let old_len = self.keyframes(); self.sequence.retain(|k| f(k.time())); if old_len != self.keyframes() { if self.time > self.duration() { self.time = self.duration(); } self.update_current_keyframe(); true } else { false } } /// If this sequence has a keyframe at the exact timestamp #[inline] pub fn has_keyframe_at(&self, timestamp: f64) -> bool { self.into_iter().any(|k| k.time() == timestamp) } /// The number of keyframes in this sequence #[inline] pub fn keyframes(&self) -> usize { self.sequence.len() } /// The current pair of keyframes that are being animated (current, next) /// /// # Note /// /// The following applies if: /// * There are no keyframes in this sequence: (`None`, `None`) is returned /// * The sequence has not reached the first keyframe: (`None`, current) is returned /// * There is only one keyframe in this sequence and the sequence has reached it: (current, `None`) is returned /// * The sequence has finished: (current, `None`) is returned pub fn pair(&self) -> (Option<&Keyframe>, Option<&Keyframe>) { match self.keyframe { Some(c) if c == self.sequence.len() - 1 => (Some(&self.sequence[c]), None), Some(c) => (Some(&self.sequence[c]), Some(&self.sequence[c + 1])), None if !self.sequence.is_empty() => (None, Some(&self.sequence[0])), None => (None, None), } } /// The current value of this sequence, only based on the existing sequence entries. pub fn now_strict(&self) -> Option where T: CanTween + Clone, { match self.pair() { (Some(s1), Some(s2)) => Some(s1.tween_to(s2, self.time)), (Some(s1), None) => Some(s1.value()), (None, Some(s2)) => Some(s2.value()), (None, None) => None, } } /// The current value of this sequence, use the default if necessary. pub fn now(&self) -> T where T: CanTween + Clone + Default, { match self.pair() { (Some(s1), Some(s2)) => s1.tween_to(s2, self.time), (Some(s1), None) => s1.value(), (None, Some(s2)) => Keyframe::new(T::default(), 0.0, Linear).tween_to(s2, self.time), (None, None) => Keyframe::new(T::default(), 0.0, Linear).value(), } } /// Advances this sequence by the duration specified. /// /// Returns the remaining time (i.e. the amount that the specified duration went outside the bounds of the total duration of this sequence) /// after the operation has completed. /// /// A value over 0 indicates the sequence is at the finish point. /// A value under 0 indicates this sequence is at the start point. pub fn advance_by(&mut self, duration: f64) -> f64 { self.advance_to(self.time() + duration) } /// Advances this sequence by the duration specified. /// If the duration causes the sequence to go out of bounds it will reverse and return `true`. pub fn advance_and_maybe_reverse(&mut self, duration: f64) -> bool { match self.advance_by(duration) { time if time == 0.0 => false, time => { self.reverse(); if time < 0.0 { self.advance_to(self.duration()); } self.advance_and_maybe_reverse(time); true } } } /// Advances this sequence by the duration specified. /// If the duration causes the sequence to go out of bounds it will wrap around and return `true`. pub fn advance_and_maybe_wrap(&mut self, duration: f64) -> bool { match self.advance_by(duration) { time if time == 0.0 => false, time => { self.advance_to(if time < 0.0 { self.duration() } else { 0.0 }); self.advance_and_maybe_wrap(time); true } } } /// Advances this sequence to the exact timestamp. /// /// Returns the remaining time (i.e. the amount that the specified timestamp went outside the bounds of the total duration of this sequence) /// after the operation has completed. /// /// A value over 0 indicates the sequence is at the finish point. /// A value under 0 indicates this sequence is at the start point. /// /// # Note /// /// The following applies if: /// * The timestamp is negative: the sequence is set to `0.0` /// * The timestamp is after the duration of the sequence: the sequence is set to `duration()` pub fn advance_to(&mut self, timestamp: f64) -> f64 { self.time = match timestamp { _ if timestamp < 0.0 => 0.0, _ if timestamp > self.duration() => self.duration(), _ => timestamp, }; self.update_current_keyframe(); timestamp - self.time } /// The length in seconds of this sequence #[inline] pub fn duration(&self) -> f64 { // Keyframe::default means that if we don't have any items in this collection (meaning - 1 is out of bounds) the maximum time will be 0.0 self.sequence .get(self.sequence.len().saturating_sub(1)) .map_or(0.0, |kf| kf.time) } /// The current progression of this sequence in seconds #[inline] pub fn time(&self) -> f64 { self.time } /// The current progression of this sequence as a percentage #[inline] pub fn progress(&self) -> f64 { if self.duration() == 0.0 { 0.0 } else { self.time / self.duration() } } /// If this sequence has finished and is at the end. /// It can be reset with `advance_to(0.0)`. #[inline] pub fn finished(&self) -> bool { self.time == self.duration() } /// Reverses the order of all keyframes in this sequence pub fn reverse(&mut self) { let max_time = self.duration(); let mut reversed_vector = Vec::new(); for i in (0..self.sequence.len()).rev() { let mut k = self.sequence.remove(i); k.time = max_time - k.time; reversed_vector.push(k); } self.sequence = reversed_vector; self.advance_to(0.0); } } impl AnimationSequence { /// Consumes this sequence and creates a normalized easing function which controls the 2D curve according to the keyframes in this sequence /// /// # Note /// /// This function is only implemented for one-dimensional float types, since each value corresponds to a Y position pub fn to_easing_function(self) -> Keyframes { Keyframes::from_easing_function(self) } } impl From>> for AnimationSequence { /// Creates a new animation sequence from a vector of keyframes fn from(vec: Vec>) -> Self { let mut me = AnimationSequence:: { sequence: vec, keyframe: None, time: 0.0, }; me.sequence .sort_unstable_by(|k, k2| k.time.partial_cmp(&k2.time).unwrap_or(core::cmp::Ordering::Equal)); me.sequence.dedup_by_key(|k| k.time()); me.update_current_keyframe(); me } } impl>> FromIterator for AnimationSequence { /// Creates a new animation sequence from an iterator fn from_iter>(iter: I2) -> Self { let mut me = Self::new(); me.insert_many(iter).ok(); // Ignore errors, collisions will be discarded me } } impl<'a, T> IntoIterator for &'a AnimationSequence { type Item = &'a Keyframe; type IntoIter = core::slice::Iter<'a, Keyframe>; #[inline] fn into_iter(self) -> Self::IntoIter { self.sequence.as_slice().iter() } } /// Creates an animation sequence containing any arguments that can be made into keyframes /// /// # Note /// /// While this macro can be used with [`Keyframe::new`] it's recommended to specify your keyframes with tuples (for shorter code) like this: /// ```ignore /// keyframes![(0.0, 0.0), (0.5, 1.0), (1.0, 2.0), (1.5, 3.0, EaseOut), (2.0, 4.0)] /// ``` #[macro_export] macro_rules! keyframes { () => (AnimationSequence::new()); ($($k: expr),*) => {{ let mut vec = Vec::new(); $( vec.push($k.into()); )* AnimationSequence::from(vec) }}; }