Add gegl:waves.

This commit is contained in:
Bauke 2022-03-10 18:09:25 +01:00
parent c9f87d365c
commit 614ced0049
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 37 additions and 0 deletions

View File

@ -10,3 +10,4 @@ export * from './plasma.js';
export * from './simplex-noise.js';
export * from './softglow.js';
export * from './stereographic-projection.js';
export * from './waves.js';

36
source/gegl/waves.ts Normal file
View File

@ -0,0 +1,36 @@
import {BaseOperation} from './base.js';
export interface WavesParameters {
amplitude: number;
aspect: number;
clamp: boolean;
period: number;
phi: number;
samplerType: 'nearest' | 'linear' | 'cubic' | 'nohalo' | 'lohalo';
x: number;
y: number;
}
export class Waves extends BaseOperation<WavesParameters> {
public static default: WavesParameters = {
amplitude: 25,
aspect: 1,
clamp: false,
period: 100,
phi: 0,
samplerType: 'cubic',
x: 0.5,
y: 0.5,
};
public get default() {
return Waves.default;
}
public appendCrop = false;
public name = 'gegl:waves';
constructor(parameters?: Partial<WavesParameters>) {
super({...Waves.default, ...parameters});
}
}