nx_tiff_decode.nx
buildroot/runtime/nx_tiff_decode.nx
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
imports: nx_syscalls.nx
imported by: nx_bmp_tiff_gate.nxnx_img_bytes_to_rgb.nx
structs
| none |
consts
| 10 | const K_MAGIC_32767: i64 = 32767 |
| 11 | const K_MAGIC_32773: i64 = 32773 |
functions
| 14 | func tf_u16(b: *u8, o: i64, le: i64) -> i64 |
| 18 | func tf_u32(b: *u8, o: i64, le: i64) -> i64 |
| 24 | func tf_type_w(t: i64) -> i64 called by 1: tf_val |
| 33 | func tf_find(raw: *u8, n: i64, ifd: i64, le: i64, tag: i64) -> i64 |
| 47 | func tf_val(raw: *u8, n: i64, eo: i64, le: i64, k: i64) -> i64 |
| 63 | func tf_val1(raw: *u8, n: i64, ifd: i64, le: i64, tag: i64, def: i64) -> i64 |
| 73 | func tf_packbits(src: *u8, slen: i64, dst: *u8, dcap: i64) -> i64 called by 1: tiff_decode_rgb |
| 95 | func tiff_decode_rgb(raw: *u8, n: i64, out_wh: *i64) -> *u8 |