Functions and classes to facilitate the generation of random images which are then provided as data URLs for use in image elements. Each image is composed of a number of cells. This allows, for example, an image of multiple circles to be created without the need for any supporting media file.
Classes
Methods
(static) circleCellPainter(data)
Circle painter.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
module:hcje/images~CellPainterData | Data describing the cell to paint. |
- Source:
- See:
(static) imageCellPainter(data)
Painter for an image cell.
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
data |
module:hcje/images~CellPainterData | Data describing the cell to be painted. Additional data describing the image are provided in the data.custom property. Properties
|
- Source:
- See:
(static) pathCellPainter(data)
Path painter.
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
data |
module:hcje/images~CellPainterData | Data describing the cell to paint. Additional data describing the path and fill are provided in the data.custom property. Properties
|
- Source:
- See:
(static) randomPathCellPainter(data)
Random path painter.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
module:hcje/images~CellPainterData | Data describing the cell to paint. |
- Source:
- See:
(static) textCellPainter(data)
Painter for a text cell.
Parameters:
| Name | Type | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
module:hcje/images~CellPainterData | Data describing the cell to be painted. Additional data describing the text are provided in the data.custom property. Properties
|
- Source:
- See:
(static) triangleCellPainter(data)
Triangle painter.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
module:hcje/images~CellPainterData | Data describing the cell to paint. |
- Source:
- See:
Type Definitions
CellPainter()
Function responsible for painting a cell (rectangular area).
CellPainterData
Data provided to a cell painter function.
Type:
- Object
Properties:
| Name | Type | Description |
|---|---|---|
imageSize |
module:hcje/utils~Dimensions | Dimensions of the image. |
cell |
module:hcje/utils~RectData | Rectangle data for the cell. |
custom |
Object | Additional painter specific data. |
ImageConfig
Configuration data for an automatically generated image. The image is created from a 2 dimensional array of square cells arranged to fit within the image. To provide more variation, the size of each cell can be slightly randomised.
Type:
- Object
Properties:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
imageSize |
module:hcje/utils~Dimensions | Dimensions of the image. |
||||||||||||||||||||||||||||||||||||||||||||||
cellPainter |
CellPainter | |||||||||||||||||||||||||||||||||||||||||||||||
cellConfig |
Object |
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||
custom |
Object |
<optional> |
Additional information that might be required by a specific painter |