Changeset - eee2a6a0c86b
[Not reviewed]
default
0 3 0
Jason Maltzen (jmaltzen) - 9 years ago 2016-03-04 06:23:05
jason.maltzen@unsanctioned.net
Loosen checks on testing for papyrus texture some more. Allow for a bit of error there, as long as everything else checks out.
3 files changed with 20 insertions and 17 deletions:
0 comments (0 inline, 0 general)
MainWindow.cs
Show inline comments
...
 
@@ -31,3 +31,3 @@ public partial class MainWindow : Gtk.Wi
 
{
 
    const string APP_VERSION = "1.7.13";
 
    const string APP_VERSION = "1.7.14";
 

	
ReactionRecorder.cs
Show inline comments
...
 
@@ -98,4 +98,4 @@ namespace DesertPaintLab
 
            bool isDarkPixel = false;
 
            bool isPapyAbove = false;
 
            bool isPapyBelow = false;
 
            //bool isPapyAbove = false;
 
            //bool isPapyBelow = false;
 

	
...
 
@@ -104,12 +104,13 @@ namespace DesertPaintLab
 
            
 
            // 2.) Check the pixel above it to see if it's from the papy texture.
 
            int otherPixelStart = testPixelStart - stride;
 
            isPapyAbove = ((otherPixelStart >= 0) &&
 
                IsPapyTexture(pixBytes[otherPixelStart++], pixBytes[otherPixelStart++], pixBytes[otherPixelStart]));
 
            //// 2.) Check the pixel above it to see if it's from the papy texture.
 
            //int otherPixelStart = testPixelStart - stride;
 
            //isPapyAbove = ((otherPixelStart >= 0) &&
 
            //    IsPapyTexture(pixBytes[otherPixelStart++], pixBytes[otherPixelStart++], pixBytes[otherPixelStart]));
 

	
 
            // 3.) Check the pixel below where the swatch should be to see if it's also from the papy texture.
 
            otherPixelStart = testPixelStart + (stride * swatchHeight);
 
            isPapyBelow = (IsPapyTexture(pixBytes[otherPixelStart++], pixBytes[otherPixelStart++], pixBytes[otherPixelStart]));
 
            //// 3.) Check the pixel below where the swatch should be to see if it's also from the papy texture.
 
            //otherPixelStart = testPixelStart + (stride * swatchHeight);
 
            //isPapyBelow = (IsPapyTexture(pixBytes[otherPixelStart++], pixBytes[otherPixelStart++], pixBytes[otherPixelStart]));
 

	
 
            bool result = isDarkPixel && isPapyAbove && isPapyBelow;
 
            //bool result = isDarkPixel && isPapyAbove && isPapyBelow;
 
            bool result = isDarkPixel;
 

	
...
 
@@ -124,3 +125,3 @@ namespace DesertPaintLab
 
            {
 
                otherPixelStart = testPixelStart + (stride * i);
 
                int otherPixelStart = testPixelStart + (stride * i);
 
                result &= IsColorMatch(pixBytes[otherPixelStart], pixBytes[otherPixelStart+1], pixBytes[otherPixelStart+2], r, g, b);
...
 
@@ -143,3 +144,4 @@ namespace DesertPaintLab
 

	
 
            // test the dark top border and for papyrus below the swatch
 
            // test the dark top border and for papyrus above and below the swatch
 
            int papyErrorCount = 0;
 
            for (int i = 0; result && (i < swatchWidth); ++i)
...
 
@@ -149,5 +151,6 @@ namespace DesertPaintLab
 
                otherPixelStart = otherPixelStart - stride;
 
                result &= IsPapyTexture(pixBytes[otherPixelStart], pixBytes[otherPixelStart+1], pixBytes[otherPixelStart+2]);
 
                papyErrorCount += (IsPapyTexture(pixBytes[otherPixelStart], pixBytes[otherPixelStart+1], pixBytes[otherPixelStart+2]) ? 1 : 0);
 
                otherPixelStart = testPixelStart + (stride * swatchHeight) + (3 * i);
 
                result &= IsPapyTexture(pixBytes[otherPixelStart], pixBytes[otherPixelStart+1], pixBytes[otherPixelStart+2]);
 
                papyErrorCount += (IsPapyTexture(pixBytes[otherPixelStart], pixBytes[otherPixelStart+1], pixBytes[otherPixelStart+2]) ? 1 : 0);
 
                result &= (papyErrorCount < (swatchWidth / 20)); // allow up to 5% error rate checking for papy texture, because this seems to be inconsistent
 
            }
...
 
@@ -189,3 +192,3 @@ namespace DesertPaintLab
 
                        colorMatch = true;
 
                        for (int i = 1; i < swatchHeight - 2; ++i)
 
                        for (int i = 2; i < swatchHeight - (2 * pixelMultiplier); ++i)
 
                        {
gtk-gui/MainWindow.cs
Show inline comments
...
 
@@ -94,3 +94,3 @@ public partial class MainWindow
 
		this.RecipeGeneratorAction = new global::Gtk.RadioAction ("RecipeGeneratorAction", "Recipe Generator", null, null, 0);
 
		this.RecipeGeneratorAction.Group = this.SimulatorAction.Group;
 
		this.RecipeGeneratorAction.Group = this.CaptureAction.Group;
 
		this.RecipeGeneratorAction.ShortLabel = "Recipe Generator";
0 comments (0 inline, 0 general)