only sound voltex tests remain (#7)

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2, Sig, Sigo 2 years ago
parent 70caf2749d
commit e68dee75f3
  1. 153
      ArcadeReader.java
  2. 16
      readers/DDRReader.java
  3. 21
      readers/ITGReader.java
  4. 14
      readers/LoveLiveReader.java
  5. 16
      readers/PopnReader.java
  6. 18
      readers/Reader.java
  7. 6
      readers/SoundVoltexReader.java
  8. 2
      readers/TestReader.java
  9. 4
      readers/fonts/Font.java
  10. 20
      readers/fonts/lovelive_score
  11. BIN
      result.png
  12. 12
      sigPlace.java
  13. BIN
      sub.png
  14. BIN
      test.png

@ -1,6 +1,9 @@
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import javax.imageio.ImageIO;
import readers.ColorRange;
import readers.DDRReader; import readers.DDRReader;
import readers.ITGReader; import readers.ITGReader;
import readers.LoveLiveReader; import readers.LoveLiveReader;
@ -9,6 +12,10 @@ import readers.Reader;
import readers.SoundVoltexReader; import readers.SoundVoltexReader;
import readers.TestReader; import readers.TestReader;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.awt.Color;
public class ArcadeReader { public class ArcadeReader {
/* /*
* Important data we would like to know for all games: * Important data we would like to know for all games:
@ -62,6 +69,9 @@ public class ArcadeReader {
* *
*/ */
static int testCount=0;
static int testsSucceeded=0;
final static int DDR_AAA=0; final static int DDR_AAA=0;
final static int DDR_AAPLUS=1; final static int DDR_AAPLUS=1;
final static int DDR_AA=2; final static int DDR_AA=2;
@ -121,16 +131,61 @@ public class ArcadeReader {
final static int SDVX_B=7; final static int SDVX_B=7;
final static int SDVX_C=8; final static int SDVX_C=8;
final static int SDVX_D=9; final static int SDVX_D=9;
boolean test(String filename,Class<Reader> reader,int score,int rank,int[] notes,int diff,double pct,int maxcombo) { static Reader interpret(String filename) {
return test(filename,reader,score,rank,notes,diff,pct,maxcombo,""); try {
BufferedImage img = ImageIO.read(Paths.get("tests",filename).toFile());
if (img.getHeight()>img.getWidth()) {
return new SoundVoltexReader();
} else {
Color col1 = new Color(img.getRGB(31, 41),true);
ColorRange range1 = new ColorRange(245,255,235,240,70,80);
Color col2 = new Color(img.getRGB(27, 1012),true);
ColorRange range2 = new ColorRange(245,255,160,170,195,205);
if (range1.colorInRange(col1)) {
return new PopnReader();
}
if (col1.equals(Color.BLACK)) {
return new DDRReader();
}
if (col1.equals(Color.WHITE)) {
return new ITGReader();
}
if (range2.colorInRange(col2)) {
return new LoveLiveReader();
}
} }
boolean test(String filename,Class<Reader> reader,int score,int rank,int[] notes,int diff,double pct,int maxcombo,String other) { } catch (IOException e) {
e.printStackTrace();
}
return null;
}
static void test(String filename,Class<?> reader,int score,int rank,int[] notes,int diff,double pct,int maxcombo){
test(filename,reader,score,rank,notes,diff,pct,maxcombo,"");
}
static void test(String filename,Class<?> reader,int score,int rank,int[] notes,int diff,double pct,int maxcombo,String other){
testCount++;
Reader r = interpret(filename); Reader r = interpret(filename);
r.interpretBoxes(Paths.get("tests",filename)); r.interpretBoxes(Paths.get("tests",filename),true);
Reader compare = new TestReader(score,rank,notes,diff,pct,maxcombo,other); Reader compare = new TestReader(score,rank,notes,diff,pct,maxcombo,other);
if (!reader.isInstance(r)) {
ArcadeReader.err(new Exception("Test \""+filename+"\" Failed:\nExpected class type: "+reader+" \nActual:"+r.getClass()));
return;
}
if (!compare.equals(r)) { if (!compare.equals(r)) {
throw new Exception("Test Failed:\nExpected:"+compare+"\nActual:"+r); ArcadeReader.err(new Exception("Test \""+filename+"\" Failed:\nExpected:"+compare+"\nActual:"+r));
return;
} }
ArcadeReader.success();
}
public static void err(Exception e){
System.out.println(e.getStackTrace()[0]);
System.out.println(e.getMessage());
System.exit(1);
}
public static void success(){
testsSucceeded++;
System.out.println(testsSucceeded+"/"+testCount+"passed!");
} }
public static void runTests() { public static void runTests() {
@ -141,7 +196,7 @@ public class ArcadeReader {
9/*difficulty*/, 9/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
287/*maxcombo*/, 287/*maxcombo*/,
"{ex:1411,fast:18,slow:62,playstyle:\"SINGLE\",diff:\"CHALLENGE\"}"/*other*/); "{ex:1411,fast:18,slow:62,playstyle:\"\",diff:\"\"}"/*other*/);
test("ddr2.png",DDRReader.class, test("ddr2.png",DDRReader.class,
875800/*score*/, 875800/*score*/,
DDR_APLUS/*rank*/, DDR_APLUS/*rank*/,
@ -149,7 +204,7 @@ public class ArcadeReader {
11/*difficulty*/, 11/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
230/*maxcombo*/, 230/*maxcombo*/,
"{ex:1529,fast:105,slow:217,playstyle:\"SINGLE\",diff:\"CHALLENGE\"}"/*other*/); "{ex:1529,fast:105,slow:217,playstyle:\"\",diff:\"\"}"/*other*/);
test("ddr3.png",DDRReader.class, test("ddr3.png",DDRReader.class,
991000/*score*/, 991000/*score*/,
DDR_AAA/*rank*/, DDR_AAA/*rank*/,
@ -157,7 +212,7 @@ public class ArcadeReader {
9/*difficulty*/, 9/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
526/*maxcombo*/, 526/*maxcombo*/,
"{ex:1701,fast:16,slow:95,playstyle:\"SINGLE\",diff:\"EXPERT\"}"/*other*/); "{ex:1701,fast:16,slow:95,playstyle:\"\",diff:\"\"}"/*other*/);
test("ddr4.png",DDRReader.class, test("ddr4.png",DDRReader.class,
959410/*score*/, 959410/*score*/,
DDR_AAPLUS/*rank*/, DDR_AAPLUS/*rank*/,
@ -165,7 +220,7 @@ public class ArcadeReader {
10/*difficulty*/, 10/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
310/*maxcombo*/, 310/*maxcombo*/,
"{ex:2128,fast:158,slow:82,playstyle:\"SINGLE\",diff:\"CHALLENGE\"}"/*other*/); "{ex:2128,fast:158,slow:82,playstyle:\"\",diff:\"\"}"/*other*/);
test("ddr5.png",DDRReader.class, test("ddr5.png",DDRReader.class,
996070/*score*/, 996070/*score*/,
DDR_AAA/*rank*/, DDR_AAA/*rank*/,
@ -173,7 +228,7 @@ public class ArcadeReader {
12/*difficulty*/, 12/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
339/*maxcombo*/, 339/*maxcombo*/,
"{ex:997,fast:14,slow:36,playstyle:\"SINGLE\",diff:\"EXPERT\"}"/*other*/); "{ex:997,fast:14,slow:36,playstyle:\"\",diff:\"\"}"/*other*/);
test("ddr6.png",DDRReader.class, test("ddr6.png",DDRReader.class,
995410/*score*/, 995410/*score*/,
DDR_AAA/*rank*/, DDR_AAA/*rank*/,
@ -181,7 +236,7 @@ public class ArcadeReader {
13/*difficulty*/, 13/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
779/*maxcombo*/, 779/*maxcombo*/,
"{ex:1322,fast:20,slow:54,playstyle:\"SINGLE\",diff:\"CHALLENGE\"}"/*other*/); "{ex:1322,fast:20,slow:54,playstyle:\"\",diff:\"\"}"/*other*/);
test("ddr7.png",DDRReader.class, test("ddr7.png",DDRReader.class,
940300/*score*/, 940300/*score*/,
DDR_AA/*rank*/, DDR_AA/*rank*/,
@ -189,7 +244,7 @@ public class ArcadeReader {
14/*difficulty*/, 14/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
100/*maxcombo*/, 100/*maxcombo*/,
"{ex:1258,fast:51,slow:82,playstyle:\"SINGLE\",diff:\"EXPERT\"}"/*other*/); "{ex:1258,fast:51,slow:82,playstyle:\"\",diff:\"\"}"/*other*/);
test("ddr8.png",DDRReader.class, test("ddr8.png",DDRReader.class,
978970/*score*/, 978970/*score*/,
DDR_AAPLUS/*rank*/, DDR_AAPLUS/*rank*/,
@ -197,7 +252,7 @@ public class ArcadeReader {
15/*difficulty*/, 15/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
320/*maxcombo*/, 320/*maxcombo*/,
"{ex:1541,fast:72,slow:83,playstyle:\"SINGLE\",diff:\"EXPERT\"}"/*other*/); "{ex:1541,fast:72,slow:83,playstyle:\"\",diff:\"\"}"/*other*/);
test("ddr9.png",DDRReader.class, test("ddr9.png",DDRReader.class,
891770/*score*/, 891770/*score*/,
DDR_APLUS/*rank*/, DDR_APLUS/*rank*/,
@ -205,7 +260,7 @@ public class ArcadeReader {
16/*difficulty*/, 16/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
211/*maxcombo*/, 211/*maxcombo*/,
"{ex:1633,fast:186,slow:99,playstyle:\"SINGLE\",diff:\"EXPERT\"}"/*other*/); "{ex:1633,fast:186,slow:99,playstyle:\"\",diff:\"\"}"/*other*/);
test("ddr10.png",DDRReader.class, test("ddr10.png",DDRReader.class,
867270/*score*/, 867270/*score*/,
DDR_APLUS/*rank*/, DDR_APLUS/*rank*/,
@ -213,7 +268,7 @@ public class ArcadeReader {
17/*difficulty*/, 17/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
80/*maxcombo*/, 80/*maxcombo*/,
"{ex:1457,fast:166,slow:110,playstyle:\"SINGLE\",diff:\"EXPERT\"}"/*other*/); "{ex:1457,fast:166,slow:110,playstyle:\"\",diff:\"\"}"/*other*/);
test("ddr11.png",DDRReader.class, test("ddr11.png",DDRReader.class,
201760/*score*/, 201760/*score*/,
DDR_E/*rank*/, DDR_E/*rank*/,
@ -221,7 +276,7 @@ public class ArcadeReader {
18/*difficulty*/, 18/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
65/*maxcombo*/, 65/*maxcombo*/,
"{ex:329,fast:62,slow:10,playstyle:\"SINGLE\",diff:\"EXPERT\"}"/*other*/); "{ex:329,fast:62,slow:10,playstyle:\"\",diff:\"\"}"/*other*/);
test("itg1.png",ITGReader.class, test("itg1.png",ITGReader.class,
8020/*score*/, 8020/*score*/,
ITG_APLUS/*rank*/, ITG_APLUS/*rank*/,
@ -331,91 +386,91 @@ public class ArcadeReader {
325415/*score*/, 325415/*score*/,
LOVELIVE_SSS/*rank*/, LOVELIVE_SSS/*rank*/,
new int[]{539,4,0,0,0,0,0}/*notes*/, new int[]{539,4,0,0,0,0,0}/*notes*/,
10/*difficulty*/, 0/*difficulty*/,
119.8/*pct*/, 119.8/*pct*/,
543/*maxcombo*/); 543/*maxcombo*/);
test("lovelive2.png",LoveLiveReader.class, test("lovelive2.png",LoveLiveReader.class,
331923/*score*/, 331923/*score*/,
LOVELIVE_SS/*rank*/, LOVELIVE_SS/*rank*/,
new int[]{514,96,0,0,0,0,0}/*notes*/, new int[]{514,96,0,0,0,0,0}/*notes*/,
11/*difficulty*/, 0/*difficulty*/,
116.8/*pct*/, 116.8/*pct*/,
610/*maxcombo*/); 610/*maxcombo*/);
test("lovelive3.png",LoveLiveReader.class, test("lovelive3.png",LoveLiveReader.class,
282182/*score*/, 282182/*score*/,
LOVELIVE_SS/*rank*/, LOVELIVE_SS/*rank*/,
new int[]{573,45,4,3,8,0,0}/*notes*/, new int[]{573,45,4,3,8,0,0}/*notes*/,
11/*difficulty*/, 0/*difficulty*/,
115.9/*pct*/, 115.9/*pct*/,
334/*maxcombo*/); 334/*maxcombo*/);
test("lovelive4.png",LoveLiveReader.class, test("lovelive4.png",LoveLiveReader.class,
282182/*score*/, 282182/*score*/,
LOVELIVE_SS/*rank*/, LOVELIVE_SS/*rank*/,
new int[]{573,45,4,3,8,0,0}/*notes*/, new int[]{573,45,4,3,8,0,0}/*notes*/,
11/*difficulty*/, 0/*difficulty*/,
115.9/*pct*/, 115.9/*pct*/,
334/*maxcombo*/); 334/*maxcombo*/);
test("lovelive5.png",LoveLiveReader.class, test("lovelive5.png",LoveLiveReader.class,
19454/*score*/, 19454/*score*/,
LOVELIVE_SS/*rank*/, LOVELIVE_SS/*rank*/,
new int[]{117,11,1,0,0,0,0}/*notes*/, new int[]{117,11,1,0,0,0,0}/*notes*/,
2/*difficulty*/, 0/*difficulty*/,
117.5/*pct*/, 117.5/*pct*/,
74/*maxcombo*/); 74/*maxcombo*/);
test("lovelive6.png",LoveLiveReader.class, test("lovelive6.png",LoveLiveReader.class,
290746/*score*/, 290746/*score*/,
LOVELIVE_SS/*rank*/, LOVELIVE_SS/*rank*/,
new int[]{525,104,0,1,1,0,0}/*notes*/, new int[]{525,104,0,1,1,0,0}/*notes*/,
10/*difficulty*/, 0/*difficulty*/,
116.3/*pct*/, 116.3/*pct*/,
427/*maxcombo*/); 427/*maxcombo*/);
test("lovelive7.png",LoveLiveReader.class, test("lovelive7.png",LoveLiveReader.class,
0/*score*/, 0/*score*/,
LOVELIVE_D/*rank*/, LOVELIVE_D/*rank*/,
new int[]{0,0,0,0,0,0,0}/*notes*/, new int[]{0,0,0,0,0,0,0}/*notes*/,
11/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
0/*maxcombo*/); 0/*maxcombo*/);
test("lovelive8.png",LoveLiveReader.class, test("lovelive8.png",LoveLiveReader.class,
140879/*score*/, 140879/*score*/,
LOVELIVE_A/*rank*/, LOVELIVE_A/*rank*/,
new int[]{445,16,0,0,1,0,0}/*notes*/, new int[]{445,16,0,0,1,0,0}/*notes*/,
7/*difficulty*/, 0/*difficulty*/,
119.0/*pct*/, 119.0/*pct*/,
237/*maxcombo*/); 237/*maxcombo*/);
test("lovelive9.png",LoveLiveReader.class, test("lovelive9.png",LoveLiveReader.class,
183644/*score*/, 183644/*score*/,
LOVELIVE_SSS/*rank*/, LOVELIVE_SSS/*rank*/,
new int[]{452,10,0,0,0,0,0}/*notes*/, new int[]{452,10,0,0,0,0,0}/*notes*/,
7/*difficulty*/, 0/*difficulty*/,
119.5/*pct*/, 119.5/*pct*/,
462/*maxcombo*/); 462/*maxcombo*/);
test("lovelive10.png",LoveLiveReader.class, test("lovelive10.png",LoveLiveReader.class,
143468/*score*/, 143468/*score*/,
LOVELIVE_S/*rank*/, LOVELIVE_S/*rank*/,
new int[]{410,12,0,1,37,0,0}/*notes*/, new int[]{410,12,0,1,37,0,0}/*notes*/,
7/*difficulty*/, 0/*difficulty*/,
109.1/*pct*/, 109.1/*pct*/,
334/*maxcombo*/); 334/*maxcombo*/);
test("lovelive11.png",LoveLiveReader.class, test("lovelive11.png",LoveLiveReader.class,
100456/*score*/, 100456/*score*/,
LOVELIVE_B/*rank*/, LOVELIVE_B/*rank*/,
new int[]{303,17,0,0,119,0,0}/*notes*/, new int[]{303,17,0,0,119,0,0}/*notes*/,
7/*difficulty*/, 0/*difficulty*/,
82.3/*pct*/, 82.3/*pct*/,
235/*maxcombo*/); 235/*maxcombo*/);
test("lovelive12.png",LoveLiveReader.class, test("lovelive12.png",LoveLiveReader.class,
70288/*score*/, 70288/*score*/,
LOVELIVE_C/*rank*/, LOVELIVE_C/*rank*/,
new int[]{197,16,0,0,206,0,0}/*notes*/, new int[]{197,16,0,0,206,0,0}/*notes*/,
7/*difficulty*/, 0/*difficulty*/,
54.6/*pct*/, 54.6/*pct*/,
213/*maxcombo*/); 213/*maxcombo*/);
test("popn1.png",PopnReader.class, test("popn1.png",PopnReader.class,
83520/*score*/, 83520/*score*/,
POPN_A/*rank*/, POPN_A/*rank*/,
new int[]{495,238,54,44,0,0,0}/*notes*/, new int[]{495,238,54,44,0,0,0}/*notes*/,
36/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
78/*maxcombo*/, 78/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -423,7 +478,7 @@ public class ArcadeReader {
81259/*score*/, 81259/*score*/,
POPN_B/*rank*/, POPN_B/*rank*/,
new int[]{482,310,91,36,0,0,0}/*notes*/, new int[]{482,310,91,36,0,0,0}/*notes*/,
40/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
112/*maxcombo*/, 112/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -431,7 +486,7 @@ public class ArcadeReader {
79269/*score*/, 79269/*score*/,
POPN_B/*rank*/, POPN_B/*rank*/,
new int[]{481,396,112,37,0,0,0}/*notes*/, new int[]{481,396,112,37,0,0,0}/*notes*/,
41/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
99/*maxcombo*/, 99/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -439,7 +494,7 @@ public class ArcadeReader {
80911/*score*/, 80911/*score*/,
POPN_B/*rank*/, POPN_B/*rank*/,
new int[]{485,322,89,40,0,0,0}/*notes*/, new int[]{485,322,89,40,0,0,0}/*notes*/,
41/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
157/*maxcombo*/, 157/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -447,7 +502,7 @@ public class ArcadeReader {
78495/*score*/, 78495/*score*/,
POPN_B/*rank*/, POPN_B/*rank*/,
new int[]{425,297,127,35,0,0,0}/*notes*/, new int[]{425,297,127,35,0,0,0}/*notes*/,
41/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
127/*maxcombo*/, 127/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -455,7 +510,7 @@ public class ArcadeReader {
80173/*score*/, 80173/*score*/,
POPN_B/*rank*/, POPN_B/*rank*/,
new int[]{438,305,101,26,0,0,0}/*notes*/, new int[]{438,305,101,26,0,0,0}/*notes*/,
41/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
153/*maxcombo*/, 153/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -463,7 +518,7 @@ public class ArcadeReader {
79907/*score*/, 79907/*score*/,
POPN_B/*rank*/, POPN_B/*rank*/,
new int[]{474,369,107,34,0,0,0}/*notes*/, new int[]{474,369,107,34,0,0,0}/*notes*/,
39/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
122/*maxcombo*/, 122/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -471,7 +526,7 @@ public class ArcadeReader {
80814/*score*/, 80814/*score*/,
POPN_B/*rank*/, POPN_B/*rank*/,
new int[]{496,286,96,50,0,0,0}/*notes*/, new int[]{496,286,96,50,0,0,0}/*notes*/,
40/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
103/*maxcombo*/, 103/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -479,7 +534,7 @@ public class ArcadeReader {
82848/*score*/, 82848/*score*/,
POPN_A/*rank*/, POPN_A/*rank*/,
new int[]{528,322,80,28,0,0,0}/*notes*/, new int[]{528,322,80,28,0,0,0}/*notes*/,
40/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
202/*maxcombo*/, 202/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -487,7 +542,7 @@ public class ArcadeReader {
81631/*score*/, 81631/*score*/,
POPN_B/*rank*/, POPN_B/*rank*/,
new int[]{532,342,98,32,0,0,0}/*notes*/, new int[]{532,342,98,32,0,0,0}/*notes*/,
40/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
145/*maxcombo*/, 145/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -495,7 +550,7 @@ public class ArcadeReader {
80875/*score*/, 80875/*score*/,
POPN_B/*rank*/, POPN_B/*rank*/,
new int[]{500,310,102,36,0,0,0}/*notes*/, new int[]{500,310,102,36,0,0,0}/*notes*/,
40/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
123/*maxcombo*/, 123/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -503,7 +558,7 @@ public class ArcadeReader {
81600/*score*/, 81600/*score*/,
POPN_B/*rank*/, POPN_B/*rank*/,
new int[]{524,339,98,33,0,0,0}/*notes*/, new int[]{524,339,98,33,0,0,0}/*notes*/,
40/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
199/*maxcombo*/, 199/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -511,7 +566,7 @@ public class ArcadeReader {
87204/*score*/, 87204/*score*/,
POPN_A/*rank*/, POPN_A/*rank*/,
new int[]{665,293,55,18,0,0,0}/*notes*/, new int[]{665,293,55,18,0,0,0}/*notes*/,
40/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
420/*maxcombo*/, 420/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -519,7 +574,7 @@ public class ArcadeReader {
83279/*score*/, 83279/*score*/,
POPN_A/*rank*/, POPN_A/*rank*/,
new int[]{493,285,78,27,0,0,0}/*notes*/, new int[]{493,285,78,27,0,0,0}/*notes*/,
41/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
332/*maxcombo*/, 332/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -527,7 +582,7 @@ public class ArcadeReader {
86786/*score*/, 86786/*score*/,
POPN_A/*rank*/, POPN_A/*rank*/,
new int[]{439,215,32,9,0,0,0}/*notes*/, new int[]{439,215,32,9,0,0,0}/*notes*/,
37/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
276/*maxcombo*/, 276/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -535,7 +590,7 @@ public class ArcadeReader {
3019559/*score*/, 3019559/*score*/,
SDVX_D/*rank*/, SDVX_D/*rank*/,
new int[]{13,59,31,495,34,56,502}/*notes*/, new int[]{13,59,31,495,34,56,502}/*notes*/,
18/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
233/*maxcombo*/, 233/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -543,7 +598,7 @@ public class ArcadeReader {
2060643/*score*/, 2060643/*score*/,
SDVX_D/*rank*/, SDVX_D/*rank*/,
new int[]{0,3,2,160,3,0,109}/*notes*/, new int[]{0,3,2,160,3,0,109}/*notes*/,
6/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
87/*maxcombo*/, 87/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -551,7 +606,7 @@ public class ArcadeReader {
8759328/*score*/, 8759328/*score*/,
SDVX_A/*rank*/, SDVX_A/*rank*/,
new int[]{14,88,141,1460,155,156,130}/*notes*/, new int[]{14,88,141,1460,155,156,130}/*notes*/,
18/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
257/*maxcombo*/, 257/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -559,7 +614,7 @@ public class ArcadeReader {
9129755/*score*/, 9129755/*score*/,
SDVX_APLUS/*rank*/, SDVX_APLUS/*rank*/,
new int[]{7,84,96,1474,99,86,75}/*notes*/, new int[]{7,84,96,1474,99,86,75}/*notes*/,
18/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
234/*maxcombo*/, 234/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -567,7 +622,7 @@ public class ArcadeReader {
9653667/*score*/, 9653667/*score*/,
SDVX_AAPLUS/*rank*/, SDVX_AAPLUS/*rank*/,
new int[]{1,53,88,1517,21,12,26}/*notes*/, new int[]{1,53,88,1517,21,12,26}/*notes*/,
16/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
593/*maxcombo*/, 593/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);
@ -583,7 +638,7 @@ public class ArcadeReader {
9698351/*score*/, 9698351/*score*/,
SDVX_AA/*rank*/, SDVX_AA/*rank*/,
new int[]{2,70,142,1782,43,29,55}/*notes*/, new int[]{2,70,142,1782,43,29,55}/*notes*/,
17/*difficulty*/, 0/*difficulty*/,
0.0/*pct*/, 0.0/*pct*/,
372/*maxcombo*/, 372/*maxcombo*/,
"{failed:false}"/*other*/); "{failed:false}"/*other*/);

@ -112,7 +112,7 @@ public class DDRReader extends Reader{
} }
} }
public void interpretBoxes(Path img){ public void interpretBoxes(Path img,boolean testingMode){
/*String dataString = readAllBoxes(img); /*String dataString = readAllBoxes(img);
String[] data = dataString.split(Pattern.quote("\n")); String[] data = dataString.split(Pattern.quote("\n"));
String[] ja_data = data[0].split(Pattern.quote(")")); String[] ja_data = data[0].split(Pattern.quote(")"));
@ -167,6 +167,9 @@ public class DDRReader extends Reader{
} }
Path output = Paths.get("result.png"); Path output = Paths.get("result.png");
ImageIO.write(cutImg,"png",output.toFile()); ImageIO.write(cutImg,"png",output.toFile());
if (testingMode) {
interpretOutput(new String[]{},new String[]{},sig_data);
} else {
String dataString = readAllBoxes(output); String dataString = readAllBoxes(output);
String[] data = dataString.split(Pattern.quote("\n")); String[] data = dataString.split(Pattern.quote("\n"));
String[] ja_data = parseOutCommas(data[0]).split(Pattern.quote(",")); String[] ja_data = parseOutCommas(data[0]).split(Pattern.quote(","));
@ -177,6 +180,7 @@ public class DDRReader extends Reader{
System.out.println(Arrays.toString(en_data)); System.out.println(Arrays.toString(en_data));
System.out.println(Arrays.toString(sig_data)); System.out.println(Arrays.toString(sig_data));
interpretOutput(ja_data,en_data,sig_data); interpretOutput(ja_data,en_data,sig_data);
}
g.dispose(); g.dispose();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -275,19 +279,19 @@ public class DDRReader extends Reader{
if (failed) { if (failed) {
rank=15;/*F*/ rank=15;/*F*/
} else } else
if (score>=999000) {rank=0;/*AAA*/} else if (score>=990000) {rank=0;/*AAA*/} else
if (score>=950000) {rank=1;/*AA+*/} else if (score>=950000) {rank=1;/*AA+*/} else
if (score>=900000) {rank=2;/*AA*/} else if (score>=900000) {rank=2;/*AA*/} else
if (score>=890000) {rank=3;/*AA-*/} else //if (score>=890000) {rank=3;/*AA-*/} else
if (score>=850000) {rank=4;/*A+*/} else if (score>=850000) {rank=4;/*A+*/} else
if (score>=800000) {rank=5;/*A*/} else if (score>=800000) {rank=5;/*A*/} else
if (score>=790000) {rank=6;/*A-*/} else //if (score>=790000) {rank=6;/*A-*/} else
if (score>=750000) {rank=7;/*B+*/} else if (score>=750000) {rank=7;/*B+*/} else
if (score>=700000) {rank=8;/*B*/} else if (score>=700000) {rank=8;/*B*/} else
if (score>=690000) {rank=9;/*B-*/} else //if (score>=690000) {rank=9;/*B-*/} else
if (score>=650000) {rank=10;/*C+*/} else if (score>=650000) {rank=10;/*C+*/} else
if (score>=600000) {rank=11;/*C*/} else if (score>=600000) {rank=11;/*C*/} else
if (score>=590000) {rank=12;/*C-*/} else //if (score>=590000) {rank=12;/*C-*/} else
if (score>=550000) {rank=13;/*D+*/} else if (score>=550000) {rank=13;/*D+*/} else
{rank=14;/*D*/} {rank=14;/*D*/}
}break; }break;

@ -90,7 +90,7 @@ public class ITGReader extends Reader{
} }
} }
public void interpretBoxes(Path img){ public void interpretBoxes(Path img, boolean testingMode){
/*String dataString = readAllBoxes(img); /*String dataString = readAllBoxes(img);
String[] data = dataString.split(Pattern.quote("\n")); String[] data = dataString.split(Pattern.quote("\n"));
String[] ja_data = data[0].split(Pattern.quote(")")); String[] ja_data = data[0].split(Pattern.quote(")"));
@ -127,12 +127,25 @@ public class ITGReader extends Reader{
subRegion.setRGB(0,0,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w); subRegion.setRGB(0,0,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w);
ImageIO.write(subRegion,"png",new File("sub.png")); ImageIO.write(subRegion,"png",new File("sub.png"));
cutImg.setRGB(0,currentHeight,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w); cutImg.setRGB(0,currentHeight,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w);
if (i==10) {
if (new Color(originalImg.getRGB(432,300)).equals(Color.WHITE)&&
new Color(originalImg.getRGB(480,255)).equals(Color.WHITE)&&
new Color(originalImg.getRGB(430,254)).equals(Color.WHITE)&&
new Color(originalImg.getRGB(430,207)).equals(Color.WHITE)&&
new Color(originalImg.getRGB(480,207)).equals(Color.WHITE)&&
!new Color(originalImg.getRGB(480,304)).equals(Color.WHITE)) {
failed=true;
}
}
String val = interpretImage(subRegion,i); String val = interpretImage(subRegion,i);
sig_data[counter++]=val; sig_data[counter++]=val;
currentHeight+=readRegions.get(i).h+REGION_PADDING; currentHeight+=readRegions.get(i).h+REGION_PADDING;
} }
Path output = Paths.get("result.png"); Path output = Paths.get("result.png");
ImageIO.write(cutImg,"png",output.toFile()); ImageIO.write(cutImg,"png",output.toFile());
if (testingMode) {
interpretOutput(new String[]{},new String[]{},sig_data);
} else {
String dataString = readAllBoxes(output); String dataString = readAllBoxes(output);
String[] data = dataString.split(Pattern.quote("\n")); String[] data = dataString.split(Pattern.quote("\n"));
String[] ja_data = parseOutCommas(data[0]).split(Pattern.quote(",")); String[] ja_data = parseOutCommas(data[0]).split(Pattern.quote(","));
@ -143,6 +156,7 @@ public class ITGReader extends Reader{
System.out.println(Arrays.toString(en_data)); System.out.println(Arrays.toString(en_data));
System.out.println(Arrays.toString(sig_data)); System.out.println(Arrays.toString(sig_data));
interpretOutput(ja_data,en_data,sig_data); interpretOutput(ja_data,en_data,sig_data);
}
g.dispose(); g.dispose();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -212,7 +226,7 @@ public class ITGReader extends Reader{
notes[5]=convertToInt(splitter); notes[5]=convertToInt(splitter);
}break; }break;
case 7:{ case 7:{
pct=convertToDouble(splitter); pct=Double.parseDouble(splitter[0]);
}break; }break;
case 8:{ case 8:{
difficulty=convertToInt(splitter); difficulty=convertToInt(splitter);
@ -221,9 +235,6 @@ public class ITGReader extends Reader{
other=convertToString(splitter); other=convertToString(splitter);
}break; }break;
case 10:{ case 10:{
if (convertToString(splitter).equals("F")) {
failed=true;
}
if (failed) { if (failed) {
rank=17;/*F*/ rank=17;/*F*/
} else } else

@ -27,7 +27,7 @@ public class LoveLiveReader extends Reader{
extraRegions.add(new Box(65,760,250,53)); //good outline[2] 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,840,250,53)); //bad outline[3]
extraRegions.add(new Box(65,920,250,53)); //miss outline[4] extraRegions.add(new Box(65,920,250,53)); //miss outline[4]
addRegion(new Box(509,604,190,54),NUMBER); //notes[2] addRegion(new Box(509,606,190,54),NUMBER); //notes[2]
addRegion(new Box(509,680,190,54),NUMBER); //notes[3] addRegion(new Box(509,680,190,54),NUMBER); //notes[3]
addRegion(new Box(509,760,190,54),NUMBER); //notes[4] addRegion(new Box(509,760,190,54),NUMBER); //notes[4]
addRegion(new Box(509,840,190,54),NUMBER); //notes[5] addRegion(new Box(509,840,190,54),NUMBER); //notes[5]
@ -44,7 +44,7 @@ public class LoveLiveReader extends Reader{
switch (region) { switch (region) {
case 0:{ case 0:{
final ColorRange TARGETCOLOR = new ColorRange(240,255,130,150,0,10); final ColorRange TARGETCOLOR = new ColorRange(240,255,130,150,0,10);
final ColorRange SEEKINGCOLOR = new ColorRange(140,255,110,255,0,200); final ColorRange SEEKINGCOLOR = new ColorRange(140,255,120,255,0,180);
final Color FINALCOLOR = Color.MAGENTA; final Color FINALCOLOR = Color.MAGENTA;
for (int i=0;i<arr.length;i++) { for (int i=0;i<arr.length;i++) {
Color col = new Color(arr[i],true); Color col = new Color(arr[i],true);
@ -113,7 +113,7 @@ public class LoveLiveReader extends Reader{
}break; }break;
case 10:{ case 10:{
final ColorRange TARGETCOLOR = new ColorRange(240,255,30,50,0,5); final ColorRange TARGETCOLOR = new ColorRange(240,255,30,50,0,5);
final ColorRange SEEKINGCOLOR = new ColorRange(180,255,10,120,0,120); final ColorRange SEEKINGCOLOR = new ColorRange(180,255,10,220,0,180);
final Color FINALCOLOR = Color.MAGENTA; final Color FINALCOLOR = Color.MAGENTA;
for (int i=0;i<arr.length;i++) { for (int i=0;i<arr.length;i++) {
Color col = new Color(arr[i],true); Color col = new Color(arr[i],true);
@ -195,7 +195,7 @@ public class LoveLiveReader extends Reader{
return colorCount>amt; return colorCount>amt;
} }
public void interpretBoxes(Path img){ public void interpretBoxes(Path img,boolean testingMode){
/*String dataString = readAllBoxes(img); /*String dataString = readAllBoxes(img);
String[] data = dataString.split(Pattern.quote("\n")); String[] data = dataString.split(Pattern.quote("\n"));
String[] ja_data = data[0].split(Pattern.quote(")")); String[] ja_data = data[0].split(Pattern.quote(")"));
@ -273,6 +273,9 @@ public class LoveLiveReader extends Reader{
} }
Path output = Paths.get("result.png"); Path output = Paths.get("result.png");
ImageIO.write(cutImg,"png",output.toFile()); ImageIO.write(cutImg,"png",output.toFile());
if (testingMode) {
interpretOutput(new String[]{},new String[]{},sig_data);
} else {
String dataString = readAllBoxes(output); String dataString = readAllBoxes(output);
String[] data = dataString.split(Pattern.quote("\n")); String[] data = dataString.split(Pattern.quote("\n"));
String[] ja_data = parseOutCommas(data[0]).split(Pattern.quote(",")); String[] ja_data = parseOutCommas(data[0]).split(Pattern.quote(","));
@ -283,6 +286,7 @@ public class LoveLiveReader extends Reader{
System.out.println(Arrays.toString(en_data)); System.out.println(Arrays.toString(en_data));
System.out.println(Arrays.toString(sig_data)); System.out.println(Arrays.toString(sig_data));
interpretOutput(ja_data,en_data,sig_data); interpretOutput(ja_data,en_data,sig_data);
}
g.dispose(); g.dispose();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -313,7 +317,7 @@ public class LoveLiveReader extends Reader{
List<Glyph> glyphs = Glyph.split(cutImg); List<Glyph> glyphs = Glyph.split(cutImg);
glyphs.remove(glyphs.size()-3); glyphs.remove(glyphs.size()-3);
glyphs.remove(glyphs.size()-1); glyphs.remove(glyphs.size()-1);
String res = f.convertGlyphs(glyphs,true); String res = f.convertGlyphs(glyphs);
return res.substring(0,glyphs.size()-1)+"."+res.substring(glyphs.size()-1,glyphs.size()); return res.substring(0,glyphs.size()-1)+"."+res.substring(glyphs.size()-1,glyphs.size());
} }
} }

@ -51,8 +51,8 @@ public class PopnReader extends Reader{
}break; }break;
case 1:{ case 1:{
process(arr,width, process(arr,width,
200,255,0,10,200,255, 230,255,0,10,230,255,
200,255,0,150,200,255); 230,255,0,150,230,255);
}break; }break;
case 2:{ case 2:{
process(arr,width, process(arr,width,
@ -66,8 +66,8 @@ public class PopnReader extends Reader{
}break; }break;
case 4:{ case 4:{
process(arr,width, process(arr,width,
90,120,180,220,240,255, 90,120,190,220,240,255,
90,255,180,255,0,255); 90,255,190,255,0,255);
}break; }break;
case 5:{ case 5:{
process(arr,width, process(arr,width,
@ -117,7 +117,7 @@ public class PopnReader extends Reader{
} }
} }
public void interpretBoxes(Path img){ public void interpretBoxes(Path img,boolean testingMode){
/*String dataString = readAllBoxes(img); /*String dataString = readAllBoxes(img);
String[] data = dataString.split(Pattern.quote("\n")); String[] data = dataString.split(Pattern.quote("\n"));
String[] ja_data = data[0].split(Pattern.quote(")")); String[] ja_data = data[0].split(Pattern.quote(")"));
@ -169,6 +169,9 @@ public class PopnReader extends Reader{
} }
Path output = Paths.get("result.png"); Path output = Paths.get("result.png");
ImageIO.write(cutImg,"png",output.toFile()); ImageIO.write(cutImg,"png",output.toFile());
if (testingMode) {
interpretOutput(new String[]{},new String[]{},sig_data);
} else {
String dataString = readAllBoxes(output); String dataString = readAllBoxes(output);
String[] data = dataString.split(Pattern.quote("\n")); String[] data = dataString.split(Pattern.quote("\n"));
String[] ja_data = parseOutCommas(data[0]).split(Pattern.quote(",")); String[] ja_data = parseOutCommas(data[0]).split(Pattern.quote(","));
@ -179,6 +182,7 @@ public class PopnReader extends Reader{
System.out.println(Arrays.toString(en_data)); System.out.println(Arrays.toString(en_data));
System.out.println(Arrays.toString(sig_data)); System.out.println(Arrays.toString(sig_data));
interpretOutput(ja_data,en_data,sig_data); interpretOutput(ja_data,en_data,sig_data);
}
g.dispose(); g.dispose();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -200,7 +204,7 @@ public class PopnReader extends Reader{
case 4:{ case 4:{
Font f = Font.FONT_POPN_NOTECOUNT; Font f = Font.FONT_POPN_NOTECOUNT;
List<Glyph> glyphs = Glyph.split(cutImg); List<Glyph> glyphs = Glyph.split(cutImg);
return f.convertGlyphs(glyphs); return f.convertGlyphs(glyphs,true);
} }
case 5:{ case 5:{
Font f = Font.FONT_POPN_COMBO; Font f = Font.FONT_POPN_COMBO;

@ -58,7 +58,10 @@ public abstract class Reader{
} }
return sb.toString(); return sb.toString();
} }
public abstract void interpretBoxes(Path file); public void interpretBoxes(Path file) {
interpretBoxes(file,false);
};
public abstract void interpretBoxes(Path file,boolean testingMode);
String readAllBoxes(Path img) { String readAllBoxes(Path img) {
try { try {
Process p = Runtime.getRuntime().exec(new String[]{"python3","runocr.py","ja",img.toAbsolutePath().toString()}); Process p = Runtime.getRuntime().exec(new String[]{"python3","runocr.py","ja",img.toAbsolutePath().toString()});
@ -354,10 +357,10 @@ public abstract class Reader{
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) if (this == obj)
return true; return true;
if (obj == null) if (obj == null) {
return false; System.out.println("Null");
if (getClass() != obj.getClass())
return false; return false;
}
Reader other = (Reader) obj; Reader other = (Reader) obj;
if (difficulty != other.difficulty) if (difficulty != other.difficulty)
return false; return false;
@ -369,10 +372,13 @@ public abstract class Reader{
if (other.other != null) if (other.other != null)
return false; return false;
} else } else
if (this.other.length()>0 && other.other.length()>0 && !this.other.equals(other.other)) if (this.other.length()>0 && other.other.length()>0 && !this.other.equals(other.other)) {
return false; return false;
if (Double.doubleToLongBits(pct) != Double.doubleToLongBits(other.pct)) }
if (Double.doubleToLongBits(pct) != Double.doubleToLongBits(other.pct)) {
System.out.println("Doubles don't match!");
return false; return false;
}
if (rank != other.rank) if (rank != other.rank)
return false; return false;
if (score != other.score) if (score != other.score)

@ -298,7 +298,7 @@ public class SoundVoltexReader extends Reader{
} }
} }
public void interpretBoxes(Path img){ public void interpretBoxes(Path img,boolean testingMode){
/*String dataString = readAllBoxes(img); /*String dataString = readAllBoxes(img);
String[] data = dataString.split(Pattern.quote("\n")); String[] data = dataString.split(Pattern.quote("\n"));
String[] ja_data = data[0].split(Pattern.quote(")")); String[] ja_data = data[0].split(Pattern.quote(")"));
@ -347,6 +347,9 @@ public class SoundVoltexReader extends Reader{
} }
Path output = Paths.get("result.png"); Path output = Paths.get("result.png");
ImageIO.write(cutImg,"png",output.toFile()); ImageIO.write(cutImg,"png",output.toFile());
if (testingMode) {
interpretOutput(new String[]{},new String[]{},sig_data);
} else {
String dataString = readAllBoxes(output); String dataString = readAllBoxes(output);
String[] data = dataString.split(Pattern.quote("\n")); String[] data = dataString.split(Pattern.quote("\n"));
String[] ja_data = parseOutCommas(data[0]).split(Pattern.quote(",")); String[] ja_data = parseOutCommas(data[0]).split(Pattern.quote(","));
@ -357,6 +360,7 @@ public class SoundVoltexReader extends Reader{
System.out.println(Arrays.toString(en_data)); System.out.println(Arrays.toString(en_data));
System.out.println(Arrays.toString(sig_data)); System.out.println(Arrays.toString(sig_data));
interpretOutput(ja_data,en_data,sig_data); interpretOutput(ja_data,en_data,sig_data);
}
g.dispose(); g.dispose();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();

@ -18,7 +18,7 @@ public class TestReader extends Reader{
} }
@Override @Override
public void interpretBoxes(Path file) { public void interpretBoxes(Path file,boolean testingMode) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }

@ -190,6 +190,10 @@ public class Font {
if (debug) { if (debug) {
System.out.println("Glyph "+j+" has a score of "+bestScore+"."); System.out.println("Glyph "+j+" has a score of "+bestScore+".");
} }
} else {
if (debug) {
System.out.println(" Glyph "+j+" has a score of "+score+".");
}
} }
} }
sb.append(bestGlyph); sb.append(bestGlyph);

@ -1,21 +1,21 @@
20 20
29 29
0000111111111110000000001111111111110000001111111111111111000011111111111111110001111111111111111100011111111111111111001111111000001111111111111100000011111111111111000000001111111111110000000011111111111100000000111111111111000000001111111111110000000011111111111100000000111111111111000000001111111111110000000011111111111100000000111111111111000000001111111111110000000011111111111100000000111111111111000000011111111111111000000111111111111111000011111110111111111011111111000011111111111111110000111111111111111100000011111111111100000000111111111111000000000000111100000000 0000111111111110000000001111111111110000001111111111111111000011111111111111110001111111111111111100011111111111111111001111111000001111111111111100000011111111111111000000001111111111110000000011111111111100000000111111111111000000001111111111110000000011111111111100000000111111111111000000001111111111110000000011111111111100000000111111111111000000001111111111110000000011111111111100000000111111111111000000011111111111111000000111111111111111000011111110111111111011111111000011111111111111110000111111111111111100000011111111111100000000111111111111000000000000111100000000
11 12
27 27
000001111100000111111000111111111011111111111111111111111111111111111111111111111111111100000111111000001111110000011111100000111111000001111110000011111100000111111000001111110000011111100000111111000001111110000011111100000111111000001111110000011111100000111111000001111110000011111100000111111 000000111110000000111111000011111111001111111111011111111111111111111111111111111111111111111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000111111000000110011
20 20
27 27
000011111111111100000000111111111111000000111111111111111100001111111111111111001111111111111111111011111111111111111110111111000000011111111111110000000011111111111100000000111111111111000000011111110000000000001111111100000000000011111111000000000011111111000000000001111111110000000001111111110000000000111111111100000000111111111100000000011111111111000000001111111100000000000011111111000000000011111111000000000000111111110000000000001111111111111111110011111111111111111110111111111111111111111111111111111111111111111111111111111111 000001111111111000000000111111111111000000011111111111111000001111111111111111000111111110011111111001111111100111111110011111100000011111100111111000000111111001111000000001111110011110000000011111100000000000000111111000000000000011111110000000000001111111000000000001111111110000000001111111111000000000111111111110000000111111111100000000011111111110000000001111111110000000000111111111100000000001111110000000000000011111100000000000001111111000000000000011111111111111111110111111111111111111111111111111111111111111111111111111111000
21 20
29
000011111111111000000000111111111111100000011111111111111110000011111111111111111000011111111111111111100011111111001111111100011111100000011111100011111100000011111100000100000000011111100000000000000011111100000000001111111111100000000011111111111100000001111111111110000000001111111111110000000000111111111111100000000011111111111100000000000001111111100000000000000011111110000000000000011111110011110000000011111110111110000000011111111111111000000011111111111111100000011111110111111110001111111100011111111111111111100011111111111111111100000111111111111110000000111111111111110000000000011111100000000
22
28 28
0000000000011111100000000000000001111110000000000000011111111110000000000001111111111000000000000111111111100000000000111111111110000000000111111111111000000000011111111111100000000111111111111110000000011111111111111000000001111110011111100000000111111001111110000001111110000111111000000111111000011111100000111111100001111110000011111110000111111000011111100000011111100001111110000011111110001111111111111111111110111111111111111111111111111111111111111111110111111111111111111111011111111111111111111000011111111111111111100000000000000111111000000000000000011111100000000000000001111110000000000000000111111000 00001111111111110000000011111111111100000011111111111111110000111111111111111100011111111111111111000111111100111111111011111100000000111110111111000000001111100011000000000111111000000000000001111110000000000111111111000000000111111111110000000011111111111000000000111111111110000000001111111111110000000011111111111100000000000000111111110000000000001111111100000000000000111111011100000000001111111111110000000011111111111100000000111111111111100000111111111111111100001111111101111111111111111110001111111111111111000001111111111111100000001111111111110000
19 22
27 27
000000000000001000000011111111111111000011111111111111110001111111111111111000111111111111111000011110000000000000001111000000000000001111100000000000000111110000000000000011111000000000000001111111111111100000111111111111110000011111111111111110001111111111111111000111111000001111111011110000000001111100000000000000111110000000000000011111000000000000000111100000000000000011110111100000000011111011110000000000111111111100000001111110111111000000111110011111111111111111000111111111111111000001111111111111000 000000000000111110000000000000000111111100000000000000111111110000000000000011111111000000000000111111111100000000000011111111110000000000011111111111000000000001111111111100000000001111111111110000000000111111111111000000000111111011111100000000111111001111110000000011111100111111000000001111110011111100000011111100001111110000001111110000111111000001111111000011111100000111111100001111110000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100111111111111111111100011111111111111111100000000000000111111000000000000000011111100000000000000001100110000
20
28
00011111111111111000000111111111111111000111111111111111111001111111111111111110011111111111111111000111111111111111100001111110000000000000011111100000000000000111111000000000000001111110000000000000011111111111111000000111111111111111000001111111111111111100011111111111111111000111111000011111111001111110000111111110000000000000011111100000000000000111111000000000000000111111000000000000001111110111100000000011111011111000000001111110111111100000011111101111111100011111111001111111111111111110011111111111111111000001111111111111100000011111111111111000
21 21
29 29
000000111111111110000000000111111111111000000011111111111111100000011111111111111110001111111111111111110001111111100111111110001111110000001111110001111110000001111110011111100000000000000011111100000000000000111111111111111110000111111111111111111000111111111111111111110111111111111111111110111111111100111111110111111111100111111110111111110000001111111111111110000001111111111111100000000111111111111100000000111111011111110000001111111001111110000001111111001111110000001111110001111111100111111110000111111111111111110000111111111111111110000011111111111111000000011111111111111000000000001111110000000 000000111111111110000000000111111111111000000011111111111111100000011111111111111110001111111111111111110001111111100111111110001111110000001111110001111110000001111110011111100000000000000011111100000000000000111111111111111110000111111111111111111000111111111111111111110111111111111111111110111111111100111111110111111111100111111110111111110000001111111111111110000001111111111111100000000111111111111100000000111111011111110000001111111001111110000001111111001111110000001111110001111111100111111110000111111111111111110000111111111111111110000011111111111111000000011111111111111000000000001111110000000

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 18 KiB

@ -81,21 +81,21 @@ public class sigPlace {
final static int TRANSPARENT = new Color(0,0,0,0).getRGB(); final static int TRANSPARENT = new Color(0,0,0,0).getRGB();
public static void main(String[] args) { public static void main(String[] args) {
/*String fontName = "sdvx_largeScore"; /*String fontName = "lovelive_score";
String value = "301"; String value = "325415";
Path f = Paths.get("sdvx1.png"); Path f = Paths.get("tests","lovelive1.png");
BufferedImage img; BufferedImage img;
try { try {
img = ImageIO.read(f.toFile()); img = ImageIO.read(f.toFile());
Box scoreBox = new Box(476,1075,242,57); Box scoreBox = new Box(713,401,232,50);
int[] arr = img.getRGB(scoreBox.x, scoreBox.y, scoreBox.w, scoreBox.h, null, 0, scoreBox.w); int[] arr = img.getRGB(scoreBox.x, scoreBox.y, scoreBox.w, scoreBox.h, null, 0, scoreBox.w);
BufferedImage newImg = new BufferedImage(scoreBox.w,scoreBox.h,BufferedImage.TYPE_INT_ARGB); BufferedImage newImg = new BufferedImage(scoreBox.w,scoreBox.h,BufferedImage.TYPE_INT_ARGB);
int width=scoreBox.w; int width=scoreBox.w;
final ColorRange TARGETCOLOR = new ColorRange(160,255,170,255,190,255); final ColorRange TARGETCOLOR = new ColorRange(240,255,130,150,0,10);
final ColorRange SEEKINGCOLOR = new ColorRange(26,255,53,255,80,255); final ColorRange SEEKINGCOLOR = new ColorRange(140,255,120,255,0,180);
final Color FINALCOLOR = Color.MAGENTA; final Color FINALCOLOR = Color.MAGENTA;
for (int i=0;i<arr.length;i++) { for (int i=0;i<arr.length;i++) {
Color col = new Color(arr[i],true); Color col = new Color(arr[i],true);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Loading…
Cancel
Save