package smart_gs.transcription_tool.tesseract;

public class BBox {
	
	private int x0;
	
	private int y0;
	
	private int x1;
	
	private int y1;
	
	public BBox(int x0, int y0, int x1, int y1) {
		this.x0 = x0;
		this.y0 = y0;
		this.x1 = x1;
		this.y1 = y1;
	}

	public int getX0() {
		return x0;
	}

	public void setX0(int x0) {
		this.x0 = x0;
	}

	public int getY0() {
		return y0;
	}

	public void setY0(int y0) {
		this.y0 = y0;
	}

	public int getX1() {
		return x1;
	}

	public void setX1(int x1) {
		this.x1 = x1;
	}

	public int getY1() {
		return y1;
	}

	public void setY1(int y1) {
		this.y1 = y1;
	}
	
	public String toString() {
		return "BBox[" + this.x0 + "," + this.y0 + "," + this.x1 + "," + this.y1 + "]";
	}
	
	public int[][] toVertexes() {
		int[] p0 = new int[]{x0, y0};
		int[] p1 = new int[]{x1, y0};
		int[] p2 = new int[]{x1, y1};
		int[] p3 = new int[]{x0, y1};
		return new int[][]{p0, p1, p2, p3};
	}
		
}
