package readers; import java.io.IOException; import java.io.InputStreamReader; import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.regex.Pattern; import java.awt.Color; public abstract class Reader{ final static int REGION_PADDING = 32; final static boolean NUMBER = true; int score; int rank; int[] notes = new int[7]; int difficulty; String title=""; double pct; int maxcombo; String other=""; String[] sig_data; List readRegions = new ArrayList<>(); int sig_data_size = 0; final int TRANSPARENT = new Color(0,0,0,0).getRGB(); protected void addRegion(Box box) { addRegion(box,false); } protected void addRegion(Box box,boolean isNumb) { readRegions.add(box); if (isNumb) { sig_data_size++; } } protected void init() { sig_data = new String[readRegions.size()]; } String parseOutCommas(String str) { StringBuilder sb = new StringBuilder(); boolean insideStr = false; char escapeChar = '\''; for (int i=0;i=spacing&&midpoint<=spacing+readRegions.get(j).h+REGION_PADDING /*&&accuracy[j]accuracy[j]) { accuracy[j]=Double.parseDouble(en_data[i+9]); } break; } spacing+=readRegions.get(j).h+REGION_PADDING; } } for (int i=0;i=spacing&&midpoint<=spacing+readRegions.get(j).h+REGION_PADDING &&accuracy[j]=0&&newY>=0&&newXfarthestRight?X:farthestRight; } void seekThreshold(int[]arr,int i,int threshold,Color FINALCOLOR,int width) { seekThreshold(arr,i,threshold,FINALCOLOR,width,0); } int seekThreshold(int[]arr,int i,int threshold,Color FINALCOLOR,int width,int farthestRight) { arr[i]=FINALCOLOR.getRGB(); int X = i%width; for (int x=-1;x<=1;x++) { for (int y=-1;y<=1;y++) { int newX=(i+x+y*width)%width; int newY=(i+x+y*width)/width; if (newX>=0&&newY>=0&&newX<=width&&newY<=arr.length/width) { Color col = new Color(arr[i+x+y*width]); if (!col.equals(Color.MAGENTA)&&colorIsBright(col, threshold)) { farthestRight=seekThreshold(arr,i+x+y*width,threshold,FINALCOLOR,width,farthestRight); } } } } return X>farthestRight?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;ibrightnessThreshold; } void processBrightness(int[]arr,int width,int threshold1,int threshold2) { final Color FINALCOLOR = Color.MAGENTA; for (int i=0;i>> 32)); result = prime * result + rank; result = prime * result + score; result = prime * result + ((title == null) ? 0 : title.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Reader other = (Reader) obj; if (difficulty != other.difficulty) return false; if (maxcombo != other.maxcombo) return false; if (!Arrays.equals(notes, other.notes)) return false; if (this.other == null) { if (other.other != null) return false; } else if (this.other.length()>0 && other.other.length()>0 && !this.other.equals(other.other)) return false; if (Double.doubleToLongBits(pct) != Double.doubleToLongBits(other.pct)) return false; if (rank != other.rank) return false; if (score != other.score) return false; return true; } }