Debian Codegraph @

src/lib.rs

raw symbols SCIP
1 //! Decoding and Encoding of TIFF Images
2 //!
3 //! TIFF (Tagged Image File Format) is a versatile image format that supports
4 //! lossless and lossy compression.
5 //!
6 //! # Related Links
7 //! * <https://web.archive.org/web/20210108073850/https://www.adobe.io/open/standards/TIFF.html> - The TIFF specification
8
9 mod bytecastrust-analyzer cargo tiff 0.11.3 bytecast/;
10 pub mod decoderrust-analyzer cargo tiff 0.11.3 decoder/;
11 mod directoryrust-analyzer cargo tiff 0.11.3 directory/;
12 pub mod encoderrust-analyzer cargo tiff 0.11.3 encoder/;
13 mod errorrust-analyzer cargo tiff 0.11.3 error/;
14 pub mod tagsrust-analyzer cargo tiff 0.11.3 tags/;
15
16 pub use selfrust-analyzer cargo tiff 0.11.3 crate/::directoryrust-analyzer cargo tiff 0.11.3 directory/::Directoryrust-analyzer cargo tiff 0.11.3 directory/Directory#;
17 pub use selfrust-analyzer cargo tiff 0.11.3 crate/::errorrust-analyzer cargo tiff 0.11.3 error/::{TiffErrorrust-analyzer cargo tiff 0.11.3 error/TiffError#, TiffFormatErrorrust-analyzer cargo tiff 0.11.3 error/TiffFormatError#, TiffResultrust-analyzer cargo tiff 0.11.3 error/TiffResult#, TiffUnsupportedErrorrust-analyzer cargo tiff 0.11.3 error/TiffUnsupportedError#, UsageErrorrust-analyzer cargo tiff 0.11.3 error/UsageError#};
18
19 /// An enumeration over supported color types and their bit depths
20 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:)]
21 #[non_exhaustive]
22 pub enum ColorTyperust-analyzer cargo tiff 0.11.3 ColorType# {
23 /// Pixel is grayscale
24 Grayrust-analyzer cargo tiff 0.11.3 ColorType#Gray#(u8),
25
26 /// Pixel contains R, G and B channels
27 RGBrust-analyzer cargo tiff 0.11.3 ColorType#RGB#(u8),
28
29 /// Pixel is an index into a color palette
30 Paletterust-analyzer cargo tiff 0.11.3 ColorType#Palette#(u8),
31
32 /// Pixel is grayscale with an alpha channel
33 GrayArust-analyzer cargo tiff 0.11.3 ColorType#GrayA#(u8),
34
35 /// Pixel is RGB with an alpha channel
36 RGBArust-analyzer cargo tiff 0.11.3 ColorType#RGBA#(u8),
37
38 /// Pixel is CMYK
39 CMYKrust-analyzer cargo tiff 0.11.3 ColorType#CMYK#(u8),
40
41 /// Pixel is CMYK with an alpha channel
42 CMYKArust-analyzer cargo tiff 0.11.3 ColorType#CMYKA#(u8),
43
44 /// Pixel is YCbCr
45 YCbCrrust-analyzer cargo tiff 0.11.3 ColorType#YCbCr#(u8),
46
47 /// Pixel is CIE L*a*b* (ICC LAb)
48 Labrust-analyzer cargo tiff 0.11.3 ColorType#Lab#(u8),
49
50 /// Pixel has multiple bands/channels
51 Multibandrust-analyzer cargo tiff 0.11.3 ColorType#Multiband# { bit_depthrust-analyzer cargo tiff 0.11.3 ColorType#Multiband#bit_depth.: u8, num_samplesrust-analyzer cargo tiff 0.11.3 ColorType#Multiband#num_samples.: u16 },
52 }
53 impl ColorTyperust-analyzer cargo tiff 0.11.3 ColorType# {
54 /// The number of bits used to store each sample.
55 pub fn bit_depthrust-analyzer cargo tiff 0.11.3 impl#[ColorType]bit_depth().(&self) -> u8 {
56 match *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self {
57 ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::Grayrust-analyzer cargo tiff 0.11.3 ColorType#Gray#(b)
58 | ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::RGBrust-analyzer cargo tiff 0.11.3 ColorType#RGB#(b)
59 | ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::Paletterust-analyzer cargo tiff 0.11.3 ColorType#Palette#(b)
60 | ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::GrayArust-analyzer cargo tiff 0.11.3 ColorType#GrayA#(b)
61 | ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::RGBArust-analyzer cargo tiff 0.11.3 ColorType#RGBA#(b)
62 | ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::CMYKrust-analyzer cargo tiff 0.11.3 ColorType#CMYK#(b)
63 | ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::CMYKArust-analyzer cargo tiff 0.11.3 ColorType#CMYKA#(b)
64 | ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::YCbCrrust-analyzer cargo tiff 0.11.3 ColorType#YCbCr#(b)
65 | ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::Labrust-analyzer cargo tiff 0.11.3 ColorType#Lab#(b)
66 | ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::Multibandrust-analyzer cargo tiff 0.11.3 ColorType#Multiband# { bit_depthrust-analyzer cargo tiff 0.11.3 ColorType#Multiband#bit_depth.: b, .. } => b,
67 }
68 }
69
70 /// The number of samples in each representation of a single color.
71 pub fn num_samplesrust-analyzer cargo tiff 0.11.3 impl#[ColorType]num_samples().(&self) -> u16 {
72 match *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self {
73 ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::Grayrust-analyzer cargo tiff 0.11.3 ColorType#Gray#(_) => 1,
74 ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::RGBrust-analyzer cargo tiff 0.11.3 ColorType#RGB#(_) => 3,
75 ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::Paletterust-analyzer cargo tiff 0.11.3 ColorType#Palette#(_) => 1,
76 ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::GrayArust-analyzer cargo tiff 0.11.3 ColorType#GrayA#(_) => 2,
77 ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::RGBArust-analyzer cargo tiff 0.11.3 ColorType#RGBA#(_) => 4,
78 ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::CMYKrust-analyzer cargo tiff 0.11.3 ColorType#CMYK#(_) => 4,
79 ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::CMYKArust-analyzer cargo tiff 0.11.3 ColorType#CMYKA#(_) => 5,
80 ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::YCbCrrust-analyzer cargo tiff 0.11.3 ColorType#YCbCr#(_) => 3,
81 ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::Labrust-analyzer cargo tiff 0.11.3 ColorType#Lab#(_) => 3,
82 ColorTyperust-analyzer cargo tiff 0.11.3 ColorType#::Multibandrust-analyzer cargo tiff 0.11.3 ColorType#Multiband# { num_samplesrust-analyzer cargo tiff 0.11.3 ColorType#Multiband#num_samples., .. } => num_samples,
83 }
84 }
85 }