Class: ImagingHelper

OpenSeadragonImaging. ImagingHelper

Provides imaging helper methods and properties for the OpenSeadragon viewer.

new ImagingHelper(options)

Creates a new ImagingHelper attached to the viewer instance passed in the options parameter.
Parameters:
Name Type Description
options Object
Properties
Name Type Argument Description
viewer external:"OpenSeadragon.Viewer" Required! Reference to OpenSeadragon viewer to attach to.
onImageViewChanged external:"OpenSeadragon.EventHandler" <optional>
OpenSeadragonImaging.ImagingHelper.event:image-view-changed handler method.
worldIndex Integer <optional>
The index of the image for world.getItemAt
Source:

Extends

Members

<static> version :Object

ImagingHelper version.
Type:
  • Object
Properties:
Name Type Description
versionStr String The version number as a string ('major.minor.revision').
major Number The major version number.
minor Number The minor version number.
revision Number The revision number.
Source:

imgAspectRatio :number

The image's aspect ratio (width / height).
Type:
  • number
Source:

imgHeight :number

The image's native height in pixels.
Type:
  • number
Source:

imgWidth :number

The image's native width in pixels.
Type:
  • number
Source:

options :object

A reference to the options passed at creation.
Type:
  • object
Properties:
Name Type Argument Description
viewer external:"OpenSeadragon.Viewer" Reference to OpenSeadragon viewer this ImagingHelper is attached to.
onImageViewChanged OpenSeadragon.EventHandler <optional>
OpenSeadragonImaging.ImagingHelper.event:image-view-changed handler method.
Source:

Methods

centerAboutLogicalPoint(logpoint, immediately)

Pans the view so the logical point is centered in the viewport.
Parameters:
Name Type Argument Description
logpoint external:"OpenSeadragon.Point" The desired center point.
immediately boolean <optional>
If true, the view is set immediately with no spring animation.
Source:

dataToLogicalPoint()

Source:

dataToLogicalX()

Source:

dataToLogicalY()

Source:

dataToPhysicalPoint()

Source:

dataToPhysicalX()

Source:

dataToPhysicalY()

Source:

getMaxZoom() → {number}

Gets the maximum zoom factor allowed.
Source:
Returns:
Type
number

getMinZoom() → {number}

Gets the minimum zoom factor allowed.
Source:
Returns:
Type
number

getViewerContainerSize() → {external:"OpenSeadragon.Point"}

Gets the size of the viewer's container element.
Source:
Returns:
Type
external:"OpenSeadragon.Point"

getZoomFactor() → {number}

Gets the current zoom factor, the ratio of the displayed size to the image's native size.
Source:
Returns:
Type
number

getZoomStepPercent() → {number}

Gets the percentage of the current zoom factor to increase/decrease when using the zoomIn/zoomOut methods.
Source:
Returns:
Type
number

logicalToDataPoint()

Source:

logicalToDataX()

Source:

logicalToDataY()

Source:

logicalToPhysicalDistance()

Source:

logicalToPhysicalPoint()

Source:

logicalToPhysicalX()

Source:

logicalToPhysicalY()

Source:

notifyResize()

Helper method for users of the OpenSeadragon.Viewer's autoResize = false option. Call this whenever the viewer is resized, and the image will stay displayed at the same scale and same center point.
Source:
Fires:

physicalToDataPoint()

Source:

physicalToDataX()

Source:

physicalToDataY()

Source:

physicalToLogicalDistance()

Source:

physicalToLogicalPoint()

Source:

physicalToLogicalX()

Source:

physicalToLogicalY()

Source:

setMaxZoom(value)

Sets the maximum zoom factor allowed.
Parameters:
Name Type Description
value number The desired maximum zoom factor.
Source:

setMinZoom(value)

Sets the minimum zoom factor allowed.
Parameters:
Name Type Description
value number The desired minimum zoom factor.
Source:

setView(width, height, centerpoint, immediately)

Zooms and/or pans the viewport based on a viewport width and center point.
Parameters:
Name Type Argument Description
width number The desired viewport width in logical units.
height number The desired viewport width in logical units (currently not used, native image aspect ratio is preserved).
centerpoint external:"OpenSeadragon.Point" The desired viewport center point in logical units.
immediately boolean <optional>
If true, the view is set immediately with no spring animation.
Source:

setZoomFactor(value, immediately)

Sets the zoom factor, the ratio of the displayed size to the image's native size.
Parameters:
Name Type Argument Description
value number The desired zoom factor.
immediately boolean <optional>
If true, the view is set immediately with no spring animation.
Source:

setZoomStepPercent(value)

Sets the percentage of the current zoom factor to increase/decrease when using the zoomIn/zoomOut methods.
Parameters:
Name Type Description
value number The desired percentage.
Source:

zoomAboutLogicalPoint(newzoomfactor, logpoint, immediately)

Sets the zoom factor, the ratio of the displayed size to the image's native size, leaving the logical point in the same viewer position.
Parameters:
Name Type Argument Description
newzoomfactor number The desired zoom factor.
logpoint external:"OpenSeadragon.Point" The logical point to remain in current displayed position.
immediately boolean <optional>
If true, the view is set immediately with no spring animation.
Source:

zoomIn(immediately)

Zooms in by a factor of getZoomStepPercent().
Parameters:
Name Type Argument Description
immediately boolean <optional>
If true, the view is set immediately with no spring animation.
Source:

zoomInAboutLogicalPoint(logpoint, immediately)

Zooms in by a factor of getZoomStepPercent(), leaving the logical point in the same viewer position.
Parameters:
Name Type Argument Description
logpoint external:"OpenSeadragon.Point" The logical point to remain in current displayed position.
immediately boolean <optional>
If true, the view is set immediately with no spring animation.
Source:

zoomOut(immediately)

Zooms out by a factor of getZoomStepPercent().
Parameters:
Name Type Argument Description
immediately boolean <optional>
If true, the view is set immediately with no spring animation.
Source:

zoomOutAboutLogicalPoint(logpoint, immediately)

Zooms out by a factor of getZoomStepPercent(), leaving the logical point in the same viewer position.
Parameters:
Name Type Argument Description
logpoint external:"OpenSeadragon.Point" The logical point to remain in current displayed position.
immediately boolean <optional>
If true, the view is set immediately with no spring animation.
Source:

Events

image-view-changed

Raised whenever the viewer's zoom or pan changes and the ImagingHelper's properties have been updated.
Type:
  • Object
Properties:
Name Type Argument Default Description
eventSource OpenSeadragonImaging.ImagingHelper A reference to the ImagingHelper which raised the event.
viewportWidth number Width of viewport in logical coordinates.
viewportHeight number Height of viewport in logical coordinates.
viewportOrigin external:"OpenSeadragon.Point" Center of viewport in logical coordinates.
viewportCenter external:"OpenSeadragon.Point" Center of viewport in logical coordinates.
zoomFactor number Zoom factor.
userData Object <optional>
null Arbitrary subscriber-defined object.
Source: