mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 15:25:07 +01:00
Doc update and changelog entry for #3461
This commit is contained in:
6
lib/index.d.ts
vendored
6
lib/index.d.ts
vendored
@@ -428,11 +428,11 @@ declare namespace sharp {
|
||||
flatten(flatten?: boolean | FlattenOptions): Sharp;
|
||||
|
||||
/**
|
||||
* Unflatten - add an alpha channel to the image if required, and make white pixels fully transparent. Alpha for non-white pixels will be unchanged/opaque.
|
||||
* @param unflatten true to enable and false to disable (defaults to true)
|
||||
* Ensure the image has an alpha channel with all white pixel values made fully transparent.
|
||||
* Existing alpha channel values for non-white pixels remain unchanged.
|
||||
* @returns A sharp instance that can be used to chain operations
|
||||
*/
|
||||
unflatten(unflatten?: boolean): Sharp;
|
||||
unflatten(): Sharp;
|
||||
|
||||
/**
|
||||
* Apply a gamma correction by reducing the encoding (darken) pre-resize at a factor of 1/gamma then increasing the encoding (brighten) post-resize at a factor of gamma.
|
||||
|
||||
@@ -406,7 +406,14 @@ function flatten (options) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Unflatten - add an alpha channel to the image if required, and make white pixels fully transparent. Alpha for non-white pixels will be unchanged/opaque.
|
||||
* Ensure the image has an alpha channel
|
||||
* with all white pixel values made fully transparent.
|
||||
*
|
||||
* Existing alpha channel values for non-white pixels remain unchanged.
|
||||
*
|
||||
* This feature is experimental and the API may change.
|
||||
*
|
||||
* @since 0.32.1
|
||||
*
|
||||
* @example
|
||||
* await sharp(rgbInput)
|
||||
@@ -419,8 +426,8 @@ function flatten (options) {
|
||||
* .unflatten()
|
||||
* .toBuffer();
|
||||
*/
|
||||
function unflatten (options) {
|
||||
this.options.unflatten = is.bool(options) ? options : true;
|
||||
function unflatten () {
|
||||
this.options.unflatten = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user