JFLib

img_all#

registration of every codec -- crate root lib/img_all/lib.rs

img_all -- registration of the codec crates in the format table  [src/img/imgreg.s, imgio.s]

  use_core_codecs()   PNG, JPEG, BMP, GIF (the assembly registers them statically: call it
                      once at start-up, before worker threads decode)
  use_all_codecs()    every codec of the library, the core formats included
                      (img_use_all_codecs); JPEG 2000 and JBIG2 into their slots
                      IMGF_JP2 and IMGF_JBIG2

Each codec crate exports `pub static CODEC: img_core::Codec`; the codec agents add one
registration line for their crate below.

img_all crate root#

  • fn use_core_codecs() register PNG, JPEG, BMP and GIF

  • fn use_all_codecs() register every codec of the library (the core formats included) [img_use_all_codecs]

img_all/psd/mod.rs#

Source: lib/img_all/psd/mod.rs

  • static CODEC: Codec

  • fn probe(data: &[u8], m: &mut ImgMeta) -> bool

  • fn has_layers(data: &[u8]) -> bool

  • fn decode(data: &[u8], sf: &mut Surface, dec: &ImgDec, m: &mut ImgMeta) -> i32

  • fn encode(sf: &Surface, opt: &ImgOpt, out: &mut Vec<u8>) -> i32

img_all/psd/document.rs#

Source: lib/img_all/psd/document.rs

  • struct Layer

    • pixels: Surface
    • name: String
    • opacity: u8
    • visible: bool
    • blend: u8
  • struct Document

    • meta: ImgMeta
    • layers: Vec<Layer> -- Bottom layer first (the order of a layered editor such as JFPainter).
    • converted: bool -- Mask application, cropped off-canvas pixels, high depth or Photoshop-specific blocks.
  • struct LayerRef<'a>

    • pixels: &'a Surface
    • name: &'a str
    • visible: bool
    • opacity: u8
    • blend: u8
  • fn decode(data: &[u8], dec: &ImgDec) -> Result<Option<Document>, i32>

  • fn encode(composite: &Surface, layers: &[LayerRef], opt: &ImgOpt) -> Result<Vec<u8>, i32> Write the app's complete 8-bit raster stack and a compatibility composite. Return an error for blend modes that Photoshop cannot represent exactly.

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