|
|
@ -2,6 +2,7 @@ package readers; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Graphics2D; |
|
|
|
import java.awt.Graphics2D; |
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.nio.file.Path; |
|
|
|
import java.nio.file.Path; |
|
|
|
import java.nio.file.Paths; |
|
|
|
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(344,393,266,36)); //playstyle[9]
|
|
|
|
addRegion(new Box(277,174,324,171)); //grade[10]
|
|
|
|
addRegion(new Box(277,174,324,171)); //grade[10]
|
|
|
|
addRegion(new Box(632,106,656,43)); //songname[11]
|
|
|
|
addRegion(new Box(632,106,656,43)); //songname[11]
|
|
|
|
|
|
|
|
init(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ColorFilter(int[] arr,int region,int width) { |
|
|
|
void ColorFilter(int[] arr,int region,int width) { |
|
|
@ -82,7 +84,7 @@ public class ITGReader extends Reader{ |
|
|
|
case 11:{ |
|
|
|
case 11:{ |
|
|
|
process(arr,width, |
|
|
|
process(arr,width, |
|
|
|
180,255,180,255,180,255, |
|
|
|
180,255,180,255,180,255, |
|
|
|
130,255,130,255,130,255); |
|
|
|
150,255,150,255,150,255); |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -140,7 +142,7 @@ public class ITGReader extends Reader{ |
|
|
|
System.out.println(Arrays.toString(ja_data)); |
|
|
|
System.out.println(Arrays.toString(ja_data)); |
|
|
|
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); |
|
|
|
//interpretOutput(ja_data,en_data);
|
|
|
|
g.dispose(); |
|
|
|
g.dispose(); |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
@ -152,17 +154,32 @@ public class ITGReader extends Reader{ |
|
|
|
private String interpretImage(BufferedImage cutImg, int i) { |
|
|
|
private String interpretImage(BufferedImage cutImg, int i) { |
|
|
|
switch (i) { |
|
|
|
switch (i) { |
|
|
|
case 0:{ |
|
|
|
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); |
|
|
|
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); |
|
|
|
return f.convertGlyphs(glyphs); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|