Debian Codegraph @

src/formats/dds.rs

raw symbols SCIP
1 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::{BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#, Seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#, SeekFromrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/SeekFrom#};
2
3 use craterust-analyzer cargo imagesize 0.13.0 crate/::{
4 utilrust-analyzer cargo imagesize 0.13.0 util/::{read_u32rust-analyzer cargo imagesize 0.13.0 util/read_u32()., Endianrust-analyzer cargo imagesize 0.13.0 util/Endian#},
5 ImageResultrust-analyzer cargo imagesize 0.13.0 ImageResult#, ImageSizerust-analyzer cargo imagesize 0.13.0 ImageSize#,
6 };
7
8 pub fn sizerust-analyzer cargo imagesize 0.13.0 formats/dds/size().<R: BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead# + Seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#>(reader: &mut R) -> ImageResultrust-analyzer cargo imagesize 0.13.0 ImageResult#<ImageSizerust-analyzer cargo imagesize 0.13.0 ImageSize#> {
9 reader.seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#seek().(SeekFromrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/SeekFrom#::Startrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/SeekFrom#Start#(12))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
10 let height = read_u32rust-analyzer cargo imagesize 0.13.0 util/read_u32().(reader, &Endianrust-analyzer cargo imagesize 0.13.0 util/Endian#::Littlerust-analyzer cargo imagesize 0.13.0 util/Endian#Little#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as usize;
11 let width = read_u32rust-analyzer cargo imagesize 0.13.0 util/read_u32().(reader, &Endianrust-analyzer cargo imagesize 0.13.0 util/Endian#::Littlerust-analyzer cargo imagesize 0.13.0 util/Endian#Little#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as usize;
12 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(ImageSizerust-analyzer cargo imagesize 0.13.0 ImageSize# { widthrust-analyzer cargo imagesize 0.13.0 ImageSize#width., heightrust-analyzer cargo imagesize 0.13.0 ImageSize#height. })
13 }
14
15 pub fn matchesrust-analyzer cargo imagesize 0.13.0 formats/dds/matches().(header: &[u8]) -> bool {
16 header.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]starts_with().(b"DDS ")
17 }