refactor: move some classes in package api to package core
This commit is contained in:
@@ -70,15 +70,15 @@ module.exports = function(__runtime__, scope){
|
||||
function getColorDetector(color, algorithm, threshold){
|
||||
switch(algorithm){
|
||||
case "rgb":
|
||||
return new com.stardust.autojs.runtime.api.image.ColorDetector.RGBDistanceDetector(color, threshold);
|
||||
return new com.stardust.autojs.core.image.ColorDetector.RGBDistanceDetector(color, threshold);
|
||||
case "equal":
|
||||
return new com.stardust.autojs.runtime.api.image.ColorDetector.EqualityDetector(color);
|
||||
return new com.stardust.autojs.core.image.ColorDetector.EqualityDetector(color);
|
||||
case "diff":
|
||||
return new com.stardust.autojs.runtime.api.image.ColorDetector.DifferenceDetector(color, threshold);
|
||||
return new com.stardust.autojs.core.image.ColorDetector.DifferenceDetector(color, threshold);
|
||||
case "rgb+":
|
||||
return new com.stardust.autojs.runtime.api.image.ColorDetector.WeightedRGBDistanceDetector(color, threshold);
|
||||
return new com.stardust.autojs.core.image.ColorDetector.WeightedRGBDistanceDetector(color, threshold);
|
||||
case "hs":
|
||||
return new com.stardust.autojs.runtime.api.image.ColorDetector.HSDistanceDetector(color, threshold);
|
||||
return new com.stardust.autojs.core.image.ColorDetector.HSDistanceDetector(color, threshold);
|
||||
}
|
||||
throw new Error("Unknown algorithm: " + algorithm);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user