import { Observable, Subject } from 'rxjs'; import { HistogramData, ImgstryEditor, ImgstryProcessor, RenderTarget } from '../../../core'; import { ImgstryThreadOptions } from '../worker'; import { IDisposable } from '../../../types'; export interface ImgstryBrowserOptions { thread: ImgstryThreadOptions; } /** * (Exposes image processing methods for html canvas) * * @export * @class Imgstry * @extends {ImgstryEditor} * @implements {IDisposable} */ export declare class Imgstry extends ImgstryEditor implements IDisposable { readonly canvas: HTMLCanvasElement; static getCanvas: (selector: string | HTMLCanvasElement) => HTMLCanvasElement; static loadImage: (src: string) => Promise; readonly context: CanvasRenderingContext2D; draw$: Subject; histogram$: Observable; get width(): number; get height(): number; private _thread; /** * Creates an instance of Imgstry. * * @param {HTMLCanvasElement} canvas (specifies the canvas base for imgstry) * @param {Partial} _options (specifies the canvas base for imgstry) * @constructor */ constructor(canvas: HTMLCanvasElement, _options?: Partial); /** * Draws an image on the canvas. * * @param {HTMLImageElement} image The source image that will be drawn on the canvas. * @memberof Imgstry * @returns {void} */ drawImage(image: HTMLImageElement): void; /** * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. * * @param {string} [type='image/png'] The standard MIME type for the image format to return. * If you do not specify this parameter, the default value is a PNG format image. * @returns {string} The image encoded as a data url. * @memberof Imgstry */ toDataUrl(type?: string): string; reset(): ImgstryProcessor; clone(source: ImageData): ImageData; createImageData(source: ImageData): ImageData; get imageData(): ImageData; set imageData(image: ImageData); renderSync(target?: RenderTarget): Imgstry; render(target?: RenderTarget): Promise; /** * Destroys the thread and clears the canvas of data. * * @memberof Imgstry * @returns {void} */ dispose(): void; }