diff --git a/ArcadeReader.java b/ArcadeReader.java index 4a767c4..8c484b5 100644 --- a/ArcadeReader.java +++ b/ArcadeReader.java @@ -102,9 +102,16 @@ class Box{ } class LoveLiveReader extends Reader{ final static int REGION_PADDING = 32; + List extraRegions = new ArrayList<>(); + static int lastJump=0; LoveLiveReader(){ readRegions.add(new Box(713,401,232,50)); //score[0] readRegions.add(new Box(613,290,65,36)); //rank[1] + extraRegions.add(new Box(65,604,250,53)); //perfect outline[0] + extraRegions.add(new Box(65,680,250,53)); //great outline[1] + extraRegions.add(new Box(65,760,250,53)); //good outline[2] + extraRegions.add(new Box(65,840,250,53)); //bad outline[3] + extraRegions.add(new Box(65,920,250,53)); //miss outline[4] readRegions.add(new Box(509,604,190,54)); //notes[2] readRegions.add(new Box(509,680,190,54)); //notes[3] readRegions.add(new Box(509,760,190,54)); //notes[4] @@ -117,14 +124,20 @@ class LoveLiveReader extends Reader{ } void seek(int[]arr,int i,ColorRange SEEKCOLOR,Color FINALCOLOR,int width) { + seek(arr,i,SEEKCOLOR,FINALCOLOR,width,0); + } + + int seek(int[]arr,int i,ColorRange SEEKCOLOR,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++) { if (SEEKCOLOR.colorInRange(new Color(arr[i+x+y*width]))) { - seek(arr,i+x+y*width,SEEKCOLOR,FINALCOLOR,width); + farthestRight=seek(arr,i+x+y*width,SEEKCOLOR,FINALCOLOR,width,farthestRight); } } } + return X>farthestRight?X:farthestRight; } void ColorFilter(int[] arr,int region,int width) { @@ -147,6 +160,93 @@ class LoveLiveReader extends Reader{ } } }break; + case 2: + case 3: + case 4: + case 5: + case 6: + case 8:{ + final ColorRange TARGETCOLOR = new ColorRange(255,255,255,255,255,255); + final ColorRange SEEKINGCOLOR = new ColorRange(240,255,240,255,240,255); + final Color FINALCOLOR = Color.MAGENTA; + for (int i=0;i=2&&i<=6) { + int[] arr2 = originalImg.getRGB(extraRegions.get(i-2).x, extraRegions.get(i-2).y, extraRegions.get(i-2).w, extraRegions.get(i-2).h, null, 0, extraRegions.get(i-2).w); + int rightMost=0; + ColorFilter(arr2,400+i-2,extraRegions.get(i-2).w); + for (int j=0;jrightMost) { + rightMost=j%extraRegions.get(i-2).w; + } + } + //cutImg.setRGB(rightMost-leftMost,currentHeight,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w); + cutImg.setRGB(0,currentHeight,extraRegions.get(i-2).w,extraRegions.get(i-2).h,arr2,0,extraRegions.get(i-2).w); + final int PADDING = 8; + for (int x=leftMost;x