RGBDataSet

Class for converting an image to a DataSet.

Constructor

new RGBDataSet(img, rgbToData, ArrayType)

Create a DataSet from image pixel data

Parameters:
NameTypeDescription
imgImage

Any "imagable" object that can be drawn to a canvas

rgbToDatafunction

Fnction converting 3 r,g,b bytes to a number

ArrayTypeconstructor

A TypedArray or Array. (default Float32)

Extends

Methods

(static) rgbToInt24(r, g, b) → {number}

Convert an r,g,b triple into an integer

Parameters:
NameTypeDescription
rnumber

Red value, integer in [0,255]

gnumber

Green value, integer in [0,255]

bnumber

Blue value, integer in [0,255]

Returns:

A 24 bit integer

Type: 
number

(static) rgbScaleFunction(min, scale) → {number}

As above with min/scale

Parameters:
NameTypeDescription
minnumber

The min return value

scalenumber

The scale factor

Returns:

A 24 bit integer

Type: 
number