pdiff: Rip out unused ImgDiff code, (dropping -output option)

This commit is contained in:
Carl Worth 2006-12-14 00:42:52 -08:00
parent 4438fb6dca
commit 358645d6eb
5 changed files with 2 additions and 35 deletions

View file

@ -34,7 +34,6 @@ static const char *usage =
\t-threshold p : #pixels p below which differences are ignored\n\
\t-gamma g : Value to convert rgb into linear space (default 2.2)\n\
\t-luminance l : White luminance (default 100.0 cdm^-2)\n\
\t-output o.ppm : Write difference to the file o.ppm\n\
\n\
\n Note: Input files can also be in the PNG format\
\n";
@ -43,7 +42,6 @@ CompareArgs::CompareArgs()
{
ImgA = NULL;
ImgB = NULL;
ImgDiff = NULL;
Verbose = false;
FieldOfView = 45.0f;
Gamma = 2.2f;
@ -55,7 +53,6 @@ CompareArgs::~CompareArgs()
{
if (ImgA) delete ImgA;
if (ImgB) delete ImgB;
if (ImgDiff) delete ImgDiff;
}
bool CompareArgs::Parse_Args(int argc, char **argv)
@ -110,10 +107,6 @@ bool CompareArgs::Parse_Args(int argc, char **argv)
if (i + 1 < argc) {
Luminance = (float) atof(argv[i + 1]);
}
}else if (strstr(argv[i], "-output")) {
if (i + 1 < argc) {
ImgDiff = new RGBAImage(ImgA->Get_Width(), ImgA->Get_Height(), argv[i+1]);
}
}
}
} /* i */

View file

@ -33,7 +33,6 @@ public:
RGBAImage *ImgA; /* Image A */
RGBAImage *ImgB; /* Image B */
RGBAImage *ImgDiff; /* Diff image */
bool Verbose; /* Print lots of text or not */
float FieldOfView; /* Field of view in degrees */
float Gamma; /* The gamma to convert to linear color space */

View file

@ -274,17 +274,6 @@ int Yee_Compare_Images(RGBAImage *image_a,
}
if (!pass)
pixels_failed++;
#if IMAGE_DIFF_ENABLED
if (!pass) {
if (args.ImgDiff) {
args.ImgDiff->Set(255, 0, 0, 255, index);
}
} else {
if (args.ImgDiff) {
args.ImgDiff->Set(0, 0, 0, 255, index);
}
}
#endif
}
}

View file

@ -62,20 +62,6 @@ static bool Yee_Compare(CompareArgs &args)
args.ErrorStr = "Images are visibly different\n";
args.ErrorStr += different;
if (args.ImgDiff) {
#if IMAGE_DIFF_CODE_ENABLED
if (args.ImgDiff->WritePPM()) {
args.ErrorStr += "Wrote difference image to ";
args.ErrorStr+= args.ImgDiff->Get_Name();
args.ErrorStr += "\n";
} else {
args.ErrorStr += "Could not write difference image to ";
args.ErrorStr+= args.ImgDiff->Get_Name();
args.ErrorStr += "\n";
}
#endif
args.ErrorStr += "Generation of image \"difference\" is currently disabled\n";
}
return false;
}

View file

@ -36,10 +36,10 @@ a theatre has a field of view of around 25 degrees. Back row has a field of
-gamma g : The gamma to use to convert to RGB linear space. Default is 2.2
-luminance l: The luminance of the display the observer is seeing. Default
is 100 candela per meter squared
-output foo.ppm : Saves the difference image to foo.ppm
Credits
Hector Yee, project administrator and originator - hectorgon.blogspot.com
Scott Corley, for png file IO code
Mick Weiss, Linux build and release & QA
Mick Weiss, Linux build and release & QA
Carl Worth, Rewrite as library, depend on cairo, and port to C