27 lines
509 B
TypeScript
27 lines
509 B
TypeScript
|
import {BaseOperation} from './base.js';
|
||
|
|
||
|
export interface CropParameters {
|
||
|
height: number;
|
||
|
resetOrigin: boolean;
|
||
|
width: number;
|
||
|
x: number;
|
||
|
y: number;
|
||
|
}
|
||
|
|
||
|
export class Crop extends BaseOperation<CropParameters> {
|
||
|
public static default: CropParameters = {
|
||
|
height: 0,
|
||
|
resetOrigin: false,
|
||
|
width: 0,
|
||
|
x: 0,
|
||
|
y: 0,
|
||
|
};
|
||
|
|
||
|
public appendCrop = false;
|
||
|
public name = 'gegl:crop';
|
||
|
|
||
|
constructor(parameters?: Partial<CropParameters>) {
|
||
|
super({...Crop.default, ...parameters});
|
||
|
}
|
||
|
}
|