mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Docs: lint JSDoc annotations when building docs
This commit is contained in:
@@ -32,9 +32,9 @@ const is = require('./is');
|
||||
* });
|
||||
* readableStream.pipe(pipeline);
|
||||
*
|
||||
* @param {Number} [angle=auto] angle of rotation.
|
||||
* @param {number} [angle=auto] angle of rotation.
|
||||
* @param {Object} [options] - if present, is an Object with optional attributes.
|
||||
* @param {String|Object} [options.background="#000000"] parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha.
|
||||
* @param {string|Object} [options.background="#000000"] parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha.
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
@@ -88,9 +88,9 @@ function flop (flop) {
|
||||
* When a `sigma` is provided, performs a slower, more accurate sharpen of the L channel in the LAB colour space.
|
||||
* Separate control over the level of sharpening in "flat" and "jagged" areas is available.
|
||||
*
|
||||
* @param {Number} [sigma] - the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`.
|
||||
* @param {Number} [flat=1.0] - the level of sharpening to apply to "flat" areas.
|
||||
* @param {Number} [jagged=2.0] - the level of sharpening to apply to "jagged" areas.
|
||||
* @param {number} [sigma] - the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`.
|
||||
* @param {number} [flat=1.0] - the level of sharpening to apply to "flat" areas.
|
||||
* @param {number} [jagged=2.0] - the level of sharpening to apply to "jagged" areas.
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
@@ -129,7 +129,7 @@ function sharpen (sigma, flat, jagged) {
|
||||
/**
|
||||
* Apply median filter.
|
||||
* When used without parameters the default window is 3x3.
|
||||
* @param {Number} [size=3] square mask size: size x size
|
||||
* @param {number} [size=3] square mask size: size x size
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
@@ -150,7 +150,7 @@ function median (size) {
|
||||
* Blur the image.
|
||||
* When used without parameters, performs a fast, mild blur of the output image.
|
||||
* When a `sigma` is provided, performs a slower, more accurate Gaussian blur.
|
||||
* @param {Number} [sigma] a value between 0.3 and 1000 representing the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`.
|
||||
* @param {number} [sigma] a value between 0.3 and 1000 representing the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`.
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
@@ -173,7 +173,7 @@ function blur (sigma) {
|
||||
/**
|
||||
* Merge alpha transparency channel, if any, with a background.
|
||||
* @param {Object} [options]
|
||||
* @param {String|Object} [options.background={r: 0, g: 0, b: 0}] - background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black.
|
||||
* @param {string|Object} [options.background={r: 0, g: 0, b: 0}] - background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black.
|
||||
* @returns {Sharp}
|
||||
*/
|
||||
function flatten (options) {
|
||||
@@ -193,8 +193,8 @@ function flatten (options) {
|
||||
*
|
||||
* Supply a second argument to use a different output gamma value, otherwise the first value is used in both cases.
|
||||
*
|
||||
* @param {Number} [gamma=2.2] value between 1.0 and 3.0.
|
||||
* @param {Number} [gammaOut] value between 1.0 and 3.0. (optional, defaults to same as `gamma`)
|
||||
* @param {number} [gamma=2.2] value between 1.0 and 3.0.
|
||||
* @param {number} [gammaOut] value between 1.0 and 3.0. (optional, defaults to same as `gamma`)
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
@@ -264,11 +264,11 @@ function normalize (normalize) {
|
||||
* });
|
||||
*
|
||||
* @param {Object} kernel
|
||||
* @param {Number} kernel.width - width of the kernel in pixels.
|
||||
* @param {Number} kernel.height - width of the kernel in pixels.
|
||||
* @param {Array<Number>} kernel.kernel - Array of length `width*height` containing the kernel values.
|
||||
* @param {Number} [kernel.scale=sum] - the scale of the kernel in pixels.
|
||||
* @param {Number} [kernel.offset=0] - the offset of the kernel in pixels.
|
||||
* @param {number} kernel.width - width of the kernel in pixels.
|
||||
* @param {number} kernel.height - width of the kernel in pixels.
|
||||
* @param {Array<number>} kernel.kernel - Array of length `width*height` containing the kernel values.
|
||||
* @param {number} [kernel.scale=sum] - the scale of the kernel in pixels.
|
||||
* @param {number} [kernel.offset=0] - the offset of the kernel in pixels.
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
@@ -300,7 +300,7 @@ function convolve (kernel) {
|
||||
|
||||
/**
|
||||
* Any pixel value greather than or equal to the threshold value will be set to 255, otherwise it will be set to 0.
|
||||
* @param {Number} [threshold=128] - a value in the range 0-255 representing the level at which the threshold will be applied.
|
||||
* @param {number} [threshold=128] - a value in the range 0-255 representing the level at which the threshold will be applied.
|
||||
* @param {Object} [options]
|
||||
* @param {Boolean} [options.greyscale=true] - convert to single channel greyscale.
|
||||
* @param {Boolean} [options.grayscale=true] - alternative spelling for greyscale.
|
||||
@@ -331,13 +331,13 @@ function threshold (threshold, options) {
|
||||
* This operation creates an output image where each pixel is the result of
|
||||
* the selected bitwise boolean `operation` between the corresponding pixels of the input images.
|
||||
*
|
||||
* @param {Buffer|String} operand - Buffer containing image data or String containing the path to an image file.
|
||||
* @param {String} operator - one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively.
|
||||
* @param {Buffer|string} operand - Buffer containing image data or string containing the path to an image file.
|
||||
* @param {string} operator - one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively.
|
||||
* @param {Object} [options]
|
||||
* @param {Object} [options.raw] - describes operand when using raw pixel data.
|
||||
* @param {Number} [options.raw.width]
|
||||
* @param {Number} [options.raw.height]
|
||||
* @param {Number} [options.raw.channels]
|
||||
* @param {number} [options.raw.width]
|
||||
* @param {number} [options.raw.height]
|
||||
* @param {number} [options.raw.channels]
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
@@ -353,8 +353,8 @@ function boolean (operand, operator, options) {
|
||||
|
||||
/**
|
||||
* Apply the linear formula a * input + b to the image (levels adjustment)
|
||||
* @param {Number} [a=1.0] multiplier
|
||||
* @param {Number} [b=0.0] offset
|
||||
* @param {number} [a=1.0] multiplier
|
||||
* @param {number} [b=0.0] offset
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
@@ -394,7 +394,7 @@ function linear (a, b) {
|
||||
* // With this example input, a sepia filter has been applied
|
||||
* });
|
||||
*
|
||||
* @param {Array<Array<Number>>} 3x3 Recombination matrix
|
||||
* @param {Array<Array<number>>} inputMatrix - 3x3 Recombination matrix
|
||||
* @returns {Sharp}
|
||||
* @throws {Error} Invalid parameters
|
||||
*/
|
||||
@@ -440,9 +440,9 @@ function recomb (inputMatrix) {
|
||||
* });
|
||||
*
|
||||
* @param {Object} [options]
|
||||
* @param {Number} [options.brightness] Brightness multiplier
|
||||
* @param {Number} [options.saturation] Saturation multiplier
|
||||
* @param {Number} [options.hue] Degrees for hue rotation
|
||||
* @param {number} [options.brightness] Brightness multiplier
|
||||
* @param {number} [options.saturation] Saturation multiplier
|
||||
* @param {number} [options.hue] Degrees for hue rotation
|
||||
* @returns {Sharp}
|
||||
*/
|
||||
function modulate (options) {
|
||||
|
||||
Reference in New Issue
Block a user