image-js
Version:
Image processing and manipulation in JavaScript
38 lines • 1.19 kB
TypeScript
import type { BitDepth, Image } from '../Image.js';
import type { BorderType } from '../utils/interpolateBorder.js';
export declare const DerivativeFilter: {
readonly SOBEL: "sobel";
readonly SCHARR: "scharr";
readonly PREWITT: "prewitt";
};
export type DerivativeFilter = (typeof DerivativeFilter)[keyof typeof DerivativeFilter];
export interface DerivativeFilterOptions {
/**
* Algorithm to use for the derivative filter.
* @default `SOBEL`
*/
filter?: DerivativeFilter;
/**
* Specify how the borders should be handled.
* @default `'replicate'`
*/
borderType?: BorderType;
/**
* Value of the border if BorderType is 'constant'.
* @default `0`
*/
borderValue?: number;
/**
* Specify the bit depth of the resulting image.
* @default `image.bitDepth`
*/
bitDepth?: BitDepth;
}
/**
* Apply a derivative filter to an image.
* @param image - Image to process.
* @param options - Derivative filter options.
* @returns The processed image.
*/
export declare function derivativeFilter(image: Image, options?: DerivativeFilterOptions): Image;
//# sourceMappingURL=derivativeFilter.d.ts.map