On this page

# RGBDataSet

Class for converting an image to a DataSet.

## Constructor

### new RGBDataSet(img, rgbToData, ArrayType)

Create a DataSet from image pixel data

Parameters:

Name | Type | Description
--- | --- | ---
`img` | Image | Any "imagable" object that can be drawn to a canvas
`rgbToData` | function | Fnction converting 3 r,g,b bytes to a number
`ArrayType` | constructor | A TypedArray or Array. (default Float32)

Source
  - RGBDataSet.js, line 13

## Extends

- DataSet

## Methods

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

As above with min/scale

Parameters:

Name | Type | Description
--- | --- | ---
`min` | number | The min return value
`scale` | number | The scale factor

Source
  - RGBDataSet.js, line 31

Returns:

A 24 bit integer

Type:
  number

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

Convert an r,g,b triple into an integer

Parameters:

Name | Type | Description
--- | --- | ---
`r` | number | Red value, integer in [0,255]
`g` | number | Green value, integer in [0,255]
`b` | number | Blue value, integer in [0,255]

Source
  - RGBDataSet.js, line 21

Returns:

A 24 bit integer

Type:
  number

Type anything to view search result