code wiki / (root) / nx_tiff_decode.nx

nx_tiff_decode.nx

buildroot/runtime/nx_tiff_decode.nx

7661 B195 linesdepth 2pulls 2 transitivereach 37 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_tiff_decode.nx -- sovereign baseline TIFF READER (the 1990s scan/fax/print interchange format; the tree had a sniffer claim and NO decoder). tiff_decode_rgb(raw,n,out_wh) -> w*h*3 packed RGB, top-down. Covers: both byte orders (II little / MM big endian), first IFD, strip organisation (StripOffsets/StripByteCounts/RowsPerStrip), Compression 1 (none) + 32773 (PackBits), Photometric 0 (white-is-zero gray, inverted here), 1 (black-is-zero gray), 2 (RGB 8-bit), 3 (palette via ColorMap's 16-bit channels >>8), BitsPerSample 8 (gray/RGB/palette) + 1 (bilevel gray). REFUSED (0 return, never a wrong image): LZW(5)/CCITT(2-4)/JPEG-in-TIFF(6,7)/Deflate(8), tiles, planar config 2, 16-bit samples. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_tiff_decode.nx nx_bmp_tiff_gate.nx nx_img_bytes_to_rgb.nx

imports: nx_syscalls.nx

imported by: nx_bmp_tiff_gate.nxnx_img_bytes_to_rgb.nx

structs

none

consts

10const K_MAGIC_32767: i64 = 32767
11const K_MAGIC_32773: i64 = 32773

functions

14func tf_u16(b: *u8, o: i64, le: i64) -> i64
called by 2: tf_findtf_val
18func tf_u32(b: *u8, o: i64, le: i64) -> i64
24func tf_type_w(t: i64) -> i64
called by 1: tf_val
33func tf_find(raw: *u8, n: i64, ifd: i64, le: i64, tag: i64) -> i64
called by 2: tf_val1tiff_decode_rgb calls 1: tf_u16
47func tf_val(raw: *u8, n: i64, eo: i64, le: i64, k: i64) -> i64
63func tf_val1(raw: *u8, n: i64, ifd: i64, le: i64, tag: i64, def: i64) -> i64
called by 1: tiff_decode_rgb calls 2: tf_findtf_val
73func tf_packbits(src: *u8, slen: i64, dst: *u8, dcap: i64) -> i64
called by 1: tiff_decode_rgb
95func tiff_decode_rgb(raw: *u8, n: i64, out_wh: *i64) -> *u8