2022-08-06 19:15:44 -05:00
|
|
|
package readers;
|
|
|
|
|
2022-08-11 20:31:12 +00:00
|
|
|
public class Box{
|
|
|
|
public int x;
|
|
|
|
public int y;
|
|
|
|
public int w;
|
|
|
|
public int h;
|
2022-08-06 19:15:44 -05:00
|
|
|
boolean ja_required;
|
|
|
|
final static int BOX_THRESHOLD=8; //How many pixels outside the specified region the score can be.
|
2022-08-11 20:31:12 +00:00
|
|
|
public Box(int x,int y,int w, int h) {
|
2022-08-06 19:15:44 -05:00
|
|
|
this.x=x;
|
|
|
|
this.y=y;
|
|
|
|
this.w=w;
|
|
|
|
this.h=h;
|
|
|
|
}
|
|
|
|
boolean insideBox(int x,int y) {
|
|
|
|
return this.x-BOX_THRESHOLD<=x&&this.x+this.w+BOX_THRESHOLD>=x&&this.y-BOX_THRESHOLD<=y&&this.y+this.h+BOX_THRESHOLD>=y;
|
|
|
|
}
|
|
|
|
}
|