@napi-rs/image 1.1.0 → 1.2.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 (3) hide show
  1. package/README.md +6 -6
  2. package/index.d.ts +2 -0
  3. package/package.json +18 -15
package/README.md CHANGED
@@ -19,8 +19,8 @@ This library support encode/decode these formats:
19
19
  | BMP | ✅ | Rgb8, Rgba8, Gray8, GrayA8 |
20
20
  | ICO | ✅ | ✅ |
21
21
  | TIFF | Baseline(no fax support) + LZW + PackBits | Rgb8, Rgba8, Gray8 |
22
- | WebP | No | ✅ |
23
- | AVIF | No | ✅ |
22
+ | WebP | | ✅ |
23
+ | AVIF | | ✅ |
24
24
  | PNM | PBM, PGM, PPM, standard PAM | ✅ |
25
25
  | DDS | DXT1, DXT3, DXT5 | No |
26
26
  | TGA | ✅ | Rgb8, Rgba8, Bgr8, Bgra8, Gray8, GrayA8 |
@@ -495,7 +495,7 @@ blur(sigma: number): this
495
495
 
496
496
  #### `unsharpen`
497
497
 
498
- > Performs an unsharpen mask on this image. <br/> > `sigma` is the amount to blur the image by. <br/> > `threshold` is a control of how much to sharpen.
498
+ > Performs an unsharpen mask on this image. <br/> `sigma` is the amount to blur the image by. <br/> `threshold` is a control of how much to sharpen.
499
499
  >
500
500
  > See <https://en.wikipedia.org/wiki/Unsharp_masking#Digital_unsharp_masking>
501
501
 
@@ -513,7 +513,7 @@ filter3x3(kernel: Array<number>): this
513
513
 
514
514
  #### `adjustContrast`
515
515
 
516
- > Adjust the contrast of this image.<br/> > `contrast` is the amount to adjust the contrast by.<br/>
516
+ > Adjust the contrast of this image.<br/> `contrast` is the amount to adjust the contrast by.<br/>
517
517
  > Negative values decrease the contrast and positive values increase the contrast.
518
518
 
519
519
  ```ts
@@ -522,7 +522,7 @@ adjustContrast(contrast: number): this
522
522
 
523
523
  #### `brighten`
524
524
 
525
- > Brighten the pixels of this image.<br/> > `value` is the amount to brighten each pixel by. <br/>
525
+ > Brighten the pixels of this image.<br/> `value` is the amount to brighten each pixel by. <br/>
526
526
  > Negative values decrease the brightness and positive values increase it.
527
527
 
528
528
  ```ts
@@ -531,7 +531,7 @@ brighten(brightness: number): this
531
531
 
532
532
  #### `huerotate`
533
533
 
534
- > Hue rotate the supplied image.<br/> > `value` is the degrees to rotate each pixel by.
534
+ > Hue rotate the supplied image.<br/> `value` is the degrees to rotate each pixel by.
535
535
  > 0 and 360 do nothing, the rest rotates by the given degree value.
536
536
  > just like the css webkit filter hue-rotate(180)
537
537
 
package/index.d.ts CHANGED
@@ -350,6 +350,8 @@ export class Transformer {
350
350
  * just like the css webkit filter hue-rotate(180)
351
351
  */
352
352
  huerotate(hue: number): this
353
+ /** Crop a cut-out of this image delimited by the bounding rectangle. */
354
+ crop(x: number, y: number, width: number, height: number): this
353
355
  /**
354
356
  * The quality factor `quality_factor` ranges from 0 to 100 and controls the loss and quality during compression.
355
357
  * The value 0 corresponds to low quality and small output sizes, whereas 100 is the highest quality and largest output size.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@napi-rs/image",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "description": "Image processing library",
@@ -56,23 +56,26 @@
56
56
  "format": "run-p format:prettier format:rs",
57
57
  "format:prettier": "prettier --config ./package.json -w .",
58
58
  "format:rs": "cargo fmt --all",
59
- "prepublishOnly": "napi prepublish -t npm",
59
+ "prepublishOnly": "napi prepublish",
60
60
  "version": "napi version"
61
61
  },
62
62
  "repository": "git@github.com:Brooooooklyn/Image.git",
63
- "gitHead": "0aa7effa90873c50d9cd418b873fde5b07d670d6",
63
+ "devDependencies": {
64
+ "@napi-rs/cli": "^2.6.2"
65
+ },
66
+ "gitHead": "dfcd5d09749c394ba939ee72534e36c70d4cc445",
64
67
  "optionalDependencies": {
65
- "@napi-rs/image-win32-x64-msvc": "1.1.0",
66
- "@napi-rs/image-darwin-x64": "1.1.0",
67
- "@napi-rs/image-linux-x64-gnu": "1.1.0",
68
- "@napi-rs/image-darwin-arm64": "1.1.0",
69
- "@napi-rs/image-android-arm64": "1.1.0",
70
- "@napi-rs/image-linux-arm64-gnu": "1.1.0",
71
- "@napi-rs/image-linux-arm64-musl": "1.1.0",
72
- "@napi-rs/image-linux-arm-gnueabihf": "1.1.0",
73
- "@napi-rs/image-linux-x64-musl": "1.1.0",
74
- "@napi-rs/image-freebsd-x64": "1.1.0",
75
- "@napi-rs/image-win32-ia32-msvc": "1.1.0",
76
- "@napi-rs/image-android-arm-eabi": "1.1.0"
68
+ "@napi-rs/image-win32-x64-msvc": "1.2.0",
69
+ "@napi-rs/image-darwin-x64": "1.2.0",
70
+ "@napi-rs/image-linux-x64-gnu": "1.2.0",
71
+ "@napi-rs/image-darwin-arm64": "1.2.0",
72
+ "@napi-rs/image-android-arm64": "1.2.0",
73
+ "@napi-rs/image-linux-arm64-gnu": "1.2.0",
74
+ "@napi-rs/image-linux-arm64-musl": "1.2.0",
75
+ "@napi-rs/image-linux-arm-gnueabihf": "1.2.0",
76
+ "@napi-rs/image-linux-x64-musl": "1.2.0",
77
+ "@napi-rs/image-freebsd-x64": "1.2.0",
78
+ "@napi-rs/image-win32-ia32-msvc": "1.2.0",
79
+ "@napi-rs/image-android-arm-eabi": "1.2.0"
77
80
  }
78
81
  }