public class GliderImage extends AVListImpl
Modifier and Type | Class and Description |
---|---|
protected class |
GliderImage.RegionListener |
Modifier and Type | Field and Description |
---|---|
protected double |
altitude |
protected java.util.List<LatLon> |
corners |
static java.lang.String |
GLIDER_IMAGE_OPACITY |
static java.lang.String |
GLIDER_IMAGE_SOURCE |
static java.lang.String |
GLIDER_REGIONS_OF_INTEREST |
protected java.lang.Object |
imageSource |
protected java.lang.String |
name |
protected double |
opacity |
protected java.beans.PropertyChangeListener |
regionListener |
protected Sector |
sector |
Constructor and Description |
---|
GliderImage(java.lang.String name,
ImageUtil.AlignedImage alignedImage,
double altitude)
Construct an image from a file or
BufferedImage and an arbitrary bounding region. |
GliderImage(java.lang.String imageSource,
java.lang.Iterable<? extends LatLon> corners,
double altitude)
Construct an image from a file.
|
GliderImage(java.lang.String name,
java.lang.Object imageSource,
java.lang.Iterable<? extends LatLon> corners,
double altitude)
Construct an image from a file or
BufferedImage and an arbitrary bounding region. |
Modifier and Type | Method and Description |
---|---|
void |
addRegionOfInterest(GliderRegionOfInterest region)
Adds a region of interest to display on the image.
|
static ImageUtil.AlignedImage |
alignImage(java.awt.image.BufferedImage sourceImage,
float[] latitudes,
float[] longitudes)
Reprojects an image into an aligned image, one with edges of constant latitude and longitude.
|
static void |
alignImageDump(java.awt.image.BufferedImage sourceImage,
float[] latitudes,
float[] longitudes) |
boolean |
equals(java.lang.Object o) |
double |
getAltitude()
Return the image's altitude.
|
java.util.List<LatLon> |
getCorners() |
java.lang.Object |
getImageSource()
Returns the image source.
|
java.lang.String |
getName()
Returns the name of the image, as specified at construction.
|
double |
getOpacity() |
GliderRegionOfInterest.RegionSet |
getRegionsOfInterest() |
Sector |
getSector()
Return the image's location.
|
int |
hashCode() |
void |
releaseImageSource() |
void |
removeRegionOfInterest(GliderRegionOfInterest region)
Removes a region of interest.
|
void |
setImageSource(java.lang.String newSource)
Changes the image source.
|
void |
setImageSource(java.lang.String newName,
java.lang.Object newSource)
Changes the image source and gives the image a new name.
|
void |
setOpacity(double opacity) |
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
protected double altitude
protected java.util.List<LatLon> corners
public static final java.lang.String GLIDER_IMAGE_OPACITY
public static final java.lang.String GLIDER_IMAGE_SOURCE
public static final java.lang.String GLIDER_REGIONS_OF_INTEREST
protected java.lang.Object imageSource
protected java.lang.String name
protected double opacity
protected java.beans.PropertyChangeListener regionListener
protected Sector sector
public GliderImage(java.lang.String name, ImageUtil.AlignedImage alignedImage, double altitude)
BufferedImage
and an arbitrary bounding region.name
- A unique name to identify the image. If the image source is a file, the file path can be used
as the name.alignedImage
- An aligned image containing a BufferedImage
and a Sector
specifying the image
and the location to place it.The image will be stretched as necessary to fully fill the
region.altitude
- The altitude at which to display the image. Specify 0 to have the image draped over the
globe's surface.java.lang.IllegalArgumentException
- if any of the first three arguments are null.public GliderImage(java.lang.String imageSource, java.lang.Iterable<? extends LatLon> corners, double altitude)
imageSource
- The path to the source image. Images can be any of those supported by ImageIO
, as well as uncompressed TIFF images..corners
- The lat/lon locations of the region in which to map the image. The image will be stretched as
necessary to fully fill the region. The locations must be specified in counterclockwise order
beginning with the lower-left image corner.altitude
- The altitude at which to display the image. Specify 0 to have the image draped over the
globe's surface.java.lang.IllegalArgumentException
- if any of the first three arguments are null.public GliderImage(java.lang.String name, java.lang.Object imageSource, java.lang.Iterable<? extends LatLon> corners, double altitude)
BufferedImage
and an arbitrary bounding region.name
- A unique name to identify the image. If the image source is a file, the file path can be used
as the name.imageSource
- Either the file path to the source image or a reference to the BufferedImage
containing it. Images can be any of those supported by ImageIO
, as well as uncompressed TIFF images.corners
- The lat/lon locations of the region in which to map the image. The image will be stretched as
necessary to fully fill the region. The locations must be specified in counterclockwise order
beginning with the lower-left image corner.altitude
- The altitude at which to display the image. Specify 0 to have the image draped over the
globe's surface.java.lang.IllegalArgumentException
- if any of the first three arguments are null.public void addRegionOfInterest(GliderRegionOfInterest region)
region
- the region of interest to add.java.lang.IllegalArgumentException
- if region
is null.public static ImageUtil.AlignedImage alignImage(java.awt.image.BufferedImage sourceImage, float[] latitudes, float[] longitudes) throws java.lang.InterruptedException
sourceImage
- the image to reproject, typically a non-aligned imagelatitudes
- an array identifying the latitude of each pixels if the source image. There must be an entry
in the array for all pixels. The values are taken to be in row-major order relative to the
image -- the horizontal component varies fastest.longitudes
- an array identifying the longitude of each pixels if the source image. There must be an entry
in the array for all pixels. The values are taken to be in row-major order relative to the
image -- the horizontal component varies fastest.java.lang.InterruptedException
- if any thread has interrupted the current thread while alignImage is running. The
interrupted status of the current thread is cleared when this exception is
thrown.public static void alignImageDump(java.awt.image.BufferedImage sourceImage, float[] latitudes, float[] longitudes)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public double getAltitude()
public java.util.List<LatLon> getCorners()
public java.lang.Object getImageSource()
public java.lang.String getName()
public double getOpacity()
public GliderRegionOfInterest.RegionSet getRegionsOfInterest()
public Sector getSector()
public int hashCode()
hashCode
in class java.lang.Object
public void releaseImageSource()
public void removeRegionOfInterest(GliderRegionOfInterest region)
region
- the region of interest to remove.java.lang.IllegalArgumentException
- if region
is null.public void setImageSource(java.lang.String newSource)
GliderImage(java.lang.String, java.lang.Object, java.lang.Iterable<? extends gov.nasa.worldwind.geom.LatLon>, double)
newSource
- the new image source.java.lang.IllegalArgumentException
- if newSource
is null.public void setImageSource(java.lang.String newName, java.lang.Object newSource)
GliderImage(java.lang.String, java.lang.Object, java.lang.Iterable<? extends gov.nasa.worldwind.geom.LatLon>, double)
newName
- the new image name.newSource
- the new image source.java.lang.IllegalArgumentException
- if either argument is null.public void setOpacity(double opacity)