maplibre-gl-raster 0.1.0

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.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +362 -0
  3. package/dist/LercDecode.es-CZm5toNk.js +442 -0
  4. package/dist/LercDecode.es-CZm5toNk.js.map +1 -0
  5. package/dist/RasterControl-B7XdXYSu.js +18838 -0
  6. package/dist/RasterControl-B7XdXYSu.js.map +1 -0
  7. package/dist/__vite-browser-external-BgMKmFg9.js +9 -0
  8. package/dist/__vite-browser-external-BgMKmFg9.js.map +1 -0
  9. package/dist/assets/LercDecode.es-Bvg6-wb5.js +442 -0
  10. package/dist/assets/LercDecode.es-Bvg6-wb5.js.map +1 -0
  11. package/dist/assets/__vite-browser-external-BgMKmFg9.js +9 -0
  12. package/dist/assets/__vite-browser-external-BgMKmFg9.js.map +1 -0
  13. package/dist/assets/chunk-FDOR9p9I.js +24 -0
  14. package/dist/assets/decode-BvR5vy7g.js +940 -0
  15. package/dist/assets/decode-BvR5vy7g.js.map +1 -0
  16. package/dist/assets/lerc-By2TvjAX.js +34 -0
  17. package/dist/assets/lerc-By2TvjAX.js.map +1 -0
  18. package/dist/assets/lzw-CQJJDca2.js +174 -0
  19. package/dist/assets/lzw-CQJJDca2.js.map +1 -0
  20. package/dist/assets/worker-C6cg9T3Y.js +51 -0
  21. package/dist/assets/worker-C6cg9T3Y.js.map +1 -0
  22. package/dist/assets/zstd-DBZv9xja.js +569 -0
  23. package/dist/assets/zstd-DBZv9xja.js.map +1 -0
  24. package/dist/chunk-FDOR9p9I.js +24 -0
  25. package/dist/decode-BMFOVF9X.js +1966 -0
  26. package/dist/decode-BMFOVF9X.js.map +1 -0
  27. package/dist/index.mjs +223 -0
  28. package/dist/index.mjs.map +1 -0
  29. package/dist/lerc-B7WY-v3y.js +34 -0
  30. package/dist/lerc-B7WY-v3y.js.map +1 -0
  31. package/dist/lzw-YEsReV21.js +174 -0
  32. package/dist/lzw-YEsReV21.js.map +1 -0
  33. package/dist/maplibre-gl-raster.css +670 -0
  34. package/dist/react.mjs +145 -0
  35. package/dist/react.mjs.map +1 -0
  36. package/dist/types/index.d.ts +649 -0
  37. package/dist/types/react.d.ts +477 -0
  38. package/dist/zstd-DBZv9xja.js +569 -0
  39. package/dist/zstd-DBZv9xja.js.map +1 -0
  40. package/package.json +125 -0
