|
|
|
@ -76,9 +76,94 @@ public class SoundVoltexReader extends Reader{ |
|
|
|
|
void ColorFilter(int[] arr,int region,int width) { |
|
|
|
|
final int TRANSPARENT = new Color(0,0,0,0).getRGB(); |
|
|
|
|
switch (region) { |
|
|
|
|
case 999:{ |
|
|
|
|
final ColorRange TARGETCOLOR = new ColorRange(240,255,130,150,0,10); |
|
|
|
|
final ColorRange SEEKINGCOLOR = new ColorRange(140,255,110,255,0,200); |
|
|
|
|
case 0:{ |
|
|
|
|
final ColorRange TARGETCOLOR = new ColorRange(240,255,240,255,240,255); |
|
|
|
|
final ColorRange SEEKINGCOLOR = new ColorRange(100,255,100,255,100,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 1: |
|
|
|
|
case 2:{ |
|
|
|
|
final ColorRange TARGETCOLOR = new ColorRange(160,255,170,255,190,255); |
|
|
|
|
final ColorRange SEEKINGCOLOR = new ColorRange(26,255,53,255,80,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 3:{ |
|
|
|
|
final ColorRange TARGETCOLOR = new ColorRange(230,255,180,255,20,255); |
|
|
|
|
final ColorRange SEEKINGCOLOR = new ColorRange(130,255,100,255,15,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 4: |
|
|
|
|
case 5: |
|
|
|
|
case 6: |
|
|
|
|
case 7: |
|
|
|
|
case 8: |
|
|
|
|
case 9: |
|
|
|
|
case 10: |
|
|
|
|
case 11: |
|
|
|
|
case 12: |
|
|
|
|
case 13: |
|
|
|
|
case 14: |
|
|
|
|
case 15: |
|
|
|
|
case 16: |
|
|
|
|
case 17: |
|
|
|
|
case 18: |
|
|
|
|
case 19: |
|
|
|
|
case 20:{ |
|
|
|
|
final ColorRange TARGETCOLOR = new ColorRange(200,255,200,255,200,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 21:{ |
|
|
|
|
final ColorRange TARGETCOLOR = new ColorRange(200,255,200,255,200,255); |
|
|
|
|
final ColorRange SEEKINGCOLOR = new ColorRange(100,255,100,255,100,255); |
|
|
|
|
final Color FINALCOLOR = Color.MAGENTA; |
|
|
|
|
for (int i=0;i<arr.length;i++) { |
|
|
|
|
Color col = new Color(arr[i],true); |
|
|
|
@ -124,12 +209,6 @@ 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);
|
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|