Class: DeepZoomImage

DeepZoomImage

The main class of a deeply zoomable image that is represented by a hierarchy of tile layers for each zoom level. This gives the user the impression that even huge pictures (up to gigapixel-images) can be zoomed instantaneously, since the tiles at smaller levels are scaled immediately and overloaded by more detailed tiles at the larger level as fast as possible.

new DeepZoomImage (deepZoomInfo)

Name Type Description
deepZoomInfo DeepZoomInfo

Information extracted from a JSON-Object

Members

baseSize

Getter for the DeepZoomInfo base level size.

foreground

Getter for PIXI.Container foreground layer. Adds a PIXI.Container if necessary.

height

Getter for the current height.

maxScale

Getter for the max scale factor.

pixelSize

Getter for the current scaled size in pixels.

width

Getter for the current width.

Methods

_calculateBounds ()

Overrides PIXI.Container._calculateBounds() Only considers the base size and reduces the calculation to a single rect.

_createTiles (level)Tiles

Private method: creates all tiles for a given level.

Name Type Description
level number

The zoom level of the grid

Returns:
Type Description
Tiles
  • tiles

activate ()

Activates the textures on the DeepZoomImage.

addTiles (key, tiles)

Adds a tile layer to the DeepZoomImage.

Name Type Description
key string

the access key

tiles Tiles

the tile layer object

allTiles (tiles, level)Array.<Array>

Returns a list of all tiles of a given level.

Name Type Description
tiles Tiles

the grid of tiles

level number

The zoom level of the grid

Returns:
Type Description
Array.<Array>
  • An array of [url, col, row] arrays

bringTilesToFront (tiles)

Ensure that the given tiles layer is the topmost one and visible.

Name Type Description
tiles *

calculateBounds ()

Overrides PIXI.Container.calculateBounds() Skips the children and only considers the deep zoom base size. Calls the also overwritten _calculateBounds method.

changedTiles (tiles, level)object

Returns all changed tiles for a given level.

Name Type Description
tiles Tiles

the grid of tiles

level number

The zoom level of the grid

Returns:
Type Description
object
  • An object with the keys added and removed which values are [url, col, row] arrays

deactivate ()

Dectivates the textures on the DeepZoomImage.

destroyObsoleteTiles ()

Destroy tiles in all layers that are no longer needed

destroyTiles ()

Destroy tiles in all layers that are not part of the visible quadTrees

destroyTilesAboveLevel (level)

Destroys all tiles above a given level to ensure that the memory can be reused.

Name Type Description
level number

The zoom level of the grid

destroyUnneededTiles ()

Destroy tiles in all layers that are no longer needed

ensureAllTiles (level)

Ensures that all tiles of a given level are loaded.

Name Type Description
level number

The zoom level of the grid

ensureTiles (level)Tiles

Ensures that all needed tiles of a given level are loaded. Creates a new Tiles layer if necessary

Name Type Description
level number

The zoom level of the grid

Returns:
Type Description
Tiles tiles

levelAndAlphaForScale (scale)

Returns the tile layer level that corresponds to the given scale.

Name Type Description
scale number

the scale factor

levelForScale (scale)

Returns the tile layer level that corresponds to the given scale.

Name Type Description
scale number

the scale factor

neededTiles (tiles, level, debug)Array.<Array>

Loads all tiles that are needed to fill the app bounds.

Name Type Default Description
tiles Tiles

the grid of tiles

level number

The zoom level of the grid

debug boolean false
Returns:
Type Description
Array.<Array>
  • An array of [url, col, row] arrays

populateAllTiles (tiles, level)

Populates all tiles for a given level.

Name Type Description
tiles Tiles

the grid of tiles

level number

The zoom level of the grid

populateTiles (tiles, level, onlyone, about)

Loads all tiles that are needed to fill the browser window. If the optional about parameter is provided (as a point with col as x, and row as y attr) the tiles are sorted by the distance to this point.

Name Type Description
tiles Tiles

the grid of tiles

level number

The zoom level of the grid Optional parameter:

onlyone boolean

if true only one tile is loaded

about PIXI.Point

point of interaction

setup (deepZoomInfo, center)

Reads the DeepZoomInfo object and initializes all tile layers. Called by the constructor. Creates the sprite for the loaded texture and add the sprite to the tile layer.

Name Type Description
deepZoomInfo Object

the DeepZoomInfo instance

center boolean

If true ensures that the pivot is set to the center

setupTiles (center)

Default setup method for tiles. Loads all tiles of the current level. Can be overwritten in subclasses.

Name Type Default Description
center boolean false

If true ensures that the pivot is set to the center

thumbnail ()Sprite

Returns a single sprite that can be used a thumbnail representation of large images.

Returns:
Type Description
Sprite sprite - A sprite with a single tile texture

tintObsoleteTiles ()

Tint tiles in all layers that are no longer needed

transformed (translated, scale, about, fast, debug)

A callback function that can be used by a Scatter view to inform the zoomable image that it has been moved, rotated or scaled, and should load tiles accordingly.

Name Type Description
translated PIXI.Point

the movement of the scatter

scale number

the zoom factor

about PIXI.Point

the anchor point of the zoom

fast boolean

informs the callback to return as fast as possible, i.e. after loading a single tile

debug boolean

log debug infos