1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! A codec for the [SVGA] animation format: decode, inspect and losslessly
//! edit. It renders nothing and makes no optimization decisions.
//!
//! There are two layers:
//!
//! - [`Document`] is the lossless one. It keeps every top-level protobuf field
//! as its original bytes, so unknown fields, field order and float bit
//! patterns survive, and an unedited document re-encodes to the exact same
//! payload. All edits happen here.
//! - [`Movie`] is a typed, read-only view decoded on demand from a document.
//!
//! ```
//! # fn main() -> Result<(), svga::Error> {
//! # let movie = svga::Movie { version: "2.0.0".into(), ..Default::default() };
//! # let file = svga::Document::from_movie(&movie, &[("hat", b"\x89PNG\r\n\x1a\n".as_slice())])?
//! # .to_bytes(svga::Compression::Fast)?;
//! let document = svga::Document::from_bytes(&file)?;
//! for image in document.images() {
//! println!("{:?}: {} bytes", image.key(), image.value().len());
//! }
//! let smaller = document.replace_image("hat", b"hat.png")?;
//! let bytes = smaller.to_bytes(svga::Compression::Best)?;
//! # assert!(!bytes.is_empty());
//! # Ok(())
//! # }
//! ```
//!
//! [SVGA]: https://github.com/svga/SVGA-Format
pub use ;
pub use ;
pub use ;
pub use ;
pub use Limits;
pub use Movie;