feat(D.5.2): IconComposer effect-color + ReplaceColorWhite helpers
ReplaceColorWhite (retail SurfaceWindow::ReplaceColor 0x00441530): replaces only pure-white-opaque (RGBA 255,255,255,255) pixels in place. TryGetEffectColor: resolves the effect tile DID via ResolveEffectDid, decodes the RenderSurface, and returns the mean-opaque RGB as the tint color (divergence DR-2: exact retail color byte is decompiler-ambiguous). TryDecode: shared RenderSurface decode helper for the effect path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
75ac51ac23
commit
3e019e408a
2 changed files with 74 additions and 0 deletions
|
|
@ -126,4 +126,22 @@ public class IconComposerTests
|
|||
Assert.Equal(0x060011C5u, composer.ResolveEffectDid(0x1000u));
|
||||
Assert.Equal(0x060011C5u, composer.ResolveEffectDid(0x0000u));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReplaceColorWhite_replacesOnlyPureWhiteOpaque()
|
||||
{
|
||||
// 2x2: [white-opaque, red-opaque, white-transparent, white-opaque]
|
||||
var px = new byte[]
|
||||
{
|
||||
255,255,255,255, // pure white opaque → replaced
|
||||
255, 0, 0,255, // red → untouched
|
||||
255,255,255, 0, // white but alpha 0 → untouched (not 0xFFFFFFFF)
|
||||
255,255,255,255, // pure white opaque → replaced
|
||||
};
|
||||
IconComposer.ReplaceColorWhite(px, 2, 2, (10, 20, 30, 255));
|
||||
Assert.Equal(new byte[] { 10, 20, 30, 255 }, px[0..4]); // replaced
|
||||
Assert.Equal(new byte[] { 255, 0, 0, 255 }, px[4..8]); // untouched
|
||||
Assert.Equal(new byte[] { 255, 255, 255, 0 }, px[8..12]); // untouched
|
||||
Assert.Equal(new byte[] { 10, 20, 30, 255 }, px[12..16]); // replaced
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue