chore(plugins): 同步标注插件 1.20.6(反白修正)
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m46s

This commit is contained in:
qiqi committed 2026-11-17 21:05:26 +08:00
1 parent 13a34073bd
commit 9283e76f1a
2 files changed
+20 -20

No files matched your search

+3 -3
View File
@@ -13,9 +13,9 @@
},
{
"id": "image-annotate",
"file": "plugin-image-annotate.2a8b070e9150.js",
"version": "1.20.5",
"integrity": "sha256-KosHDpFQs910KPsW1G91hhLX58Xh9oWcvyb8tbmYqnM="
"file": "plugin-image-annotate.7a865c7c353c.js",
"version": "1.20.6",
"integrity": "sha256-eoZcfDU8P7yqxVGorrWs0b9iTKJfEE25b85JPDCEsk8="
},
{
"id": "image-vectorize",
@@ -9,7 +9,7 @@
var __IWB_ANNOTATE_MANIFEST__ = {
id: 'image-annotate',
name: '标注 / 修图',
version: '1.20.5',
version: '1.20.6',
apiVersion: 1,
capabilities: ['commands', 'nodeActions', 'canvas', 'canvasWrite'],
settings: {
@@ -3901,29 +3901,16 @@ var __IWB_ANNOTATE_MANIFEST__ = {
render: (canvas, v) => {
if (v <= 0) return;
const k = v / 100;
if (!FILTER_SUPPORTED) {
const bright = 1 + 0.4 * k, contrast = 1 + 0.25 * k, sat = 1 + 0.2 * k;
mapPixels(canvas, (r, g, b) => {
const y = luma(r, g, b);
const out = [r, g, b].map((c) => {
let v2 = y + (c - y) * sat;
v2 = (v2 - 128) * contrast + 128;
return clamp255(v2 * bright);
});
return out;
});
return;
}
if (FILTER_SUPPORTED) {
filterCanvas(canvas, "invert(" + k + ")");
return;
}
const okInv = mapPixels(canvas, (r, g, b) => [
const ok = mapPixels(canvas, (r, g, b) => [
clamp255(r + (255 - 2 * r) * k),
clamp255(g + (255 - 2 * g) * k),
clamp255(b + (255 - 2 * b) * k)
]);
if (!okInv) blendFallback(canvas, "invert", k);
if (!ok) blendFallback(canvas, "invert", k);
}
},
gray: {
@@ -3961,7 +3948,20 @@ var __IWB_ANNOTATE_MANIFEST__ = {
render: (canvas, v) => {
if (v <= 0) return;
const k = v / 100;
filterCanvas(canvas, "brightness(" + (1 + 0.4 * k).toFixed(3) + ") contrast(" + (1 + 0.25 * k).toFixed(3) + ") saturate(" + (1 + 0.2 * k).toFixed(3) + ")");
if (FILTER_SUPPORTED) {
filterCanvas(canvas, "brightness(" + (1 + 0.4 * k).toFixed(3) + ") contrast(" + (1 + 0.25 * k).toFixed(3) + ") saturate(" + (1 + 0.2 * k).toFixed(3) + ")");
return;
}
const bright = 1 + 0.4 * k, contrast = 1 + 0.25 * k, sat = 1 + 0.2 * k;
mapPixels(canvas, (r, g, b) => {
const y = luma(r, g, b);
const out = [r, g, b].map((c) => {
let v2 = y + (c - y) * sat;
v2 = (v2 - 128) * contrast + 128;
return clamp255(v2 * bright);
});
return out;
});
}
},
contrast: {