new CanvasUtils()
CanvasUtils provides several method to manipulate basic geometries in canvas
This class doesn't need to be instantiated, as all its methods are static in order to make those utils methods available with constraints. Refer to each method for their associated documentation.
- Since:
- 2020
- Source:
Methods
(static) drawBeatCount(canvas, options)
Draw in canvas the beat count and the bar count of current playback.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
canvas |
object | The canvas to draw hotcue in |
||||||||||||
options |
object | Peak meter options Properties
|
- Since:
- 2020
- Source:
(static) drawCircle(canvas, options)
Draw a circle in given canvas.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
canvas |
object | The canvas to draw circle in |
||||||||||||||||||||||||
options |
object | Circle options Properties
|
- Since:
- 2020
- Source:
(static) drawCircleGlow(canvas, options)
Draw a circle with glow effect made with radial gradients in inner and outer circle.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
canvas |
object | The canvas to draw circle glow in |
||||||||||||||||||||||||
options |
object | Circle glow options Properties
|
- Since:
- 2020
- Source:
(static) drawDisc(canvas, options)
Draw a disc in given canvas.
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
canvas |
object | The canvas to draw disc in |
|||||||||||||||||||||
options |
object | Disc options Properties
|
- Since:
- 2020
- Source:
(static) drawHotCue(canvas, options)
Draw a hotcue in given canvas. HotCue is a square with a label in it.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
canvas |
object | The canvas to draw hotcue in |
||||||||||||||||||||||||
options |
object | Hot cue options Properties
|
- Since:
- 2020
- Source:
(static) drawOscilloscope(canvas, options)
Draw an oscilloscope of frequencies in given canvas.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
canvas |
object | The canvas to draw disc in |
||||||||||||
options |
object | Oscilloscope options Properties
|
- Since:
- 2020
- Source:
(static) drawPeakMeter(canvas, options)
Draw a peakmeter in given canvas.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
canvas |
object | The canvas to draw disc in |
|||||||||||||||
options |
object | Peak meter options Properties
|
- Since:
- 2020
- Source:
(static) drawPointsOscilloscope(canvas, options)
Draw an oscilloscope as points only in given canvas.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
canvas |
object | The canvas to draw disc in |
||||||||||||
options |
object | Oscilloscope options Properties
|
- Since:
- 2020
- Source:
(static) drawRadialBar(canvas, options)
Draw a radial bar with its height and color being computed from the frequency intensity.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
canvas |
object | The canvas to draw radial bar in |
||||||||||||||||||||||||
options |
object | Radial bar options Properties
|
- Since:
- 2020
- Source:
(static) drawRadialOscilloscope(canvas, options)
Draw a radial oscilloscope as points only in given canvas.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
canvas |
object | The canvas to draw disc in |
||||||||||||||||||||||||
options |
object | Oscilloscope options Properties
|
- Since:
- 2020
- Source:
(static) drawTriangle(canvas, options)
Draw a triangle in given canvas.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
canvas |
object | The canvas to draw disc in |
|||||||||||||||
options |
object | Peak meter options Properties
|
- Since:
- 2020
- Source:
(static) drawVerticalBar(canvas, options)
Draw a disc vertical bar in given canvas with given gradient.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
canvas |
object | The canvas to draw disc in |
|||||||||||||||
options |
object | Vertical bar options Properties
|
- Since:
- 2020
- Source:
(static) precisionRound(value, precision) → {number}
Round a floating number with a given precision after coma.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The floating value to round |
precision |
number | the amount of number we want to have after floating point |
- Since:
- 2020
- Source:
Returns:
- The rounded value
- Type
- number