diff options
author | cc <cc@localhost> | 2025-08-20 19:56:24 -0700 |
---|---|---|
committer | cc <cc@localhost> | 2025-08-20 19:57:14 -0700 |
commit | a7ded0a844feac401be72a5b575cb0e0c3e12e01 (patch) | |
tree | 7d2d48b6258c23a633d18eab9784f8dc1c47d8a2 /src/lib.rs | |
parent | 238a3e31a8fb0eb24de278b9286b9b6caef1c66b (diff) |
Standardize Label Structures
Compress processed masks to simple labels
Dump simple labels to file
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -3,6 +3,7 @@ pub mod binfile; pub const TEST_IMAGE_PATH: &str = "../test.tif"; pub const TEST_OUTPUT_PATH: &str = "../test.bin"; +pub const TEST_LABEL_OUTPUT_PATH: &str = "../test.c.bin"; #[cfg(test)] mod tests { @@ -80,7 +81,21 @@ mod tests { fn tiff_data_dump_test() { tiff::ignore_warnings(); if let Some(standard_format) = tiff::as_standard_format(TEST_IMAGE_PATH) { - binfile::dump_u32_vec(TEST_OUTPUT_PATH, standard_format).expect("File output error"); + println!("{:?}", standard_format); + let data = standard_format.buffer; + binfile::dump_u32_vec(TEST_OUTPUT_PATH, data).expect("File output error"); + } else { + assert!(false); + } + } + + #[test] + fn tiff_compressed_data_dump_test() { + tiff::ignore_warnings(); + if let Some(standard_format) = tiff::as_standard_format(TEST_IMAGE_PATH) { + let compressed_format = tiff::standard_to_labels(standard_format); + let data = compressed_format.buffer; + binfile::dump_u16_vec(TEST_LABEL_OUTPUT_PATH, data).expect("File output error"); } else { assert!(false); } |