|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.layer.ClipPixellator
public class ClipPixellator
Pixellator implementation that wraps another pixellator and only retains the pixels that fall within a given clip rectangle.
Note: Pixellator bounds are reported such that the points of the pixellator are included, but not the outer bounds of the 1-pixel-wide lines they generate are included. This means that the pixellator bounds need effectively to be extended by one pixel down and right before comparing with a graphics clip. This is probably an unfortunate/wrong part of the pixellator API, but for now we just deal with it here.
In most cases you should call the clip(uk.ac.starlink.ttools.plot.Pixellator, java.awt.Rectangle)
factory method
rather than the constructor of this class.
Constructor Summary | |
---|---|
ClipPixellator(Pixellator base,
Rectangle clip)
Constructor. |
Method Summary | |
---|---|
static Pixellator |
clip(Pixellator pixellator,
Rectangle clip)
Returns a pixellator which is guaranteed to fall within a given clip. |
Rectangle |
getBounds()
Returns a copy of the bounding rectangle for this pixellator. |
int |
getX()
Returns the X value for the current point. |
int |
getY()
Returns the Y value for the current point. |
boolean |
next()
Moves to the next point in the sequence. |
void |
start()
Makes this object ready to iterate. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClipPixellator(Pixellator base, Rectangle clip)
base
- base pixellatorclip
- clipping rectangle to impose on baseMethod Detail |
---|
public Rectangle getBounds()
Pixellator
null
may be returned.
getBounds
in interface Pixellator
public void start()
Pixellator
Pixellator.next()
.
start
in interface Pixellator
public boolean next()
Pixellator
Pixellator.getX()
/Pixellator.getY()
. Returns value indicates whether
there is a next point.
next
in interface Pixellator
public int getX()
Pixellator
getX
in interface Pixellator
public int getY()
Pixellator
getY
in interface Pixellator
public static Pixellator clip(Pixellator pixellator, Rectangle clip)
pixellator
- base pixellator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |