package readers; import java.io.IOException; import java.io.InputStreamReader; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import java.awt.Color; import javax.imageio.metadata.IIOInvalidTreeException; public abstract class Reader{ int score; int rank; int[] notes = new int[7]; int difficulty; String title; int pct; int maxcombo; String other; List readRegions = new ArrayList<>(); final int TRANSPARENT = new Color(0,0,0,0).getRGB(); String readAllBoxes(Path img) { try { Process p = Runtime.getRuntime().exec(new String[]{"python3","runocr.py","ja",img.toAbsolutePath().toString()}); while (p.isAlive()); InputStreamReader result = new InputStreamReader(p.getInputStream()); StringBuilder sb = new StringBuilder(); while (result.ready()) { sb.append((char)result.read()); } result.close(); sb.append("\n"); p = Runtime.getRuntime().exec(new String[]{"python3","runocr.py","en",img.toAbsolutePath().toString()}); while (p.isAlive()); result = new InputStreamReader(p.getInputStream()); while (result.ready()) { sb.append((char)result.read()); } return sb.toString(); } catch (IOException e) { e.printStackTrace(); } return ""; } void trimAllData(String[] data) { StringBuilder sb = new StringBuilder(); for (int i=0;ifarthestRight?X:farthestRight; } void process(int[]arr,int width,int a,int b,int c,int d,int e,int f,int g,int h,int ii,int j,int k,int l) { final ColorRange TARGETCOLOR = new ColorRange(a,b,c,d,e,f); final ColorRange SEEKINGCOLOR = new ColorRange(g,h,ii,j,k,l); final Color FINALCOLOR = Color.MAGENTA; for (int i=0;i