CCSDS 123.0-B Lossless Multispectral and Hyperspectral Image Compression
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-hcomp: bind image_data and assert roundtrip

The README example used [image_data] as a free variable. Bind a
zeroed [Bytes.make ...] (deterministic, sized to the call), then
assert [Bytes.equal restored image_data] so the round-trip claim is
checked, not just typed.

+8 -6
+8 -6
README.md
··· 39 39 ## Usage 40 40 41 41 ```ocaml 42 - (* Compress multi-band image data *) 42 + (* Compress + decompress 256x256 4-band 12-bit imagery. *) 43 + let image_data = Bytes.make (4 * 256 * 256 * 2) '\x00' 44 + 43 45 let compressed = 44 - Hcomp.compress ~bands:4 ~width:256 ~height:256 45 - ~bits_per_sample:12 image_data 46 + Hcomp.compress ~bands:4 ~width:256 ~height:256 ~bits_per_sample:12 image_data 46 47 47 - (* Decompress *) 48 48 let restored = 49 - Hcomp.decompress ~bands:4 ~width:256 ~height:256 50 - ~bits_per_sample:12 compressed 49 + Hcomp.decompress ~bands:4 ~width:256 ~height:256 ~bits_per_sample:12 50 + compressed 51 + 52 + let () = assert (Bytes.equal restored image_data) 51 53 ``` 52 54 53 55 ## Licence