Refactor color processing into a single method
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
6270afa926
commit
6e40010b2f
@ -35,25 +35,7 @@ public class LoveLiveReader extends Reader{
|
|||||||
readRegions.add(new Box(782,452,158,50)); //maxcombo[10]
|
readRegions.add(new Box(782,452,158,50)); //maxcombo[10]
|
||||||
}
|
}
|
||||||
|
|
||||||
void seek(int[]arr,int i,ColorRange SEEKCOLOR,Color FINALCOLOR,int width) {
|
|
||||||
seek(arr,i,SEEKCOLOR,FINALCOLOR,width,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int seek(int[]arr,int i,ColorRange SEEKCOLOR,Color FINALCOLOR,int width,int farthestRight) {
|
|
||||||
arr[i]=FINALCOLOR.getRGB();
|
|
||||||
int X = i%width;
|
|
||||||
for (int x=-1;x<=1;x++) {
|
|
||||||
for (int y=-1;y<=1;y++) {
|
|
||||||
if (SEEKCOLOR.colorInRange(new Color(arr[i+x+y*width]))) {
|
|
||||||
farthestRight=seek(arr,i+x+y*width,SEEKCOLOR,FINALCOLOR,width,farthestRight);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return X>farthestRight?X:farthestRight;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorFilter(int[] arr,int region,int width) {
|
void ColorFilter(int[] arr,int region,int width) {
|
||||||
final int TRANSPARENT = new Color(0,0,0,0).getRGB();
|
|
||||||
switch (region) {
|
switch (region) {
|
||||||
case 0:{
|
case 0:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(240,255,130,150,0,10);
|
final ColorRange TARGETCOLOR = new ColorRange(240,255,130,150,0,10);
|
||||||
|
|||||||
@ -16,7 +16,6 @@ public class PopnReader extends Reader{
|
|||||||
final static int REGION_PADDING = 32;
|
final static int REGION_PADDING = 32;
|
||||||
List<Box> extraRegions = new ArrayList<>();
|
List<Box> extraRegions = new ArrayList<>();
|
||||||
static int lastJump=0;
|
static int lastJump=0;
|
||||||
final int TRANSPARENT = new Color(0,0,0,0).getRGB();
|
|
||||||
public PopnReader(){
|
public PopnReader(){
|
||||||
readRegions.add(new Box(941,609,275,54)); //score[0]
|
readRegions.add(new Box(941,609,275,54)); //score[0]
|
||||||
readRegions.add(new Box(1060,684,157,40)); //cool[1]
|
readRegions.add(new Box(1060,684,157,40)); //cool[1]
|
||||||
@ -38,263 +37,77 @@ public class PopnReader extends Reader{
|
|||||||
extraRegions.add(new Box(970,290,194,47)); //diff text[6]
|
extraRegions.add(new Box(970,290,194,47)); //diff text[6]
|
||||||
}
|
}
|
||||||
|
|
||||||
void seek(int[]arr,int i,ColorRange SEEKCOLOR,Color FINALCOLOR,int width) {
|
|
||||||
seek(arr,i,SEEKCOLOR,FINALCOLOR,width,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int seek(int[]arr,int i,ColorRange SEEKCOLOR,Color FINALCOLOR,int width,int farthestRight) {
|
|
||||||
arr[i]=FINALCOLOR.getRGB();
|
|
||||||
int X = i%width;
|
|
||||||
for (int x=-1;x<=1;x++) {
|
|
||||||
for (int y=-1;y<=1;y++) {
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return X>farthestRight?X:farthestRight;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorFilter(int[] arr,int region,int width) {
|
void ColorFilter(int[] arr,int region,int width) {
|
||||||
switch (region) {
|
switch (region) {
|
||||||
case 0:{
|
case 0:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(240,255,100,130,0,10);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(240,255,100,255,0,100);
|
240,255,100,130,0,10,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
240,255,100,255,0,100);
|
||||||
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;
|
}break;
|
||||||
case 1:{
|
case 1:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(240,255,0,10,240,255);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(240,255,0,150,240,255);
|
240,255,0,10,240,255,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
240,255,0,150,240,255);
|
||||||
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;
|
}break;
|
||||||
case 2:{
|
case 2:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(240,255,180,225,0,10);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(240,255,180,255,0,140);
|
240,255,180,225,0,10,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
240,255,180,255,0,140);
|
||||||
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;
|
}break;
|
||||||
case 3:{
|
case 3:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(240,255,0,40,0,10);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(240,255,0,180,0,255);
|
240,244,0,40,0,10,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
240,255,0,180,0,255);
|
||||||
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;
|
}break;
|
||||||
case 4:{
|
case 4:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(90,120,180,220,240,255);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(90,255,180,255,0,255);
|
90,120,180,220,240,255,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
90,255,180,255,0,255);
|
||||||
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;
|
}break;
|
||||||
case 5:{
|
case 5:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(0,10,0,60,240,255);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(0,20,0,100,240,255);
|
0,10,0,60,240,255,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
0,20,0,100,240,255);
|
||||||
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;
|
}break;
|
||||||
case 6:{
|
case 6:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(240,255,230,255,0,40);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(240,255,230,255,0,240);
|
240,255,230,255,0,40,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
240,255,230,255,0,240);
|
||||||
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;
|
}break;
|
||||||
case 400:{
|
case 400:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(240,255,0,10,0,10);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(240,255,0,10,0,10);
|
240,255,0,10,0,10,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
240,255,0,10,0,10);
|
||||||
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;
|
}break;
|
||||||
case 401:{
|
case 401:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(230,255,0,10,240,255);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(230,255,0,10,240,255);
|
230,255,0,10,240,255,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
230,255,0,10,240,255);
|
||||||
for (int i=0;i<arr.length;i++) {
|
|
||||||
Color col = new Color(arr[i],true);
|
|
||||||
if (!col.equals(Color.MAGENTA)&&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;
|
}break;
|
||||||
case 402:{
|
case 402:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(240,255,200,255,0,10);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(240,255,200,255,0,10);
|
240,255,200,255,0,10,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
240,255,200,255,0,10);
|
||||||
for (int i=0;i<arr.length;i++) {
|
|
||||||
Color col = new Color(arr[i],true);
|
|
||||||
if (!col.equals(Color.MAGENTA)&&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;
|
}break;
|
||||||
case 403:{
|
case 403:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(240,255,0,50,0,10);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(240,255,0,50,0,10);
|
240,255,0,50,0,10,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
240,255,0,50,0,10);
|
||||||
for (int i=0;i<arr.length;i++) {
|
|
||||||
Color col = new Color(arr[i],true);
|
|
||||||
if (!col.equals(Color.MAGENTA)&&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;
|
}break;
|
||||||
case 404:{
|
case 404:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(90,120,180,220,240,255);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(85,120,160,220,180,255);
|
90,120,180,220,240,255,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
85,120,160,220,180,255);
|
||||||
for (int i=0;i<arr.length;i++) {
|
|
||||||
Color col = new Color(arr[i],true);
|
|
||||||
if (!col.equals(Color.MAGENTA)&&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;
|
}break;
|
||||||
case 405:{
|
case 405:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(0,20,0,80,240,255);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(0,20,0,80,240,255);
|
0,20,0,80,240,255,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
0,20,0,80,240,255);
|
||||||
for (int i=0;i<arr.length;i++) {
|
|
||||||
Color col = new Color(arr[i],true);
|
|
||||||
if (!col.equals(Color.MAGENTA)&&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;
|
}break;
|
||||||
case 406:{
|
case 406:{
|
||||||
final ColorRange TARGETCOLOR = new ColorRange(240,255,240,255,240,255);
|
process(arr,width,
|
||||||
final ColorRange SEEKINGCOLOR = new ColorRange(210,255,210,255,210,255);
|
240,255,240,255,240,255,
|
||||||
final Color FINALCOLOR = Color.MAGENTA;
|
210,255,210,255,210,255);
|
||||||
for (int i=0;i<arr.length;i++) {
|
|
||||||
Color col = new Color(arr[i],true);
|
|
||||||
if (!col.equals(Color.MAGENTA)&&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;
|
}break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,9 @@ import java.io.InputStreamReader;
|
|||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.awt.Color;
|
||||||
|
|
||||||
|
import javax.imageio.metadata.IIOInvalidTreeException;
|
||||||
|
|
||||||
public abstract class Reader{
|
public abstract class Reader{
|
||||||
int score;
|
int score;
|
||||||
@ -15,6 +18,7 @@ public abstract class Reader{
|
|||||||
int maxcombo;
|
int maxcombo;
|
||||||
String other;
|
String other;
|
||||||
List<Box> readRegions = new ArrayList<>();
|
List<Box> readRegions = new ArrayList<>();
|
||||||
|
final int TRANSPARENT = new Color(0,0,0,0).getRGB();
|
||||||
String readAllBoxes(Path img) {
|
String readAllBoxes(Path img) {
|
||||||
try {
|
try {
|
||||||
Process p = Runtime.getRuntime().exec(new String[]{"python3","runocr.py","ja",img.toAbsolutePath().toString()});
|
Process p = Runtime.getRuntime().exec(new String[]{"python3","runocr.py","ja",img.toAbsolutePath().toString()});
|
||||||
@ -50,4 +54,39 @@ public abstract class Reader{
|
|||||||
data[i]=sb.toString();
|
data[i]=sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void seek(int[]arr,int i,ColorRange SEEKCOLOR,Color FINALCOLOR,int width) {
|
||||||
|
seek(arr,i,SEEKCOLOR,FINALCOLOR,width,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int seek(int[]arr,int i,ColorRange SEEKCOLOR,Color FINALCOLOR,int width,int farthestRight) {
|
||||||
|
arr[i]=FINALCOLOR.getRGB();
|
||||||
|
int X = i%width;
|
||||||
|
for (int x=-1;x<=1;x++) {
|
||||||
|
for (int y=-1;y<=1;y++) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return X>farthestRight?X:farthestRight;
|
||||||
|
}
|
||||||
|
void process(int[]arr,int width,int a,int b,int c,int d,int e,int f,int g,int h,int ii,int j,int k,int l) {
|
||||||
|
final ColorRange TARGETCOLOR = new ColorRange(a,b,c,d,e,f);
|
||||||
|
final ColorRange SEEKINGCOLOR = new ColorRange(g,h,ii,j,k,l);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -17,7 +17,6 @@ public class SoundVoltexReader extends Reader{
|
|||||||
final static int REGION_PADDING = 32;
|
final static int REGION_PADDING = 32;
|
||||||
List<Box> extraRegions = new ArrayList<>();
|
List<Box> extraRegions = new ArrayList<>();
|
||||||
static int lastJump=0;
|
static int lastJump=0;
|
||||||
final int TRANSPARENT = new Color(0,0,0,0).getRGB();
|
|
||||||
public SoundVoltexReader(){
|
public SoundVoltexReader(){
|
||||||
readRegions.add(new Box(430,1006,454,29)); //title[0]
|
readRegions.add(new Box(430,1006,454,29)); //title[0]
|
||||||
readRegions.add(new Box(458,1075,240,57)); //bigscore[1]
|
readRegions.add(new Box(458,1075,240,57)); //bigscore[1]
|
||||||
@ -65,23 +64,6 @@ public class SoundVoltexReader extends Reader{
|
|||||||
extraRegions.add(new Box(71,1365,171,22)); //maximum chain text[17]
|
extraRegions.add(new Box(71,1365,171,22)); //maximum chain text[17]
|
||||||
}
|
}
|
||||||
|
|
||||||
void seek(int[]arr,int i,ColorRange SEEKCOLOR,Color FINALCOLOR,int width) {
|
|
||||||
seek(arr,i,SEEKCOLOR,FINALCOLOR,width,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int seek(int[]arr,int i,ColorRange SEEKCOLOR,Color FINALCOLOR,int width,int farthestRight) {
|
|
||||||
arr[i]=FINALCOLOR.getRGB();
|
|
||||||
int X = i%width;
|
|
||||||
for (int x=-1;x<=1;x++) {
|
|
||||||
for (int y=-1;y<=1;y++) {
|
|
||||||
if (SEEKCOLOR.colorInRange(new Color(arr[i+x+y*width]))) {
|
|
||||||
farthestRight=seek(arr,i+x+y*width,SEEKCOLOR,FINALCOLOR,width,farthestRight);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return X>farthestRight?X:farthestRight;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ColorFilter(int[] arr,int region,int width) {
|
void ColorFilter(int[] arr,int region,int width) {
|
||||||
switch (region) {
|
switch (region) {
|
||||||
case 0:{
|
case 0:{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user