Class: DeepZoomInfo

DeepZoomInfo

A utility class that holds information typically provided by DZI files, i.e. height and width of the overall image, overlap, and image type.

new DeepZoomInfo (attrs)

Name Type Description
attrs obj

A JSON-Object holding the listed keys and values

Example
{
        "tileSize": 1024,
        "format": "jpeg",
        "overlap": 1,
        "height": 4794,
        "width": 4095,
        "clip": { "minLevel": 12, "maxLevel": 20, "startCol": 301436, "startRow": 354060 },
                  // optional: minLevel and maxLevel define the level bounds
                  // startCol: first col at maxLevel
                  // startRow: first row at maxLevel
        "path": "var/Vermeer/Vermeer_files",
        "type": "dzi",  // optional: dzi (default) or map
        "urlTileTemplate": "{path}/{level}/{column}/{row}.{format}"
          // optional: {path}/{level}/{column}_{row}.{format} (default) or
          // a template String with the format of the URL
    }

Classes

DeepZoomInfo

Methods

dimensions (level)array

Computes the columns and rows as well as scaled width and height.

Name Type Description
level number

The level of the wanted layer

Returns:
Type Description
array [cols, rows, width, height]

getDimensions (level)array

Computes the scaled width and height of the given level.

Name Type Description
level number

The level of the wanted layer

Returns:
Type Description
array size - The width and height

getNumTiles (level)array

Computes the number of cols and rows of tiles.

Name Type Description
level number

The level of the wanted layer

Returns:
Type Description
array size - The cols and rows

getScale (level)number

Computes the scale at the given level.

Name Type Description
level number

The level of the wanted layer

Returns:
Type Description
number scale

imageForURL (url, complete)Image

Loads the image for the given url and executes a callback function on completion.

Name Type Description
url string

The url of the tile

complete function

The callback function

Returns:
Type Description
Image obj

urlForTile (level, column, row)string

Computes the url for the given level, column and and row.

Name Type Description
level number

The level of the wanted layer

column number

The column of the tile

row number

The row of the tile

Returns:
Type Description
string url