# HG changeset patch # User russes02 # Date 1340793924 14400 # Wed Jun 27 06:45:24 2012 -0400 # Node ID aa44efb58ae3f63601576a56fb9a06dc77ba2744 # Parent 81b93601f332bcc320894389c1c5f01c97529fa5 Renamed executable to pdiff; executable now imports from repo. diff --git a/perceptualdiff/main.go b/pdiff/main.go rename from perceptualdiff/main.go rename to pdiff/main.go --- a/perceptualdiff/main.go +++ b/pdiff/main.go @@ -25,7 +25,7 @@ "flag" "fmt" "os" - "perceptualdiff" + pdiff "hg.germane-software.com/perceptualdiff.hg" ) const copyright = `PerceptualDiff Go version 1.0.0 @@ -39,24 +39,24 @@ ` func main() { - args := perceptualdiff.NewCompareArgs() + args := pdiff.NewCompareArgs() if !parse_Args(args) { os.Exit(-1) } - passed := perceptualdiff.Yee_Compare(args) + passed := pdiff.Yee_Compare(args) switch args.Result { default: fmt.Printf("library returned unknown result %d\n", args.Result) - case perceptualdiff.BINARY_IDENTICAL: + case pdiff.BINARY_IDENTICAL: fmt.Println("images are binary identical") - case perceptualdiff.DIMENSION_MISMATCH: + case pdiff.DIMENSION_MISMATCH: fmt.Println("image dimensions do not match: %v, %v", args.ImgA.Bounds(), args.ImgB.Bounds()) - case perceptualdiff.PERCEPTUALLY_INDISTINGUISHABLE: + case pdiff.PERCEPTUALLY_INDISTINGUISHABLE: fmt.Printf("images are perceptually indistinguishable; %d pixels differ\n", args.Differing) - case perceptualdiff.VISIBLY_DIFFERENT: + case pdiff.VISIBLY_DIFFERENT: fmt.Printf("images are visually different; %d pixels differ\n", args.Differing) } @@ -69,7 +69,7 @@ } -func parse_Args(c *perceptualdiff.CompareArgs) bool { +func parse_Args(c *pdiff.CompareArgs) bool { flag.BoolVar(&c.Verbose, "verbose", false, "Turns on verbose mode") flag.Float64Var(&c.FieldOfView, "fov", 45.0, "Field of view in degrees (0.1 to 89.9)") flag.UintVar(&c.ThresholdPixels, "threshold", 100, "#pixels p below which differences are ignored") @@ -93,19 +93,19 @@ } var err error - c.ImgA, err = perceptualdiff.ReadFromFile(flag.Arg(0)) + c.ImgA, err = pdiff.ReadFromFile(flag.Arg(0)) if err != nil { fmt.Printf("FAIL: Cannot open %s\n", flag.Arg(0)) return false } - c.ImgB, err = perceptualdiff.ReadFromFile(flag.Arg(1)) + c.ImgB, err = pdiff.ReadFromFile(flag.Arg(1)) if err != nil { fmt.Printf("FAIL: Cannot open %s\n", flag.Arg(1)) return false } if *output_file_name != "" { - c.ImgDiff = perceptualdiff.NewRGBAImage(c.ImgA.Bounds().Dx(), c.ImgA.Bounds().Dy(), *output_file_name) + c.ImgDiff = pdiff.NewRGBAImage(c.ImgA.Bounds().Dx(), c.ImgA.Bounds().Dy(), *output_file_name) } return true }