色差问题优化

This commit is contained in:
hesuicong committed 2026-08-14 14:56:42 +08:00
1 parent 8577d13579
commit c49c3df5ad
1 file changed
+10 -2
+10 -2
View File
@@ -10406,9 +10406,17 @@ void MeshTexture::GlobalSeamLeveling3()
if (a == Color::ZERO)
continue;
Pixel8U& v = image.at<Pixel8U>(r,c);
// 替换原来的 RGB2YCBCR → 加减 → YCBCR2RGB 那段
const float maxAdjY = 25.0f;
const float maxAdjC = 12.0f;
Color clamped_a;
clamped_a[0] = CLAMP(a[0], -maxAdjY, maxAdjY);
clamped_a[1] = CLAMP(a[1], -maxAdjC, maxAdjC);
clamped_a[2] = CLAMP(a[2], -maxAdjC, maxAdjC);
const Color col(RGB2YCBCR(Color(v)));
const Color acol(YCBCR2RGB(Color(col+a)));
for (int p=0; p<3; ++p)
const Color acol(YCBCR2RGB(Color(col + clamped_a)));
for (int p = 0; p < 3; ++p)
v[p] = (uint8_t)CLAMP(ROUND2INT(acol[p]), 0, 255);
}
}