Add gegl:maze.

This commit is contained in:
Bauke 2022-03-11 22:07:13 +01:00
parent 2d1de9e34b
commit be6a197419
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 35 additions and 0 deletions

View File

@ -6,6 +6,7 @@ export * from './crop.js';
export * from './diffraction-patterns.js'; export * from './diffraction-patterns.js';
export * from './focus-blur.js'; export * from './focus-blur.js';
export * from './generic.js'; export * from './generic.js';
export * from './maze.js';
export * from './median-blur.js'; export * from './median-blur.js';
export * from './mirrors.js'; export * from './mirrors.js';
export * from './mosaic.js'; export * from './mosaic.js';

34
source/gegl/maze.ts Normal file
View File

@ -0,0 +1,34 @@
import {BaseOperation} from './base.js';
export interface MazeParameters {
algorithmType: 'depth-first' | 'prim';
bgColor: string;
fgColor: string;
seed: number;
tileable: boolean;
x: number;
y: number;
}
export class Maze extends BaseOperation<MazeParameters> {
public static default: MazeParameters = {
algorithmType: 'depth-first',
bgColor: '#fff',
fgColor: '#000',
seed: 0,
tileable: false,
x: 16,
y: 16,
};
public get default() {
return Maze.default;
}
public appendCrop = false;
public name = 'gegl:maze';
constructor(parameters?: Partial<MazeParameters>) {
super({...Maze.default, ...parameters});
}
}