Add gegl:median-blur.

This commit is contained in:
Bauke 2022-03-10 18:17:11 +01:00
parent 1828a82c82
commit e14c9ae2a6
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 33 additions and 0 deletions

View File

@ -4,6 +4,7 @@ export * from './cell-noise.js';
export * from './crop.js'; export * from './crop.js';
export * from './focus-blur.js'; export * from './focus-blur.js';
export * from './generic.js'; export * from './generic.js';
export * from './median-blur.js';
export * from './mirrors.js'; export * from './mirrors.js';
export * from './mosaic.js'; export * from './mosaic.js';
export * from './newsprint.js'; export * from './newsprint.js';

View File

@ -0,0 +1,32 @@
import {BaseOperation} from './base.js';
export interface MedianBlurParameters {
abyssPolicy: 'none' | 'clamp';
alphaPercentile: number;
highPrecision: boolean;
neighborhood: 'square' | 'circle' | 'diamond';
percentile: number;
radius: number;
}
export class MedianBlur extends BaseOperation<MedianBlurParameters> {
public static default: MedianBlurParameters = {
abyssPolicy: 'clamp',
alphaPercentile: 50,
highPrecision: false,
neighborhood: 'circle',
percentile: 50,
radius: 3,
};
public get default() {
return MedianBlur.default;
}
public appendCrop = false;
public name = 'gegl:median-blur';
constructor(parameters?: Partial<MedianBlurParameters>) {
super({...MedianBlur.default, ...parameters});
}
}