|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--com.ermapper.ecw.JNCSFile
|
+--com.ermapper.ecw.JNCSRenderer
This class provides an easy mechanism for displaying ECW images, in progressive or
non-progressive mode to a graphics context (usually a frame or panel in an application).
The renderer will draw into the target device, according to the parameters passed in the
setView and the drawImage calls.
In progressive mode, call setView before drawing imagery. In this mode, image construction is
asynchronous, and the coordinates passed to the drawImage function, may not match those passed
in the setView. The renderer will adjust its drawing accordingly.
The renderer constructs an image from the incomming ECW data stream (local or remote) in a
background thread, and waits for a drawImage call to display the data. The renderer is capable of
realtime display, and under a fast virtual machine, can interactively roam and zoom the image.
In non-progressive mode it is sufficient to call drawImage with the correct world coordinates
with out a valid setView. This mode is synchronous.
TODO: Super sampling (zoomed way in) when viewing over any edge (left or right)
generates a "Supersampling not supported" exception. Problem is in the clipping in the setView.
TODO: SetView() using dataset coodinates are not fully implemented yet.
| Fields inherited from class com.ermapper.ecw.JNCSFile |
bIsOpen, cellIncrementX, cellIncrementY, cellSizeUnits, compressionRate, datum, ECW_CELL_UNITS_DEGREES, ECW_CELL_UNITS_FEET, ECW_CELL_UNITS_INVALID, ECW_CELL_UNITS_METERS, fileName, height, numBands, originX, originY, progImageClient, progressive, projection, width |
| Constructor Summary | |
JNCSRenderer()
Default constructor |
|
JNCSRenderer(java.lang.String fileName,
boolean bProgressive)
Construct a renderer object and open the file, in progressive or static mode. |
|
| Method Summary | |
void |
drawImage(java.awt.Graphics g,
int tlX,
int tlY,
int nWidth,
int nHeight,
double dWorldTLX,
double dWorldTLY,
double dWorldBRX,
double dWorldBRY,
java.awt.image.ImageObserver imgObsv)
Draw all available imagery to the graphics context. |
void |
refreshUpdate(int nWidth,
int nHeight,
double dWorldTLX,
double dWorldTLY,
double dWorldBRX,
double dWorldBRY)
This method gets called when imagery arrives from the network and the set view was in world coordinates. |
void |
refreshUpdate(int nWidth,
int nHeight,
int dDatasetTLX,
int dDatasetTLY,
double dDatasetBRX,
int dDatasetBRY)
|
void |
setTransparency(float value)
Set the transparency value for the image. |
int |
setView(int nBands,
int[] nBandList,
double dWorldTLX,
double dWorldTLY,
double dWorldBRX,
double dWorldBRY,
int nWidth,
int nHeight)
Set a view of an open ECW file, in world coordinates. |
int |
setView(int nBands,
int[] nBandList,
int nDatasetTLX,
int nDatasetTLY,
int nDatasetBRX,
int nDatasetBRY,
int nWidth,
int nHeight)
Set a view of an open ECW file in dataset coordinates. |
| Methods inherited from class com.ermapper.ecw.JNCSFile |
addProgressiveUpdateListener, close, convertDatasetToWorld, convertWorldToDataset, finalize, getLastErrorText, getLibVersion, getPercentComplete, open, readImageRGBA, readLineBGRA, readLineBIL, readLineBIL, readLineRGBA, refreshUpdate |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JNCSRenderer()
throws JNCSException
public JNCSRenderer(java.lang.String fileName,
boolean bProgressive)
throws JNCSException,
JNCSFileOpenFailedException
fileName - A file name, either local or an ecwp: URL.bProgressive - Open the file in progressive or static mode.JNCSFile.open(java.lang.String, boolean)| Method Detail |
public void setTransparency(float value)
value - The transparency value.
public int setView(int nBands,
int[] nBandList,
int nDatasetTLX,
int nDatasetTLY,
int nDatasetBRX,
int nDatasetBRY,
int nWidth,
int nHeight)
throws JNCSInvalidSetViewException,
JNCSFileNotOpenException
This method returns 0 on success, or 1 of the extents were outside the dataset. It only throws an exception if the set view call actually fails (for example because of an internal error). This is because exceptions are expensive at runtime, and it is valid to request an area outside the dataset, but for the renderer to silently draw nothing.
setView in class JNCSFilenBands - The number of bands to decodenBandList - The list indicating which bands to decode. For RGB123 this should be {0,1,2}.nDatasetTLX - The top left X dataset cell coordinatenDatasetTLY - The top left Y dataset cell coordinatenDatasetBRX - The bottom right X dataset cell coordinatenDatasetBRY - The bottom right Y dataset cell coordinatenWith - The width of the output viewnHeight - The height of the output viewJNCSFileNotOpenException - indicating there is currently no valid open file.JNCSInvalidSetViewException - the input coordinates are not valid.setView(int, int, double, double, double, double, int, int)
public int setView(int nBands,
int[] nBandList,
double dWorldTLX,
double dWorldTLY,
double dWorldBRX,
double dWorldBRY,
int nWidth,
int nHeight)
throws JNCSInvalidSetViewException,
JNCSFileNotOpenException
This method returns 0 on success, or 1 of the extents were outside the dataset. It only throws an exception if the set view call actually fails (for example because of an internal error). This is because exceptions are expensive at runtime, and it is valid to request an area out side the dataset, but for the renderer to silently draw nothing.
setView in class JNCSFilenBands - The number of bands to decodenBandList - The list indicating which bands to decode. For RGB123 this should be {0,1,2}.dWorldTLX - The top left X world coordinatedWorldTLY - The top left Y world coordinatedWorldBRX - The bottom right X world coordinatedWorldBRY - The bottom right Y world coordinatenWith - The width of the output viewnHeight - The height of the output viewJNCSFileNotOpenException - indicating there is currently no valid open file.JNCSInvalidSetViewException - the input coordinates are not valid.setView(int, int, int, int, int, int, int, int)
public void refreshUpdate(int nWidth,
int nHeight,
double dWorldTLX,
double dWorldTLY,
double dWorldBRX,
double dWorldBRY)
JNCSProgressiveUpdaterefreshUpdate in class JNCSFilecom.ermapper.ecw.JNCSProgressiveUpdatenWidth - The width of the setView which generated this callbacknHeight - The height of the setView which generated this callbackdWorldTLX - The top left X coord that generated this callbackdWorldTLY - The top left Y coord that generated this callbackdWorldBRX - The bottom right X coord that generated this callbackdWorldBRY - The bottom right Y coord that generated this callbackJNCSFile.addProgressiveUpdateListener(com.ermapper.ecw.JNCSProgressiveUpdate)
public void refreshUpdate(int nWidth,
int nHeight,
int dDatasetTLX,
int dDatasetTLY,
double dDatasetBRX,
int dDatasetBRY)
public void drawImage(java.awt.Graphics g,
int tlX,
int tlY,
int nWidth,
int nHeight,
double dWorldTLX,
double dWorldTLY,
double dWorldBRX,
double dWorldBRY,
java.awt.image.ImageObserver imgObsv)
g - The Java graphics contexttlX - The x offset into the graphics contexttlY - The y offset into the graphics contextnWidth - The width of the graphics contextnHeight - The height of the graphics contextdWorldTLX - The world top left X coordinate of the graphics contextdWorldTLY - The world top left Y coordinate of the graphics contextdWorldBRX - The world bottom right X coordinate of the graphics contextdWorldBRY - The world bottom right Y coordinate of the graphics contextimgObsv - The component being drawn.Graphics
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||