image-js
Version:
Image processing and manipulation in JavaScript
46 lines • 1.36 kB
TypeScript
import { Image } from '../Image.js';
import type { BorderType } from '../utils/interpolateBorder.js';
import type { InterpolationType } from '../utils/interpolatePixel.js';
export interface TransformOptions {
/**
* Width of the output image.
*/
width?: number;
/**
* Height of the output image.
*/
height?: number;
/**
* Method to use to interpolate the new pixels.
* @default `'bilinear'`
*/
interpolationType?: InterpolationType;
/**
* Specify how the borders should be handled.
* @default `'constant'`
*/
borderType?: BorderType;
/**
* Value of the border if BorderType is 'constant'.
* @default `0`
*/
borderValue?: number | number[];
/**
* Whether the transform matrix should be inverted.
*/
inverse?: boolean;
/**
* Bypasses width and height options to include
* every pixel of the original image inside the transformed image.
*/
fullImage?: boolean;
}
/**
* Transforms an image using a matrix.
* @param image - Original image.
* @param transformMatrix - 2×3 transform matrix.
* @param options - Transform options.
* @returns The new image.
*/
export declare function transform(image: Image, transformMatrix: number[][], options?: TransformOptions): Image;
//# sourceMappingURL=transform.d.ts.map