|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcbr.ccv.Span
This class manges a span of a scanline. It supports testing for intersection and ordering of spans, as well as joining the pixel areas of spans. Hence, this class also acts as a pixel area consisting of accumulated spans. A span is a continuous segment of a scanline consisting of pixels of the same color.
| Field Summary | |
protected Area |
area_
The area of this span. |
protected int |
color_
The color of the span. |
protected int |
left_
The index of the leftmost pixel in the span. |
protected int |
length_
The length of the span in pixels. |
| Constructor Summary | |
Span(int length)
Creates a fake span with the given length but size and color zero. |
|
Span(int left,
int length,
int color)
Creates an instance with the given start index, length and color. |
|
| Method Summary | |
boolean |
endsRightOf(Span span)
Returns true iff a pixel of this span is
to the right of the rightmost pixel of the given span. |
int |
init(byte[] px,
int off,
int left,
int max)
Initialises a span from the given pixel array. |
void |
init(int left,
int length,
int color)
This method reinitialises a span with the given parameters. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Area area_
protected int left_
protected int length_
protected int color_
| Constructor Detail |
public Span(int left,
int length,
int color)
left - The index of the leftmost pixel of the
span, starting at 0.length - The length of the span in pixels.color - The color of the span's pixels.public Span(int length)
length - The length of the span.| Method Detail |
public void init(int left,
int length,
int color)
left - The index of the leftmost pixel of the
span, starting at 0.length - The length of the span in pixels.color - The color of the span's pixels.
public int init(byte[] px,
int off,
int left,
int max)
The area of this span is cleared upon calling this method.
px - The array of pixel values. Each byte
represents a pixel.off - The offset into the pixel array from
which the initialisation starts.left - The leftmost pixel index of the span.max - The maximum length of the span.
public boolean endsRightOf(Span span)
true iff a pixel of this span is
to the right of the rightmost pixel of the given span.
true if this span extends beyond
the right part of the given span.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||