增加交并计算功能

This commit is contained in:
algotao
2025-11-05 16:41:06 +08:00
parent 869bae0a9e
commit 44d9206b9f
10 changed files with 950 additions and 12 deletions

View File

@@ -15,18 +15,18 @@ func RunHitTest(args ...string) error {
txtFile := fs.String("d", "", "device id filename")
bmpFile := fs.String("b", "", "bitmap filename")
stateFile := fs.String("s", "", "state filename for output")
outStateFile := fs.String("o", "", "state filename for output")
filter := fs.Bool("f", false, "filter for hit only")
if err := fs.Parse(args); err != nil {
return err
} else if fs.NArg() > 0 || *txtFile == "" || *bmpFile == "" || *stateFile == "" {
} else if fs.NArg() > 0 || *txtFile == "" || *bmpFile == "" || *outStateFile == "" {
fmt.Println(fs.NArg())
fs.Usage()
return nil
}
return hitTest(*txtFile, *bmpFile, *stateFile, *filter)
return hitTest(*txtFile, *bmpFile, *outStateFile, *filter)
}
func hitTest(txtFile, bmpFile, stateFile string, filter bool) error {