Skip to main content

Interface: RasterData

Defined in: storage/base.ts:75

A Data object that provides a tiled, multi-resolution raster

Extended by data types that are drawn as OpenSeadragon tiled images (e.g. images, labels).

Extends​

Extended by​

Properties​

getTileData?​

optional getTileData?: (event) => Promise<{ height: number; values: TypedArray; width: number; }>

Defined in: storage/base.ts:104

Extracts the raw values of an invalidated tile

Provided by raster data whose tiles carry values rather than colors (e.g. label IDs, or one sample per pixel of an image channel), which the renderer recolors through a data transfer; raster data whose tiles are drawn as they are does not provide it. The tile in event already belongs to one of this raster's tile sources, which identifies the channel for multi-channel data.

The raster does not need to be cropped to the tile's source bounds: it may cover the full tile size, as the renderer crops it when drawing.

Parameters​

event​

TileInvalidatedEvent

The tile invalidation event

Returns​

Promise<{ height: number; values: TypedArray; width: number; }>

The values of the invalidated tile, one per raster pixel in row-major order, along with the width and height of the raster in pixels

Throws​

Error if the event does not contain raster data

Methods​

close()​

close(): void

Defined in: storage/base.ts:18

Releases all resources held by this data object

Returns​

void

Inherited from​

Data.close


getTileSource()​

getTileSource(): string | object | CustomTileSource

Defined in: storage/base.ts:85

Returns the tile source of this raster

Data types providing more than one tile source (see ImageData) extend this to address them.

Returns​

string | object | CustomTileSource

The tile source, which can be a URL string, a TileSourceConfig object, or a CustomTileSource object