Options
All
  • Public
  • Public/Protected
  • All
Menu

The virtual Micrio camera

author

Marcel Duin [email protected]

copyright

Q42 Internet BV, Micrio, 2015 - 2023

link

https://micr.io/ , https://q42.nl/en/

Hierarchy

  • Camera

Index

Methods

getView

  • getView(): Float64Array
  • Get the current image view rectangle

    Returns Float64Array

    The current screen viewport

setView

  • setView(view: View, noLimit?: boolean): void
  • Set the screen viewport

    Parameters

    • view: View

      The viewport

    • noLimit: boolean = false

      Don't restrict the boundaries

    Returns void

getCoo

  • getCoo(x: number, y: number, absolute?: boolean, noLimit?: boolean): Float64Array
  • Gets the static image XY coordinates of a screen coordinate

    Parameters

    • x: number

      The screen X coordinate in pixels

    • y: number

      The screen Y coordinate in pixels

    • absolute: boolean = false

      Use absolute browser window coordinates

    • noLimit: boolean = false

      Allow to go out of image bounds

    Returns Float64Array

    The relative image XY coordinates

setCoo

  • setCoo(x: number, y: number, scale?: number): void
  • Sets current coordinates as the center of the screen

    Parameters

    • x: number

      The X Coordinate

    • y: number

      The Y Coordinate

    • scale: number = ...

      The scale to set

    Returns void

getCurrentCoo

  • getCurrentCoo(): Float64Array
  • Get the current image coordinates at the center of the screen

    Returns Float64Array

getXY

  • getXY(x: number, y: number, abs?: boolean): Float64Array
  • Gets the static screen XY coordinates of an image coordinate

    Parameters

    • x: number

      The image X coordinate

    • y: number

      The image Y coordinate

    • abs: boolean = false

      Use absolute browser window coordinates

    Returns Float64Array

    The screen XY coordinates in pixels

getScale

  • getScale(): number
  • Get the current image scale

    Returns number

getCoverScale

  • getCoverScale(): number
  • Get the scale when the image would cover the screen

    Returns number

getMinScale

  • getMinScale(): number
  • Get the minimum scale

    Returns number

    The minimum scale

setMinScale

  • setMinScale(s: number): void
  • Sets the minimum scale

    Parameters

    • s: number

      The minimum scale to set

    Returns void

isZoomedIn

  • isZoomedIn(): boolean
  • Returns true when the camera is zoomed in to the max

    Returns boolean

isZoomedOut

  • isZoomedOut(): boolean
  • Returns true when the camera is fully zoomed out

    Returns boolean

setLimit

  • setLimit(limit: View): void
  • Limit camera navigation boundaries

    Parameters

    • limit: View

      The viewport limit

    Returns void

set360RangeLimit

  • set360RangeLimit(x?: number, y?: number): void
  • Limit camera navigation boundaries

    Parameters

    • x: number = 0

      The viewport width to limit to

    • y: number = 0

      The viewport height to limit to

    Returns void

flyToView

  • flyToView(view: View, duration?: number, speed?: number, progress?: number, prevView?: View, isJump?: boolean): Promise<void>
  • Fly to a specific view

    Parameters

    • view: View

      The viewport to fly to

    • duration: number = -1

      A forced duration in ms of the animation

    • speed: number = -1

      A non-default camera speed

    • progress: number = 0

      Set the starting animation progress percentage

    • Optional prevView: View

      Base the progress override on this starting view

    • Optional isJump: boolean

      Zoom out and in during the animation

    Returns Promise<void>

    Promise when the animation is done

flyToFullView

  • flyToFullView(duration?: number, speed?: number): Promise<void>
  • Fly to a full view of the image

    Parameters

    • duration: number = -1

      A forced duration in ms of the animation

    • speed: number = -1

      A non-default camera speed

    Returns Promise<void>

    Promise when the animation is done

flyToCoverView

  • flyToCoverView(duration?: number, speed?: number): Promise<void>
  • Fly to a screen-covering view of the image

    Parameters

    • duration: number = -1

      A forced duration in ms of the animation

    • speed: number = -1

      A non-default camera speed

    Returns Promise<void>

    Promise when the animation is done

flyToCoo

  • flyToCoo(coords: number[], duration?: number, speed?: number): Promise<void>
  • Fly to the specific coordinates

    Parameters

    • coords: number[]

      The X, Y and scale coordinates to fly to

    • duration: number = -1

      A forced duration in ms of the animation

    • speed: number = -1

      A non-default camera speed

    Returns Promise<void>

    Promise when the animation is done

jumpToView

  • jumpToView(view: View, duration?: number, speed?: number): Promise<void>
  • Do a "jump" animation to the specific view

    Parameters

    • view: View

      The viewport to fly to

    • duration: number = -1

      A forced duration in ms of the animation

    • speed: number = 1

      A non-default camera speed

    Returns Promise<void>

    Promise when the animation is done

zoom

  • zoom(delta: number, duration?: number, x?: number, y?: number, speed?: number, noLimit?: boolean): Promise<void>
  • Do a zooming animation

    Parameters

    • delta: number

      The amount to zoom

    • duration: number = 0

      A forced duration in ms of the animation

    • x: number = undefined

      Screen pixel X-coordinate as zoom focus

    • y: number = undefined

      Screen pixel Y-coordinate as zoom focus

    • speed: number = 1

      A non-default camera speed

    • noLimit: boolean = false

      Can zoom outside of the image boundaries

    Returns Promise<void>

    Promise when the zoom animation is done

zoomIn

  • zoomIn(factor?: number, duration?: number, speed?: number): Promise<void>
  • Zoom out a factor

    Parameters

    • factor: number = 200

      The amount to zoom in

    • duration: number = 250

      A forced duration in ms of the animation

    • speed: number = 1

      A non-default camera speed

    Returns Promise<void>

    Promise when the zoom animation is done

zoomOut

  • zoomOut(factor?: number, duration?: number, speed?: number): Promise<void>
  • Zoom out a factor

    Parameters

    • factor: number = 300

      The amount to zoom out

    • duration: number = 250

      A forced duration in ms of the animation

    • speed: number = 1

      A non-default camera speed

    Returns Promise<void>

    Promise when the zoom animation is done

pan

  • pan(x: number, y: number, duration?: number): void
  • Pan relative pixels

    Parameters

    • x: number

      The horizontal number of pixels to pan

    • y: number

      The vertical number of pixels to pan

    • duration: number = 0

      An optional duration

    Returns void

stop

  • stop(): void
  • Stop any animation

    Returns void

getDirection

  • getDirection(): number
  • Get the current direction facing in 360 mode in radians

    Returns number

setDirection

  • setDirection(yaw: number, pitch?: number): void
  • Sets the 360 viewing direction in radians

    Parameters

    • yaw: number

      The direction in radians

    • Optional pitch: number

      Optional pitch in radians

    Returns void

getPitch

  • getPitch(): number
  • Get the current direction pitch

    Returns number

    The current pitch in radians

setMargins

  • setMargins(width: number, height: number): void
  • Set virtual offset margins applied to all viewports

    Parameters

    • width: number

      The offset width in pixels

    • height: number

      The offset height in pixels

    Returns void

Generated using TypeDoc