@@ -0,0 +1,940 @@
1
+ //#region node_modules/@cogeotiff/core/build/const/tiff.endian.js
2
+ /**
3
+ * Tiff format
4
+ *
5
+ * The header of a Tiff file contains the endianness of the file
6
+ */
7
+ var TiffEndian;
8
+ (function(TiffEndian) {
9
+ TiffEndian[TiffEndian["Big"] = 19789] = "Big";
10
+ TiffEndian[TiffEndian["Little"] = 18761] = "Little";
11
+ })(TiffEndian || (TiffEndian = {}));
12
+ //#endregion
13
+ //#region node_modules/@cogeotiff/core/build/const/tiff.tag.id.js
14
+ /** Sub file type for tag 254 {@link TiffTag.SubFileType} */
15
+ var SubFileType;
16
+ (function(SubFileType) {
17
+ /** Reduced resolution version */
18
+ SubFileType[SubFileType["ReducedImage"] = 1] = "ReducedImage";
19
+ /** One page of many */
20
+ SubFileType[SubFileType["Page"] = 2] = "Page";
21
+ /** Transparency mask */
22
+ SubFileType[SubFileType["Mask"] = 4] = "Mask";
23
+ })(SubFileType || (SubFileType = {}));
24
+ var Orientation;
25
+ (function(Orientation) {
26
+ Orientation[Orientation["TopLeft"] = 1] = "TopLeft";
27
+ Orientation[Orientation["TopRight"] = 2] = "TopRight";
28
+ Orientation[Orientation["BottomRight"] = 3] = "BottomRight";
29
+ Orientation[Orientation["BottomLeft"] = 4] = "BottomLeft";
30
+ Orientation[Orientation["LeftTop"] = 5] = "LeftTop";
31
+ Orientation[Orientation["RightTOP"] = 6] = "RightTOP";
32
+ Orientation[Orientation["RightBottom"] = 7] = "RightBottom";
33
+ Orientation[Orientation["LeftBottom"] = 8] = "LeftBottom";
34
+ })(Orientation || (Orientation = {}));
35
+ var RasterTypeKey;
36
+ (function(RasterTypeKey) {
37
+ /**
38
+ * PixelIsArea (default) a pixel is treated as an area,
39
+ * the raster coordinate (0,0) is the top left corner of the top left pixel.
40
+ */
41
+ RasterTypeKey[RasterTypeKey["PixelIsArea"] = 1] = "PixelIsArea";
42
+ /**
43
+ * PixelIsPoint treats pixels as point samples with empty space between the "pixel" samples.
44
+ * the raster coordinate (0,0) is the location of the top left raster pixel.
45
+ */
46
+ RasterTypeKey[RasterTypeKey["PixelIsPoint"] = 2] = "PixelIsPoint";
47
+ })(RasterTypeKey || (RasterTypeKey = {}));
48
+ var ModelTypeCode;
49
+ (function(ModelTypeCode) {
50
+ ModelTypeCode[ModelTypeCode["Unknown"] = 0] = "Unknown";
51
+ /** Projection Coordinate System */
52
+ ModelTypeCode[ModelTypeCode["Projected"] = 1] = "Projected";
53
+ /** Geographic latitude-longitude System */
54
+ ModelTypeCode[ModelTypeCode["Geographic"] = 2] = "Geographic";
55
+ /** Geocentric (X,Y,Z) Coordinate System */
56
+ ModelTypeCode[ModelTypeCode["Geocentric"] = 3] = "Geocentric";
57
+ ModelTypeCode[ModelTypeCode["UserDefined"] = 32767] = "UserDefined";
58
+ })(ModelTypeCode || (ModelTypeCode = {}));
59
+ /** Sub file type for tag 255 {@link TiffTag.OldSubFileType} */
60
+ var OldSubFileType;
61
+ (function(OldSubFileType) {
62
+ /** Full resolution image data */
63
+ OldSubFileType[OldSubFileType["Image"] = 1] = "Image";
64
+ /** Reduced resolution version */
65
+ OldSubFileType[OldSubFileType["ReducedImage"] = 2] = "ReducedImage";
66
+ /** One page of many */
67
+ OldSubFileType[OldSubFileType["Page"] = 3] = "Page";
68
+ })(OldSubFileType || (OldSubFileType = {}));
69
+ /** Tiff compression types */
70
+ var Compression;
71
+ (function(Compression) {
72
+ Compression[Compression["None"] = 1] = "None";
73
+ Compression[Compression["Ccittrle"] = 2] = "Ccittrle";
74
+ Compression[Compression["CcittT4"] = 3] = "CcittT4";
75
+ Compression[Compression["CcittT6"] = 4] = "CcittT6";
76
+ Compression[Compression["Lzw"] = 5] = "Lzw";
77
+ Compression[Compression["Jpeg6"] = 6] = "Jpeg6";
78
+ Compression[Compression["Jpeg"] = 7] = "Jpeg";
79
+ Compression[Compression["DeflateOther"] = 8] = "DeflateOther";
80
+ Compression[Compression["T85"] = 9] = "T85";
81
+ Compression[Compression["T43"] = 10] = "T43";
82
+ Compression[Compression["Next"] = 32766] = "Next";
83
+ Compression[Compression["Ccittrlew"] = 32771] = "Ccittrlew";
84
+ Compression[Compression["PackBits"] = 32773] = "PackBits";
85
+ Compression[Compression["ThunderScan"] = 32809] = "ThunderScan";
86
+ Compression[Compression["It8ctpad"] = 32895] = "It8ctpad";
87
+ Compression[Compression["It8lw"] = 32896] = "It8lw";
88
+ Compression[Compression["It8mp"] = 32897] = "It8mp";
89
+ Compression[Compression["It8bl"] = 32898] = "It8bl";
90
+ Compression[Compression["PixarFilm"] = 32908] = "PixarFilm";
91
+ Compression[Compression["PixarLog"] = 32909] = "PixarLog";
92
+ Compression[Compression["Deflate"] = 32946] = "Deflate";
93
+ Compression[Compression["Dcs"] = 32947] = "Dcs";
94
+ Compression[Compression["Jbig"] = 34661] = "Jbig";
95
+ Compression[Compression["SgiLog"] = 34676] = "SgiLog";
96
+ Compression[Compression["SgiLog24"] = 34677] = "SgiLog24";
97
+ Compression[Compression["Jp2000"] = 34712] = "Jp2000";
98
+ Compression[Compression["Lerc"] = 34887] = "Lerc";
99
+ Compression[Compression["Lzma"] = 34925] = "Lzma";
100
+ Compression[Compression["Zstd"] = 5e4] = "Zstd";
101
+ Compression[Compression["Webp"] = 50001] = "Webp";
102
+ Compression[Compression["JpegXl"] = 50002] = "JpegXl";
103
+ Compression[Compression["JpegXlDng17"] = 52546] = "JpegXlDng17";
104
+ })(Compression || (Compression = {}));
105
+ var PlanarConfiguration;
106
+ (function(PlanarConfiguration) {
107
+ /** single image plane */
108
+ PlanarConfiguration[PlanarConfiguration["Contig"] = 1] = "Contig";
109
+ /** separate planes of data */
110
+ PlanarConfiguration[PlanarConfiguration["Separate"] = 2] = "Separate";
111
+ })(PlanarConfiguration || (PlanarConfiguration = {}));
112
+ var Predictor;
113
+ (function(Predictor) {
114
+ Predictor[Predictor["None"] = 1] = "None";
115
+ /** Horizontal differencing */
116
+ Predictor[Predictor["Horizontal"] = 2] = "Horizontal";
117
+ /** Floating point */
118
+ Predictor[Predictor["FloatingPoint"] = 3] = "FloatingPoint";
119
+ })(Predictor || (Predictor = {}));
120
+ var SampleFormat;
121
+ (function(SampleFormat) {
122
+ /** Unsigned integer data */
123
+ SampleFormat[SampleFormat["Uint"] = 1] = "Uint";
124
+ /** Signed integer data */
125
+ SampleFormat[SampleFormat["Int"] = 2] = "Int";
126
+ /** IEEE floating point data */
127
+ SampleFormat[SampleFormat["Float"] = 3] = "Float";
128
+ /** Untyped data */
129
+ SampleFormat[SampleFormat["Void"] = 4] = "Void";
130
+ /** Complex signed int */
131
+ SampleFormat[SampleFormat["ComplexInt"] = 5] = "ComplexInt";
132
+ /** Complex ieee floating */
133
+ SampleFormat[SampleFormat["ComplexFloat"] = 6] = "ComplexFloat";
134
+ })(SampleFormat || (SampleFormat = {}));
135
+ var Photometric;
136
+ (function(Photometric) {
137
+ /** min value is white */
138
+ Photometric[Photometric["MinIsWhite"] = 0] = "MinIsWhite";
139
+ /** min value is black */
140
+ Photometric[Photometric["MinIsBlack"] = 1] = "MinIsBlack";
141
+ /** RGB color model */
142
+ Photometric[Photometric["Rgb"] = 2] = "Rgb";
143
+ /** color map indexed */
144
+ Photometric[Photometric["Palette"] = 3] = "Palette";
145
+ /** $holdout mask */
146
+ Photometric[Photometric["Mask"] = 4] = "Mask";
147
+ /** !color separations */
148
+ Photometric[Photometric["Separated"] = 5] = "Separated";
149
+ /** !CCIR 601 */
150
+ Photometric[Photometric["Ycbcr"] = 6] = "Ycbcr";
151
+ /** !1976 CIE L*a*b* */
152
+ Photometric[Photometric["Cielab"] = 8] = "Cielab";
153
+ /** ICC L*a*b* [Adobe TIFF Technote 4] */
154
+ Photometric[Photometric["Icclab"] = 9] = "Icclab";
155
+ /** ITU L*a*b* */
156
+ Photometric[Photometric["Itulab"] = 10] = "Itulab";
157
+ /** color filter array */
158
+ Photometric[Photometric["Cfa"] = 32803] = "Cfa";
159
+ /** CIE Log2(L) */
160
+ Photometric[Photometric["Logl"] = 32844] = "Logl";
161
+ Photometric[Photometric["Logluv"] = 32845] = "Logluv";
162
+ })(Photometric || (Photometric = {}));
163
+ /**
164
+ * Tiff tags as defined by libtiff and libgeotiff
165
+ *
166
+ * - {@link https://gitlab.com/libtiff/libtiff}
167
+ * - {@link https://github.com/OSGeo/libgeotiff/}
168
+ */
169
+ var TiffTag;
170
+ (function(TiffTag) {
171
+ /**
172
+ * Type of the sub file
173
+ *
174
+ * @see {@link SubFileType}
175
+ */
176
+ TiffTag[TiffTag["SubFileType"] = 254] = "SubFileType";
177
+ /**
178
+ * Type of sub file
179
+ *
180
+ * @see {@link OldSubFileType}
181
+ */
182
+ TiffTag[TiffTag["OldSubFileType"] = 255] = "OldSubFileType";
183
+ /** Width of image in pixels */
184
+ TiffTag[TiffTag["ImageWidth"] = 256] = "ImageWidth";
185
+ /** Height of image in pixels */
186
+ TiffTag[TiffTag["ImageHeight"] = 257] = "ImageHeight";
187
+ /**
188
+ * Number of bits per channel
189
+ *
190
+ * @example
191
+ * ```typescript
192
+ * [8,8,8] // 8 bit RGB
193
+ * [16] // 16bit
194
+ * ```
195
+ */
196
+ TiffTag[TiffTag["BitsPerSample"] = 258] = "BitsPerSample";
197
+ /**
198
+ *
199
+ * Data type of the image
200
+ *
201
+ * See {@link SampleFormat}
202
+ *
203
+ * @example
204
+ * ```typescript
205
+ * [1] // SampleFormat.Uint
206
+ * [1,1,1,1] // 4 band Uint
207
+ * ```
208
+ */
209
+ TiffTag[TiffTag["SampleFormat"] = 339] = "SampleFormat";
210
+ /**
211
+ * Compression Type
212
+ *
213
+ * @see {@link Compression}
214
+ *
215
+ * @example
216
+ * ```typescript
217
+ * 5 // Compression.Lzw
218
+ * ```
219
+ */
220
+ TiffTag[TiffTag["Compression"] = 259] = "Compression";
221
+ /**
222
+ * Photometric interpretation
223
+ *
224
+ * @see {@link Photometric}
225
+ *
226
+ * @example
227
+ * ```typescript
228
+ * 2 // Photometric.Rgb
229
+ * ```
230
+ */
231
+ TiffTag[TiffTag["Photometric"] = 262] = "Photometric";
232
+ /** Tile width in pixels */
233
+ TiffTag[TiffTag["TileWidth"] = 322] = "TileWidth";
234
+ /** Tile height in pixels */
235
+ TiffTag[TiffTag["TileHeight"] = 323] = "TileHeight";
236
+ /**
237
+ * Offsets to data tiles
238
+ * `0` means the tile has no data (sparse tiff)
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * [0, 3200, 1406] // three tiles, first tile does not exist
243
+ * ```
244
+ */
245
+ TiffTag[TiffTag["TileOffsets"] = 324] = "TileOffsets";
246
+ /**
247
+ * Byte counts for tiles
248
+ * `0 means the tile does not exist (sparse tiff)
249
+ *
250
+ * @example
251
+ * ```typescript
252
+ * [0, 3200, 1406] // three tiles, first tile does not exist
253
+ * ```
254
+ **/
255
+ TiffTag[TiffTag["TileByteCounts"] = 325] = "TileByteCounts";
256
+ /** JPEG table stream */
257
+ TiffTag[TiffTag["JpegTables"] = 347] = "JpegTables";
258
+ TiffTag[TiffTag["StripOffsets"] = 273] = "StripOffsets";
259
+ TiffTag[TiffTag["StripByteCounts"] = 279] = "StripByteCounts";
260
+ /**
261
+ * GDAL metadata
262
+ * Generally a xml document with lots of information about the tiff and how it was created
263
+ */
264
+ TiffTag[TiffTag["GdalMetadata"] = 42112] = "GdalMetadata";
265
+ /**
266
+ * No data value encoded as a string
267
+ *
268
+ * @example "-9999"
269
+ */
270
+ TiffTag[TiffTag["GdalNoData"] = 42113] = "GdalNoData";
271
+ /** GeoTiff Tags */
272
+ /**
273
+ * Pixel scale in meters
274
+ * in the format [scaleX, scaleY, scaleZ]
275
+ *
276
+ * Requires {@link ModelTiePoint} to be set and {@link ModelTransformation} not to be set
277
+ *
278
+ * @example
279
+ * ```typescript
280
+ * [100.0, 100.0, 0.0]
281
+ * ```
282
+ */
283
+ TiffTag[TiffTag["ModelPixelScale"] = 33550] = "ModelPixelScale";
284
+ /**
285
+ * Position of the tiff
286
+ *
287
+ * contains a list of tie points that contain
288
+ * [x,y,z] of position in the in the tiff, generally [0,0,0]
289
+ * [x,y,z] of the position in the projected
290
+ *
291
+ * @example
292
+ * Mapping tiff point `[0,0,0]` to projected coordinates `[350807.4, 5316081.3, 0.0]`
293
+ * ```
294
+ * [0, 0, 0, 350807.4, 5316081.3, 0.0]
295
+ * ```
296
+ */
297
+ TiffTag[TiffTag["ModelTiePoint"] = 33922] = "ModelTiePoint";
298
+ /**
299
+ * Exact affine transformation between the tiff and the projected location
300
+ *
301
+ * this tag should not be defined when {@link ModelTiePoint} or {@link ModelPixelScale} are used
302
+ *
303
+ * @example
304
+ *```typescript
305
+ * [ 0, 100.0, 0, 400000.0,
306
+ * 100.0, 0, 0, 500000.0,
307
+ * 0, 0, 0, 0,
308
+ * 0, 0, 0, 1]
309
+ * ```
310
+ */
311
+ TiffTag[TiffTag["ModelTransformation"] = 34264] = "ModelTransformation";
312
+ /**
313
+ * List of GeoTiff tags
314
+ * {@link TiffTagGeo}
315
+ *
316
+ * {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_requirements_class_geokeydirectorytag}
317
+ */
318
+ TiffTag[TiffTag["GeoKeyDirectory"] = 34735] = "GeoKeyDirectory";
319
+ /**
320
+ * Double Parameters for GeoTiff Tags
321
+ *
322
+ * {@link TiffTagGeo}
323
+ */
324
+ TiffTag[TiffTag["GeoDoubleParams"] = 34736] = "GeoDoubleParams";
325
+ /**
326
+ * Ascii Parameters for GeoTiff Tags
327
+ *
328
+ * {@link TiffTagGeo}
329
+ */
330
+ TiffTag[TiffTag["GeoAsciiParams"] = 34737] = "GeoAsciiParams";
331
+ /**
332
+ * Stores the LERC version and additional compression
333
+ *
334
+ * @example
335
+ * ```typescript
336
+ * [4, 0] // version 4, no extra compression
337
+ * ```
338
+ */
339
+ TiffTag[TiffTag["LercParameters"] = 50674] = "LercParameters";
340
+ TiffTag[TiffTag["PlanarConfiguration"] = 284] = "PlanarConfiguration";
341
+ /** Untyped values */
342
+ TiffTag[TiffTag["CellLength"] = 265] = "CellLength";
343
+ TiffTag[TiffTag["CellWidth"] = 264] = "CellWidth";
344
+ TiffTag[TiffTag["ColorMap"] = 320] = "ColorMap";
345
+ TiffTag[TiffTag["Copyright"] = 33432] = "Copyright";
346
+ TiffTag[TiffTag["DateTime"] = 306] = "DateTime";
347
+ TiffTag[TiffTag["ExtraSamples"] = 338] = "ExtraSamples";
348
+ TiffTag[TiffTag["FillOrder"] = 266] = "FillOrder";
349
+ TiffTag[TiffTag["FreeByteCounts"] = 289] = "FreeByteCounts";
350
+ TiffTag[TiffTag["FreeOffsets"] = 288] = "FreeOffsets";
351
+ TiffTag[TiffTag["GrayResponseCurve"] = 291] = "GrayResponseCurve";
352
+ TiffTag[TiffTag["GrayResponseUnit"] = 290] = "GrayResponseUnit";
353
+ TiffTag[TiffTag["HostComputer"] = 316] = "HostComputer";
354
+ TiffTag[TiffTag["ImageDescription"] = 270] = "ImageDescription";
355
+ TiffTag[TiffTag["Make"] = 271] = "Make";
356
+ TiffTag[TiffTag["MaxSampleValue"] = 281] = "MaxSampleValue";
357
+ TiffTag[TiffTag["MinSampleValue"] = 280] = "MinSampleValue";
358
+ TiffTag[TiffTag["Model"] = 272] = "Model";
359
+ TiffTag[TiffTag["Orientation"] = 274] = "Orientation";
360
+ TiffTag[TiffTag["ResolutionUnit"] = 296] = "ResolutionUnit";
361
+ TiffTag[TiffTag["RowsPerStrip"] = 278] = "RowsPerStrip";
362
+ TiffTag[TiffTag["SamplesPerPixel"] = 277] = "SamplesPerPixel";
363
+ TiffTag[TiffTag["Software"] = 305] = "Software";
364
+ TiffTag[TiffTag["Threshholding"] = 263] = "Threshholding";
365
+ TiffTag[TiffTag["XResolution"] = 282] = "XResolution";
366
+ TiffTag[TiffTag["YResolution"] = 283] = "YResolution";
367
+ TiffTag[TiffTag["BadFaxLines"] = 326] = "BadFaxLines";
368
+ TiffTag[TiffTag["CleanFaxData"] = 327] = "CleanFaxData";
369
+ TiffTag[TiffTag["ClipPath"] = 343] = "ClipPath";
370
+ TiffTag[TiffTag["ConsecutiveBadFaxLines"] = 328] = "ConsecutiveBadFaxLines";
371
+ TiffTag[TiffTag["Decode"] = 433] = "Decode";
372
+ TiffTag[TiffTag["DefaultImageColor"] = 434] = "DefaultImageColor";
373
+ TiffTag[TiffTag["DocumentName"] = 269] = "DocumentName";
374
+ TiffTag[TiffTag["DotRange"] = 336] = "DotRange";
375
+ TiffTag[TiffTag["HalftoneHints"] = 321] = "HalftoneHints";
376
+ TiffTag[TiffTag["Indexed"] = 346] = "Indexed";
377
+ TiffTag[TiffTag["PageName"] = 285] = "PageName";
378
+ TiffTag[TiffTag["PageNumber"] = 297] = "PageNumber";
379
+ TiffTag[TiffTag["Predictor"] = 317] = "Predictor";
380
+ TiffTag[TiffTag["PrimaryChromaticities"] = 319] = "PrimaryChromaticities";
381
+ TiffTag[TiffTag["ReferenceBlackWhite"] = 532] = "ReferenceBlackWhite";
382
+ TiffTag[TiffTag["SMinSampleValue"] = 340] = "SMinSampleValue";
383
+ TiffTag[TiffTag["SMaxSampleValue"] = 341] = "SMaxSampleValue";
384
+ TiffTag[TiffTag["StripRowCounts"] = 559] = "StripRowCounts";
385
+ TiffTag[TiffTag["SubIFDs"] = 330] = "SubIFDs";
386
+ TiffTag[TiffTag["T4Options"] = 292] = "T4Options";
387
+ TiffTag[TiffTag["T6Options"] = 293] = "T6Options";
388
+ TiffTag[TiffTag["TransferFunction"] = 301] = "TransferFunction";
389
+ TiffTag[TiffTag["WhitePoint"] = 318] = "WhitePoint";
390
+ TiffTag[TiffTag["XClipPathUnits"] = 344] = "XClipPathUnits";
391
+ TiffTag[TiffTag["XPosition"] = 286] = "XPosition";
392
+ TiffTag[TiffTag["YCbCrCoefficients"] = 529] = "YCbCrCoefficients";
393
+ TiffTag[TiffTag["YCbCrPositioning"] = 531] = "YCbCrPositioning";
394
+ TiffTag[TiffTag["YCbCrSubSampling"] = 530] = "YCbCrSubSampling";
395
+ TiffTag[TiffTag["YClipPathUnits"] = 345] = "YClipPathUnits";
396
+ TiffTag[TiffTag["YPosition"] = 287] = "YPosition";
397
+ TiffTag[TiffTag["ApertureValue"] = 37378] = "ApertureValue";
398
+ TiffTag[TiffTag["ColorSpace"] = 40961] = "ColorSpace";
399
+ TiffTag[TiffTag["DateTimeDigitized"] = 36868] = "DateTimeDigitized";
400
+ TiffTag[TiffTag["DateTimeOriginal"] = 36867] = "DateTimeOriginal";
401
+ TiffTag[TiffTag["ExifIFD"] = 34665] = "ExifIFD";
402
+ TiffTag[TiffTag["ExifVersion"] = 36864] = "ExifVersion";
403
+ TiffTag[TiffTag["ExposureTime"] = 33434] = "ExposureTime";
404
+ TiffTag[TiffTag["FileSource"] = 41728] = "FileSource";
405
+ TiffTag[TiffTag["Flash"] = 37385] = "Flash";
406
+ TiffTag[TiffTag["FlashpixVersion"] = 40960] = "FlashpixVersion";
407
+ TiffTag[TiffTag["FNumber"] = 33437] = "FNumber";
408
+ TiffTag[TiffTag["ImageUniqueID"] = 42016] = "ImageUniqueID";
409
+ TiffTag[TiffTag["LightSource"] = 37384] = "LightSource";
410
+ TiffTag[TiffTag["MakerNote"] = 37500] = "MakerNote";
411
+ TiffTag[TiffTag["ShutterSpeedValue"] = 37377] = "ShutterSpeedValue";
412
+ TiffTag[TiffTag["UserComment"] = 37510] = "UserComment";
413
+ TiffTag[TiffTag["IPTC"] = 33723] = "IPTC";
414
+ TiffTag[TiffTag["ICCProfile"] = 34675] = "ICCProfile";
415
+ TiffTag[TiffTag["XMP"] = 700] = "XMP";
416
+ })(TiffTag || (TiffTag = {}));
417
+ /**
418
+ * Geotiff tags as defined by OGC GeoTiff 1.1
419
+ *
420
+ * {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_summary_of_geokey_ids_and_names}
421
+ */
422
+ var TiffTagGeo;
423
+ (function(TiffTagGeo) {
424
+ /**
425
+ * This GeoKey defines the type of Model coordinate reference system used, to which the transformation from the raster space is made:
426
+ *
427
+ * {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_requirements_class_gtmodeltypegeokey}
428
+ *
429
+ * {@link ModelTypeCode}
430
+ */
431
+ TiffTagGeo[TiffTagGeo["GTModelTypeGeoKey"] = 1024] = "GTModelTypeGeoKey";
432
+ /**
433
+ * There are currently only two options: `RasterPixelIsPoint` and `RasterPixelIsArea`
434
+ *
435
+ * {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_requirements_class_gtrastertypegeokey}
436
+ *
437
+ * {@link RasterTypeKey}
438
+ */
439
+ TiffTagGeo[TiffTagGeo["GTRasterTypeGeoKey"] = 1025] = "GTRasterTypeGeoKey";
440
+ /**
441
+ * ASCII reference to published documentation on the overall configuration of the GeoTIFF file.
442
+ *
443
+ * @example "NZGD2000 / New Zealand Transverse Mercator 2000"
444
+ */
445
+ TiffTagGeo[TiffTagGeo["GTCitationGeoKey"] = 1026] = "GTCitationGeoKey";
446
+ /**
447
+ * Renamed from GeographicTypeGeoKey in OGC GeoTiff
448
+ */
449
+ TiffTagGeo[TiffTagGeo["GeodeticCRSGeoKey"] = 2048] = "GeodeticCRSGeoKey";
450
+ /**
451
+ * Renamed from GeogCitationGeoKey in OGC GeoTiff
452
+ *
453
+ * @example "NZTM"
454
+ */
455
+ TiffTagGeo[TiffTagGeo["GeodeticCitationGeoKey"] = 2049] = "GeodeticCitationGeoKey";
456
+ /**
457
+ * Renamed from GeogGeodeticDatumGeoKey in OGC GeoTiff
458
+ */
459
+ TiffTagGeo[TiffTagGeo["GeodeticDatumGeoKey"] = 2050] = "GeodeticDatumGeoKey";
460
+ /**
461
+ * Renamed from "GeogPrimeMeridianGeoKey" in OGC GeoTiff
462
+ */
463
+ TiffTagGeo[TiffTagGeo["PrimeMeridianGeoKey"] = 2051] = "PrimeMeridianGeoKey";
464
+ /**
465
+ * Linear unit of measure
466
+ * @example 9001 // Metre
467
+ */
468
+ TiffTagGeo[TiffTagGeo["GeogLinearUnitsGeoKey"] = 2052] = "GeogLinearUnitsGeoKey";
469
+ TiffTagGeo[TiffTagGeo["GeogLinearUnitSizeGeoKey"] = 2053] = "GeogLinearUnitSizeGeoKey";
470
+ /**
471
+ * Angular unit of measure
472
+ *
473
+ * @example 9102 // Degree
474
+ */
475
+ TiffTagGeo[TiffTagGeo["GeogAngularUnitsGeoKey"] = 2054] = "GeogAngularUnitsGeoKey";
476
+ TiffTagGeo[TiffTagGeo["GeogAngularUnitSizeGeoKey"] = 2055] = "GeogAngularUnitSizeGeoKey";
477
+ /**
478
+ * Renamed from "GeogEllipsoidGeoKey" in OGC GeoTiff
479
+ */
480
+ TiffTagGeo[TiffTagGeo["EllipsoidGeoKey"] = 2056] = "EllipsoidGeoKey";
481
+ /**
482
+ * Renamed from "GeogSemiMajorAxisGeoKey" in OGC GeoTiff
483
+ */
484
+ TiffTagGeo[TiffTagGeo["EllipsoidSemiMajorAxisGeoKey"] = 2057] = "EllipsoidSemiMajorAxisGeoKey";
485
+ /**
486
+ * Renamed from "GeogSemiMinorAxisGeoKey" in OGC GeoTiff
487
+ */
488
+ TiffTagGeo[TiffTagGeo["EllipsoidSemiMinorAxisGeoKey"] = 2058] = "EllipsoidSemiMinorAxisGeoKey";
489
+ /**
490
+ * Renamed from "GeogInvFlatteningGeoKey" in OGC GeoTiff
491
+ */
492
+ TiffTagGeo[TiffTagGeo["EllipsoidInvFlatteningGeoKey"] = 2059] = "EllipsoidInvFlatteningGeoKey";
493
+ /**
494
+ * Renamed from "GeogPrimeMeridianLongGeoKey" in OGC GeoTiff
495
+ */
496
+ TiffTagGeo[TiffTagGeo["PrimeMeridianLongitudeGeoKey"] = 2061] = "PrimeMeridianLongitudeGeoKey";
497
+ TiffTagGeo[TiffTagGeo["GeogTOWGS84GeoKey"] = 2062] = "GeogTOWGS84GeoKey";
498
+ TiffTagGeo[TiffTagGeo["GeogAzimuthUnitsGeoKey"] = 2060] = "GeogAzimuthUnitsGeoKey";
499
+ /**
500
+ * EPSG code of the tiff
501
+ *
502
+ * Renamed from "ProjectedCSTypeGeoKey" in OGC GeoTiff
503
+ *
504
+ * @example
505
+ * ```typescript
506
+ * 2193 // NZTM
507
+ * 3857 // WebMercatorQuad
508
+ * ```
509
+ */
510
+ TiffTagGeo[TiffTagGeo["ProjectedCRSGeoKey"] = 3072] = "ProjectedCRSGeoKey";
511
+ /**
512
+ * ASCII reference to published documentation on the Projected Coordinate System
513
+ *
514
+ * Renamed from "PCSCitationGeoKey" in OGC GeoTiff
515
+ *
516
+ * @example "UTM Zone 60 N with WGS 84"
517
+ */
518
+ TiffTagGeo[TiffTagGeo["ProjectedCitationGeoKey"] = 3073] = "ProjectedCitationGeoKey";
519
+ /**
520
+ * Specifies a map projection from the GeoTIFF CRS register or to indicate that the map projection is user-defined.
521
+ *
522
+ * {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_map_projection_geokeys}
523
+ *
524
+ * @example 2193
525
+ */
526
+ TiffTagGeo[TiffTagGeo["ProjectionGeoKey"] = 3074] = "ProjectionGeoKey";
527
+ TiffTagGeo[TiffTagGeo["ProjMethodGeoKey"] = 3075] = "ProjMethodGeoKey";
528
+ TiffTagGeo[TiffTagGeo["ProjLinearUnitsGeoKey"] = 3076] = "ProjLinearUnitsGeoKey";
529
+ TiffTagGeo[TiffTagGeo["ProjLinearUnitSizeGeoKey"] = 3077] = "ProjLinearUnitSizeGeoKey";
530
+ TiffTagGeo[TiffTagGeo["ProjStdParallel1GeoKey"] = 3078] = "ProjStdParallel1GeoKey";
531
+ TiffTagGeo[TiffTagGeo["ProjStdParallel2GeoKey"] = 3079] = "ProjStdParallel2GeoKey";
532
+ TiffTagGeo[TiffTagGeo["ProjNatOriginLongGeoKey"] = 3080] = "ProjNatOriginLongGeoKey";
533
+ TiffTagGeo[TiffTagGeo["ProjNatOriginLatGeoKey"] = 3081] = "ProjNatOriginLatGeoKey";
534
+ TiffTagGeo[TiffTagGeo["ProjFalseEastingGeoKey"] = 3082] = "ProjFalseEastingGeoKey";
535
+ TiffTagGeo[TiffTagGeo["ProjFalseNorthingGeoKey"] = 3083] = "ProjFalseNorthingGeoKey";
536
+ TiffTagGeo[TiffTagGeo["ProjFalseOriginLongGeoKey"] = 3084] = "ProjFalseOriginLongGeoKey";
537
+ TiffTagGeo[TiffTagGeo["ProjFalseOriginLatGeoKey"] = 3085] = "ProjFalseOriginLatGeoKey";
538
+ TiffTagGeo[TiffTagGeo["ProjFalseOriginEastingGeoKey"] = 3086] = "ProjFalseOriginEastingGeoKey";
539
+ TiffTagGeo[TiffTagGeo["ProjFalseOriginNorthingGeoKey"] = 3087] = "ProjFalseOriginNorthingGeoKey";
540
+ TiffTagGeo[TiffTagGeo["ProjCenterLongGeoKey"] = 3088] = "ProjCenterLongGeoKey";
541
+ TiffTagGeo[TiffTagGeo["ProjCenterLatGeoKey"] = 3089] = "ProjCenterLatGeoKey";
542
+ TiffTagGeo[TiffTagGeo["ProjCenterEastingGeoKey"] = 3090] = "ProjCenterEastingGeoKey";
543
+ TiffTagGeo[TiffTagGeo["ProjCenterNorthingGeoKey"] = 3091] = "ProjCenterNorthingGeoKey";
544
+ TiffTagGeo[TiffTagGeo["ProjScaleAtNatOriginGeoKey"] = 3092] = "ProjScaleAtNatOriginGeoKey";
545
+ TiffTagGeo[TiffTagGeo["ProjScaleAtCenterGeoKey"] = 3093] = "ProjScaleAtCenterGeoKey";
546
+ TiffTagGeo[TiffTagGeo["ProjAzimuthAngleGeoKey"] = 3094] = "ProjAzimuthAngleGeoKey";
547
+ TiffTagGeo[TiffTagGeo["ProjStraightVertPoleLongGeoKey"] = 3095] = "ProjStraightVertPoleLongGeoKey";
548
+ TiffTagGeo[TiffTagGeo["ProjRectifiedGridAngleGeoKey"] = 3096] = "ProjRectifiedGridAngleGeoKey";
549
+ /**
550
+ * This key is provided to specify the vertical coordinate reference system from the GeoTIFF CRS register or to indicate that the CRS is a user-defined vertical coordinate reference system. The value for VerticalGeoKey should follow the
551
+ *
552
+ * {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_requirements_class_verticalgeokey}
553
+ *
554
+ * @example 4979
555
+ */
556
+ TiffTagGeo[TiffTagGeo["VerticalGeoKey"] = 4096] = "VerticalGeoKey";
557
+ /**
558
+ *
559
+ * @example "Geographic 3D WGS 84, Ellipsoidal height"
560
+ */
561
+ TiffTagGeo[TiffTagGeo["VerticalCitationGeoKey"] = 4097] = "VerticalCitationGeoKey";
562
+ /**
563
+ * vertical datum for a user-defined vertical coordinate reference system.
564
+ */
565
+ TiffTagGeo[TiffTagGeo["VerticalDatumGeoKey"] = 4098] = "VerticalDatumGeoKey";
566
+ /**
567
+ * Linear Unit for vertical CRS
568
+ *
569
+ * @example 9001
570
+ */
571
+ TiffTagGeo[TiffTagGeo["VerticalUnitsGeoKey"] = 4099] = "VerticalUnitsGeoKey";
572
+ })(TiffTagGeo || (TiffTagGeo = {}));
573
+ /**
574
+ * EPSG Angular Units. exist between [9100, 9199]
575
+ *
576
+ * Taken from libgeotiff
577
+ */
578
+ var AngularUnit;
579
+ (function(AngularUnit) {
580
+ AngularUnit[AngularUnit["Radian"] = 9101] = "Radian";
581
+ AngularUnit[AngularUnit["Degree"] = 9102] = "Degree";
582
+ AngularUnit[AngularUnit["ArcMinute"] = 9103] = "ArcMinute";
583
+ AngularUnit[AngularUnit["ArcDegree"] = 9104] = "ArcDegree";
584
+ AngularUnit[AngularUnit["Grad"] = 9105] = "Grad";
585
+ AngularUnit[AngularUnit["Gon"] = 9106] = "Gon";
586
+ AngularUnit[AngularUnit["Dms"] = 9107] = "Dms";
587
+ })(AngularUnit || (AngularUnit = {}));
588
+ /**
589
+ * ESPG Liner units exist between [9000, 9099]
590
+ *
591
+ * Taken from libgeotiff
592
+ */
593
+ var LinearUnit;
594
+ (function(LinearUnit) {
595
+ LinearUnit[LinearUnit["Metre"] = 9001] = "Metre";
596
+ LinearUnit[LinearUnit["Foot"] = 9002] = "Foot";
597
+ LinearUnit[LinearUnit["FootUsSurvey"] = 9003] = "FootUsSurvey";
598
+ LinearUnit[LinearUnit["FootModifiedAmerican"] = 9004] = "FootModifiedAmerican";
599
+ LinearUnit[LinearUnit["FootClarke"] = 9005] = "FootClarke";
600
+ LinearUnit[LinearUnit["FootIndian"] = 9006] = "FootIndian";
601
+ LinearUnit[LinearUnit["Link"] = 9007] = "Link";
602
+ LinearUnit[LinearUnit["LinkBenoit"] = 9008] = "LinkBenoit";
603
+ LinearUnit[LinearUnit["LinkSears"] = 9009] = "LinkSears";
604
+ LinearUnit[LinearUnit["ChainBenoit"] = 9010] = "ChainBenoit";
605
+ LinearUnit[LinearUnit["ChainSears"] = 9011] = "ChainSears";
606
+ LinearUnit[LinearUnit["YardSears"] = 9012] = "YardSears";
607
+ LinearUnit[LinearUnit["YardIndian"] = 9013] = "YardIndian";
608
+ LinearUnit[LinearUnit["Fathom"] = 9014] = "Fathom";
609
+ LinearUnit[LinearUnit["MileInternationalNautical"] = 9015] = "MileInternationalNautical";
610
+ })(LinearUnit || (LinearUnit = {}));
611
+ TiffTag.TileByteCounts, TiffTag.TileOffsets, TiffTag.StripOffsets, TiffTag.StripByteCounts, TiffTag.BitsPerSample, TiffTag.SampleFormat, TiffTag.GeoKeyDirectory, TiffTag.GeoDoubleParams;
612
+ //#endregion
613
+ //#region node_modules/@cogeotiff/core/build/const/tiff.mime.js
614
+ /**
615
+ * MimeType conversion for common tif image compresson types
616
+ */
617
+ var TiffMimeType;
618
+ (function(TiffMimeType) {
619
+ TiffMimeType["None"] = "application/octet-stream";
620
+ TiffMimeType["Jbig"] = "image/jbig";
621
+ TiffMimeType["Dcs"] = "image/x-kodak-dcs";
622
+ TiffMimeType["PackBits"] = "application/packbits";
623
+ TiffMimeType["Jpeg"] = "image/jpeg";
624
+ TiffMimeType["Jp2000"] = "image/jp2";
625
+ TiffMimeType["JpegXl"] = "image/jpegxl";
626
+ TiffMimeType["Webp"] = "image/webp";
627
+ TiffMimeType["Zstd"] = "application/zstd";
628
+ TiffMimeType["Lzw"] = "application/lzw";
629
+ TiffMimeType["Deflate"] = "application/deflate";
630
+ TiffMimeType["Lerc"] = "application/lerc";
631
+ TiffMimeType["Lzma"] = "application/x-lzma";
632
+ })(TiffMimeType || (TiffMimeType = {}));
633
+ Compression.None, TiffMimeType.None, Compression.Lzw, TiffMimeType.Lzw, Compression.Jpeg6, TiffMimeType.Jpeg, Compression.Jpeg, TiffMimeType.Jpeg, Compression.DeflateOther, TiffMimeType.Deflate, Compression.Deflate, TiffMimeType.Deflate, Compression.Lerc, TiffMimeType.Lerc, Compression.Lzma, TiffMimeType.Lzma, Compression.Jp2000, TiffMimeType.Jp2000, Compression.Zstd, TiffMimeType.Zstd, Compression.Webp, TiffMimeType.Webp, Compression.JpegXl, TiffMimeType.JpegXl, Compression.Ccittrle, TiffMimeType.None, Compression.CcittT4, TiffMimeType.None, Compression.CcittT6, TiffMimeType.None, Compression.T85, TiffMimeType.Jbig, Compression.T43, TiffMimeType.Jbig, Compression.Next, TiffMimeType.None, Compression.Ccittrlew, TiffMimeType.None, Compression.PackBits, TiffMimeType.PackBits, Compression.ThunderScan, TiffMimeType.None, Compression.It8ctpad, TiffMimeType.None, Compression.It8lw, TiffMimeType.None, Compression.It8mp, TiffMimeType.None, Compression.It8bl, TiffMimeType.None, Compression.PixarFilm, TiffMimeType.None, Compression.PixarLog, TiffMimeType.None, Compression.Dcs, TiffMimeType.Dcs, Compression.Jbig, TiffMimeType.Jbig, Compression.SgiLog, TiffMimeType.None, Compression.SgiLog24, TiffMimeType.None, Compression.JpegXlDng17, TiffMimeType.JpegXl;
634
+ //#endregion
635
+ //#region node_modules/@cogeotiff/core/build/const/tiff.tag.value.js
636
+ var TiffTagValueType;
637
+ (function(TiffTagValueType) {
638
+ TiffTagValueType[TiffTagValueType["Uint8"] = 1] = "Uint8";
639
+ TiffTagValueType[TiffTagValueType["Ascii"] = 2] = "Ascii";
640
+ TiffTagValueType[TiffTagValueType["Uint16"] = 3] = "Uint16";
641
+ TiffTagValueType[TiffTagValueType["Uint32"] = 4] = "Uint32";
642
+ TiffTagValueType[TiffTagValueType["Rational"] = 5] = "Rational";
643
+ TiffTagValueType[TiffTagValueType["Int8"] = 6] = "Int8";
644
+ TiffTagValueType[TiffTagValueType["Undefined"] = 7] = "Undefined";
645
+ TiffTagValueType[TiffTagValueType["Int16"] = 8] = "Int16";
646
+ TiffTagValueType[TiffTagValueType["Int32"] = 9] = "Int32";
647
+ TiffTagValueType[TiffTagValueType["SignedRational"] = 10] = "SignedRational";
648
+ TiffTagValueType[TiffTagValueType["Float32"] = 11] = "Float32";
649
+ TiffTagValueType[TiffTagValueType["Float64"] = 12] = "Float64";
650
+ TiffTagValueType[TiffTagValueType["Ifd"] = 13] = "Ifd";
651
+ TiffTagValueType[TiffTagValueType["Uint64"] = 16] = "Uint64";
652
+ TiffTagValueType[TiffTagValueType["Int64"] = 17] = "Int64";
653
+ TiffTagValueType[TiffTagValueType["Ifd8"] = 18] = "Ifd8";
654
+ })(TiffTagValueType || (TiffTagValueType = {}));
655
+ //#endregion
656
+ //#region node_modules/@cogeotiff/core/build/const/tiff.version.js
657
+ /**
658
+ * Tif version number that is stored at the start of a tif file
659
+ */
660
+ var TiffVersion;
661
+ (function(TiffVersion) {
662
+ /**
663
+ * Big tif's,
664
+ * generally uses 64bit numbers for offsets
665
+ * @see http://bigtiff.org/
666
+ **/
667
+ TiffVersion[TiffVersion["BigTiff"] = 43] = "BigTiff";
668
+ /**
669
+ * Original tif
670
+ * Uses 32 bit or smaller numbers for offsets and counters
671
+ */
672
+ TiffVersion[TiffVersion["Tiff"] = 42] = "Tiff";
673
+ })(TiffVersion || (TiffVersion = {}));
674
+ //#endregion
675
+ //#region node_modules/@cogeotiff/core/build/util/bytes.js
676
+ var ByteSizeFloat;
677
+ (function(ByteSizeFloat) {
678
+ ByteSizeFloat[ByteSizeFloat["Double"] = 8] = "Double";
679
+ ByteSizeFloat[ByteSizeFloat["Float32"] = 4] = "Float32";
680
+ })(ByteSizeFloat || (ByteSizeFloat = {}));
681
+ var ByteSize;
682
+ (function(ByteSize) {
683
+ ByteSize[ByteSize["UInt64"] = 8] = "UInt64";
684
+ ByteSize[ByteSize["UInt32"] = 4] = "UInt32";
685
+ ByteSize[ByteSize["UInt16"] = 2] = "UInt16";
686
+ ByteSize[ByteSize["UInt8"] = 1] = "UInt8";
687
+ })(ByteSize || (ByteSize = {}));
688
+ //#endregion
689
+ //#region node_modules/@cogeotiff/core/build/read/endian.js
690
+ const buffer = /* @__PURE__ */ new ArrayBuffer(4);
691
+ const uint32 = new Uint32Array(buffer);
692
+ const uint8 = new Uint8Array(buffer);
693
+ uint32[0] = 1;
694
+ uint8[0];
695
+ new Set([
696
+ TiffTag.Compression,
697
+ TiffTag.ImageHeight,
698
+ TiffTag.ImageWidth,
699
+ TiffTag.ModelPixelScale,
700
+ TiffTag.ModelTiePoint,
701
+ TiffTag.ModelTransformation,
702
+ TiffTag.TileHeight,
703
+ TiffTag.TileWidth
704
+ ]);
705
+ new Set([
706
+ TiffTag.GeoKeyDirectory,
707
+ TiffTag.GeoAsciiParams,
708
+ TiffTag.GeoDoubleParams
709
+ ]);
710
+ //#endregion
711
+ //#region node_modules/@cogeotiff/core/build/read/tiff.gdal.js
712
+ var GhostOption;
713
+ (function(GhostOption) {
714
+ GhostOption["GdalStructuralMetadataSize"] = "GDAL_STRUCTURAL_METADATA_SIZE";
715
+ GhostOption["Layout"] = "LAYOUT";
716
+ GhostOption["BlockOrder"] = "BLOCK_ORDER";
717
+ GhostOption["BlockLeader"] = "BLOCK_LEADER";
718
+ GhostOption["BlockTrailer"] = "BLOCK_TRAILER";
719
+ GhostOption["KnownIncompatibleEdition"] = "KNOWN_INCOMPATIBLE_EDITION";
720
+ GhostOption["MaskInterleavedWithImagery"] = "MASK_INTERLEAVED_WITH_IMAGERY";
721
+ })(GhostOption || (GhostOption = {}));
722
+ var GhostOptionTileOrder;
723
+ (function(GhostOptionTileOrder) {
724
+ GhostOptionTileOrder["RowMajor"] = "ROW_MAJOR";
725
+ })(GhostOptionTileOrder || (GhostOptionTileOrder = {}));
726
+ var GhostOptionTileLeader;
727
+ (function(GhostOptionTileLeader) {
728
+ GhostOptionTileLeader["uint32"] = "SIZE_AS_UINT4";
729
+ })(GhostOptionTileLeader || (GhostOptionTileLeader = {}));
730
+ TiffVersion.Tiff, ByteSize.UInt32, ByteSize.UInt16, ByteSize.UInt16 + ByteSize.UInt16 + 2 * ByteSize.UInt32;
731
+ TiffVersion.BigTiff, ByteSize.UInt64, ByteSize.UInt64, ByteSize.UInt16 + ByteSize.UInt16 + 2 * ByteSize.UInt64;
732
+ TiffVersion.BigTiff, TiffVersion.Tiff;
733
+ //#endregion
734
+ //#region node_modules/@developmentseed/geotiff/dist/codecs/canvas.js
735
+ async function decode$2(bytes, metadata) {
736
+ const blob = new Blob([bytes]);
737
+ const imageBitmap = await createImageBitmap(blob);
738
+ const canvas = new OffscreenCanvas(imageBitmap.width, imageBitmap.height);
739
+ const ctx = canvas.getContext("2d");
740
+ ctx.drawImage(imageBitmap, 0, 0);
741
+ imageBitmap.close();
742
+ const { width, height } = canvas;
743
+ const rgba = ctx.getImageData(0, 0, width, height).data;
744
+ const samplesPerPixel = metadata.samplesPerPixel;
745
+ if (samplesPerPixel === 4) return {
746
+ layout: "pixel-interleaved",
747
+ data: rgba
748
+ };
749
+ if (samplesPerPixel === 3) {
750
+ const pixelCount = width * height;
751
+ const rgb = new Uint8ClampedArray(pixelCount * 3);
752
+ for (let i = 0, j = 0; i < rgb.length; i += 3, j += 4) {
753
+ rgb[i] = rgba[j];
754
+ rgb[i + 1] = rgba[j + 1];
755
+ rgb[i + 2] = rgba[j + 2];
756
+ }
757
+ return {
758
+ layout: "pixel-interleaved",
759
+ data: rgb
760
+ };
761
+ }
762
+ throw new Error(`Unsupported SamplesPerPixel for JPEG: ${samplesPerPixel}`);
763
+ }
764
+ //#endregion
765
+ //#region node_modules/@developmentseed/geotiff/dist/codecs/decompression-stream.js
766
+ function assert(expression, msg = "") {
767
+ if (!expression) throw new Error(msg);
768
+ }
769
+ async function decompressWithDecompressionStream(data, { format, signal }) {
770
+ const response = data instanceof Response ? data : new Response(data);
771
+ assert(response.body, "Response does not contain body.");
772
+ try {
773
+ return await new Response(response.body.pipeThrough(new DecompressionStream(format), { signal })).arrayBuffer();
774
+ } catch {
775
+ signal?.throwIfAborted();
776
+ throw new Error(`Failed to decode ${format}`);
777
+ }
778
+ }
779
+ //#endregion
780
+ //#region node_modules/@developmentseed/geotiff/dist/codecs/deflate.js
781
+ async function decode$1(bytes) {
782
+ return decompressWithDecompressionStream(bytes, { format: "deflate" });
783
+ }
784
+ //#endregion
785
+ //#region node_modules/@developmentseed/geotiff/dist/codecs/predictor.js
786
+ /**
787
+ * Undo TIFF horizontal differencing (predictor 2) or floating-point
788
+ * prediction (predictor 3) in-place on a decoded tile buffer.
789
+ *
790
+ * Mirrors the applyPredictor logic in geotiff.js.
791
+ */
792
+ /** Undo horizontal differencing for integer samples (predictor 2). */
793
+ function decodeRowAcc(row, stride) {
794
+ const r = row;
795
+ let offset = 0;
796
+ let length = row.length - stride;
797
+ do {
798
+ for (let i = stride; i > 0; i--) {
799
+ r[offset + stride] = (r[offset + stride] ?? 0) + (r[offset] ?? 0);
800
+ offset++;
801
+ }
802
+ length -= stride;
803
+ } while (length > 0);
804
+ }
805
+ /** Undo floating-point horizontal differencing (predictor 3). */
806
+ function decodeRowFloatingPoint(row, stride, bytesPerSample) {
807
+ let index = 0;
808
+ let count = row.length;
809
+ const wc = count / bytesPerSample;
810
+ while (count > stride) {
811
+ for (let i = stride; i > 0; i--) {
812
+ row[index + stride] += row[index];
813
+ index++;
814
+ }
815
+ count -= stride;
816
+ }
817
+ const copy = row.slice();
818
+ for (let i = 0; i < wc; i++) for (let b = 0; b < bytesPerSample; b++) row[bytesPerSample * i + b] = copy[(bytesPerSample - b - 1) * wc + i];
819
+ }
820
+ /**
821
+ * Apply TIFF predictor decoding to a raw decoded tile buffer in-place.
822
+ *
823
+ * @param block Decoded tile bytes.
824
+ * @param predictor Predictor enum value.
825
+ * @param width Tile width in pixels.
826
+ * @param height Tile height in pixels.
827
+ * @param bitsPerSample Bits per sample (all samples must be equal).
828
+ * @param samplesPerPixel Number of bands.
829
+ * @param planarConfiguration PlanarConfiguration enum value.
830
+ */
831
+ function applyPredictor(block, predictor, width, height, bitsPerSample, samplesPerPixel, planarConfiguration) {
832
+ if (predictor === Predictor.None) return block;
833
+ const bytesPerSample = bitsPerSample / 8;
834
+ const stride = planarConfiguration === PlanarConfiguration.Separate ? 1 : samplesPerPixel;
835
+ for (let i = 0; i < height; i++) {
836
+ const byteOffset = i * stride * width * bytesPerSample;
837
+ if (byteOffset >= block.byteLength) break;
838
+ if (predictor === Predictor.Horizontal) {
839
+ let row;
840
+ const length = stride * width;
841
+ switch (bitsPerSample) {
842
+ case 8:
843
+ row = new Uint8Array(block, byteOffset, length);
844
+ break;
845
+ case 16:
846
+ row = new Uint16Array(block, byteOffset, length);
847
+ break;
848
+ case 32:
849
+ row = new Uint32Array(block, byteOffset, length);
850
+ break;
851
+ default: throw new Error(`Predictor 2 not supported for ${bitsPerSample} bits per sample.`);
852
+ }
853
+ decodeRowAcc(row, stride);
854
+ } else if (predictor === Predictor.FloatingPoint) decodeRowFloatingPoint(new Uint8Array(block, byteOffset, stride * width * bytesPerSample), stride, bytesPerSample);
855
+ }
856
+ return block;
857
+ }
858
+ //#endregion
859
+ //#region node_modules/@developmentseed/geotiff/dist/decode.js
860
+ async function decodeUncompressed(bytes) {
861
+ return bytes;
862
+ }
863
+ /**
864
+ * The global registry of decoders for each compression type.
865
+ *
866
+ * This maps a {@link Compression} value to a function that returns a promise of
867
+ * a {@link Decoder}.
868
+ */
869
+ const DECODER_REGISTRY = /* @__PURE__ */ new Map();
870
+ DECODER_REGISTRY.set(Compression.None, () => Promise.resolve(decodeUncompressed));
871
+ DECODER_REGISTRY.set(Compression.Deflate, () => Promise.resolve(decode$1));
872
+ DECODER_REGISTRY.set(Compression.DeflateOther, () => Promise.resolve(decode$1));
873
+ DECODER_REGISTRY.set(Compression.Lzw, () => import("./lzw-CQJJDca2.js").then((m) => m.decode));
874
+ DECODER_REGISTRY.set(Compression.Zstd, () => import("./zstd-DBZv9xja.js").then((m) => m.decode));
875
+ DECODER_REGISTRY.set(Compression.Jpeg, () => Promise.resolve(decode$2));
876
+ DECODER_REGISTRY.set(Compression.Jpeg6, () => Promise.resolve(decode$2));
877
+ DECODER_REGISTRY.set(Compression.Webp, () => Promise.resolve(decode$2));
878
+ DECODER_REGISTRY.set(Compression.Lerc, () => import("./lerc-By2TvjAX.js").then((m) => m.decode));
879
+ /**
880
+ * Decode a tile's bytes according to its compression and image metadata.
881
+ */
882
+ async function decode(bytes, compression, metadata) {
883
+ const loader = DECODER_REGISTRY.get(compression);
884
+ if (!loader) throw new Error(`Unsupported compression: ${compression}`);
885
+ const result = await (await loader())(bytes, metadata);
886
+ if (result instanceof ArrayBuffer) {
887
+ const { predictor, width, height, bitsPerSample, samplesPerPixel, planarConfiguration } = metadata;
888
+ return {
889
+ layout: "pixel-interleaved",
890
+ data: toTypedArray(applyPredictor(result, predictor, width, height, bitsPerSample, samplesPerPixel, planarConfiguration), metadata)
891
+ };
892
+ }
893
+ return result;
894
+ }
895
+ /**
896
+ * Unpack a 1-bit packed mask buffer (MSB-first) into a Uint8Array of 0/255.
897
+ * Each input byte holds 8 pixels; bit 7 is the first pixel in that byte.
898
+ */
899
+ function unpackBitPacked(buffer, pixelCount) {
900
+ const packed = new Uint8Array(buffer);
901
+ const out = new Uint8Array(pixelCount);
902
+ for (let i = 0; i < pixelCount; i++) out[i] = packed[i >> 3] >> 7 - (i & 7) & 1 ? 255 : 0;
903
+ return out;
904
+ }
905
+ /**
906
+ * Convert a raw ArrayBuffer of pixel data into a typed array based on the
907
+ * sample format and bits per sample. This is used for codecs that return raw
908
+ * bytes.
909
+ */
910
+ function toTypedArray(buffer, metadata) {
911
+ const { sampleFormat, bitsPerSample } = metadata;
912
+ switch (sampleFormat) {
913
+ case SampleFormat.Uint:
914
+ switch (bitsPerSample) {
915
+ case 1: return unpackBitPacked(buffer, metadata.width * metadata.height * metadata.samplesPerPixel);
916
+ case 8: return new Uint8Array(buffer);
917
+ case 16: return new Uint16Array(buffer);
918
+ case 32: return new Uint32Array(buffer);
919
+ }
920
+ break;
921
+ case SampleFormat.Int:
922
+ switch (bitsPerSample) {
923
+ case 8: return new Int8Array(buffer);
924
+ case 16: return new Int16Array(buffer);
925
+ case 32: return new Int32Array(buffer);
926
+ }
927
+ break;
928
+ case SampleFormat.Float:
929
+ switch (bitsPerSample) {
930
+ case 32: return new Float32Array(buffer);
931
+ case 64: return new Float64Array(buffer);
932
+ }
933
+ break;
934
+ }
935
+ throw new Error(`Unsupported sample format/depth: SampleFormat=${sampleFormat}, BitsPerSample=${bitsPerSample}`);
936
+ }
937
+ //#endregion
938
+ export { decode as n, Compression as r, DECODER_REGISTRY as t };
939
+
940
+ //# sourceMappingURL=decode-BvR5vy7g.js.map