Camera

Camera

The Micrio camera

Constructor

new Camera()

Create the camera instance

Classes

Camera

Members

(constant, non-null) events :Events

Browser event handler
Type:

Methods

fadeIn(dur) → {number}

Fade in the image
Parameters:
Name Type Description
dur number Duration in ms
Returns:
The actual duration
Type
number

fadeOut(dur) → {number}

Fade in the image
Parameters:
Name Type Description
dur number Duration in ms
Returns:
The actual duration
Type
number

flyToCoo(coordinatesnon-null, durationopt, speedopt) → (non-null) {Promise}

Fly to the specific coordinates
Parameters:
Name Type Attributes Description
coordinates Array.<number> The X, Y and scale coordinates to fly to
duration number <optional>
A forced duration in ms of the animation
speed number <optional>
A non-default camera speed
Returns:
Promise when the animation is done
Type
Promise

flyToCoverView(durationopt, speedopt) → (non-null) {Promise}

Fly to a screen-covering view of the image
Parameters:
Name Type Attributes Description
duration number <optional>
A forced duration in ms of the animation
speed number <optional>
A non-default camera speed
Returns:
Promise when the animation is done
Type
Promise

flyToFullView(durationopt, speedopt) → (non-null) {Promise}

Fly to a full view of the image
Parameters:
Name Type Attributes Description
duration number <optional>
A forced duration in ms of the animation
speed number <optional>
A non-default camera speed
Returns:
Promise when the animation is done
Type
Promise

flyToView(view, durationopt, speedopt, progressopt, prevView, isJumpopt) → (non-null) {Promise}

Fly to the specific view
Parameters:
Name Type Attributes Default Description
view !Array.<number> | Float64Array The viewport to fly to
duration number <optional>
A forced duration in ms of the animation
speed number <optional>
A non-default camera speed
progress number <optional>
0 Set the starting animation progress percentage
prevView ?Array.<number> | Float64Array null Base the progress override on this starting view
isJump boolean <optional>
false Zoom out and in during the animation
Returns:
Promise when the animation is done
Type
Promise

fullScreenToggle() → {boolean}

Toggle fullscreen mode
Returns:
Fullscreen state
Type
boolean

getCoo(xynon-null, absoluteopt, noLimitopt) → (non-null) {Float64Array}

Get the screen XY coordinates for relative image coordinates
Parameters:
Name Type Attributes Description
xy Array.<number> The screen X, Y coordinates in pixels
absolute boolean <optional>
Include the absolute Micrio screen offset
noLimit boolean <optional>
Allow out of bounds return coordinates
Returns:
The image X, Y, scale coordinates
Type
Float64Array

getCurrentCoo() → (non-null) {Float64Array}

Get the current image coordinates at the center of the screen
Returns:
The current image coordinates
Type
Float64Array

getView() → (non-null) {Float64Array}

Get the current image view rectangle
Returns:
The current screen viewport
Type
Float64Array

getXY(coonon-null, absoluteopt) → (non-null) {Float64Array}

Get the screen XY coordinates for relative image coordinates
Parameters:
Name Type Attributes Description
coo Array.<number> The image X,Y coordinates
absolute boolean <optional>
Include the absolute Micrio screen offset
Returns:
The screen X,Y coordinates
Type
Float64Array

hook(micrionon-null)

Bind the camera to a Micrio instance
Parameters:
Name Type Description
micrio Micrio The Micrio instance

isFullScreen() → {boolean}

Returns if fullscreen
Returns:
Fullscreen state
Type
boolean

isZoomedIn() → {boolean}

Returns true when the camera is zoomed in to the max
Returns:
The camera is fully zoomed in
Type
boolean

isZoomedOut() → {boolean}

Returns true when the camera is fully zoomed out
Returns:
The camera is fully zoomed out
Type
boolean

jumpToView(view, durationopt, speedopt) → (non-null) {Promise}

Do a "jump" animation to the specific view
Parameters:
Name Type Attributes Default Description
view !Array.<number> | Float64Array The viewport to fly to
duration number <optional>
A forced duration in ms of the animation
speed number <optional>
1 A non-default camera speed
Returns:
Promise when the animation is done
Type
Promise

setCoo(coordinatesnon-null)

Set the image XY coordinates
Parameters:
Name Type Description
coordinates Array.<number> The screen X, Y, scale coordinates in pixels

setLimit(lims)

Set navigation limits
Parameters:
Name Type Description
lims !Array.<number> | Float64Array The image viewport to limit to

setMargins(w, h)

Set virtual offset margins applied to all viewports
Parameters:
Name Type Description
w number The offset width in pixels
h number The offset height in pixels

setView(viewnon-null)

Set the screen viewport
Parameters:
Name Type Description
view Array.<number> The viewport

stop()

Stop any animation

unhook()

Unbind the camera from its current Micrio instance

zoom(delta, durationopt, xopt, yopt, speedopt, noLimitopt) → (non-null) {Promise}

Do a zooming animation
Parameters:
Name Type Attributes Default Description
delta number The amount to zoom
duration number <optional>
0 A forced duration in ms of the animation
x number <optional>
Screen pixel X-coordinate as zoom focus
y number <optional>
Screen pixel Y-coordinate as zoom focus
speed number <optional>
1 A non-default camera speed
noLimit boolean <optional>
false Can zoom outside of the image boundaries
Returns:
Promise when the zoom animation is done
Type
Promise

zoomIn(factoropt, durationopt, speedopt) → (non-null) {Promise}

Zoom in a factor
Parameters:
Name Type Attributes Default Description
factor number <optional>
The amount to zoom in
duration number <optional>
250 A forced duration in ms of the animation
speed number <optional>
1 A non-default camera speed
Returns:
Promise when the zoom animation is done
Type
Promise

zoomOut(factoropt, durationopt, speedopt) → (non-null) {Promise}

Zoom out a factor
Parameters:
Name Type Attributes Default Description
factor number <optional>
The amount to zoom in
duration number <optional>
250 A forced duration in ms of the animation
speed number <optional>
1 A non-default camera speed
Returns:
Promise when the zoom animation is done
Type
Promise