UNPKG

image-js

Version:

Image processing and manipulation in JavaScript

14 lines 1.02 kB
import type { Image } from '../Image.js'; import type { TransformOptions } from '../geometry/index.js'; import type { Point } from '../utils/geometry/points.js'; export type CropRectangleOptions = Omit<TransformOptions, 'width' | 'height' | 'inverse' | 'fullImage'>; /** * Crop an oriented rectangle from an image. * If the rectangle's length or width are not an integers, its dimension is expanded in both directions such as the length and width are integers. * @param image - The input image * @param points - The points of the rectangle. Points must be circling around the rectangle (clockwise or anti-clockwise). The validity of the points passed is assumed and not checked. * @param options - Crop options, see {@link CropRectangleOptions} * @returns The cropped image. The orientation of the image is the one closest to the rectangle passed as input. */ export declare function cropRectangle(image: Image, points: Point[], options?: CropRectangleOptions): Image; //# sourceMappingURL=cropRectangle.d.ts.map