Docs: improve descripion of create/raw props

This commit is contained in:
Lovell Fuller
2021-01-01 14:47:26 +00:00
parent b2a0b8c0f0
commit 39ddb6a175
3 changed files with 13 additions and 13 deletions

View File

@@ -108,13 +108,13 @@ const debuglog = util.debuglog('sharp');
* @param {number} [options.level=0] - level to extract from a multi-level input (OpenSlide), zero based.
* @param {boolean} [options.animated=false] - Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`).
* @param {Object} [options.raw] - describes raw pixel input image data. See `raw()` for pixel ordering.
* @param {number} [options.raw.width]
* @param {number} [options.raw.height]
* @param {number} [options.raw.channels] - 1-4
* @param {number} [options.raw.width] - integral number of pixels wide.
* @param {number} [options.raw.height] - integral number of pixels high.
* @param {number} [options.raw.channels] - integral number of channels, between 1 and 4.
* @param {Object} [options.create] - describes a new image to be created.
* @param {number} [options.create.width]
* @param {number} [options.create.height]
* @param {number} [options.create.channels] - 3-4
* @param {number} [options.create.width] - integral number of pixels wide.
* @param {number} [options.create.height] - integral number of pixels high.
* @param {number} [options.create.channels] - integral number of channels, either 3 (RGB) or 4 (RGBA).
* @param {string|Object} [options.create.background] - 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