| Members | Methods |
|---|---|
Constructor
new CanvasDrawer(options)
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Options for this Drawer.
Properties
|
- Source:
Extends
Members
canvas :Element
The HTML element (canvas) that this drawer uses for drawing
Type:
- Element
- Source:
container :Element
The parent element of this Drawer instance, passed in when the Drawer was created.
The parent of
OpenSeadragon.WebGLDrawer#canvas.
Type:
- Element
- Source:
Methods
(abstract) canRotate() → {Boolean}
- Inherited From:
- Source:
Returns:
True if rotation is supported.
- Type
- Boolean
destroy()
Destroy the drawer. Child classes must call this super class.
- Inherited From:
- Source:
destroyInternalCache()
Destroy internal cache. Should be called within destroy() when
usePrivateCache is set to true. Ensures cleanup of anything created
by internalCacheCreate(...).
- Inherited From:
- Source:
drawDebuggingRect(rect)
Optional public API to draw a rectangle (e.g. for debugging purposes)
Child classes can override this method if they wish to support this
Parameters:
| Name | Type | Description |
|---|---|---|
rect |
OpenSeadragon.Rect |
- Inherited From:
- Source:
getId() → {string}
Get unique drawer ID
- Inherited From:
- Source:
Returns:
- Type
- string
internalCacheCreate(cache, tile)
If options.usePrivateCache is true, this method MUST RETURN the private cache content
Parameters:
| Name | Type | Description |
|---|---|---|
cache |
OpenSeadragon.CacheRecord | |
tile |
OpenSeadragon.Tile |
- Inherited From:
- Source:
Returns:
any
internalCacheFree(data)
It is possible to perform any necessary cleanup on internal cache, necessary if you
need to clean up some memory (e.g. destroy canvas by setting with & height to 0).
Parameters:
| Name | Type | Description |
|---|---|---|
data |
* | object returned by internalCacheCreate(...) |
- Inherited From:
- Source:
(abstract) setImageSmoothingEnabled(imageSmoothingEnabledopt)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
imageSmoothingEnabled |
Boolean |
<optional> |
Whether or not the image is
drawn smoothly on the canvas; see imageSmoothingEnabled in
OpenSeadragon.Options for more explanation. |
- Inherited From:
- Source:
setInternalCacheNeedsRefresh()
Call to invalidate internal cache. It will be rebuilt. With synchronous converions,
it will be rebuilt immediatelly. With asynchronous, it will be rebuilt once invalidation
routine happens, e.g. you should call also requestInvalidate() if you need to happen
it as soon as possible.
- Inherited From:
- Source:
tiledImageCreated(tiledImage)
When a Tiled Image is initialized and ready, this method is called.
Unlike with events, here it is guaranteed that all external code has finished
processing (under normal circumstances) and the tiled image should not change.
Parameters:
| Name | Type | Description |
|---|---|---|
tiledImage |
OpenSeadragon.TiledImage | target image that has been created |
- Inherited From:
- Source:
viewportCoordToDrawerCoord(point) → {OpenSeadragon.Point}
This function converts the given point from to the drawer coordinate by
multiplying it with the pixel density.
This function does not take rotation into account, thus assuming provided
point is at 0 degree.
Parameters:
| Name | Type | Description |
|---|---|---|
point |
OpenSeadragon.Point | the pixel point to convert |
- Inherited From:
- Source:
Returns:
Point in drawer coordinate system.
- Type
- OpenSeadragon.Point
viewportToDrawerRectangle(rectangle) → {OpenSeadragon.Rect}
Scale from OpenSeadragon viewer rectangle to drawer rectangle
(ignoring rotation)
Parameters:
| Name | Type | Description |
|---|---|---|
rectangle |
OpenSeadragon.Rect | The rectangle in viewport coordinate system. |
- Inherited From:
- Source:
Returns:
Rectangle in drawer coordinate system.
- Type
- OpenSeadragon.Rect