Constructor
new VideoMotionView(motion, output)
Parameters:
Name | Type | Description |
---|---|---|
motion |
VideoMotion | VideoMotion with inputs to visualize |
output |
OUTPUT | visualization output mode |
Members
(static) OUTPUT :object
Modes of debug output that can be rendered.
Type:
- object
buffer :Uint32Array
Pixel buffer to store output values into before they replace the last frames info in the debug canvas.
Type:
- Uint32Array
context :CanvasRendering2DContext
2D context to draw to debug canvas.
Type:
- CanvasRendering2DContext
motion :VideoMotion
VideoMotion instance to visualize.
Type:
output :OUTPUT
Visualization output mode.
Type:
Methods
_components(eachAddress) → {object}
Build component values used in determining a motion vector for a pixel address.
Parameters:
Name | Type | Description |
---|---|---|
eachAddress |
function | a bound handle to _eachAddress to build component values for |
Returns:
a object with a A2, A1B2, B1, C2, C1 value
- Type
- object
_eachAddress(xStart, yStart, xStop, yStop, fn)
Iterate each pixel address location and call a function with that address.
Parameters:
Name | Type | Description |
---|---|---|
xStart |
number | start location on the x axis of the output pixel buffer |
yStart |
number | start location on the y axis of the output pixel buffer |
xStop |
nubmer | location to stop at on the x axis |
yStop |
number | location to stop at on the y axis |
fn |
function | handle to call with each iterated address |
_eachCell(xStart, yStart, xStop, yStop, xStep, yStep, fn)
Iterate over cells of pixels and call a function with a function to iterate over pixel addresses.
Parameters:
Name | Type | Description |
---|---|---|
xStart |
number | start location on the x axis |
yStart |
number | start lcoation on the y axis |
xStop |
number | location to stop at on the x axis |
yStop |
number | location to stop at on the y axis |
xStep |
number | width of the cells |
yStep |
number | height of the cells |
fn |
function | function to call with a bound handle to _eachAddress |
_grads(address) → {object}
Build horizontal, vertical, and temporal difference of a pixel address.
Parameters:
Name | Type | Description |
---|---|---|
address |
number | address to build values for |
Returns:
a object with a gradX, grady, and gradT value
- Type
- object
draw()
Visualize the motion code output mode selected for this view to the debug canvas.