Class: DataTypeConverter

OpenSeadragon.DataTypeConverter

Methods

new DataTypeConverter()

Class that orchestrates automated data types conversion. Do not instantiate this class, use OpenSeadragon.converter - a global instance, instead. Types are defined to closely describe the data type, e.g. "url" is insufficient, because url can point to many different data types. Another bad example is 'canvas' as canvas can have different underlying rendering implementations and thus differ in behavior. The following data types supported by OpenSeadragon core are: - "image" - HTMLImageElement, an object - "context2d" - HtmlRenderingContext2D, a 2D canvas context - "imageUrl" - string, a URL to a resource carrying image data - "rasterBlob" - Blob, a binary file-like object carrying image data The system uses these to deliver desired data from TileSource (which implements fetching logics) through plugins to the renderer with preserving data type compatibility. Typical example is: TiledImage downloads without ajax a data present at url 'myUrl'. It submits to the system object of data type 'imageUrl'. The system runs this object through possible plugins integrated into the invalidation routine (by default none), and finishes by conversion for the WebGL renderer, which would most likely be "image" object, because the conversion is the cheapest starting from "imageUrl" type. If some plugin required context2d type, the pipeline would deliver this type and used it also for WebGL, as texture loading function accepts canvas object as well as image.
Source: