Skip to content

Commit 5d20195

Browse files
committed
chore(ccitt): expose FaxImage
1 parent f2e03ea commit 5d20195

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

crates/ccitt/src/g42d/decode_iter/image.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::{io, iter::Peekable};
22

33
use crate::{ascii_art::BorderDrawing, ASCII};
44

5+
/// A decoded bi-level image
56
pub struct FaxImage {
67
pub(crate) width: usize,
78
pub(crate) complete: Vec<bool>,
@@ -16,6 +17,7 @@ impl FaxImage {
1617
println!("{}", b.right);
1718
}
1819

20+
/// Print the image to the console / stdout
1921
pub fn print(&self, invert: bool) {
2022
let b = ASCII;
2123
self.print_border(&b.top);
@@ -30,7 +32,8 @@ impl FaxImage {
3032
self.print_border(&b.bottom);
3133
}
3234

33-
///
35+
/// Write a PBM file from the decoded image
36+
///
3437
/// ## Parameters
3538
///
3639
/// - `dbl` - write every line twice, because "Standard" fax is 200 dpi horizontal and 100 dpi vertical

crates/ccitt/src/g42d/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
//! CCITT Group 4 2D-encoding
22
3-
use crate::{
4-
bits::{BitIter, FillOrder},
5-
g42d::decode_iter::FaxImage,
6-
};
3+
use crate::bits::{BitIter, FillOrder};
74

85
mod decode;
96
mod decode_iter;
107
mod encode;
118

129
pub use decode::Decoder;
1310
use decode_iter::FaxDecode;
11+
pub use decode_iter::FaxImage;
1412
pub use encode::Encoder;
1513

1614
/// Options for fax decoding

0 commit comments

Comments
 (0)