Put main score texts together

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2, Sig, Sigo 2 years ago
parent 5ef1a4ae5a
commit 6c3f0f6041
  1. 117
      readers/SoundVoltexReader.java
  2. BIN
      result.png

@ -29,15 +29,15 @@ public class SoundVoltexReader extends Reader{
readRegions.add(new Box(617,1362,70,23)); //late critical[9]
readRegions.add(new Box(617,1393,70,23)); //late near[10]
readRegions.add(new Box(617,1424,70,23)); //late error[11]
readRegions.add(new Box(304,1364,70,23)); //max combo[12]
readRegions.add(new Box(188,1231,70,23)); //chip s-critical[13]
readRegions.add(new Box(188,1262,70,23)); //chip critical[14]
readRegions.add(new Box(188,1294,70,23)); //chip near[15]
readRegions.add(new Box(188,1324,70,23)); //chip error[16]
readRegions.add(new Box(266,1231,70,23)); //long s-critical[17]
readRegions.add(new Box(266,1324,70,23)); //long error[18]
readRegions.add(new Box(345,1231,70,23)); //vol s-critical[19]
readRegions.add(new Box(345,1324,70,23)); //vol error[20]
readRegions.add(new Box(188,1231,70,23)); //chip s-critical[12]
readRegions.add(new Box(188,1262,70,23)); //chip critical[13]
readRegions.add(new Box(188,1294,70,23)); //chip near[14]
readRegions.add(new Box(188,1324,70,23)); //chip error[15]
readRegions.add(new Box(266,1231,70,23)); //long s-critical[16]
readRegions.add(new Box(266,1324,70,23)); //long error[17]
readRegions.add(new Box(345,1231,70,23)); //vol s-critical[18]
readRegions.add(new Box(345,1324,70,23)); //vol error[19]
readRegions.add(new Box(304,1364,70,23)); //max combo[20]
readRegions.add(new Box(233,880,84,20)); //difficulty[21]
readRegions.add(new Box(875,1046,125,82)); //rating[22]
@ -53,7 +53,11 @@ public class SoundVoltexReader extends Reader{
extraRegions.add(new Box(62,1230,119,24)); //s-critical extra text[7]
extraRegions.add(new Box(62,1262,119,24)); //critical extra text[8]
extraRegions.add(new Box(62,1294,119,24)); //near extra text[9]
extraRegions.add(new Box(62,1325,119,24)); //miss extra text[10]
extraRegions.add(new Box(62,1325,119,24)); //error extra text[10]
extraRegions.add(new Box(62,1230,119,24)); //s-critical extra text[11]
extraRegions.add(new Box(62,1325,119,24)); //error extra text[12]
extraRegions.add(new Box(62,1230,119,24)); //s-critical extra text[13]
extraRegions.add(new Box(62,1325,119,24)); //error extra text[14]
}
void seek(int[]arr,int i,ColorRange SEEKCOLOR,Color FINALCOLOR,int width) {
@ -178,6 +182,72 @@ public class SoundVoltexReader extends Reader{
}
}
}break;
case 400:
case 401:
case 405:
case 406:
case 409:
case 410:
case 412:
case 414: //Error/Near
{
final ColorRange TARGETCOLOR = new ColorRange(240,255,240,255,240,255);
final ColorRange SEEKINGCOLOR = new ColorRange(120,255,120,255,120,255);
final Color FINALCOLOR = Color.MAGENTA;
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);
}
}
for (int i=0;i<arr.length;i++) {
Color col = new Color(arr[i],true);
if (!col.equals(Color.MAGENTA)) {
arr[i]=TRANSPARENT;
}
}
}break;
case 402:
case 404:
case 408: //Critical
{
final ColorRange TARGETCOLOR = new ColorRange(200,255,190,255,140,255);
final ColorRange SEEKINGCOLOR = new ColorRange(120,255,120,255,120,255);
final Color FINALCOLOR = Color.MAGENTA;
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);
}
}
for (int i=0;i<arr.length;i++) {
Color col = new Color(arr[i],true);
if (!col.equals(Color.MAGENTA)) {
arr[i]=TRANSPARENT;
}
}
}break;
case 403:
case 407:
case 411:
case 413: //S-Critical
{
final ColorRange TARGETCOLOR = new ColorRange(200,255,200,255,0,50);
final ColorRange SEEKINGCOLOR = new ColorRange(120,255,120,255,120,255);
final Color FINALCOLOR = Color.MAGENTA;
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);
}
}
for (int i=0;i<arr.length;i++) {
Color col = new Color(arr[i],true);
if (!col.equals(Color.MAGENTA)) {
arr[i]=TRANSPARENT;
}
}
}break;
}
}
@ -209,7 +279,32 @@ public class SoundVoltexReader extends Reader{
//System.out.println(Arrays.toString(arr));
ColorFilter(arr,i,readRegions.get(i).w);
//g.drawImage(originalImg, 0,currentHeight,readRegions.get(i).w,readRegions.get(i).h+currentHeight,readRegions.get(i).x, readRegions.get(i).y, readRegions.get(i).x+readRegions.get(i).w, readRegions.get(i).y+readRegions.get(i).h, null);
cutImg.setRGB(0,currentHeight,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w);
int leftMost=readRegions.get(i).w;
for (int j=0;j<arr.length;j++) {
if (arr[j]==Color.MAGENTA.getRGB()&&j%readRegions.get(i).w<leftMost) {
leftMost=j%readRegions.get(i).w;
}
}
if (i>=5&&i<=19) {
int[] arr2 = originalImg.getRGB(extraRegions.get(i-5).x, extraRegions.get(i-5).y, extraRegions.get(i-5).w, extraRegions.get(i-5).h, null, 0, extraRegions.get(i-5).w);
int rightMost=0;
ColorFilter(arr2,400+i-5,extraRegions.get(i-5).w);
for (int j=0;j<arr2.length;j++) {
if (arr2[j]==Color.MAGENTA.getRGB()&&j%extraRegions.get(i-5).w>rightMost) {
rightMost=j%extraRegions.get(i-5).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-5).w,extraRegions.get(i-5).h,arr2,0,extraRegions.get(i-5).w);
final int PADDING = 4;
for (int x=leftMost;x<readRegions.get(i).w;x++) {
for (int y=0;y<readRegions.get(i).h;y++) {
cutImg.setRGB(x+rightMost-leftMost+PADDING, y+currentHeight, arr[y*readRegions.get(i).w+x]);
}
}
} else {
cutImg.setRGB(0,currentHeight,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w);
}
currentHeight+=readRegions.get(i).h+REGION_PADDING;
}
Path output = Paths.get("result.png");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Loading…
Cancel
Save