Package noaa.coastwatch.render
Class ImageTransform
java.lang.Object
noaa.coastwatch.render.ImageTransform
The ImageTransform class translates between 2D data coordinates
and image coordinates in x and y.
- Since:
- 3.1.1
- Author:
- Peter Hollemans
-
Constructor Summary
ConstructorDescriptionImageTransform
(Dimension imageDims) Deprecated.As of 3.3.1, use the other constructors instead.ImageTransform
(Dimension imageDims, Dimension dataDims, DataLocation center, double scale, AffineTransform orientationAffine) Constructs a new image transform with the specified image dimensions, center data location, scaling factors, and orientation affine.ImageTransform
(Dimension imageDims, DataLocation center, double scale) Constructs a new image transform with the specified image dimensions, center data location, and scaling factor.ImageTransform
(Dimension imageDims, DataLocation center, double[] scales) Deprecated.As of 3.3.1, replaced byImageTransform(Dimension,DataLocation,double)
orImageTransform(Dimension,Dimension,DataLocation,double,AffineTransform)
. -
Method Summary
Modifier and TypeMethodDescriptionGets the data to image coordinate transform.Gets the current image dimensions.static void
Tests this class.Converts arbitrary precision image coordinates to data coordinates.Converts integer image coordinates to data coordinates.transform
(DataLocation loc) Converts data coordinates to image coordinates.
-
Constructor Details
-
ImageTransform
Deprecated.As of 3.3.1, use the other constructors instead.Constructs a new default image transform set to unity.- Parameters:
imageDims
- the image dimensions.
-
ImageTransform
@Deprecated public ImageTransform(Dimension imageDims, DataLocation center, double[] scales) throws NoninvertibleTransformException Deprecated.As of 3.3.1, replaced byImageTransform(Dimension,DataLocation,double)
orImageTransform(Dimension,Dimension,DataLocation,double,AffineTransform)
.Constructs a new image transform with the specified image dimensions, center data location, and scaling factors.- Parameters:
imageDims
- the image dimensions.center
- the center data location. This location transforms to the center of the image coordinates.scales
- the image to data scaling factors as [row, column].- Throws:
NoninvertibleTransformException
- if the image to data transform is not invertible.
-
ImageTransform
public ImageTransform(Dimension imageDims, DataLocation center, double scale) throws NoninvertibleTransformException Constructs a new image transform with the specified image dimensions, center data location, and scaling factor.- Parameters:
imageDims
- the image dimensions.center
- the center data location. This location transforms to the center of the image coordinates.scale
- the ratio of data pixels to view image pixels.- Throws:
NoninvertibleTransformException
- if the image to data transform is not invertible.- Since:
- 3.3.1
-
ImageTransform
public ImageTransform(Dimension imageDims, Dimension dataDims, DataLocation center, double scale, AffineTransform orientationAffine) throws NoninvertibleTransformException Constructs a new image transform with the specified image dimensions, center data location, scaling factors, and orientation affine.- Parameters:
imageDims
- the image dimensions.dataDims
- the data dimensions.center
- the center data location. This location transforms to the center of the image coordinates.scale
- the ratio of data pixels to view image pixels.orientationAffine
- the affine transform that orients the data for display. This may be used for when data row and column coordinates do not correspond to the normal way that a data image is expected to be displayed. The affine can be TYPE_FLIP, TYPE_QUANDRANT_ROTATION, or TYPE_IDENTITY only. The orientation affine is used to rotate or flip the data about its center point in data coordinate space (ie: world coordinates versus viewport coordinates).- Throws:
NoninvertibleTransformException
- if the data to image transform is not invertible.IllegalArgumentException
- if the orientation affine is not a flip, quadrant rotation, or identity.- Since:
- 3.3.1
-
-
Method Details
-
transform
Converts data coordinates to image coordinates.- Parameters:
loc
- the data location.- Returns:
- the image coordinates, or null if the location is invalid.
- See Also:
-
transform
Converts arbitrary precision image coordinates to data coordinates.- Parameters:
point
- the image coordinates.- Returns:
- the data location.
- See Also:
-
transform
Converts integer image coordinates to data coordinates.- Parameters:
point
- the image coordinates.- Returns:
- the data location.
- See Also:
-
getAffine
Gets the data to image coordinate transform.- Returns:
- the affine to transform data [row,column] to image [x,y].
-
getImageDimensions
Gets the current image dimensions.- Returns:
- the image dimensions width and height in pixels.
-
main
Tests this class.- Parameters:
argv
- the array of command line parameters.- Throws:
Exception
-