fix: ウォーターマークのFX定義を分ける
This commit is contained in:
parent
4e5df65931
commit
5d87c039fb
|
@ -230,7 +230,7 @@ export class ImageEffector<IEX extends ReadonlyArray<ImageEffectorFx<any, any, a
|
||||||
gl: gl,
|
gl: gl,
|
||||||
program: shaderProgram,
|
program: shaderProgram,
|
||||||
params: Object.fromEntries(
|
params: Object.fromEntries(
|
||||||
Object.entries(fx.params).map(([key, param]) => {
|
Object.entries(fx.params as ImageEffectorFxParamDefs).map(([key, param]) => {
|
||||||
return [key, layer.params[key] ?? param.default];
|
return [key, layer.params[key] ?? param.default];
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
@ -238,7 +238,7 @@ export class ImageEffector<IEX extends ReadonlyArray<ImageEffectorFx<any, any, a
|
||||||
width: this.renderWidth,
|
width: this.renderWidth,
|
||||||
height: this.renderHeight,
|
height: this.renderHeight,
|
||||||
textures: Object.fromEntries(
|
textures: Object.fromEntries(
|
||||||
Object.entries(fx.params).map(([k, v]) => {
|
Object.entries(fx.params as ImageEffectorFxParamDefs).map(([k, v]) => {
|
||||||
if (v.type !== 'texture') return [k, null];
|
if (v.type !== 'texture') return [k, null];
|
||||||
const param = getValue<typeof v.type>(layer.params, k);
|
const param = getValue<typeof v.type>(layer.params, k);
|
||||||
if (param == null) return [k, null];
|
if (param == null) return [k, null];
|
||||||
|
|
|
@ -35,10 +35,3 @@ export const FXS = [
|
||||||
FX_polkadot,
|
FX_polkadot,
|
||||||
FX_checker,
|
FX_checker,
|
||||||
] as const satisfies ImageEffectorFx<string, any>[];
|
] as const satisfies ImageEffectorFx<string, any>[];
|
||||||
|
|
||||||
export const WATERMARK_FXS = [
|
|
||||||
FX_watermarkPlacement,
|
|
||||||
FX_stripe,
|
|
||||||
FX_polkadot,
|
|
||||||
FX_checker,
|
|
||||||
] as const satisfies ImageEffectorFx<string, any>[];
|
|
||||||
|
|
|
@ -3,10 +3,20 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { WATERMARK_FXS } from './image-effector/fxs.js';
|
import { FX_watermarkPlacement } from '@/utility/image-effector/fxs/watermarkPlacement.js';
|
||||||
import type { ImageEffectorLayer } from '@/utility/image-effector/ImageEffector.js';
|
import { FX_stripe } from '@/utility/image-effector/fxs/stripe.js';
|
||||||
|
import { FX_polkadot } from '@/utility/image-effector/fxs/polkadot.js';
|
||||||
|
import { FX_checker } from '@/utility/image-effector/fxs/checker.js';
|
||||||
|
import type { ImageEffectorFx, ImageEffectorLayer } from '@/utility/image-effector/ImageEffector.js';
|
||||||
import { ImageEffector } from '@/utility/image-effector/ImageEffector.js';
|
import { ImageEffector } from '@/utility/image-effector/ImageEffector.js';
|
||||||
|
|
||||||
|
const WATERMARK_FXS = [
|
||||||
|
FX_watermarkPlacement,
|
||||||
|
FX_stripe,
|
||||||
|
FX_polkadot,
|
||||||
|
FX_checker,
|
||||||
|
] as const satisfies ImageEffectorFx<string, any>[];
|
||||||
|
|
||||||
export type WatermarkPreset = {
|
export type WatermarkPreset = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
|
Loading…
Reference in New Issue