|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavamorph.CTriangle
public class CTriangle
Field Summary | |
---|---|
private Point[] |
c
All three corners of the triangle. |
private Point[] |
p
All three corners of the triangle. |
private Point[] |
withins
All pixel points within the triangle. |
private int |
x_max
Rectangular border of the triangle. |
private int |
x_min
Rectangular border of the triangle. |
private int |
y_max
Rectangular border of the triangle. |
private int |
y_min
Rectangular border of the triangle. |
Constructor Summary | |
---|---|
CTriangle(Point _p0,
Point _p1,
Point _p2)
Copy constructor. |
Method Summary | |
---|---|
private void |
calculateXBounds(int y)
Calculate left & right edge point of the scan line. |
int |
compare(Point o1,
Point o2)
Due to comparator API. |
void |
debug(BufferedImage image)
Draw the triangle to an image. |
private void |
drawLine(BufferedImage image,
Point p1,
Point p2)
Debug one line to an image. |
boolean |
equals(Object obj)
Equal if the sorted points are equal. |
Point[] |
getPoints()
Get function. |
Point[] |
getWithins()
Get function. |
private int |
getXIntersection(int y,
Point p1,
Point p2)
Test |
int |
hashCode()
Hash code calculated by sorted points. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Point[] p
private Point[] c
private Point[] withins
private int y_min
private int y_max
private int x_min
private int x_max
Constructor Detail |
---|
public CTriangle(Point _p0, Point _p1, Point _p2)
_p0
- First of the three points._p1
- Second of the three points._p2
- Third of the three pointsMethod Detail |
---|
public Point[] getWithins()
public Point[] getPoints()
public void debug(BufferedImage image)
image
- Image to draw the lines to.public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in interface Comparator<Point>
equals
in class Object
public int compare(Point o1, Point o2)
compare
in interface Comparator<Point>
private void drawLine(BufferedImage image, Point p1, Point p2)
image
- Image to draw to.p1
- First point.p2
- Second point.private void calculateXBounds(int y)
y
- Vertical position of the scan line.private int getXIntersection(int y, Point p1, Point p2)
y
- Vertical position of the scan line.p1
- First point of the edge line.p2
- Second point of the edge line.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |