Add gegl:mosaic.

This commit is contained in:
Bauke 2022-03-10 18:06:01 +01:00
parent 0436563959
commit c9f87d365c
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 49 additions and 0 deletions

View File

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

48
source/gegl/mosaic.ts Normal file
View File

@ -0,0 +1,48 @@
import {BaseOperation} from './base.js';
export interface MosaicParameters {
antialiasing: boolean;
colorAveraging: boolean;
colorVariation: number;
jointsColor: string;
lightColor: string;
lightDir: number;
seed: number;
tileAllowSplit: boolean;
tileHeight: number;
tileNeatness: number;
tileSize: number;
tileSpacing: number;
tileSurface: boolean;
tileType: 'squares' | 'hexagons' | 'octagons' | 'triangles';
}
export class Mosaic extends BaseOperation<MosaicParameters> {
public static default: MosaicParameters = {
antialiasing: true,
colorAveraging: true,
colorVariation: 0.2,
jointsColor: '#000',
lightColor: '#fff',
lightDir: 135,
seed: 0,
tileAllowSplit: true,
tileHeight: 4,
tileNeatness: 0.65,
tileSize: 15,
tileSpacing: 1,
tileSurface: false,
tileType: 'hexagons',
};
public get default() {
return Mosaic.default;
}
public appendCrop = false;
public name = 'gegl:mosaic';
constructor(parameters?: Partial<MosaicParameters>) {
super({...Mosaic.default, ...parameters});
}
}