public class ImageCoordinateConverter extends Object implements CoordinateConverter
Constructor and Description |
---|
ImageCoordinateConverter(BasicImageDisplay imageDisplay) |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener l)
Register to receive change events from this object whenever the
the WCS information is changed.
|
void |
assertWCS()
Throw an exception is WCS information is not available
|
void |
canvasToImageCoords(Point2D.Double p,
boolean isDistance)
Convert the given canvas coordinates to image coordinates.
|
void |
canvasToScreenCoords(Point2D.Double p,
boolean isDistance)
Convert the given canvas coordinates to screen coordinates.
|
void |
canvasToUserCoords(Point2D.Double p,
boolean isDistance)
Convert the given canvas coordinates to user coordinates.
|
void |
canvasToWorldCoords(Point2D.Double p,
boolean isDistance)
Convert the given canvas coordinates to world coordinates degrees in the equinox
of the current image.
|
void |
convertCoords(Point2D.Double p,
int inType,
int outType,
boolean isDistance)
Convert the given coordinates from inType to outType.
|
protected void |
fireChange()
Notify any listeners of a change in the WCS information.
|
void |
flip(Point2D.Double p)
Flip the x,y coordinates of the given point based on the current settings.
|
double |
getEquinox()
Return the equinox used for coordinates (usually the equionx of the image)
|
double |
getHeight()
Return the height in pixels
|
double |
getHeightInDeg()
Return the height in deg
|
Point2D.Double |
getImageCenter()
Return the center coordinates in image pixels.
|
BasicImageDisplay |
getImageDisplay()
Return the target image display
|
Point2D.Double |
getWCSCenter()
Return the center RA,Dec coordinates in degrees.
|
double |
getWidth()
Return the width in pixels
|
double |
getWidthInDeg()
Return the width in deg
|
void |
imageToCanvasCoords(Point2D.Double p,
boolean isDistance)
Convert the given image coordinates to canvas coordinates.
|
void |
imageToScreenCoords(Point2D.Double p,
boolean isDistance)
Convert the given image coordinates to screen coordinates.
|
void |
imageToUserCoords(Point2D.Double p,
boolean isDistance)
Convert the given image coordinates to user coordinates.
|
void |
imageToWorldCoords(Point2D.Double p,
boolean isDistance)
Convert the given image coordinates to world coordinates degrees in the equinox
of the current image.
|
boolean |
isWCS()
Return true if world coordinates conversion is available.
|
void |
removeChangeListener(ChangeListener l)
Stop receiving change events from this object.
|
void |
rotate(Point2D.Double p,
int factor)
Rotate the given point about the image center by the current rotation angle,
multiplied by the given factor.
|
void |
screenToCanvasCoords(Point2D.Double p,
boolean isDistance)
Convert the given screen coordinates to canvas coordinates.
|
void |
screenToImageCoords(Point2D.Double p,
boolean isDistance)
Convert the given screen coordinates to image coordinates.
|
void |
screenToUserCoords(Point2D.Double p,
boolean isDistance)
Convert the given screen coordinates to user coordinates.
|
void |
screenToWorldCoords(Point2D.Double p,
boolean isDistance)
Convert the given screen coordinates to world coordinates degrees in the equinox
of the current image.
|
void |
userToCanvasCoords(Point2D.Double p,
boolean isDistance)
Convert the given user coordinates to canvas coordinates.
|
void |
userToImageCoords(Point2D.Double p,
boolean isDistance)
Convert the given user coordinates to image coordinates.
|
void |
userToScreenCoords(Point2D.Double p,
boolean isDistance)
Convert the given user coordinates to screen coordinates.
|
void |
userToWorldCoords(Point2D.Double p,
boolean isDistance)
Convert the given user coordinates to world coordinates degrees in the equinox
of the current image.
|
void |
worldToCanvasCoords(Point2D.Double p,
boolean isDistance)
Convert the given world coordinates (degrees, in the equinox of the current image)
to canvas coordinates.
|
void |
worldToImageCoords(Point2D.Double p,
boolean isDistance)
Convert the given world coordinates (degrees, in the equinox of the current image)
to image coordinates.
|
void |
worldToScreenCoords(Point2D.Double p,
boolean isDistance)
Convert the given world coordinates (degrees, in the equinox of the current image)
to screen coordinates.
|
void |
worldToUserCoords(Point2D.Double p,
boolean isDistance)
Convert the given world coordinates (degrees, in the equinox of the current image)
to user coordinates.
|
public ImageCoordinateConverter(BasicImageDisplay imageDisplay)
public BasicImageDisplay getImageDisplay()
public void addChangeListener(ChangeListener l)
public void removeChangeListener(ChangeListener l)
protected void fireChange()
public boolean isWCS()
isWCS
in interface WorldCoordinateConverter
public Point2D.Double getWCSCenter()
getWCSCenter
in interface WorldCoordinateConverter
public Point2D.Double getImageCenter()
getImageCenter
in interface WorldCoordinateConverter
public double getEquinox()
getEquinox
in interface WorldCoordinateConverter
public double getWidthInDeg()
getWidthInDeg
in interface WorldCoordinateConverter
public double getHeightInDeg()
getHeightInDeg
in interface WorldCoordinateConverter
public double getWidth()
getWidth
in interface WorldCoordinateConverter
public double getHeight()
getHeight
in interface WorldCoordinateConverter
public void convertCoords(Point2D.Double p, int inType, int outType, boolean isDistance)
convertCoords
in interface CoordinateConverter
p
- The point to convert.inType
- the type of the input coordinatesoutType
- the type of the output coordinatesisDistance
- True if p should be interpreted as a distance instead
of a point.public void canvasToImageCoords(Point2D.Double p, boolean isDistance)
canvasToImageCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void userToImageCoords(Point2D.Double p, boolean isDistance)
userToImageCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void canvasToUserCoords(Point2D.Double p, boolean isDistance)
canvasToUserCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void userToCanvasCoords(Point2D.Double p, boolean isDistance)
userToCanvasCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void imageToCanvasCoords(Point2D.Double p, boolean isDistance)
imageToCanvasCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void imageToUserCoords(Point2D.Double p, boolean isDistance)
imageToUserCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void canvasToScreenCoords(Point2D.Double p, boolean isDistance)
canvasToScreenCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void screenToCanvasCoords(Point2D.Double p, boolean isDistance)
screenToCanvasCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void screenToImageCoords(Point2D.Double p, boolean isDistance)
screenToImageCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void imageToScreenCoords(Point2D.Double p, boolean isDistance)
imageToScreenCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void screenToUserCoords(Point2D.Double p, boolean isDistance)
screenToUserCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void userToScreenCoords(Point2D.Double p, boolean isDistance)
userToScreenCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void imageToWorldCoords(Point2D.Double p, boolean isDistance)
imageToWorldCoords
in interface WorldCoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void screenToWorldCoords(Point2D.Double p, boolean isDistance)
screenToWorldCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void canvasToWorldCoords(Point2D.Double p, boolean isDistance)
canvasToWorldCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void userToWorldCoords(Point2D.Double p, boolean isDistance)
userToWorldCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void worldToImageCoords(Point2D.Double p, boolean isDistance)
worldToImageCoords
in interface WorldCoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void worldToCanvasCoords(Point2D.Double p, boolean isDistance)
worldToCanvasCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void worldToScreenCoords(Point2D.Double p, boolean isDistance)
worldToScreenCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void worldToUserCoords(Point2D.Double p, boolean isDistance)
worldToUserCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void flip(Point2D.Double p)
public void rotate(Point2D.Double p, int factor)
p
- the point to rotatefactor
- set to 1 to rotate, -1 to undo the rotationpublic void assertWCS()
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.