Class: RasterTool

OSDPaperjsAnnotation.RasterTool(paperScope)

The RasterTool class extends the AnnotationUITool and provides functionality for rasterizing annotations.

Constructor

new RasterTool(paperScope)

Creates a new RasterTool instance. The constructor initializes the RasterTool by calling the base class (AnnotationUITool) constructor and sets up the necessary toolbar control (RasterToolbar).
Parameters:
Name Type Description
paperScope paper.PaperScope The Paper.js scope for the tool.
Source:

Extends

  • AnnotationUITool

Classes

RasterToolbar

Methods

rasterize()

Rasterizes the current annotation item. It converts the vector annotation to a pixel-based raster. After rasterization, it replaces the original annotation with the rasterized version. The rasterized version includes both the raster image and the original annotation's geoJSON data.
Properties:
Name Type Description
onLoad function The function performs rasterization and replacement of the vector annotation with the rasterized version.
geoJSON Object geoJSON data representing the rasterized annotation item.
Properties
Name Type Description
type string The type of the geoJSON object (e.g., 'Feature').
geometry Object The geometry information of the geoJSON object.
Properties
Name Type Description
type string The type of the geometry (e.g., 'GeometryCollection').
properties Object Additional properties of the geometry.
Properties
Name Type Description
subtype string The subtype of the geometry (e.g., 'Raster').
raster Object The raster data of the geometry.
Properties
Name Type Description
data paper.Raster The pixel-based raster data.
geometries Object The list of geometries in the geometry collection.
properties Object The properties of the geoJSON object.
Source: