[]
Defines Paint Tools Plugin API.
id: PluginType;
Unique plug-in identifier.
ImageViewerPluginAPI.id
readonly paintLayer: ImageLayer;
Gets the paint layer containing the HTML canvas for drawing the image.
ImageViewerPluginAPI.paintLayer
readonly isReady: boolean;
Returns true if the image is loaded into the viewer and the image format is supported by the Image Filters plugin.
ImageViewerPluginAPI.isReady
readonly naturalSize: Size;
Natural image size.
ImageViewerPluginAPI.naturalSize
options: PaintToolsPluginOptions;
Plugin options
readonly effectsToolbarLayout: ToolbarItemType[];
Returns the layout for the effects tools toolbar.
If the value is true, undefined, or null, a default layout is returned.
If the value is false, an empty layout is returned.
Otherwise, the provided custom layout is used.
readonly paintToolbarLayout: ToolbarItemType[];
Returns the layout for the effects tools toolbar.
If the value is true, undefined, or null, a default layout is returned.
If the value is false, an empty layout is returned.
Otherwise, the provided custom layout is used.
readonly textToolbarLayout: ToolbarItemType[];
Returns the layout for the effects tools toolbar.
If the value is true, undefined, or null, a default layout is returned.
If the value is false, an empty layout is returned.
Otherwise, the provided custom layout is used.
readonly objectsToolbarLayout: ToolbarItemType[];
Returns the layout for the effects tools toolbar.
If the value is true, undefined, or null, a default layout is returned.
If the value is false, an empty layout is returned.
Otherwise, the provided custom layout is used.
initialize(viewer): void;
The method is called when the GcImageViewer component is initialized.
void
ImageViewerPluginAPI.initialize
isImageFormatSupported(imageFormat, allowUnknown?): boolean;
Determines whether the specified image format is supported for modifications.
The image format to check, either as an enum value or string.
string | ImageFormatCode
boolean
If true, allows unknown formats (ImageFormatCode.Default) to be considered supported.
boolean
True if the format is supported for modifications, false otherwise.
The following formats are explicitly not supported:
// Check if PNG is supported
const supported = isImageFormatSupported(ImageFormatCode.PNG);
// Check if an unknown format is supported (returns false by default)
const supported = isImageFormatSupported('custom-format');
// Check if an unknown format is supported (returns true when allowUnknown is true)
const supported = isImageFormatSupported('custom-format', true);
ImageViewerPluginAPI.isImageFormatSupported
dispose(): void;
Cleans up resources and disposes the plugin.
void
ImageViewerPluginAPI.dispose
removePaintLayer(): void;
Removes and disposes the active paint layer. If no paint layer exists, this method does nothing.
void
ImageViewerPluginAPI.removePaintLayer