1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-15 04:35:34 +02:00
Files
misskey/packages/frontend/src/utility/image-compositor-functions/mirror.ts
syuilo 4ba18690d7 feat(frontend): EXIFフレーム機能 (#16725)
* wip

* wip

* Update ImageEffector.ts

* Update image-label-renderer.ts

* Update image-label-renderer.ts

* wip

* Update image-label-renderer.ts

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update use-uploader.ts

* Update watermark.ts

* wip

* wu

* wip

* Update image-frame-renderer.ts

* wip

* wip

* Update image-frame-renderer.ts

* Create ImageCompositor.ts

* Update ImageCompositor.ts

* wip

* wip

* Update ImageEffector.ts

* wip

* Update use-uploader.ts

* wip

* wip

* wip

* wip

* Update fxs.ts

* wip

* wip

* wip

* Update CHANGELOG.md

* wip

* wip

* Update MkImageEffectorDialog.vue

* Update MkImageEffectorDialog.vue

* Update MkImageFrameEditorDialog.vue

* Update use-uploader.ts

* improve error handling

* Update use-uploader.ts

* 🎨

* wip

* wip

* lazy load

* lazy load

* wip

* wip

* wip
2025-11-06 20:25:17 +09:00

47 lines
1.2 KiB
TypeScript

/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import shader from './mirror.glsl';
import type { ImageEffectorUiDefinition } from '../image-effector/ImageEffector.js';
import { defineImageCompositorFunction } from '@/lib/ImageCompositor.js';
import { i18n } from '@/i18n.js';
export const fn = defineImageCompositorFunction<{
h: number;
v: number;
}>({
shader,
main: ({ gl, u, params }) => {
gl.uniform1i(u.h, params.h);
gl.uniform1i(u.v, params.v);
},
});
export const uiDefinition = {
name: i18n.ts._imageEffector._fxs.mirror,
params: {
h: {
label: i18n.ts.horizontal,
type: 'number:enum',
enum: [
{ value: -1 as const, icon: 'ti ti-arrow-bar-right' },
{ value: 0 as const, icon: 'ti ti-minus-vertical' },
{ value: 1 as const, icon: 'ti ti-arrow-bar-left' },
],
default: -1,
},
v: {
label: i18n.ts.vertical,
type: 'number:enum',
enum: [
{ value: -1 as const, icon: 'ti ti-arrow-bar-down' },
{ value: 0 as const, icon: 'ti ti-minus' },
{ value: 1 as const, icon: 'ti ti-arrow-bar-up' },
],
default: 0,
},
},
} satisfies ImageEffectorUiDefinition<typeof fn>;