|
|
|
@ -79,18 +79,18 @@ public class LoveLiveReader extends Reader{ |
|
|
|
|
case 9:{ |
|
|
|
|
final ColorRange TARGETCOLOR = new ColorRange(0,10,155,190,95,145); |
|
|
|
|
final ColorRange SEEKINGCOLOR = new ColorRange(0,200,155,240,95,240); |
|
|
|
|
final Color FINALCOLOR = Color.MAGENTA; |
|
|
|
|
final Color FINALCOLOR = Color.RED; |
|
|
|
|
for (int i=0;i<arr.length;i++) { |
|
|
|
|
Color col = new Color(arr[i],true); |
|
|
|
|
if (TARGETCOLOR.colorInRange(col)) { |
|
|
|
|
seek(arr,i,SEEKINGCOLOR,FINALCOLOR,width); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
final ColorRange SEEKINGCOLOR2 = new ColorRange(255,255,0,0,255,255); |
|
|
|
|
final ColorRange SEEKINGCOLOR2 = new ColorRange(255,255,0,0,0,0); |
|
|
|
|
final Color FINALCOLOR2 = new Color(TRANSPARENT,true); |
|
|
|
|
for (int x=0;x<width;x++) { |
|
|
|
|
//30 pixels from top.
|
|
|
|
|
if (arr[30*width+x]==Color.MAGENTA.getRGB()) { |
|
|
|
|
if (arr[30*width+x]==Color.RED.getRGB()) { |
|
|
|
|
System.out.println("Start Jump: "+x); |
|
|
|
|
x=seek(arr,30*width+x,SEEKINGCOLOR2,FINALCOLOR2,width,x); |
|
|
|
|
System.out.println("End Jump: "+x); |
|
|
|
@ -98,7 +98,7 @@ public class LoveLiveReader extends Reader{ |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<arr.length;i++) { |
|
|
|
|
Color col = new Color(arr[i],true); |
|
|
|
|
if (!col.equals(Color.MAGENTA)) { |
|
|
|
|
if (!col.equals(Color.RED)) { |
|
|
|
|
arr[i]=TRANSPARENT; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -210,6 +210,7 @@ public class LoveLiveReader extends Reader{ |
|
|
|
|
trimAllData(en_data); |
|
|
|
|
System.out.println(Arrays.toString(ja_data)); |
|
|
|
|
System.out.println(Arrays.toString(en_data)); |
|
|
|
|
interpretOutput(ja_data,en_data); |
|
|
|
|
g.dispose(); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
@ -217,4 +218,35 @@ public class LoveLiveReader extends Reader{ |
|
|
|
|
//System.out.println(data[0]);
|
|
|
|
|
//System.out.println(data[2]);
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
String interpretOutput(String[] jp_data,String[] en_data) { |
|
|
|
|
//[6, 0, 218, 0, 218, 48, 6, 48, 32 5 4 1 5, 0.9670235803680689]
|
|
|
|
|
//For each data point we want to first see if it's within the correct rectangular bounds and from there parse it as such.
|
|
|
|
|
double accuracy[] = new double[readRegions.size()]; |
|
|
|
|
for (int i=0;i<en_data.length;i+=11) { |
|
|
|
|
int spacing=0; |
|
|
|
|
for (int j=0;j<readRegions.size();j++) { |
|
|
|
|
if (Integer.parseInt(en_data[i+1])>=spacing&&Integer.parseInt(en_data[i+5])<=spacing+readRegions.get(j).h&& |
|
|
|
|
accuracy[j]<Double.parseDouble(en_data[i+9])) { |
|
|
|
|
System.out.print("["); |
|
|
|
|
for (int k=0;k<10;k++) { |
|
|
|
|
if (k!=0) { |
|
|
|
|
System.out.print(","); |
|
|
|
|
} |
|
|
|
|
System.out.print(en_data[i+k]); |
|
|
|
|
} |
|
|
|
|
System.out.print("]"); |
|
|
|
|
System.out.println(" belongs to region "+j+"."); |
|
|
|
|
accuracy[j]=Double.parseDouble(en_data[i+9]); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
spacing+=readRegions.get(j).h+REGION_PADDING; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<jp_data.length;i+=10) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |