ITG Number Parsing (#1)

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2 3 years ago
parent 7004f21e0c
commit 729432a693
  1. 2
      ArcadeReader.java
  2. 41
      readers/ITGReader.java
  3. 2
      readers/Reader.java
  4. BIN
      result.png
  5. 2
      sigPlace.java
  6. BIN
      sub.png

@ -59,6 +59,6 @@ public class ArcadeReader {
*
*/
public static void retrieveData(Path img) {
new DDRReader().interpretBoxes(img);
new ITGReader().interpretBoxes(img);
}
}

@ -2,6 +2,7 @@ package readers;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
@ -32,6 +33,7 @@ public class ITGReader extends Reader{
addRegion(new Box(344,393,266,36)); //playstyle[9]
addRegion(new Box(277,174,324,171)); //grade[10]
addRegion(new Box(632,106,656,43)); //songname[11]
init();
}
void ColorFilter(int[] arr,int region,int width) {
@ -82,7 +84,7 @@ public class ITGReader extends Reader{
case 11:{
process(arr,width,
180,255,180,255,180,255,
130,255,130,255,130,255);
150,255,150,255,150,255);
}break;
}
}
@ -140,7 +142,7 @@ public class ITGReader extends Reader{
System.out.println(Arrays.toString(ja_data));
System.out.println(Arrays.toString(en_data));
System.out.println(Arrays.toString(sig_data));
interpretOutput(ja_data,en_data);
//interpretOutput(ja_data,en_data);
g.dispose();
} catch (IOException e) {
e.printStackTrace();
@ -152,17 +154,32 @@ public class ITGReader extends Reader{
private String interpretImage(BufferedImage cutImg, int i) {
switch (i) {
case 0:{
Font f = Font.FONT_DDR_SCORE;
Font f = Font.FONT_ITG_EX;
List<Glyph> glyphs = Glyph.split(cutImg);
glyphs.remove(glyphs.size()-3);
String res = f.convertGlyphs(glyphs);
return res.substring(0,res.length()-2)+"."+res.substring(res.length()-2,res.length());
}
case 7:{
Font f = Font.FONT_ITG_PCT;
List<Glyph> glyphs = Glyph.split(cutImg);
glyphs.remove(glyphs.size()-3);
String res = f.convertGlyphs(glyphs);
return res.substring(0,res.length()-2)+"."+res.substring(res.length()-2,res.length());
}
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:{
Font f = Font.FONT_ITG_NOTECOUNT;
List<Glyph> glyphs = Glyph.split(cutImg);
return f.convertGlyphs(glyphs);
}
case 8:{
Font f = Font.FONT_ITG_DIFF;
List<Glyph> glyphs = Glyph.split(cutImg);
if (glyphs.size()==9) {
//This is a 1,000,000 score.
glyphs.remove(5);
glyphs.remove(1);
} else
if (glyphs.size()>4) {
//This is a XXX,XXX score.
glyphs.remove(3);
}
return f.convertGlyphs(glyphs);
}
}

@ -144,7 +144,7 @@ public abstract class Reader{
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) {
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)&&SEEKCOLOR.colorInRange(col)) {
farthestRight=seek(arr,i+x+y*width,SEEKCOLOR,FINALCOLOR,width,farthestRight);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

@ -115,7 +115,7 @@ public class sigPlace {
// TODO Auto-generated catch block
e.printStackTrace();
}*/
ArcadeReader.retrieveData(Paths.get("ddr5.png"));
ArcadeReader.retrieveData(Paths.get("itg11.png"));
/* Path secretFile = Paths.get(".clientsecret");
List<String> data;
try {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Loading…
Cancel
Save