jsky.coords
Interface CoordinateConverter

All Superinterfaces:
WorldCoordinateConverter
All Known Implementing Classes:
ImageCoordinateConverter

public interface CoordinateConverter
extends WorldCoordinateConverter

This interface may be implemented by classes that display images and can convert between different coordinate systems, optionally including world coordinates. Methods are available for converting between the following coordinate systems:

Screen Coordinates
The origin (0,0) is always at the upper left corner of the window. Whole pixels are counted and no transformations are taken into account.
Canvas Coordinates
The origin (0,0) is at the upper left corner of the image. Whole pixels are counted and no transformations are taken into account.
Image Coordinates
The origin is at lower left (FITS style) after all transformations are undone. At mag 1, the origin is (1, 1), otherwise it is a fraction of a pixel (0.5, 0.5). Image coordinates correspond to the coordinates in a FITS image.
User Coordinates
The origin (0.0, 0.0) is at upper left after all transformations undone. User coordinates are like image coordinates, except that the Y axis is reversed and the origin at mag 1 is (0., 0.) instead of (1. 1).
World Coordinates
World coordinates are converted from image coordinates based on the keywords in the image header, if available.

Version:
$Revision: 1.3 $ $Date: 2002/07/09 13:30:36 $
Author:
Allan Brighton

Field Summary
static int CANVAS
          Constant for canvas coordinates
static int IMAGE
          Constant for image coordinates
static int SCREEN
          Constant for screen coordinates
static int USER
          Constant for user coordinates
static int WORLD
          Constant for world coordinates (deg, in the equinox of the image)
 
Method Summary
 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.
 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 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 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.
 
Methods inherited from interface jsky.coords.WorldCoordinateConverter
getEquinox, getHeight, getHeightInDeg, getImageCenter, getWCSCenter, getWidth, getWidthInDeg, imageToWorldCoords, isWCS, worldToImageCoords
 

Field Detail

IMAGE

static final int IMAGE
Constant for image coordinates

See Also:
Constant Field Values

SCREEN

static final int SCREEN
Constant for screen coordinates

See Also:
Constant Field Values

CANVAS

static final int CANVAS
Constant for canvas coordinates

See Also:
Constant Field Values

USER

static final int USER
Constant for user coordinates

See Also:
Constant Field Values

WORLD

static final int WORLD
Constant for world coordinates (deg, in the equinox of the image)

See Also:
Constant Field Values
Method Detail

convertCoords

void convertCoords(Point2D.Double p,
                   int inType,
                   int outType,
                   boolean isDistance)
Convert the given coordinates from inType to outType. The inType and outType arguments should be one of the constants defined in this interface (IMAGE for image coordinates, WCS for world coordinates, etc...).

Parameters:
p - The point to convert.
inType - the type of the input coordinates
outType - the type of the output coordinates
isDistance - True if p should be interpreted as a distance instead of a point.

canvasToImageCoords

void canvasToImageCoords(Point2D.Double p,
                         boolean isDistance)
Convert the given canvas coordinates to image coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

canvasToUserCoords

void canvasToUserCoords(Point2D.Double p,
                        boolean isDistance)
Convert the given canvas coordinates to user coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

userToImageCoords

void userToImageCoords(Point2D.Double p,
                       boolean isDistance)
Convert the given user coordinates to image coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

userToCanvasCoords

void userToCanvasCoords(Point2D.Double p,
                        boolean isDistance)
Convert the given user coordinates to canvas coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

imageToCanvasCoords

void imageToCanvasCoords(Point2D.Double p,
                         boolean isDistance)
Convert the given image coordinates to canvas coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

imageToUserCoords

void imageToUserCoords(Point2D.Double p,
                       boolean isDistance)
Convert the given image coordinates to user coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

canvasToScreenCoords

void canvasToScreenCoords(Point2D.Double p,
                          boolean isDistance)
Convert the given canvas coordinates to screen coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

screenToCanvasCoords

void screenToCanvasCoords(Point2D.Double p,
                          boolean isDistance)
Convert the given screen coordinates to canvas coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

screenToImageCoords

void screenToImageCoords(Point2D.Double p,
                         boolean isDistance)
Convert the given screen coordinates to image coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

imageToScreenCoords

void imageToScreenCoords(Point2D.Double p,
                         boolean isDistance)
Convert the given image coordinates to screen coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

screenToUserCoords

void screenToUserCoords(Point2D.Double p,
                        boolean isDistance)
Convert the given screen coordinates to user coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

userToScreenCoords

void userToScreenCoords(Point2D.Double p,
                        boolean isDistance)
Convert the given user coordinates to screen coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

screenToWorldCoords

void screenToWorldCoords(Point2D.Double p,
                         boolean isDistance)
Convert the given screen coordinates to world coordinates degrees in the equinox of the current image.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

canvasToWorldCoords

void canvasToWorldCoords(Point2D.Double p,
                         boolean isDistance)
Convert the given canvas coordinates to world coordinates degrees in the equinox of the current image.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

userToWorldCoords

void userToWorldCoords(Point2D.Double p,
                       boolean isDistance)
Convert the given user coordinates to world coordinates degrees in the equinox of the current image.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

worldToCanvasCoords

void worldToCanvasCoords(Point2D.Double p,
                         boolean isDistance)
Convert the given world coordinates (degrees, in the equinox of the current image) to canvas coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

worldToScreenCoords

void worldToScreenCoords(Point2D.Double p,
                         boolean isDistance)
Convert the given world coordinates (degrees, in the equinox of the current image) to screen coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.

worldToUserCoords

void worldToUserCoords(Point2D.Double p,
                       boolean isDistance)
Convert the given world coordinates (degrees, in the equinox of the current image) to user coordinates.

Parameters:
p - The point to convert.
isDistance - True if p should be interpreted as a distance instead of a point.