fix type
This commit is contained in:
parent
78d65ef3dd
commit
990be44d98
|
|
@ -20,7 +20,7 @@ export type ImageCompositorFunction<PS extends ImageCompositorFunctionParams = I
|
||||||
}) => void;
|
}) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ImageCompositorLayer<FNS extends Record<string, ImageCompositorFunction> = any> = {
|
export type ImageCompositorLayer<FNS extends Record<string, ImageCompositorFunction> = Record<string, ImageCompositorFunction>> = {
|
||||||
[K in keyof FNS]: {
|
[K in keyof FNS]: {
|
||||||
id: string;
|
id: string;
|
||||||
functionId: K;
|
functionId: K;
|
||||||
|
|
@ -219,7 +219,7 @@ export class ImageCompositor<FNS extends Record<string, ImageCompositorFunction<
|
||||||
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, resultTexture, 0);
|
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, resultTexture, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.renderLayer(layer, preTexture, isLast);
|
this.renderLayer(layer as ImageCompositorLayer, preTexture, isLast);
|
||||||
|
|
||||||
preTexture = resultTexture;
|
preTexture = resultTexture;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { FXS } from './fxs.js';
|
import { FXS } from './fxs.js';
|
||||||
import type { ImageCompositorFunction, ImageCompositorLayer } from '@/lib/ImageCompositor.js';
|
import type { ImageCompositorFunction } from '@/lib/ImageCompositor.js';
|
||||||
import { ImageCompositor } from '@/lib/ImageCompositor.js';
|
import { ImageCompositor } from '@/lib/ImageCompositor.js';
|
||||||
|
|
||||||
export type ImageEffectorRGB = [r: number, g: number, b: number];
|
export type ImageEffectorRGB = [r: number, g: number, b: number];
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export const fn = defineImageCompositorFunction<Partial<{
|
||||||
gl.uniform1i(u.noBBoxExpansion, params.noBoundingBoxExpansion ? 1 : 0);
|
gl.uniform1i(u.noBBoxExpansion, params.noBoundingBoxExpansion ? 1 : 0);
|
||||||
|
|
||||||
// ウォーターマークテクスチャ
|
// ウォーターマークテクスチャ
|
||||||
const wm = textures.get(params.watermark);
|
const wm = params.watermark ? textures.get(params.watermark) : null;
|
||||||
if (wm) {
|
if (wm) {
|
||||||
gl.activeTexture(gl.TEXTURE1);
|
gl.activeTexture(gl.TEXTURE1);
|
||||||
gl.bindTexture(gl.TEXTURE_2D, wm.texture);
|
gl.bindTexture(gl.TEXTURE_2D, wm.texture);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue