diff --git a/source/gegl/exports.ts b/source/gegl/exports.ts index c9bd3ea..ed15e66 100644 --- a/source/gegl/exports.ts +++ b/source/gegl/exports.ts @@ -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'; diff --git a/source/gegl/focus-blur.ts b/source/gegl/focus-blur.ts new file mode 100644 index 0000000..f3d5519 --- /dev/null +++ b/source/gegl/focus-blur.ts @@ -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 { + 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) { + super({...FocusBlur.default, ...parameters}); + } +}