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 GIFfn 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: Codecfn probe(data: &[u8], m: &mut ImgMeta) -> boolfn has_layers(data: &[u8]) -> boolfn decode(data: &[u8], sf: &mut Surface, dec: &ImgDec, m: &mut ImgMeta) -> i32fn encode(sf: &Surface, opt: &ImgOpt, out: &mut Vec<u8>) -> i32
img_all/psd/document.rs#
Source: lib/img_all/psd/document.rs
struct Layerpixels: Surfacename: Stringopacity: u8visible: boolblend: u8
struct Documentmeta: ImgMetalayers: 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 Surfacename: &'a strvisible: boolopacity: u8blend: 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.