Add gegl:focus-blur.

This commit is contained in:
Bauke 2022-03-08 18:54:17 +01:00
parent 91ba4468c7
commit 93ad125a7f
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 49 additions and 0 deletions

View File

@ -1,5 +1,6 @@
export * from './base.js';
export * from './crop.js';
export * from './focus-blur.js';
export * from './generic.js';
export * from './mirrors.js';
export * from './newsprint.js';

48
source/gegl/focus-blur.ts Normal file
View File

@ -0,0 +1,48 @@
import {BaseOperation} from './base.js';
export interface FocusBlurParameters {
aspectRatio: number;
blurRadius: number;
blurType: 'gaussian' | 'lens';
focus: number;
highlightFactor: number;
highlightThresholdHigh: number;
highlightThresholdLow: number;
highQuality: boolean;
midpoint: number;
radius: number;
rotation: number;
shape: 'circle' | 'square' | 'diamond' | 'horizontal' | 'vertical';
x: number;
y: number;
}
export class FocusBlur extends BaseOperation<FocusBlurParameters> {
public static default: FocusBlurParameters = {
aspectRatio: 0,
blurRadius: 25,
blurType: 'gaussian',
focus: 0.25,
highlightFactor: 0,
highlightThresholdHigh: 1,
highlightThresholdLow: 0,
highQuality: false,
midpoint: 0.5,
radius: 0.75,
rotation: 0,
shape: 'circle',
x: 0.5,
y: 0.5,
};
public get default() {
return FocusBlur.default;
}
public appendCrop = false;
public name = 'gegl:focus-blur';
constructor(parameters?: Partial<FocusBlurParameters>) {
super({...FocusBlur.default, ...parameters});
}
}