import { ImgstryProcessor } from './imgstry.processor'; import { OperationOption, RenderTarget } from './types'; import { Kernel } from '../kernel'; /** * Defines the imgstry editor schema. * * @export * @interface ImgstryEditor * @template T */ export declare abstract class ImgstryEditor extends ImgstryProcessor { protected _operations: OperationOption[]; /** * Turn the image black and white with the provided ratio. * * @param {[number, number, number]} [ratio] an array of rations for each RGB channel the total sum must be 1 * @returns {T} the current editor instance * @memberof ImgstryEditor */ blackAndWhite(ratio?: [number, number, number]): ImgstryEditor; /** * Increase / decrease image constrast. * * @param {number} value contrast intensity * @returns {T} the current editor instance * @memberof ImgstryEditor */ contrast(value: number): ImgstryEditor; /** * Increase / decrease image brightness. * * @param {number} value brightness intensity * @returns {T} the current editor instance * @memberof ImgstryEditor */ brightness(value: number): ImgstryEditor; /** * Increase / decrease image saturation. * * @param {number} value saturation intensity * @returns {T} the current editor instance * @memberof ImgstryEditor */ saturation(value: number): ImgstryEditor; /** * Shift the image hue. * * @param {number} value hue shift value (-180, 180) * @returns {T} the current editor instance * @memberof ImgstryEditor */ hue(value: number): ImgstryEditor; /** * Apply sepia with the specified intensity. * * @param {number} value desired intensity of the sepia effect * @returns {T} the current editor instance * @memberof ImgstryEditor */ sepia(value: number): ImgstryEditor; /** * Increase / decrease image gamma. * * @param {number} value gamma intensity * @returns {T} the current editor instance * @memberof ImgstryEditor */ gamma(value: number): ImgstryEditor; /** * Add a provided amount of noise to the image. * * @param {number} value noise amount * @returns {T} the current editor instance * @memberof ImgstryEditor */ noise(value: number): ImgstryEditor; /** * Increase / decrease image vibrance. * * @param {number} value vibrance intensity * @returns {T} the current editor instance * @memberof ImgstryEditor */ vibrance(value: number): ImgstryEditor; /** * Invert the image colors. * * @returns {T} the current editor instance * @memberof ImgstryEditor */ invert(): ImgstryEditor; /** * Apply a color tint to the image. * * @param {string} color the hex color code of the desired tint * @returns {T} the current editor instance * @memberof ImgstryEditor */ tint(color: string): ImgstryEditor; /** * Fill the canvas with a color. * * @param {string} color the hex color code of the desired tint * @returns {T} the current editor instance * @memberof ImgstryEditor */ fill(color: string): ImgstryEditor; /** * Apply a kernel to the active image * * @param {Kernel | Array} kernel a square matrice that will be applied to the image * @returns {T} the current editor instance * @memberof ImgstryEditor */ convolve(kernel: Kernel | number[][]): ImgstryEditor; /** * Clears the operation list. * * @returns {T} the current editor instance * @memberof ImgstryEditor */ clear(): this; /** * Apply the requested operations to the image. * * @param {RenderTarget} target the processing target * @returns {T} the current editor instance * @memberof ImgstryEditor */ renderSync(target?: RenderTarget): ImgstryEditor; /** * Apply the requested operations to the image using a worker thread. * * @param {RenderTarget} target the processing target * @returns {Promise} a promise that resolves in the current editor instance * @memberof ImgstryEditor */ abstract render(target: RenderTarget): Promise; private _recordOperation; }