@poe-platform/safe-bash 0.1.844 → 0.1.846
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/dist/image-ast/ast.d.ts +12 -2
- package/dist/image-ast/browser/ast.d.ts +12 -2
- package/dist/image-ast/browser/codecs/exif-metadata.d.ts +2 -0
- package/dist/image-ast/browser/codecs/exif.d.ts +2 -0
- package/dist/image-ast/browser/codecs/gif-metadata-storage.d.ts +1 -0
- package/dist/image-ast/browser/codecs/gif-metadata.d.ts +1 -0
- package/dist/image-ast/browser/codecs/gif-output-parts.d.ts +1 -1
- package/dist/image-ast/browser/codecs/jpeg.d.ts +1 -1
- package/dist/image-ast/browser/codecs/netpbm-storage.d.ts +2 -2
- package/dist/image-ast/browser/codecs/netpbm.d.ts +4 -4
- package/dist/image-ast/browser/codecs/png-storage.d.ts +9 -1
- package/dist/image-ast/browser/codecs/png.d.ts +1 -0
- package/dist/image-ast/browser/codecs/tiff-layout.d.ts +3 -2
- package/dist/image-ast/codecs/exif-metadata.d.ts +2 -0
- package/dist/image-ast/codecs/exif.d.ts +2 -0
- package/dist/image-ast/codecs/gif-metadata-storage.d.ts +1 -0
- package/dist/image-ast/codecs/gif-metadata.d.ts +1 -0
- package/dist/image-ast/codecs/gif-output-parts.d.ts +1 -1
- package/dist/image-ast/codecs/jpeg.d.ts +1 -1
- package/dist/image-ast/codecs/netpbm-storage.d.ts +2 -2
- package/dist/image-ast/codecs/netpbm.d.ts +4 -4
- package/dist/image-ast/codecs/png-storage.d.ts +9 -1
- package/dist/image-ast/codecs/png.d.ts +1 -0
- package/dist/image-ast/codecs/tiff-layout.d.ts +3 -2
- package/dist/image-ast/index.js +554 -163
- package/dist/mp4-ast/types.d.ts +2 -0
- package/dist/safe-bash/command-chunks/{chunk-LORSYIAF.js → chunk-CSJHADNR.js} +31 -7
- package/dist/safe-bash/command-chunks/{chunk-KSCVKF7I.js → chunk-F42YLXD4.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-2EEIB5O3.js → chunk-HUE2ATJY.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-3SWIXYXT.js → chunk-NBQWCUOP.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-U5TQVW64.js → chunk-ZTEK2JJD.js} +1 -1
- package/dist/safe-bash-command-ffmpeg/index.js +535 -88
- package/dist/safe-bash-command-ffprobe/index.js +2 -2
- package/dist/safe-bash-command-ffprobe/media.js +2 -2
- package/dist/safe-bash-command-imagemagick/compare-file.d.ts +3 -2
- package/dist/safe-bash-command-imagemagick/index.d.ts +1 -0
- package/dist/safe-bash-command-imagemagick/index.js +895 -276
- package/dist/safe-bash-command-imagemagick/raw-output.d.ts +10 -0
- package/dist/safe-bash-command-python/executor.js +3 -3
- package/dist/safe-bash-command-python/index.js +3 -3
- package/dist/safe-bash-command-python/jspi.js +2 -2
- package/dist/safe-bash-command-python/worker.js +1 -1
- package/package.json +2 -2
package/dist/image-ast/ast.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FileSystem } from "@poe-platform/safe-fs/contracts";
|
|
2
|
-
export type ImageFormat = "png" | "jpeg" | "webp" | "heic" | "heif" | "avif" | "gif" | "ppm" | "pgm" | "pbm" | "bmp" | "tiff" | "svg" | "pdf" | "raw";
|
|
2
|
+
export type ImageFormat = "png" | "jpeg" | "webp" | "heic" | "heif" | "avif" | "gif" | "pam" | "ppm" | "pgm" | "pbm" | "bmp" | "miff" | "tiff" | "svg" | "pdf" | "raw";
|
|
3
3
|
export type ColorSpace = "srgb" | "b-w" | "cmyk" | "rgb16" | "grey16";
|
|
4
4
|
export interface RgbaColor {
|
|
5
5
|
readonly r: number;
|
|
@@ -14,6 +14,8 @@ export type ColorInput = string | {
|
|
|
14
14
|
readonly alpha?: number;
|
|
15
15
|
};
|
|
16
16
|
export interface RgbaImage {
|
|
17
|
+
readonly miffPages?: readonly RgbaImage[];
|
|
18
|
+
readonly tiffPages?: readonly RgbaImage[];
|
|
17
19
|
readonly isPalette?: boolean;
|
|
18
20
|
readonly backgroundColor?: RgbaColor;
|
|
19
21
|
readonly width: number;
|
|
@@ -25,6 +27,7 @@ export interface RgbaImage {
|
|
|
25
27
|
readonly channels: 1 | 2 | 3 | 4;
|
|
26
28
|
readonly depth: "uchar" | "char" | "ushort" | "short" | "uint" | "int" | "float" | "double" | "bit";
|
|
27
29
|
readonly density: number;
|
|
30
|
+
readonly resolution?: NonNullable<ImageMetadata["resolution"]>;
|
|
28
31
|
readonly hasAlpha: boolean;
|
|
29
32
|
readonly isPremultiplied?: boolean;
|
|
30
33
|
readonly wasPremultiplied?: boolean;
|
|
@@ -34,6 +37,8 @@ export interface RgbaImage {
|
|
|
34
37
|
readonly x: number;
|
|
35
38
|
readonly y: number;
|
|
36
39
|
};
|
|
40
|
+
readonly properties?: Readonly<Record<string, string>>;
|
|
41
|
+
readonly icc?: Uint8Array;
|
|
37
42
|
readonly orientation?: number;
|
|
38
43
|
readonly autoOrient?: {
|
|
39
44
|
readonly width: number;
|
|
@@ -74,7 +79,7 @@ export interface ImageMetadata {
|
|
|
74
79
|
readonly resolution?: {
|
|
75
80
|
readonly x: number;
|
|
76
81
|
readonly y: number;
|
|
77
|
-
readonly unit: "meter" | "unknown";
|
|
82
|
+
readonly unit: "meter" | "inch" | "cm" | "unknown";
|
|
78
83
|
};
|
|
79
84
|
readonly virtualCanvas?: {
|
|
80
85
|
readonly width: number;
|
|
@@ -82,6 +87,8 @@ export interface ImageMetadata {
|
|
|
82
87
|
readonly x: number;
|
|
83
88
|
readonly y: number;
|
|
84
89
|
};
|
|
90
|
+
readonly properties?: Readonly<Record<string, string>>;
|
|
91
|
+
readonly icc?: Uint8Array;
|
|
85
92
|
readonly orientation?: number;
|
|
86
93
|
readonly autoOrient?: {
|
|
87
94
|
readonly width: number;
|
|
@@ -419,9 +426,12 @@ export type ImageAstNode = {
|
|
|
419
426
|
readonly orientation?: number;
|
|
420
427
|
};
|
|
421
428
|
export interface OutputEncodeOptions {
|
|
429
|
+
readonly omitPngResolution?: boolean;
|
|
422
430
|
readonly consumeInput?: boolean;
|
|
423
431
|
readonly format?: ImageFormat;
|
|
424
432
|
readonly rawDepth?: string;
|
|
433
|
+
readonly netpbmDepth?: number;
|
|
434
|
+
readonly netpbmAscii?: boolean;
|
|
425
435
|
readonly quality?: number;
|
|
426
436
|
readonly samplingFactor?: string;
|
|
427
437
|
readonly chromaSubsampling?: "4:2:0" | "4:4:4";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FileSystem } from "@poe-platform/safe-fs/contracts";
|
|
2
|
-
export type ImageFormat = "png" | "jpeg" | "webp" | "heic" | "heif" | "avif" | "gif" | "ppm" | "pgm" | "pbm" | "bmp" | "tiff" | "svg" | "pdf" | "raw";
|
|
2
|
+
export type ImageFormat = "png" | "jpeg" | "webp" | "heic" | "heif" | "avif" | "gif" | "pam" | "ppm" | "pgm" | "pbm" | "bmp" | "miff" | "tiff" | "svg" | "pdf" | "raw";
|
|
3
3
|
export type ColorSpace = "srgb" | "b-w" | "cmyk" | "rgb16" | "grey16";
|
|
4
4
|
export interface RgbaColor {
|
|
5
5
|
readonly r: number;
|
|
@@ -14,6 +14,8 @@ export type ColorInput = string | {
|
|
|
14
14
|
readonly alpha?: number;
|
|
15
15
|
};
|
|
16
16
|
export interface RgbaImage {
|
|
17
|
+
readonly miffPages?: readonly RgbaImage[];
|
|
18
|
+
readonly tiffPages?: readonly RgbaImage[];
|
|
17
19
|
readonly isPalette?: boolean;
|
|
18
20
|
readonly backgroundColor?: RgbaColor;
|
|
19
21
|
readonly width: number;
|
|
@@ -25,6 +27,7 @@ export interface RgbaImage {
|
|
|
25
27
|
readonly channels: 1 | 2 | 3 | 4;
|
|
26
28
|
readonly depth: "uchar" | "char" | "ushort" | "short" | "uint" | "int" | "float" | "double" | "bit";
|
|
27
29
|
readonly density: number;
|
|
30
|
+
readonly resolution?: NonNullable<ImageMetadata["resolution"]>;
|
|
28
31
|
readonly hasAlpha: boolean;
|
|
29
32
|
readonly isPremultiplied?: boolean;
|
|
30
33
|
readonly wasPremultiplied?: boolean;
|
|
@@ -34,6 +37,8 @@ export interface RgbaImage {
|
|
|
34
37
|
readonly x: number;
|
|
35
38
|
readonly y: number;
|
|
36
39
|
};
|
|
40
|
+
readonly properties?: Readonly<Record<string, string>>;
|
|
41
|
+
readonly icc?: Uint8Array;
|
|
37
42
|
readonly orientation?: number;
|
|
38
43
|
readonly autoOrient?: {
|
|
39
44
|
readonly width: number;
|
|
@@ -74,7 +79,7 @@ export interface ImageMetadata {
|
|
|
74
79
|
readonly resolution?: {
|
|
75
80
|
readonly x: number;
|
|
76
81
|
readonly y: number;
|
|
77
|
-
readonly unit: "meter" | "unknown";
|
|
82
|
+
readonly unit: "meter" | "inch" | "cm" | "unknown";
|
|
78
83
|
};
|
|
79
84
|
readonly virtualCanvas?: {
|
|
80
85
|
readonly width: number;
|
|
@@ -82,6 +87,8 @@ export interface ImageMetadata {
|
|
|
82
87
|
readonly x: number;
|
|
83
88
|
readonly y: number;
|
|
84
89
|
};
|
|
90
|
+
readonly properties?: Readonly<Record<string, string>>;
|
|
91
|
+
readonly icc?: Uint8Array;
|
|
85
92
|
readonly orientation?: number;
|
|
86
93
|
readonly autoOrient?: {
|
|
87
94
|
readonly width: number;
|
|
@@ -419,9 +426,12 @@ export type ImageAstNode = {
|
|
|
419
426
|
readonly orientation?: number;
|
|
420
427
|
};
|
|
421
428
|
export interface OutputEncodeOptions {
|
|
429
|
+
readonly omitPngResolution?: boolean;
|
|
422
430
|
readonly consumeInput?: boolean;
|
|
423
431
|
readonly format?: ImageFormat;
|
|
424
432
|
readonly rawDepth?: string;
|
|
433
|
+
readonly netpbmDepth?: number;
|
|
434
|
+
readonly netpbmAscii?: boolean;
|
|
425
435
|
readonly quality?: number;
|
|
426
436
|
readonly samplingFactor?: string;
|
|
427
437
|
readonly chromaSubsampling?: "4:2:0" | "4:4:4";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { ImageMetadata } from "../ast.js";
|
|
1
2
|
import { type ExifMetadata } from "./exif-metadata.js";
|
|
2
3
|
export type { ExifMetadata } from "./exif-metadata.js";
|
|
3
4
|
export declare function parseExifBuffer(raw: Uint8Array): ExifMetadata;
|
|
4
5
|
export declare function buildExifApp1Segment(options: {
|
|
5
6
|
readonly orientation?: number;
|
|
6
7
|
readonly density?: number;
|
|
8
|
+
readonly resolution?: ImageMetadata["resolution"];
|
|
7
9
|
}): Uint8Array;
|
|
@@ -4,6 +4,7 @@ import { SourceBytes } from "./storage-source.js";
|
|
|
4
4
|
export declare function scanGifAnimation(reader: SourceBytes, size: number, start: number, onFrame?: (frame: number, delay: number) => Promise<void>): Promise<{
|
|
5
5
|
frames: number;
|
|
6
6
|
loop: number | undefined;
|
|
7
|
+
properties?: Record<string, string>;
|
|
7
8
|
}>;
|
|
8
9
|
/** Frame delays remain in caller backing. The caller owns both source and storage lifetimes. */
|
|
9
10
|
export declare function readGifMetadataFromSource(source: ImageByteSource, storage: ImageByteStorage, signal: AbortSignal, options?: SharpInputOptions): Promise<RetainedImageMetadata>;
|
|
@@ -7,5 +7,6 @@ export declare function gifAnimationSteps(size: number, start: number): Generato
|
|
|
7
7
|
}, {
|
|
8
8
|
frames: number;
|
|
9
9
|
loop: number | undefined;
|
|
10
|
+
properties?: Record<string, string>;
|
|
10
11
|
}, number | undefined>;
|
|
11
12
|
export declare function gifMetadataFields(width: number, height: number, size: number, frames: number, loop: number | undefined, options?: Pick<SharpInputOptions, "animated" | "page" | "pages">): ImageMetadata;
|
|
@@ -5,7 +5,7 @@ export interface GifOptions {
|
|
|
5
5
|
readonly loop?: number;
|
|
6
6
|
readonly optimizeFrames?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export type GifImage = Pick<RgbaImage, "width" | "height" | "pageHeight" | "delay" | "loop" | "disposal" | "virtualCanvas" | "gifFrames" | "backgroundColor">;
|
|
8
|
+
export type GifImage = Pick<RgbaImage, "width" | "height" | "pageHeight" | "delay" | "loop" | "disposal" | "virtualCanvas" | "gifFrames" | "backgroundColor" | "properties">;
|
|
9
9
|
/** The wire palette is fixed at 256 entries, independent of raster size. */
|
|
10
10
|
export declare class GifPalette {
|
|
11
11
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
@@ -4,7 +4,7 @@ export declare function readJpegMetadata(bytes: Uint8Array): ImageMetadata;
|
|
|
4
4
|
export declare function idct8x8(coeffs: Int32Array | Int16Array, quant: Uint16Array, out: Uint8Array, maxK?: number): void;
|
|
5
5
|
export declare function idctScaledBlock(coeffs: Int32Array | Int16Array, quant: Uint16Array, out: Uint8Array, maxK: number, step: 8 | 4 | 2): void;
|
|
6
6
|
export declare function decodeJpegImage(bytes: Uint8Array, options?: SharpInputOptions): RgbaImage;
|
|
7
|
-
export declare function createJpegEncoder(img: Pick<RgbaImage, "width" | "height" | "density" | "orientation">, options?: {
|
|
7
|
+
export declare function createJpegEncoder(img: Pick<RgbaImage, "width" | "height" | "density" | "resolution" | "orientation" | "icc" | "properties">, options?: {
|
|
8
8
|
readonly quality?: number;
|
|
9
9
|
readonly samplingFactor?: string;
|
|
10
10
|
readonly chromaSubsampling?: "4:2:0" | "4:4:4";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SharpInputOptions } from "../ast.js";
|
|
2
2
|
import type { ImageByteSource, ImageByteStorage, StoredRgbaImage } from "./png-storage.js";
|
|
3
|
-
/** Decode
|
|
3
|
+
/** Decode Netpbm variants including PAM without retaining the encoded file or raster. */
|
|
4
4
|
export declare function decodeNetpbmToStorage(source: ImageByteSource, storage: ImageByteStorage, signal: AbortSignal, options?: SharpInputOptions): Promise<StoredRgbaImage>;
|
|
5
5
|
/** Owned output chunks and pull-driven backpressure; rows never require full buffers. */
|
|
6
|
-
export declare function encodeNetpbmFromStorage(image: StoredRgbaImage, storage: ImageByteStorage, signal: AbortSignal, format: "ppm" | "pgm" | "pbm"): AsyncGenerator<Uint8Array>;
|
|
6
|
+
export declare function encodeNetpbmFromStorage(image: StoredRgbaImage, storage: ImageByteStorage, signal: AbortSignal, format: "ppm" | "pgm" | "pbm" | "pam", depth?: number, ascii?: boolean): AsyncGenerator<Uint8Array>;
|
|
@@ -3,10 +3,10 @@ export declare function isNetpbmBytes(bytes: Uint8Array): boolean;
|
|
|
3
3
|
export declare function isBmpBytes(bytes: Uint8Array): boolean;
|
|
4
4
|
export declare function isTiffBytes(bytes: Uint8Array): boolean;
|
|
5
5
|
export declare function readNetpbmMetadata(bytes: Uint8Array): ImageMetadata;
|
|
6
|
-
export declare function decodeNetpbmImage(bytes: Uint8Array): RgbaImage;
|
|
7
|
-
export declare function encodePpm(img: RgbaImage): Uint8Array;
|
|
8
|
-
export declare function encodePgm(img: RgbaImage): Uint8Array;
|
|
9
|
-
export declare function encodePbm(img: RgbaImage): Uint8Array;
|
|
6
|
+
export declare function decodeNetpbmImage(bytes: Uint8Array, page?: number): RgbaImage;
|
|
7
|
+
export declare function encodePpm(img: RgbaImage, depth?: number, ascii?: boolean, pam?: boolean): Uint8Array;
|
|
8
|
+
export declare function encodePgm(img: RgbaImage, depth?: number, ascii?: boolean): Uint8Array;
|
|
9
|
+
export declare function encodePbm(img: RgbaImage, ascii?: boolean): Uint8Array;
|
|
10
10
|
export declare function readBmpMetadata(bytes: Uint8Array): ImageMetadata;
|
|
11
11
|
export declare function decodeBmpImage(bytes: Uint8Array): RgbaImage;
|
|
12
12
|
export declare function encodeBmpImage(img: RgbaImage): Uint8Array;
|
|
@@ -14,7 +14,15 @@ export interface ImageByteStorage extends Pick<ImageByteSource, "read"> {
|
|
|
14
14
|
readonly signal?: AbortSignal;
|
|
15
15
|
}): Promise<void>;
|
|
16
16
|
}
|
|
17
|
-
export interface StoredRgbaImage extends Omit<RgbaImage, "data" | "data16"> {
|
|
17
|
+
export interface StoredRgbaImage extends Omit<RgbaImage, "data" | "data16" | "miffPages" | "tiffPages"> {
|
|
18
|
+
readonly storedMiffPages?: {
|
|
19
|
+
readonly length: number;
|
|
20
|
+
at(index: number): Promise<StoredRgbaImage>;
|
|
21
|
+
};
|
|
22
|
+
readonly storedTiffPages?: {
|
|
23
|
+
readonly length: number;
|
|
24
|
+
at(index: number): Promise<StoredRgbaImage>;
|
|
25
|
+
};
|
|
18
26
|
readonly position: number;
|
|
19
27
|
/** Original high-depth raw samples retain the same lifetime as buffered data16. */
|
|
20
28
|
readonly storedData16?: {
|
|
@@ -6,6 +6,7 @@ export declare function encodePngImage(img: RgbaImage, options?: {
|
|
|
6
6
|
readonly compressionLevel?: number;
|
|
7
7
|
readonly density?: number;
|
|
8
8
|
readonly orientation?: number;
|
|
9
|
+
readonly omitPngResolution?: boolean;
|
|
9
10
|
readonly forceOpaque?: boolean;
|
|
10
11
|
readonly consumeInput?: boolean;
|
|
11
12
|
}): Uint8Array;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { RgbaImage } from "../ast.js";
|
|
2
2
|
export declare function tiffChannels(img: Pick<RgbaImage, "space" | "hasAlpha">): 1 | 2 | 4;
|
|
3
|
-
export declare function createTiffLayout(img: Pick<RgbaImage, "width" | "height" | "density" | "orientation" | "space" | "hasAlpha">, options?: {
|
|
3
|
+
export declare function createTiffLayout(img: Pick<RgbaImage, "width" | "height" | "density" | "resolution" | "orientation" | "space" | "hasAlpha" | "properties">, options?: {
|
|
4
4
|
readonly density?: number;
|
|
5
5
|
readonly orientation?: number;
|
|
6
|
-
}): {
|
|
6
|
+
}, offset?: number, hasNext?: boolean): {
|
|
7
7
|
header: Uint8Array<ArrayBuffer>;
|
|
8
8
|
directory: Uint8Array<ArrayBuffer>;
|
|
9
9
|
channels: 1 | 2 | 4;
|
|
10
10
|
padding: number;
|
|
11
|
+
end: number;
|
|
11
12
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { ImageMetadata } from "../ast.js";
|
|
1
2
|
import { type ExifMetadata } from "./exif-metadata.js";
|
|
2
3
|
export type { ExifMetadata } from "./exif-metadata.js";
|
|
3
4
|
export declare function parseExifBuffer(raw: Uint8Array): ExifMetadata;
|
|
4
5
|
export declare function buildExifApp1Segment(options: {
|
|
5
6
|
readonly orientation?: number;
|
|
6
7
|
readonly density?: number;
|
|
8
|
+
readonly resolution?: ImageMetadata["resolution"];
|
|
7
9
|
}): Uint8Array;
|
|
@@ -4,6 +4,7 @@ import { SourceBytes } from "./storage-source.js";
|
|
|
4
4
|
export declare function scanGifAnimation(reader: SourceBytes, size: number, start: number, onFrame?: (frame: number, delay: number) => Promise<void>): Promise<{
|
|
5
5
|
frames: number;
|
|
6
6
|
loop: number | undefined;
|
|
7
|
+
properties?: Record<string, string>;
|
|
7
8
|
}>;
|
|
8
9
|
/** Frame delays remain in caller backing. The caller owns both source and storage lifetimes. */
|
|
9
10
|
export declare function readGifMetadataFromSource(source: ImageByteSource, storage: ImageByteStorage, signal: AbortSignal, options?: SharpInputOptions): Promise<RetainedImageMetadata>;
|
|
@@ -7,5 +7,6 @@ export declare function gifAnimationSteps(size: number, start: number): Generato
|
|
|
7
7
|
}, {
|
|
8
8
|
frames: number;
|
|
9
9
|
loop: number | undefined;
|
|
10
|
+
properties?: Record<string, string>;
|
|
10
11
|
}, number | undefined>;
|
|
11
12
|
export declare function gifMetadataFields(width: number, height: number, size: number, frames: number, loop: number | undefined, options?: Pick<SharpInputOptions, "animated" | "page" | "pages">): ImageMetadata;
|
|
@@ -5,7 +5,7 @@ export interface GifOptions {
|
|
|
5
5
|
readonly loop?: number;
|
|
6
6
|
readonly optimizeFrames?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export type GifImage = Pick<RgbaImage, "width" | "height" | "pageHeight" | "delay" | "loop" | "disposal" | "virtualCanvas" | "gifFrames" | "backgroundColor">;
|
|
8
|
+
export type GifImage = Pick<RgbaImage, "width" | "height" | "pageHeight" | "delay" | "loop" | "disposal" | "virtualCanvas" | "gifFrames" | "backgroundColor" | "properties">;
|
|
9
9
|
/** The wire palette is fixed at 256 entries, independent of raster size. */
|
|
10
10
|
export declare class GifPalette {
|
|
11
11
|
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
@@ -4,7 +4,7 @@ export declare function readJpegMetadata(bytes: Uint8Array): ImageMetadata;
|
|
|
4
4
|
export declare function idct8x8(coeffs: Int32Array | Int16Array, quant: Uint16Array, out: Uint8Array, maxK?: number): void;
|
|
5
5
|
export declare function idctScaledBlock(coeffs: Int32Array | Int16Array, quant: Uint16Array, out: Uint8Array, maxK: number, step: 8 | 4 | 2): void;
|
|
6
6
|
export declare function decodeJpegImage(bytes: Uint8Array, options?: SharpInputOptions): RgbaImage;
|
|
7
|
-
export declare function createJpegEncoder(img: Pick<RgbaImage, "width" | "height" | "density" | "orientation">, options?: {
|
|
7
|
+
export declare function createJpegEncoder(img: Pick<RgbaImage, "width" | "height" | "density" | "resolution" | "orientation" | "icc" | "properties">, options?: {
|
|
8
8
|
readonly quality?: number;
|
|
9
9
|
readonly samplingFactor?: string;
|
|
10
10
|
readonly chromaSubsampling?: "4:2:0" | "4:4:4";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SharpInputOptions } from "../ast.js";
|
|
2
2
|
import type { ImageByteSource, ImageByteStorage, StoredRgbaImage } from "./png-storage.js";
|
|
3
|
-
/** Decode
|
|
3
|
+
/** Decode Netpbm variants including PAM without retaining the encoded file or raster. */
|
|
4
4
|
export declare function decodeNetpbmToStorage(source: ImageByteSource, storage: ImageByteStorage, signal: AbortSignal, options?: SharpInputOptions): Promise<StoredRgbaImage>;
|
|
5
5
|
/** Owned output chunks and pull-driven backpressure; rows never require full buffers. */
|
|
6
|
-
export declare function encodeNetpbmFromStorage(image: StoredRgbaImage, storage: ImageByteStorage, signal: AbortSignal, format: "ppm" | "pgm" | "pbm"): AsyncGenerator<Uint8Array>;
|
|
6
|
+
export declare function encodeNetpbmFromStorage(image: StoredRgbaImage, storage: ImageByteStorage, signal: AbortSignal, format: "ppm" | "pgm" | "pbm" | "pam", depth?: number, ascii?: boolean): AsyncGenerator<Uint8Array>;
|
|
@@ -3,10 +3,10 @@ export declare function isNetpbmBytes(bytes: Uint8Array): boolean;
|
|
|
3
3
|
export declare function isBmpBytes(bytes: Uint8Array): boolean;
|
|
4
4
|
export declare function isTiffBytes(bytes: Uint8Array): boolean;
|
|
5
5
|
export declare function readNetpbmMetadata(bytes: Uint8Array): ImageMetadata;
|
|
6
|
-
export declare function decodeNetpbmImage(bytes: Uint8Array): RgbaImage;
|
|
7
|
-
export declare function encodePpm(img: RgbaImage): Uint8Array;
|
|
8
|
-
export declare function encodePgm(img: RgbaImage): Uint8Array;
|
|
9
|
-
export declare function encodePbm(img: RgbaImage): Uint8Array;
|
|
6
|
+
export declare function decodeNetpbmImage(bytes: Uint8Array, page?: number): RgbaImage;
|
|
7
|
+
export declare function encodePpm(img: RgbaImage, depth?: number, ascii?: boolean, pam?: boolean): Uint8Array;
|
|
8
|
+
export declare function encodePgm(img: RgbaImage, depth?: number, ascii?: boolean): Uint8Array;
|
|
9
|
+
export declare function encodePbm(img: RgbaImage, ascii?: boolean): Uint8Array;
|
|
10
10
|
export declare function readBmpMetadata(bytes: Uint8Array): ImageMetadata;
|
|
11
11
|
export declare function decodeBmpImage(bytes: Uint8Array): RgbaImage;
|
|
12
12
|
export declare function encodeBmpImage(img: RgbaImage): Uint8Array;
|
|
@@ -14,7 +14,15 @@ export interface ImageByteStorage extends Pick<ImageByteSource, "read"> {
|
|
|
14
14
|
readonly signal?: AbortSignal;
|
|
15
15
|
}): Promise<void>;
|
|
16
16
|
}
|
|
17
|
-
export interface StoredRgbaImage extends Omit<RgbaImage, "data" | "data16"> {
|
|
17
|
+
export interface StoredRgbaImage extends Omit<RgbaImage, "data" | "data16" | "miffPages" | "tiffPages"> {
|
|
18
|
+
readonly storedMiffPages?: {
|
|
19
|
+
readonly length: number;
|
|
20
|
+
at(index: number): Promise<StoredRgbaImage>;
|
|
21
|
+
};
|
|
22
|
+
readonly storedTiffPages?: {
|
|
23
|
+
readonly length: number;
|
|
24
|
+
at(index: number): Promise<StoredRgbaImage>;
|
|
25
|
+
};
|
|
18
26
|
readonly position: number;
|
|
19
27
|
/** Original high-depth raw samples retain the same lifetime as buffered data16. */
|
|
20
28
|
readonly storedData16?: {
|
|
@@ -6,6 +6,7 @@ export declare function encodePngImage(img: RgbaImage, options?: {
|
|
|
6
6
|
readonly compressionLevel?: number;
|
|
7
7
|
readonly density?: number;
|
|
8
8
|
readonly orientation?: number;
|
|
9
|
+
readonly omitPngResolution?: boolean;
|
|
9
10
|
readonly forceOpaque?: boolean;
|
|
10
11
|
readonly consumeInput?: boolean;
|
|
11
12
|
}): Uint8Array;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { RgbaImage } from "../ast.js";
|
|
2
2
|
export declare function tiffChannels(img: Pick<RgbaImage, "space" | "hasAlpha">): 1 | 2 | 4;
|
|
3
|
-
export declare function createTiffLayout(img: Pick<RgbaImage, "width" | "height" | "density" | "orientation" | "space" | "hasAlpha">, options?: {
|
|
3
|
+
export declare function createTiffLayout(img: Pick<RgbaImage, "width" | "height" | "density" | "resolution" | "orientation" | "space" | "hasAlpha" | "properties">, options?: {
|
|
4
4
|
readonly density?: number;
|
|
5
5
|
readonly orientation?: number;
|
|
6
|
-
}): {
|
|
6
|
+
}, offset?: number, hasNext?: boolean): {
|
|
7
7
|
header: Uint8Array<ArrayBuffer>;
|
|
8
8
|
directory: Uint8Array<ArrayBuffer>;
|
|
9
9
|
channels: 1 | 2 | 4;
|
|
10
10
|
padding: number;
|
|
11
|
+
end: number;
|
|
11
12
|
};
|