Changelog and doc refresh for #915

This commit is contained in:
Lovell Fuller
2017-12-09 13:14:23 +00:00
parent d6aee8e5ba
commit 1d7a0ea99e
3 changed files with 27 additions and 24 deletions

View File

@@ -239,20 +239,20 @@ function metadata (callback) {
}
/**
* Access to pixel-derived image statistics for every channel in the image
* A Promise/A+ promise is returned when `callback` is not provided.
* Access to pixel-derived image statistics for every channel in the image.
* A Promise is returned when `callback` is not provided.
*
* - `channels`: Array of channel statistics for each channel in the image. Each channel statistic contains
* - `min` (minimum value in the channel)
* - `max` (maximum value in the channel)
* - `sum` (sum of all values in a channel)
* - `squaresSum` (sum of squared values in a channel)
* - `mean` (mean of the values in a channel)
* - `stdev` (standard deviation for the values in a channel)
* - `minX` (x-coordinate of one of the pixel where the minimum lies)
* - `minY` (y-coordinate of one of the pixel where the minimum lies)
* - `maxX` (x-coordinate of one of the pixel where the maximum lies)
* - `maxY` (y-coordinate of one of the pixel where the maximum lies)
* - `channels`: Array of channel statistics for each channel in the image. Each channel statistic contains
* - `min` (minimum value in the channel)
* - `max` (maximum value in the channel)
* - `sum` (sum of all values in a channel)
* - `squaresSum` (sum of squared values in a channel)
* - `mean` (mean of the values in a channel)
* - `stdev` (standard deviation for the values in a channel)
* - `minX` (x-coordinate of one of the pixel where the minimum lies)
* - `minY` (y-coordinate of one of the pixel where the minimum lies)
* - `maxX` (x-coordinate of one of the pixel where the maximum lies)
* - `maxY` (y-coordinate of one of the pixel where the maximum lies)
* - `isOpaque`: Value to identify if the image is opaque or transparent, based on the presence and use of alpha channel
*
* @example
@@ -261,11 +261,10 @@ function metadata (callback) {
* .stats()
* .then(function(stats) {
* // stats contains the channel-wise statistics array and the isOpaque value
* })
*
* });
*
* @param {Function} [callback] - called with the arguments `(err, stats)`
* @returns {Promise<Object>|Sharp}
* @returns {Promise<Object>}
*/
function stats (callback) {
const that = this;