@ac-kit/format-tiff 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/LICENSE +28 -0
- package/README.md +114 -2
- package/dist/codec/_deflate.d.ts +12 -0
- package/dist/codec/_deflate.d.ts.map +1 -0
- package/dist/codec/_deflate.js +33 -0
- package/dist/codec/_deflate.js.map +1 -0
- package/dist/codec/_lzw.d.ts +18 -0
- package/dist/codec/_lzw.d.ts.map +1 -0
- package/dist/codec/_lzw.js +134 -0
- package/dist/codec/_lzw.js.map +1 -0
- package/dist/codec/_packbits.d.ts +10 -0
- package/dist/codec/_packbits.d.ts.map +1 -0
- package/dist/codec/_packbits.js +34 -0
- package/dist/codec/_packbits.js.map +1 -0
- package/dist/codec/_predictor.d.ts +15 -0
- package/dist/codec/_predictor.d.ts.map +1 -0
- package/dist/codec/_predictor.js +68 -0
- package/dist/codec/_predictor.js.map +1 -0
- package/dist/codec/tiff-decoder.d.ts +54 -0
- package/dist/codec/tiff-decoder.d.ts.map +1 -0
- package/dist/codec/tiff-decoder.js +2 -0
- package/dist/codec/tiff-decoder.js.map +1 -0
- package/dist/container/_ifd.d.ts +45 -0
- package/dist/container/_ifd.d.ts.map +1 -0
- package/dist/container/_ifd.js +160 -0
- package/dist/container/_ifd.js.map +1 -0
- package/dist/container/_image.d.ts +37 -0
- package/dist/container/_image.d.ts.map +1 -0
- package/dist/container/_image.js +201 -0
- package/dist/container/_image.js.map +1 -0
- package/dist/container/_reader.d.ts +18 -0
- package/dist/container/_reader.d.ts.map +1 -0
- package/dist/container/_reader.js +53 -0
- package/dist/container/_reader.js.map +1 -0
- package/dist/container/open-tiff.d.ts +40 -0
- package/dist/container/open-tiff.d.ts.map +1 -0
- package/dist/container/open-tiff.js +209 -0
- package/dist/container/open-tiff.js.map +1 -0
- package/dist/container/read-tiff-gdal-metadata.d.ts +33 -0
- package/dist/container/read-tiff-gdal-metadata.d.ts.map +1 -0
- package/dist/container/read-tiff-gdal-metadata.js +82 -0
- package/dist/container/read-tiff-gdal-metadata.js.map +1 -0
- package/dist/container/tiff.d.ts +119 -0
- package/dist/container/tiff.d.ts.map +1 -0
- package/dist/container/tiff.js +2 -0
- package/dist/container/tiff.js.map +1 -0
- package/dist/errors.d.ts +34 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +43 -0
- package/dist/errors.js.map +1 -0
- package/dist/field/_field-values.d.ts +10 -0
- package/dist/field/_field-values.d.ts.map +1 -0
- package/dist/field/_field-values.js +51 -0
- package/dist/field/_field-values.js.map +1 -0
- package/dist/field/tiff-field-type.d.ts +42 -0
- package/dist/field/tiff-field-type.d.ts.map +1 -0
- package/dist/field/tiff-field-type.js +68 -0
- package/dist/field/tiff-field-type.js.map +1 -0
- package/dist/field/tiff-field.d.ts +62 -0
- package/dist/field/tiff-field.d.ts.map +1 -0
- package/dist/field/tiff-field.js +125 -0
- package/dist/field/tiff-field.js.map +1 -0
- package/dist/field/tiff-tag.d.ts +120 -0
- package/dist/field/tiff-tag.d.ts.map +1 -0
- package/dist/field/tiff-tag.js +124 -0
- package/dist/field/tiff-tag.js.map +1 -0
- package/dist/geotiff/geo-key.d.ts +67 -0
- package/dist/geotiff/geo-key.d.ts.map +1 -0
- package/dist/geotiff/geo-key.js +69 -0
- package/dist/geotiff/geo-key.js.map +1 -0
- package/dist/geotiff/geotiff-raster-to-model.d.ts +36 -0
- package/dist/geotiff/geotiff-raster-to-model.d.ts.map +1 -0
- package/dist/geotiff/geotiff-raster-to-model.js +70 -0
- package/dist/geotiff/geotiff-raster-to-model.js.map +1 -0
- package/dist/geotiff/index.d.ts +4 -0
- package/dist/geotiff/index.d.ts.map +1 -0
- package/dist/geotiff/index.js +4 -0
- package/dist/geotiff/index.js.map +1 -0
- package/dist/geotiff/read-geotiff.d.ts +63 -0
- package/dist/geotiff/read-geotiff.d.ts.map +1 -0
- package/dist/geotiff/read-geotiff.js +150 -0
- package/dist/geotiff/read-geotiff.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/raster/_decode-chunk.d.ts +29 -0
- package/dist/raster/_decode-chunk.d.ts.map +1 -0
- package/dist/raster/_decode-chunk.js +159 -0
- package/dist/raster/_decode-chunk.js.map +1 -0
- package/dist/raster/_layout.d.ts +27 -0
- package/dist/raster/_layout.d.ts.map +1 -0
- package/dist/raster/_layout.js +79 -0
- package/dist/raster/_layout.js.map +1 -0
- package/dist/raster/_samples.d.ts +52 -0
- package/dist/raster/_samples.d.ts.map +1 -0
- package/dist/raster/_samples.js +192 -0
- package/dist/raster/_samples.js.map +1 -0
- package/dist/raster/read-tiff-window.d.ts +109 -0
- package/dist/raster/read-tiff-window.d.ts.map +1 -0
- package/dist/raster/read-tiff-window.js +396 -0
- package/dist/raster/read-tiff-window.js.map +1 -0
- package/dist/raster/tiff-sample-array.d.ts +7 -0
- package/dist/raster/tiff-sample-array.d.ts.map +1 -0
- package/dist/raster/tiff-sample-array.js +2 -0
- package/dist/raster/tiff-sample-array.js.map +1 -0
- package/package.json +68 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-tiff-window.d.ts","sourceRoot":"","sources":["../../src/raster/read-tiff-window.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAQtD,OAAO,EAON,KAAK,eAAe,EAEpB,MAAM,eAAe,CAAC;AAEvB,4EAA4E;AAC5E,MAAM,MAAM,UAAU,GAAG;IACxB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,kEAAkE;AAClE,MAAM,MAAM,eAAe,GAAG;IAC7B;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC1C,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAC7C;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,wEAAwE;IACxE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C,CAAC;AA+YF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAsB,cAAc,CAAC,CAAC,SAAS,eAAe,EAC7D,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,CAAC,EACN,OAAO,GAAE,eAAoB,GAC3B,OAAO,CAAC,CAAC,CAAC,CAmBZ;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CAAC,CAAC,SAAS,eAAe,EAC3D,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,CAAC,EACN,OAAO,GAAE,eAAoB,GAC3B,OAAO,CAAC,CAAC,CAAC,CAwBZ;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACX,eAAe,CASjB"}
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { imageContext_ } from "../container/_image.js";
|
|
2
|
+
import { TiffFormatError, TiffLimitError, TiffUnsupportedError, } from "../errors.js";
|
|
3
|
+
import { checkDecodable_, decodeChunk_ } from "./_decode-chunk.js";
|
|
4
|
+
import { chunkRows_, layout_, rowBytes_ } from "./_layout.js";
|
|
5
|
+
import { checkOutArray_, createArray_, float24_, readBits_, sampleKind_, ValueKind_, } from "./_samples.js";
|
|
6
|
+
const DEFAULT_GAP_ = 4096;
|
|
7
|
+
const DEFAULT_READ_ = 16 * 1024 * 1024;
|
|
8
|
+
function isBigIntArray_(out) {
|
|
9
|
+
return out instanceof BigInt64Array || out instanceof BigUint64Array;
|
|
10
|
+
}
|
|
11
|
+
function select_(image, band) {
|
|
12
|
+
if (band !== undefined) {
|
|
13
|
+
if (!Number.isInteger(band) || band < 0 || band >= image.samplesPerPixel) {
|
|
14
|
+
throw new RangeError(`Band ${band} of an image of ${image.samplesPerPixel} samples`);
|
|
15
|
+
}
|
|
16
|
+
const kind = sampleKind_(image.sampleFormat[band], image.bitsPerSample[band]);
|
|
17
|
+
return { samples: [band], kinds: [kind], kind, bands: 1 };
|
|
18
|
+
}
|
|
19
|
+
const samples = [];
|
|
20
|
+
const kinds = [];
|
|
21
|
+
for (let sample = 0; sample < image.samplesPerPixel; sample++) {
|
|
22
|
+
const current = sampleKind_(image.sampleFormat[sample], image.bitsPerSample[sample]);
|
|
23
|
+
const first = kinds[0];
|
|
24
|
+
if (first !== undefined &&
|
|
25
|
+
(current.natural !== first.natural ||
|
|
26
|
+
current.components !== first.components)) {
|
|
27
|
+
throw new TypeError("Samples of different types, read one band at a time");
|
|
28
|
+
}
|
|
29
|
+
kinds.push(current);
|
|
30
|
+
samples.push(sample);
|
|
31
|
+
}
|
|
32
|
+
return { samples, kinds, kind: kinds[0], bands: samples.length };
|
|
33
|
+
}
|
|
34
|
+
function checkSize_(value, name, fallback) {
|
|
35
|
+
if (value === undefined) {
|
|
36
|
+
return fallback;
|
|
37
|
+
}
|
|
38
|
+
if (!Number.isSafeInteger(value) || value < 0) {
|
|
39
|
+
throw new TypeError(`${name} of ${value}`);
|
|
40
|
+
}
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
function fillValue_(image) {
|
|
44
|
+
const value = image.noDataValue ?? 0;
|
|
45
|
+
let bigInt = 0n;
|
|
46
|
+
if (image.noData !== undefined && /^\s*[+-]?\d+\s*$/u.test(image.noData)) {
|
|
47
|
+
bigInt = BigInt(image.noData.trim());
|
|
48
|
+
}
|
|
49
|
+
return { number: value, bigInt };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Reads one value of `kind` at bit `position` of `data`: byte-aligned widths
|
|
53
|
+
* through `view`, in the file's byte order; other widths as a big-endian bit
|
|
54
|
+
* stream, as TIFF packs them.
|
|
55
|
+
*/
|
|
56
|
+
function valueAt_(data, view, position, kind, little) {
|
|
57
|
+
const at = position >>> 3;
|
|
58
|
+
switch (kind.value) {
|
|
59
|
+
case ValueKind_.UINT8:
|
|
60
|
+
return data[at];
|
|
61
|
+
case ValueKind_.INT8:
|
|
62
|
+
return view.getInt8(at);
|
|
63
|
+
case ValueKind_.UINT16:
|
|
64
|
+
return view.getUint16(at, little);
|
|
65
|
+
case ValueKind_.INT16:
|
|
66
|
+
return view.getInt16(at, little);
|
|
67
|
+
case ValueKind_.UINT32:
|
|
68
|
+
return view.getUint32(at, little);
|
|
69
|
+
case ValueKind_.INT32:
|
|
70
|
+
return view.getInt32(at, little);
|
|
71
|
+
case ValueKind_.UINT64:
|
|
72
|
+
return view.getBigUint64(at, little);
|
|
73
|
+
case ValueKind_.INT64:
|
|
74
|
+
return view.getBigInt64(at, little);
|
|
75
|
+
case ValueKind_.FLOAT16:
|
|
76
|
+
return view.getFloat16(at, little);
|
|
77
|
+
case ValueKind_.FLOAT24:
|
|
78
|
+
return float24_(little
|
|
79
|
+
? data[at] | (data[at + 1] << 8) | (data[at + 2] << 16)
|
|
80
|
+
: (data[at] << 16) | (data[at + 1] << 8) | data[at + 2]);
|
|
81
|
+
case ValueKind_.FLOAT32:
|
|
82
|
+
return view.getFloat32(at, little);
|
|
83
|
+
case ValueKind_.FLOAT64:
|
|
84
|
+
return view.getFloat64(at, little);
|
|
85
|
+
case ValueKind_.BITS_SIGNED: {
|
|
86
|
+
const bits = kind.valueBits;
|
|
87
|
+
const value = readBits_(data, position, bits);
|
|
88
|
+
return value >= 2 ** (bits - 1) ? value - 2 ** bits : value;
|
|
89
|
+
}
|
|
90
|
+
default:
|
|
91
|
+
return readBits_(data, position, kind.valueBits);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** The kind as read at a bit offset not on a byte boundary. */
|
|
95
|
+
function unalignedKind_(kind) {
|
|
96
|
+
switch (kind.value) {
|
|
97
|
+
case ValueKind_.UINT8:
|
|
98
|
+
case ValueKind_.UINT16:
|
|
99
|
+
case ValueKind_.UINT32:
|
|
100
|
+
return { ...kind, value: ValueKind_.BITS_UNSIGNED };
|
|
101
|
+
case ValueKind_.INT8:
|
|
102
|
+
case ValueKind_.INT16:
|
|
103
|
+
case ValueKind_.INT32:
|
|
104
|
+
return { ...kind, value: ValueKind_.BITS_SIGNED };
|
|
105
|
+
case ValueKind_.BITS_SIGNED:
|
|
106
|
+
case ValueKind_.BITS_UNSIGNED:
|
|
107
|
+
return kind;
|
|
108
|
+
default:
|
|
109
|
+
throw new TiffUnsupportedError(`A ${kind.valueBits}-bit value off a byte boundary`, kind.valueBits);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function copyChunk_(image, context, layout, chunk, data, region, selection, out) {
|
|
113
|
+
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
114
|
+
const little = context.littleEndian;
|
|
115
|
+
const chunkX = chunk.column * image.chunkWidth;
|
|
116
|
+
const chunkY = chunk.row * image.chunkHeight;
|
|
117
|
+
const startX = Math.max(region.x, chunkX);
|
|
118
|
+
const endX = Math.min(region.x + region.width, chunkX + image.chunkWidth);
|
|
119
|
+
const startY = Math.max(region.y, chunkY);
|
|
120
|
+
const endY = Math.min(region.y + region.height, chunkY + chunk.rows);
|
|
121
|
+
const pixelBits = layout.pixelBits[chunk.plane];
|
|
122
|
+
const { bands } = selection;
|
|
123
|
+
const components = selection.kind.components;
|
|
124
|
+
const bigInts = isBigIntArray_(out) ? out : undefined;
|
|
125
|
+
const numbers = bigInts === undefined ? out : undefined;
|
|
126
|
+
for (let band = 0; band < bands; band++) {
|
|
127
|
+
const sample = selection.samples[band];
|
|
128
|
+
if (layout.samplePlanes[sample] !== chunk.plane) {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const sampleBits = layout.sampleBitOffsets[sample];
|
|
132
|
+
let kind = selection.kinds[band];
|
|
133
|
+
if (pixelBits % 8 !== 0 ||
|
|
134
|
+
sampleBits % 8 !== 0 ||
|
|
135
|
+
kind.valueBits % 8 !== 0) {
|
|
136
|
+
kind = unalignedKind_(kind);
|
|
137
|
+
}
|
|
138
|
+
const valueBits = kind.valueBits;
|
|
139
|
+
for (let y = startY; y < endY; y++) {
|
|
140
|
+
const rowBit = (y - chunkY) * chunk.rowBytes * 8;
|
|
141
|
+
const outRow = (y - region.y) * region.width;
|
|
142
|
+
for (let x = startX; x < endX; x++) {
|
|
143
|
+
const bit = rowBit + (x - chunkX) * pixelBits + sampleBits;
|
|
144
|
+
const target = ((outRow + x - region.x) * bands + band) * components;
|
|
145
|
+
for (let component = 0; component < components; component++) {
|
|
146
|
+
const value = valueAt_(data, view, bit + component * valueBits, kind, little);
|
|
147
|
+
if (numbers === undefined) {
|
|
148
|
+
bigInts[target + component] = value;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
numbers[target + component] = value;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function fillChunk_(image, chunk, region, selection, out) {
|
|
159
|
+
const fill = fillValue_(image);
|
|
160
|
+
const chunkX = chunk.column * image.chunkWidth;
|
|
161
|
+
const chunkY = chunk.row * image.chunkHeight;
|
|
162
|
+
const startX = Math.max(region.x, chunkX);
|
|
163
|
+
const endX = Math.min(region.x + region.width, chunkX + image.chunkWidth);
|
|
164
|
+
const startY = Math.max(region.y, chunkY);
|
|
165
|
+
const endY = Math.min(region.y + region.height, chunkY + chunk.rows);
|
|
166
|
+
const { bands } = selection;
|
|
167
|
+
const components = selection.kind.components;
|
|
168
|
+
const bigInts = isBigIntArray_(out) ? out : undefined;
|
|
169
|
+
const numbers = bigInts === undefined ? out : undefined;
|
|
170
|
+
for (let band = 0; band < bands; band++) {
|
|
171
|
+
const sample = selection.samples[band];
|
|
172
|
+
if (image.planar && sample !== chunk.plane) {
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
for (let y = startY; y < endY; y++) {
|
|
176
|
+
const outRow = (y - region.y) * region.width;
|
|
177
|
+
for (let x = startX; x < endX; x++) {
|
|
178
|
+
const target = ((outRow + x - region.x) * bands + band) * components;
|
|
179
|
+
for (let component = 0; component < components; component++) {
|
|
180
|
+
if (numbers === undefined) {
|
|
181
|
+
bigInts[target + component] = fill.bigInt;
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
numbers[target + component] = fill.number;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async function readRegion_(image, region, out, options) {
|
|
192
|
+
const context = imageContext_(image);
|
|
193
|
+
const { signal, decoders } = options;
|
|
194
|
+
const maxGap = checkSize_(options.maxGapBytes, "maxGapBytes", DEFAULT_GAP_);
|
|
195
|
+
const maxRead = checkSize_(options.maxReadBytes, "maxReadBytes", DEFAULT_READ_);
|
|
196
|
+
signal?.throwIfAborted();
|
|
197
|
+
const selection = select_(image, options.band);
|
|
198
|
+
checkOutArray_(out, selection.kind);
|
|
199
|
+
const needed = region.width * region.height * selection.bands * selection.kind.components;
|
|
200
|
+
if (out.length < needed) {
|
|
201
|
+
throw new RangeError(`An array of ${out.length} for the ${needed} values of the window`);
|
|
202
|
+
}
|
|
203
|
+
if (needed === 0) {
|
|
204
|
+
return out;
|
|
205
|
+
}
|
|
206
|
+
checkDecodable_(image, decoders);
|
|
207
|
+
const layout = layout_(image);
|
|
208
|
+
const { limits, reader } = context;
|
|
209
|
+
const firstColumn = Math.floor(region.x / image.chunkWidth);
|
|
210
|
+
const lastColumn = Math.floor((region.x + region.width - 1) / image.chunkWidth);
|
|
211
|
+
const firstRow = Math.floor(region.y / image.chunkHeight);
|
|
212
|
+
const lastRow = Math.floor((region.y + region.height - 1) / image.chunkHeight);
|
|
213
|
+
const planes = image.planar
|
|
214
|
+
? [
|
|
215
|
+
...new Set(selection.samples.map((sample) => layout.samplePlanes[sample])),
|
|
216
|
+
]
|
|
217
|
+
: [0];
|
|
218
|
+
const chunks = [];
|
|
219
|
+
for (const plane of planes) {
|
|
220
|
+
const rowBytes = rowBytes_(image, layout, plane);
|
|
221
|
+
for (let row = firstRow; row <= lastRow; row++) {
|
|
222
|
+
const rows = chunkRows_(image, row);
|
|
223
|
+
if (rows * rowBytes > limits.maxDecodedBytes) {
|
|
224
|
+
throw new TiffLimitError(`A chunk of ${rows * rowBytes} decoded bytes, past maxDecodedBytes (${limits.maxDecodedBytes})`);
|
|
225
|
+
}
|
|
226
|
+
for (let column = firstColumn; column <= lastColumn; column++) {
|
|
227
|
+
const index = plane * layout.chunksPerPlane + row * image.chunksAcross + column;
|
|
228
|
+
const offset = layout.offsets[index];
|
|
229
|
+
const byteCount = layout.byteCounts[index];
|
|
230
|
+
const chunk = {
|
|
231
|
+
index,
|
|
232
|
+
plane,
|
|
233
|
+
column,
|
|
234
|
+
row,
|
|
235
|
+
offset,
|
|
236
|
+
byteCount,
|
|
237
|
+
rows,
|
|
238
|
+
rowBytes,
|
|
239
|
+
};
|
|
240
|
+
if (byteCount === 0) {
|
|
241
|
+
fillChunk_(image, chunk, region, selection, out);
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
if (byteCount > limits.maxTileBytes) {
|
|
245
|
+
throw new TiffLimitError(`Chunk ${index} of ${byteCount} bytes, past maxTileBytes (${limits.maxTileBytes})`);
|
|
246
|
+
}
|
|
247
|
+
if (offset + byteCount > reader.size) {
|
|
248
|
+
throw new TiffFormatError(`Chunk ${index} of ${byteCount} bytes past the end of the file`, offset);
|
|
249
|
+
}
|
|
250
|
+
chunks.push(chunk);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
chunks.sort((left, right) => left.offset - right.offset);
|
|
255
|
+
let index = 0;
|
|
256
|
+
while (index < chunks.length) {
|
|
257
|
+
const first = index;
|
|
258
|
+
const start = chunks[index].offset;
|
|
259
|
+
let end = start + chunks[index].byteCount;
|
|
260
|
+
index++;
|
|
261
|
+
while (index < chunks.length) {
|
|
262
|
+
const chunk = chunks[index];
|
|
263
|
+
const chunkEnd = Math.max(end, chunk.offset + chunk.byteCount);
|
|
264
|
+
if (chunk.offset - end > maxGap || chunkEnd - start > maxRead) {
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
end = chunkEnd;
|
|
268
|
+
index++;
|
|
269
|
+
}
|
|
270
|
+
const bytes = await reader.read(start, end - start, signal);
|
|
271
|
+
for (let member = first; member < index; member++) {
|
|
272
|
+
const chunk = chunks[member];
|
|
273
|
+
const stored = bytes.subarray(chunk.offset - start, chunk.offset - start + chunk.byteCount);
|
|
274
|
+
const decoded = await decodeChunk_(image, context, chunk, stored, decoders, signal);
|
|
275
|
+
copyChunk_(image, context, layout, chunk, decoded, region, selection, out);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return out;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Reads a window of an image into `out`, row by row from its top-left pixel:
|
|
282
|
+
* `window.width × window.height` pixels, each one value of `band`, or every
|
|
283
|
+
* sample in order without it, and two values (real, imaginary) per complex
|
|
284
|
+
* sample. Samples are as stored, with no photometric conversion; a sparse chunk
|
|
285
|
+
* (offset and byte count 0, as GDAL writes it) reads as `noDataValue`, or 0
|
|
286
|
+
* without one.
|
|
287
|
+
*
|
|
288
|
+
* Only the strips or tiles the window touches are read, sorted by offset and
|
|
289
|
+
* read together where the gap between them is at most `maxGapBytes`, up to
|
|
290
|
+
* `maxReadBytes` per request: a COG window is one read per run of adjacent
|
|
291
|
+
* tiles. Chunks decode with the built-in codecs (none, PackBits, LZW, Deflate
|
|
292
|
+
* through `DecompressionStream`) and predictors (2, 3), or with
|
|
293
|
+
* `options.decoders`.
|
|
294
|
+
*
|
|
295
|
+
* `out` is the samples' natural array ({@link createTiffSampleArray} makes
|
|
296
|
+
* one): `Uint8Array` to `Uint32Array` and `Int8Array` to `Int32Array` for
|
|
297
|
+
* integers up to 8, 16 and 32 bits, `BigUint64Array`/`BigInt64Array` for 64,
|
|
298
|
+
* `Float32Array` for 16-, 24- and 32-bit floats, `Float64Array` for 64-bit
|
|
299
|
+
* ones; a `Float64Array` also takes any but 64-bit integers.
|
|
300
|
+
*
|
|
301
|
+
* Time linear in the chunks touched; memory one run of stored chunks and one
|
|
302
|
+
* decoded chunk at a time.
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* const window = { x: 570, y: 70, width: 750, height: 930 };
|
|
306
|
+
* const heights = await readTiffWindow(
|
|
307
|
+
* image,
|
|
308
|
+
* window,
|
|
309
|
+
* new Float32Array(window.width * window.height),
|
|
310
|
+
* { band: 0 },
|
|
311
|
+
* );
|
|
312
|
+
*
|
|
313
|
+
* @returns `out`.
|
|
314
|
+
* @throws {RangeError} When the window is not inside the image, `band` is not
|
|
315
|
+
* one of its samples, or `out` is too short.
|
|
316
|
+
* @throws {TypeError} When `out` is not an array the samples may be read into,
|
|
317
|
+
* the image did not come from {@link openTiff}, an option is not a safe
|
|
318
|
+
* non-negative integer, or without `band` the samples differ in type.
|
|
319
|
+
* @throws {TiffFormatError} When the offsets or byte counts are missing or
|
|
320
|
+
* short, a chunk lies past the end of the file, or its data is corrupt or
|
|
321
|
+
* decodes to fewer bytes than its rows hold.
|
|
322
|
+
* @throws {TiffLimitError} When a chunk is larger than `maxTileBytes` stored or
|
|
323
|
+
* `maxDecodedBytes` decoded.
|
|
324
|
+
* @throws {TiffUnsupportedError} When the compression has no decoder, or the
|
|
325
|
+
* predictor, sample format or YCbCr subsampling is not one this reads.
|
|
326
|
+
* @throws When `signal` aborts, its reason; the source's or a decoder's error.
|
|
327
|
+
*/
|
|
328
|
+
export async function readTiffWindow(image, window, out, options = {}) {
|
|
329
|
+
const { x, y, width, height } = window;
|
|
330
|
+
if (!Number.isSafeInteger(x) ||
|
|
331
|
+
!Number.isSafeInteger(y) ||
|
|
332
|
+
!Number.isSafeInteger(width) ||
|
|
333
|
+
!Number.isSafeInteger(height) ||
|
|
334
|
+
x < 0 ||
|
|
335
|
+
y < 0 ||
|
|
336
|
+
width < 0 ||
|
|
337
|
+
height < 0 ||
|
|
338
|
+
x + width > image.width ||
|
|
339
|
+
y + height > image.height) {
|
|
340
|
+
throw new RangeError(`The window (${x}, ${y}, ${width} × ${height}) of a ${image.width} × ${image.height} image`);
|
|
341
|
+
}
|
|
342
|
+
return await readRegion_(image, window, out, options);
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Reads one tile, or one strip, into `out` as {@link readTiffWindow} reads a
|
|
346
|
+
* window: `chunkWidth × chunkHeight` pixels for a tile, its padding past the
|
|
347
|
+
* image's edge included, or `width ×` the strip's rows (fewer for the last
|
|
348
|
+
* one). `column` and `row` count tiles from the top left; a strip is `(0,
|
|
349
|
+
* strip)`.
|
|
350
|
+
*
|
|
351
|
+
* @returns `out`.
|
|
352
|
+
* @throws {RangeError} When there is no such tile or strip; what
|
|
353
|
+
* {@link readTiffWindow} throws otherwise.
|
|
354
|
+
*/
|
|
355
|
+
export async function readTiffTile(image, column, row, out, options = {}) {
|
|
356
|
+
if (!Number.isSafeInteger(column) ||
|
|
357
|
+
!Number.isSafeInteger(row) ||
|
|
358
|
+
column < 0 ||
|
|
359
|
+
row < 0 ||
|
|
360
|
+
column >= image.chunksAcross ||
|
|
361
|
+
row >= image.chunksDown) {
|
|
362
|
+
throw new RangeError(`Chunk (${column}, ${row}) of an image of ${image.chunksAcross} × ${image.chunksDown}`);
|
|
363
|
+
}
|
|
364
|
+
return await readRegion_(image, {
|
|
365
|
+
x: column * image.chunkWidth,
|
|
366
|
+
y: row * image.chunkHeight,
|
|
367
|
+
width: image.chunkWidth,
|
|
368
|
+
height: chunkRows_(image, row),
|
|
369
|
+
}, out, options);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Makes the natural array for `pixels` pixels of `band` of `image`, or of every
|
|
373
|
+
* sample interleaved without it: `pixels × samples × 2` values for complex
|
|
374
|
+
* samples, `pixels × samples` otherwise. See {@link readTiffWindow} for which
|
|
375
|
+
* array each sample format takes.
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* const out = createTiffSampleArray(
|
|
379
|
+
* image,
|
|
380
|
+
* image.chunkWidth * image.chunkHeight,
|
|
381
|
+
* );
|
|
382
|
+
* await readTiffTile(image, 0, 0, out);
|
|
383
|
+
*
|
|
384
|
+
* @throws {RangeError} When `pixels` is not a safe non-negative integer or
|
|
385
|
+
* `band` not one of the samples.
|
|
386
|
+
* @throws {TypeError} Without `band`, when the samples differ in type.
|
|
387
|
+
* @throws {TiffUnsupportedError} When the sample format is not one this reads.
|
|
388
|
+
*/
|
|
389
|
+
export function createTiffSampleArray(image, pixels, band) {
|
|
390
|
+
if (!Number.isSafeInteger(pixels) || pixels < 0) {
|
|
391
|
+
throw new RangeError(`An array for ${pixels} pixels`);
|
|
392
|
+
}
|
|
393
|
+
const selection = select_(image, band);
|
|
394
|
+
return createArray_(selection.kind.natural, pixels * selection.bands * selection.kind.components);
|
|
395
|
+
}
|
|
396
|
+
//# sourceMappingURL=read-tiff-window.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-tiff-window.js","sourceRoot":"","sources":["../../src/raster/read-tiff-window.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAsB,MAAM,wBAAwB,CAAC;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M,GAAG,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,UAAU,CAAC,gBAAgB,MAAM,SAAS,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACvC,OAAO,YAAY,CAClB,SAAS,CAAC,IAAI,CAAC,OAAO,EACtB,MAAM,GAAG,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,UAAU,CACpD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arrays {@link readTiffWindow} and {@link readTiffTile} write samples to:
|
|
3
|
+
* each sample format's natural one, or `Float64Array` for any but 64-bit
|
|
4
|
+
* integers.
|
|
5
|
+
*/
|
|
6
|
+
export type TiffSampleArray = Uint8Array<ArrayBuffer> | Int8Array<ArrayBuffer> | Uint16Array<ArrayBuffer> | Int16Array<ArrayBuffer> | Uint32Array<ArrayBuffer> | Int32Array<ArrayBuffer> | Float32Array<ArrayBuffer> | Float64Array<ArrayBuffer> | BigUint64Array<ArrayBuffer> | BigInt64Array<ArrayBuffer>;
|
|
7
|
+
//# sourceMappingURL=tiff-sample-array.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiff-sample-array.d.ts","sourceRoot":"","sources":["../../src/raster/tiff-sample-array.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACxB,UAAU,CAAC,WAAW,CAAC,GACvB,SAAS,CAAC,WAAW,CAAC,GACtB,WAAW,CAAC,WAAW,CAAC,GACxB,UAAU,CAAC,WAAW,CAAC,GACvB,WAAW,CAAC,WAAW,CAAC,GACxB,UAAU,CAAC,WAAW,CAAC,GACvB,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,WAAW,CAAC,GACzB,cAAc,CAAC,WAAW,CAAC,GAC3B,aAAa,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiff-sample-array.js","sourceRoot":"","sources":["../../src/raster/tiff-sample-array.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/format-tiff",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "TIFF 6.0, BigTIFF and Cloud Optimized GeoTIFF read by ranges within limits: every IFD and tag, overviews and masks, windows and tiles decoded from none, PackBits, LZW and Deflate with predictors, other codecs through caller decoders, and GeoTIFF 1.1 keys and georeferencing.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bigtiff",
|
|
7
|
+
"cog",
|
|
8
|
+
"dem",
|
|
9
|
+
"geotiff",
|
|
10
|
+
"raster",
|
|
11
|
+
"tiff"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://anthochamp.pages.grenadine.io/node-essentials/api/format-tiff/",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://git.grenadine.io/anthochamp/node-essentials/issues"
|
|
16
|
+
},
|
|
17
|
+
"license": "BSD-3-Clause",
|
|
18
|
+
"author": "Anthony Champagne <dev@anthonychampagne.fr>",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://git.grenadine.io/anthochamp/node-essentials.git",
|
|
22
|
+
"directory": "packages/format-tiff"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"type": "module",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": "./dist/index.js",
|
|
32
|
+
"./geotiff": "./dist/geotiff/index.js"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"main": "./dist/index.js",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": "./dist/index.js",
|
|
38
|
+
"./geotiff": "./dist/geotiff/index.js"
|
|
39
|
+
},
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"compile": "tsc -p ./tsconfig.build.json -outDir dist",
|
|
44
|
+
"compile:check": "tsc -noEmit -p ./tsconfig.json",
|
|
45
|
+
"clean": "rimraf dist",
|
|
46
|
+
"build": "yarn clean && yarn compile",
|
|
47
|
+
"test": "yarn run -T vitest run",
|
|
48
|
+
"prepack": "yarn build"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@ac-kit/core": "^0.15.0",
|
|
52
|
+
"@ac-kit/format-xml": "^0.3.1",
|
|
53
|
+
"@ac-kit/math-linear": "^0.5.1",
|
|
54
|
+
"@types/web": "^0.0.367"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@ac-kit/fixture-tiff": "0.1.0",
|
|
58
|
+
"@ac-kit/math-random": "0.4.3",
|
|
59
|
+
"@ac-kit/tsconfig": "0.1.0",
|
|
60
|
+
"@ac-kit/typedoc-config": "0.1.0",
|
|
61
|
+
"@ac-kit/vitest-config": "0.4.0",
|
|
62
|
+
"@types/node": "^26.5.1",
|
|
63
|
+
"@typescript/native": "typescript@7.0.2",
|
|
64
|
+
"rimraf": "6.1.4",
|
|
65
|
+
"typedoc": "0.28.20",
|
|
66
|
+
"typescript": "@typescript/typescript6@6.0.2"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=24"
|
|
70
|
+
}
|
|
6
71
|
}
|