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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Copyright (c) 2023.
*
* This software is free software;
*
* You can redistribute it or modify it under terms of the MIT, Apache License or Zlib license
*/
//! A Portable Pixmap and Portable FloatMap Format Decoder and Encoder
//!
//! This crate supports decoding and encoding of the following ppm formats
//!
//! # Specification
//! [here](https://netpbm.sourceforge.net/doc/ppm.html)
//!
//!|Format | Decoder | Encoder |
//!|-------|--------|--------|
//!|P1-P3 | No | No |
//!| P5 | Yes | Yes |
//!| P6 | Yes | Yes |
//!| P7 | Yes | Yes |
//!| [PFM] | Yes | No |
//!
//!
//![PFM]:https://www.pauldebevec.com/Research/HDR/PFM/
//!
//! # Example
//! - Decoding PPM
//!```no_run
//! use zune_ppm::PPMDecoder;
//! use zune_ppm::PPMDecodeErrors;
//! use zune_core::result::DecodingResult;
//!
//! fn main()->Result<(),PPMDecodeErrors>{
//! use zune_core::bytestream::ZCursor;
//! let mut decoder = PPMDecoder::new(ZCursor::new(&[]));
//! let pix = decoder.decode()?;
//! match pix {
//! DecodingResult::U8(_) => {
//! // deal with 8 bit images
//! }
//! DecodingResult::U16(_) => {
//! // deal with 16 bit images
//! }
//! DecodingResult::F32(_) => {
//! // deal with 32 bit images (PFM)
//! }
//! _=>unreachable!()};
//! Ok(())
//! }
//! ```
extern crate alloc;
pub use zune_core;
pub use crate*;
pub use crate*;