JFLib

img_jxr#

JPEG XR -- crate root lib/img_jxr/lib.rs

img_jxr -- JPEG XR (ITU-T T.832 / ISO 29199-2, HD Photo) decoder and encoder: tag-based
container (Annex A), codestream decode driver, metadata              [src/img/jxr.s]

  probe(data, meta) -> recognised                    jxr_probe (container + IMAGE_HEADER
                                                     fields into meta)
  decode(data, out, dec, meta) -> 0 / ERR_*          jxr_decode
  enc::encode(sf, opt, out) -> 0 / ERR_*             jxr_encode (jxr_enc.s)
  dbg_planes(data, mode) -> (0 / ERR_*, blob)        jxr_dbg_planes -- test hook: the decoded
      planes of the primary codestream as {u32 w, h, ml, mt, npl; per plane u32 cf, nch,
      scaled; per component u32 width, height, i32 samples...}; mode 0 = reconstructed
      samples, 1 = before the inverse transform (HP coefficients in the planes), 2 = the DC
      grids after decoding, 3 = {u32 w, h; i32 [h][w][5]} output samples of the pixel format
      (color.rs, before 8-bit)
  CODEC                                              jxr_codec

Modules: ent (jxr_ent.s: headers, entropy decoding, prediction, dequantisation), pct
(jxr_pct.s: inverse transform, overlap filters), color (jxr_color.s: output formatting), enc
(jxr_enc.s: the writer), tab (generated tables, tools/gen_jxr.py).

img_jxr API#

  • static CODEC: Codec the codec descriptor [jxr_codec]

  • fn probe(data: &[u8], meta: &mut ImgMeta) -> bool container + IMAGE_HEADER fields into meta [jxr_probe]

  • fn decode(data: &[u8], out: &mut Surface, dec: &ImgDec, m: &mut ImgMeta) -> i32 decode a JPEG XR file [jxr_decode]

  • fn dbg_planes(data: &[u8], mode: u32) -> (i32, Vec<u8>) see the module header [jxr_dbg_planes]

img_jxr modules#

The codec's building blocks (public for the codec test app codectest; see their source headers):

ModuleContent
img_jxr::encJPEG XR encoder (ITU-T T.832); the bit-exact model is tools/jxr_enc_ref.py

Source: docs/API.md in the JFLib repository.