standardised util functions comments (#1805)

* standardised util functions comments

* Update pixelSetter.js

* Update pixelSetter.js

* Update pixelSetter.js

Co-authored-by: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com>
This commit is contained in:
Tanish
2021-02-10 20:49:36 +05:30
committed by GitHub
parent a73cba8d3c
commit eb81b7de4b
2 changed files with 9 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
/** Parses the defaults and gets the input which is available. */
module.exports = function(info){ module.exports = function(info){
var defaults = {}; var defaults = {};
for (var key in info.inputs) { for (var key in info.inputs) {

View File

@@ -1,5 +1,12 @@
/**
* @param {number} x x-coordinate.
* @param {number} y y-coordinate.
* @param {object} value array [r, g, b, a]
* @param {object} pixels NDarray of pixels.
* @description Sets the pixels from 0 through length of value.
*/
module.exports = function(x, y, value, pixels){ module.exports = function(x, y, value, pixels){
for(let i = 0; i < value.length; i++){ for(let i = 0; i < value.length; i++){
pixels.set(x, y, i, value[i]); pixels.set(x, y, i, value[i]);
} }
}; };