@napi-rs/image 1.9.1 → 1.9.2
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/README.md +5 -5
- package/index.d.ts +9 -9
- package/package.json +17 -17
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ export interface Metadata {
|
|
|
62
62
|
colorType: JsColorType
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
export
|
|
65
|
+
export enum JsColorType {
|
|
66
66
|
/** Pixel is 8-bit luminance */
|
|
67
67
|
L8 = 0,
|
|
68
68
|
/** Pixel is 8-bit luminance with an alpha channel */
|
|
@@ -172,7 +172,7 @@ export interface AvifConfig {
|
|
|
172
172
|
* https://en.wikipedia.org/wiki/Chroma_subsampling#Types_of_sampling_and_subsampling
|
|
173
173
|
* https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Video_concepts
|
|
174
174
|
*/
|
|
175
|
-
export
|
|
175
|
+
export enum ChromaSubsampling {
|
|
176
176
|
/**
|
|
177
177
|
* Each of the three Y'CbCr components has the same sample rate, thus there is no chroma subsampling. This scheme is sometimes used in high-end film scanners and cinematic post-production.
|
|
178
178
|
* Note that "4:4:4" may instead be wrongly referring to R'G'B' color space, which implicitly also does not have any chroma subsampling (except in JPEG R'G'B' can be subsampled).
|
|
@@ -228,7 +228,7 @@ export interface PngEncodeOptions {
|
|
|
228
228
|
/** Default is `FilterType::NoFilter` */
|
|
229
229
|
filterType?: FilterType | undefined | null
|
|
230
230
|
}
|
|
231
|
-
export
|
|
231
|
+
export enum CompressionType {
|
|
232
232
|
/** Default compression level */
|
|
233
233
|
Default = 0,
|
|
234
234
|
/** Fast, minimal compression */
|
|
@@ -240,7 +240,7 @@ export const enum CompressionType {
|
|
|
240
240
|
/** Run-length encoding compression */
|
|
241
241
|
Rle = 4,
|
|
242
242
|
}
|
|
243
|
-
export
|
|
243
|
+
export enum FilterType {
|
|
244
244
|
/**
|
|
245
245
|
* No processing done, best used for low bit depth greyscale or data with a
|
|
246
246
|
* low color count
|
|
@@ -405,7 +405,7 @@ invert(): this
|
|
|
405
405
|
*/
|
|
406
406
|
resize(width: number, height?: number | undefined | null, filterType?: ResizeFilterType | undefined | null): this
|
|
407
407
|
|
|
408
|
-
export
|
|
408
|
+
export enum ResizeFilterType {
|
|
409
409
|
/** Nearest Neighbor */
|
|
410
410
|
Nearest = 0,
|
|
411
411
|
/** Linear Filter */
|
package/index.d.ts
CHANGED
|
@@ -131,7 +131,7 @@ export interface AvifConfig {
|
|
|
131
131
|
* https://en.wikipedia.org/wiki/Chroma_subsampling#Types_of_sampling_and_subsampling
|
|
132
132
|
* https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Video_concepts
|
|
133
133
|
*/
|
|
134
|
-
export
|
|
134
|
+
export enum ChromaSubsampling {
|
|
135
135
|
/**
|
|
136
136
|
* Each of the three Y'CbCr components has the same sample rate, thus there is no chroma subsampling. This scheme is sometimes used in high-end film scanners and cinematic post-production.
|
|
137
137
|
* Note that "4:4:4" may instead be wrongly referring to R'G'B' color space, which implicitly also does not have any chroma subsampling (except in JPEG R'G'B' can be subsampled).
|
|
@@ -170,7 +170,7 @@ export const enum ChromaSubsampling {
|
|
|
170
170
|
Yuv400 = 3
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
export
|
|
173
|
+
export enum CompressionType {
|
|
174
174
|
/** Default compression level */
|
|
175
175
|
Default = 0,
|
|
176
176
|
/** Fast, minimal compression */
|
|
@@ -183,7 +183,7 @@ export function compressJpeg(input: Buffer, options?: JpegCompressOptions | unde
|
|
|
183
183
|
|
|
184
184
|
export function compressJpegSync(input: Buffer, options?: JpegCompressOptions | undefined | null): Buffer
|
|
185
185
|
|
|
186
|
-
export
|
|
186
|
+
export enum FastResizeFilter {
|
|
187
187
|
/**
|
|
188
188
|
* Each pixel of source image contributes to one pixel of the
|
|
189
189
|
* destination image with identical weights. For upscaling is equivalent
|
|
@@ -230,7 +230,7 @@ export interface FastResizeOptions {
|
|
|
230
230
|
fit?: ResizeFit
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
export
|
|
233
|
+
export enum FilterType {
|
|
234
234
|
/**
|
|
235
235
|
* No processing done, best used for low bit depth greyscale or data with a
|
|
236
236
|
* low color count
|
|
@@ -261,7 +261,7 @@ export interface JpegCompressOptions {
|
|
|
261
261
|
optimizeScans?: boolean
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
export
|
|
264
|
+
export enum JsColorType {
|
|
265
265
|
/** Pixel is 8-bit luminance */
|
|
266
266
|
L8 = 0,
|
|
267
267
|
/** Pixel is 8-bit luminance with an alpha channel */
|
|
@@ -297,7 +297,7 @@ export interface Metadata {
|
|
|
297
297
|
colorType: JsColorType
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
export
|
|
300
|
+
export enum Orientation {
|
|
301
301
|
/** Normal */
|
|
302
302
|
Horizontal = 1,
|
|
303
303
|
MirrorHorizontal = 2,
|
|
@@ -381,7 +381,7 @@ export interface PngQuantOptions {
|
|
|
381
381
|
posterization?: number
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
-
export
|
|
384
|
+
export enum PngRowFilter {
|
|
385
385
|
None = 0,
|
|
386
386
|
Sub = 1,
|
|
387
387
|
Up = 2,
|
|
@@ -462,7 +462,7 @@ export const enum PngRowFilter {
|
|
|
462
462
|
* </tr>
|
|
463
463
|
* </table>
|
|
464
464
|
*/
|
|
465
|
-
export
|
|
465
|
+
export enum ResizeFilterType {
|
|
466
466
|
/** Nearest Neighbor */
|
|
467
467
|
Nearest = 0,
|
|
468
468
|
/** Linear Filter */
|
|
@@ -475,7 +475,7 @@ export const enum ResizeFilterType {
|
|
|
475
475
|
Lanczos3 = 4
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
-
export
|
|
478
|
+
export enum ResizeFit {
|
|
479
479
|
/**
|
|
480
480
|
* (default) Preserving aspect ratio
|
|
481
481
|
* ensure the image covers both provided dimensions by cropping/clipping to fit.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@napi-rs/image",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"browser": "browser.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"artifacts": "napi artifacts -d ../../artifacts",
|
|
57
|
-
"build": "napi build --platform --release",
|
|
58
|
-
"build:debug": "napi build --platform",
|
|
57
|
+
"build": "napi build --platform --no-const-enum --release",
|
|
58
|
+
"build:debug": "napi build --platform --no-const-enum",
|
|
59
59
|
"format": "run-p format:prettier format:rs",
|
|
60
60
|
"format:prettier": "prettier --config ./package.json -w .",
|
|
61
61
|
"format:rs": "cargo fmt --all",
|
|
@@ -65,21 +65,21 @@
|
|
|
65
65
|
"repository": "git@github.com:Brooooooklyn/Image.git",
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@napi-rs/cli": "^3.0.0-alpha.41",
|
|
68
|
-
"@napi-rs/wasm-runtime": "^0.
|
|
68
|
+
"@napi-rs/wasm-runtime": "^0.2.0"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "c505d043caea0850f90362bba9d96d72ebe1ca1b",
|
|
71
71
|
"optionalDependencies": {
|
|
72
|
-
"@napi-rs/image-darwin-x64": "1.9.
|
|
73
|
-
"@napi-rs/image-win32-x64-msvc": "1.9.
|
|
74
|
-
"@napi-rs/image-linux-x64-gnu": "1.9.
|
|
75
|
-
"@napi-rs/image-darwin-arm64": "1.9.
|
|
76
|
-
"@napi-rs/image-android-arm64": "1.9.
|
|
77
|
-
"@napi-rs/image-linux-arm64-gnu": "1.9.
|
|
78
|
-
"@napi-rs/image-linux-arm64-musl": "1.9.
|
|
79
|
-
"@napi-rs/image-linux-arm-gnueabihf": "1.9.
|
|
80
|
-
"@napi-rs/image-linux-x64-musl": "1.9.
|
|
81
|
-
"@napi-rs/image-freebsd-x64": "1.9.
|
|
82
|
-
"@napi-rs/image-win32-ia32-msvc": "1.9.
|
|
83
|
-
"@napi-rs/image-wasm32-wasi": "1.9.
|
|
72
|
+
"@napi-rs/image-darwin-x64": "1.9.2",
|
|
73
|
+
"@napi-rs/image-win32-x64-msvc": "1.9.2",
|
|
74
|
+
"@napi-rs/image-linux-x64-gnu": "1.9.2",
|
|
75
|
+
"@napi-rs/image-darwin-arm64": "1.9.2",
|
|
76
|
+
"@napi-rs/image-android-arm64": "1.9.2",
|
|
77
|
+
"@napi-rs/image-linux-arm64-gnu": "1.9.2",
|
|
78
|
+
"@napi-rs/image-linux-arm64-musl": "1.9.2",
|
|
79
|
+
"@napi-rs/image-linux-arm-gnueabihf": "1.9.2",
|
|
80
|
+
"@napi-rs/image-linux-x64-musl": "1.9.2",
|
|
81
|
+
"@napi-rs/image-freebsd-x64": "1.9.2",
|
|
82
|
+
"@napi-rs/image-win32-ia32-msvc": "1.9.2",
|
|
83
|
+
"@napi-rs/image-wasm32-wasi": "1.9.2"
|
|
84
84
|
}
|
|
85
85
|
}
|