Changeset - 4b8c1db26558
[Not reviewed]
default
0 1 0
Jason Maltzen - 3 years ago 2021-09-09 23:57:46
jason@hiddenachievement.com
Check explicitly for a white shift before trying to apply the white shift clipping logic.
1 file changed with 19 insertions and 3 deletions:
0 comments (0 inline, 0 general)
Models/ReactionTest.cs
Show inline comments
...
 
@@ -218,3 +218,19 @@ namespace DesertPaintCodex.Models
 
                        // still extrapolate the reaction, based on the available information.
 
                        if (!testing3Way && (reaction != null))
 
                        bool isWhiteShift = (reaction != null) && Clipped switch
 
                        {
 
                            ClipType.RedLow => (reaction.Blue == reaction.Green) && (reaction.Blue != 0),
 
                            ClipType.RedHigh => (reaction.Blue == reaction.Green) && (reaction.Blue != 0),
 
                            ClipType.BlueLow => (reaction.Red == reaction.Green) && (reaction.Red != 0),
 
                            ClipType.BlueHigh => (reaction.Red == reaction.Green) && (reaction.Red != 0),
 
                            ClipType.GreenLow => (reaction.Red == reaction.Blue) && (reaction.Red != 0),
 
                            ClipType.GreenHigh => (reaction.Red == reaction.Blue) && (reaction.Red != 0),
 
                            ClipType.RedLow|ClipType.BlueLow => (reaction.Green < 0),
 
                            ClipType.RedLow|ClipType.GreenLow => (reaction.Blue < 0),
 
                            ClipType.BlueLow|ClipType.GreenLow => (reaction.Red < 0),
 
                            ClipType.RedHigh | ClipType.BlueHigh => (reaction.Green > 0),
 
                            ClipType.RedHigh | ClipType.GreenHigh => (reaction.Blue > 0),
 
                            ClipType.BlueHigh | ClipType.GreenHigh => (reaction.Red > 0),
 
                            _ => false
 
                        };
 
                        if (!testing3Way && (reaction != null) && isWhiteShift)
 
                        {
...
 
@@ -228,3 +244,3 @@ namespace DesertPaintCodex.Models
 
                                if (!extrapolated) extrapolated = ExtrapolateWhiteFromOneChannel(_observedColor.Green, 0, reaction.Green);
 
                                if (!extrapolated)                ExtrapolateWhiteFromOneChannel(_observedColor.Blue,  0, reaction.Blue);
 
                                if (!extrapolated) extrapolated = ExtrapolateWhiteFromOneChannel(_observedColor.Blue,  0, reaction.Blue);
 
                            }
...
 
@@ -237,3 +253,3 @@ namespace DesertPaintCodex.Models
 
                                if (!extrapolated) extrapolated = ExtrapolateWhiteFromOneChannel(_observedColor.Green, 255, reaction.Green);
 
                                if (!extrapolated)                ExtrapolateWhiteFromOneChannel(_observedColor.Blue,  255, reaction.Blue);
 
                                if (!extrapolated) extrapolated = ExtrapolateWhiteFromOneChannel(_observedColor.Blue,  255, reaction.Blue);
 
                            }
0 comments (0 inline, 0 general)