captcha.graphics
Class Quadrangle

java.lang.Object
  extended by captcha.graphics.Quadrangle

public class Quadrangle
extends java.lang.Object

This class is the representation of an quadrangle (not necessarily a rectangle).


Field Summary
private  int[][] m_corners
          Stores the 4 corners of the quadrangle (4 x 2 matrix).
 
Constructor Summary
Quadrangle(int a_x0, int a_y0, int a_x1, int a_y1, int a_x2, int a_y2, int a_x3, int a_y3)
          Creates a new quadrangle given by the 4 corners (x and y values).
 
Method Summary
 int getX0()
          Returns the X position of the first corner.
 int getX1()
          Returns the X position of the second corner.
 int getX2()
          Returns the X position of the third corner.
 int getX3()
          Returns the X position of the fourth corner.
 int getY0()
          Returns the Y position of the first corner.
 int getY1()
          Returns the Y position of the second corner.
 int getY2()
          Returns the Y position of the third corner.
 int getY3()
          Returns the Y position of the fourth corner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_corners

private int[][] m_corners
Stores the 4 corners of the quadrangle (4 x 2 matrix).

Constructor Detail

Quadrangle

public Quadrangle(int a_x0,
                  int a_y0,
                  int a_x1,
                  int a_y1,
                  int a_x2,
                  int a_y2,
                  int a_x3,
                  int a_y3)
Creates a new quadrangle given by the 4 corners (x and y values). Attention: The order of the corners can matter in some cases.

Parameters:
a_x0 - X position of the first corner.
a_y0 - Y position of the first corner.
a_x1 - X position of the second corner.
a_y1 - Y position of the second corner.
a_x2 - X position of the third corner.
a_y2 - Y position of the third corner.
a_x3 - X position of the fourtht corner.
a_y3 - Y position of the fourth corner.
Method Detail

getX0

public int getX0()
Returns the X position of the first corner.

Returns:
The X position of the first corner.

getY0

public int getY0()
Returns the Y position of the first corner.

Returns:
The Y position of the first corner.

getX1

public int getX1()
Returns the X position of the second corner.

Returns:
The X position of the second corner.

getY1

public int getY1()
Returns the Y position of the second corner.

Returns:
The Y position of the second corner.

getX2

public int getX2()
Returns the X position of the third corner.

Returns:
The X position of the third corner.

getY2

public int getY2()
Returns the Y position of the third corner.

Returns:
The Y position of the third corner.

getX3

public int getX3()
Returns the X position of the fourth corner.

Returns:
The X position of the fourth corner.

getY3

public int getY3()
Returns the Y position of the fourth corner.

Returns:
The Y position of the fourth corner.