@@ -20,8 +20,8 @@ const twoPi = 2 * Math.PI;
|
||||
|
||||
/**
|
||||
* Convert an RGB pixel into an HCL pixel.
|
||||
* @param {Array.<number>} pixel A pixel in RGB space.
|
||||
* @return {Array.<number>} A pixel in HCL space.
|
||||
* @param {Array<number>} pixel A pixel in RGB space.
|
||||
* @return {Array<number>} A pixel in HCL space.
|
||||
*/
|
||||
function rgb2hcl(pixel) {
|
||||
const red = rgb2xyz(pixel[0]);
|
||||
@@ -55,8 +55,8 @@ function rgb2hcl(pixel) {
|
||||
|
||||
/**
|
||||
* Convert an HCL pixel into an RGB pixel.
|
||||
* @param {Array.<number>} pixel A pixel in HCL space.
|
||||
* @return {Array.<number>} A pixel in RGB space.
|
||||
* @param {Array<number>} pixel A pixel in HCL space.
|
||||
* @return {Array<number>} A pixel in RGB space.
|
||||
*/
|
||||
function hcl2rgb(pixel) {
|
||||
const h = pixel[0];
|
||||
|
||||
@@ -101,7 +101,7 @@ imagery.on('postcompose', function(event) {
|
||||
* Apply a convolution kernel to canvas. This works for any size kernel, but
|
||||
* performance starts degrading above 3 x 3.
|
||||
* @param {CanvasRenderingContext2D} context Canvas 2d context.
|
||||
* @param {Array.<number>} kernel Kernel.
|
||||
* @param {Array<number>} kernel Kernel.
|
||||
*/
|
||||
function convolve(context, kernel) {
|
||||
const canvas = context.canvas;
|
||||
|
||||
@@ -12,7 +12,7 @@ const bins = 10;
|
||||
/**
|
||||
* Calculate the Vegetation Greenness Index (VGI) from an input pixel. This
|
||||
* is a rough estimate assuming that pixel values correspond to reflectance.
|
||||
* @param {Array.<number>} pixel An array of [R, G, B, A] values.
|
||||
* @param {Array<number>} pixel An array of [R, G, B, A] values.
|
||||
* @return {number} The VGI value for the given pixel.
|
||||
*/
|
||||
function vgi(pixel) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {OSM, Raster, XYZ} from '../src/ol/source.js';
|
||||
/**
|
||||
* Generates a shaded relief image given elevation data. Uses a 3x3
|
||||
* neighborhood for determining slope and aspect.
|
||||
* @param {Array.<ImageData>} inputs Array of input images.
|
||||
* @param {Array<ImageData>} inputs Array of input images.
|
||||
* @param {Object} data Data added in the "beforeoperations" event.
|
||||
* @return {ImageData} Output image.
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ handlebars.registerHelper('indent', (text, options) => {
|
||||
* Create an inverted index of keywords from examples. Property names are
|
||||
* lowercased words. Property values are objects mapping example index to word
|
||||
* count.
|
||||
* @param {Array.<Object>} exampleData Array of example data objects.
|
||||
* @param {Array<Object>} exampleData Array of example data objects.
|
||||
* @return {Object} Word index.
|
||||
*/
|
||||
function createWordIndex(exampleData) {
|
||||
|
||||
Reference in New Issue
Block a user