|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--com.ermapper.ecw.JNCSFile
The JNCSFile class is the lowest level interface between the Java lannguage and the native ECW code. It uses the JNI to acces the native libraries. It is the base class for all of the ECW file access in Java. It supports reading from a local disk or from an ECWP URL.
In addition, this class provides standard setView() and readLine() functionality. It is analagous to the NCSFile object in the C++ SDK.
This class looks for the native libraries in 3 ways: 1) On the default search path.
2) Add the path to the native libraries as a parameter to the virutal machien, of the form: -Djava.library.path=C:\Program Files\Earth Resource Mapping\Image Web Server\Client
2) Add an entry in the propery file "jncsclasses.properties" in the users home directory, of the form: clientDLLPath=C\:\\Program Files\\Earth Resource Mapping\\Image Web Server\\Client
If all these methods fail to resolve the ECW libraries, native ECW imagery will not be available.
| Field Summary | |
boolean |
bIsOpen
A flag to specify if a valid file is currently open. |
double |
cellIncrementX
The cell increment in the X direction of the file. |
double |
cellIncrementY
The cell increment in the Y direction of the file. |
int |
cellSizeUnits
The cell units of the file. |
double |
compressionRate
The compression rate of the file. |
java.lang.String |
datum
The GDT datum of the file. |
static int |
ECW_CELL_UNITS_DEGREES
Cell units for the ecw file are degrees, a latitude/longitude coordinate system. |
static int |
ECW_CELL_UNITS_FEET
Cell units for the ecw file are feet (US). |
static int |
ECW_CELL_UNITS_INVALID
Cell units for the ecw file are unknown |
static int |
ECW_CELL_UNITS_METERS
Cell units for the ecw file are metric meters |
java.lang.String |
fileName
The filename of the current open file. |
int |
height
The height (Y dimension) of the file. |
int |
numBands
The number of image bands in the file. |
double |
originX
The X origin of the current open file. |
double |
originY
The Y origin of the current open file. |
protected JNCSProgressiveUpdate |
progImageClient
|
boolean |
progressive
Flag indicating if the file was opened in progressive mode. |
java.lang.String |
projection
The GDT projection of the file. |
int |
width
The width (X dimension) of the file. |
| Constructor Summary | |
JNCSFile()
Constructor. |
|
JNCSFile(java.lang.String fileName,
boolean progressive)
Constructor. |
|
| Method Summary | |
void |
addProgressiveUpdateListener(JNCSProgressiveUpdate listener)
Inform the ECW file that a client wants progressive imagery and is ready to listen for updates. |
void |
close(boolean freeCache)
Close an ecw file, and optionally free the image case. |
JNCSWorldPoint |
convertDatasetToWorld(int nDatasetX,
int nDatasetY)
Convert a dataset x,y point into a world coordinate. |
JNCSDatasetPoint |
convertWorldToDataset(double dWorldX,
double dWorldY)
Convert a world x,y coordinate into a dataset point. |
protected void |
finalize()
Performs final cleanup when the object is destroyed. |
java.lang.String |
getLastErrorText(int errorNum)
Return the last error from the file object. |
static java.lang.String |
getLibVersion()
Get the version of the decompressoin library (currently native) used in this class. |
short |
getPercentComplete()
Get the percent complete of the current setView() command. |
int |
open(java.lang.String fileName,
boolean bProgressive)
Opens an ECW file in progressive or static mode, from a URL or local file path. |
int |
readImageRGBA(int[] pRGBAImageArray,
int width,
int height)
Read an image of into an RGBA data buffer. |
int |
readLineBGRA(int[] pRGBArray)
Read a scanline of BGRA format data. |
int |
readLineBIL(double[] pRGBArray)
Read a scanline of BIL format data. |
int |
readLineBIL(int[] pRGBArray)
Read a scanline of BIL format data. |
int |
readLineRGBA(int[] pRGBArray)
Read a scanline of RGBA format data. |
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,
int dDatasetBRX,
int dDatasetBRY)
This method gets called when imagery arrives from the network, and the set view was in dataset cells. |
int |
setView(int nBands,
int[] nBandList,
double dWorldTLX,
double dWorldTLY,
double dWorldBRX,
double dWorldBRY,
int nWidth,
int nHeight)
Set a file view, in world coordinates. |
int |
setView(int nBands,
int[] nBandList,
int nDatasetTLX,
int nDatasetTLY,
int nDatasetBRX,
int nDatasetBRY,
int nWidth,
int nHeight)
Set a file view, in dataset coordinates. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int ECW_CELL_UNITS_INVALID
public static final int ECW_CELL_UNITS_METERS
public static final int ECW_CELL_UNITS_DEGREES
public static final int ECW_CELL_UNITS_FEET
public int numBands
public int width
public int height
public double originX
public double originY
public double cellIncrementX
public double cellIncrementY
public int cellSizeUnits
public double compressionRate
public boolean progressive
public java.lang.String fileName
public java.lang.String datum
public java.lang.String projection
public boolean bIsOpen
protected JNCSProgressiveUpdate progImageClient
| Constructor Detail |
public JNCSFile()
throws JNCSException
JNCSFile(String, boolean)
public JNCSFile(java.lang.String fileName,
boolean progressive)
throws JNCSException
JNCSFile(),
open(java.lang.String, boolean)| Method Detail |
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable - JNCSFile()
public int open(java.lang.String fileName,
boolean bProgressive)
throws JNCSFileOpenFailedException
fileName - The file pathprogressive - Progressive or static modeJNCSFileOpenFailedException - indicating that the file could not be opened.
Use the getMessage() method of this Exception to determine the reason for the failure.close(boolean)public void close(boolean freeCache)
freeCache - If true, the connection is closed and the image cache is freed. If false the connection is kept alive, pending requests are cancelled, but the image cache is left intact.open(java.lang.String, boolean)public void addProgressiveUpdateListener(JNCSProgressiveUpdate listener)
listener - The client that implements the JNCSProgressiveUpdate interfaceJNCSProgressiveUpdate.refreshUpdate(int, int, double, double, double, double)
public void refreshUpdate(int nWidth,
int nHeight,
double dWorldTLX,
double dWorldTLY,
double dWorldBRX,
double dWorldBRY)
JNCSProgressiveUpdaterefreshUpdate in interface JNCSProgressiveUpdatecom.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 callbackaddProgressiveUpdateListener(com.ermapper.ecw.JNCSProgressiveUpdate)
public void refreshUpdate(int nWidth,
int nHeight,
int dDatasetTLX,
int dDatasetTLY,
int dDatasetBRX,
int dDatasetBRY)
JNCSProgressiveUpdaterefreshUpdate in interface JNCSProgressiveUpdatecom.ermapper.ecw.JNCSProgressiveUpdatenWidth - The width of the setView which generated this callbacknHeight - The height of the setView which generated this callbackdDatasetTLX - The top left X dataset cell that generated this callbackdDatasetTLY - The top left Y dataset cell that generated this callbackdDatasetBRX - The bottom right X dataset cell that generated this callbackdDatasetBRY - The bottom right Y dataset cell that generated this callbackaddProgressiveUpdateListener(com.ermapper.ecw.JNCSProgressiveUpdate)
public int setView(int nBands,
int[] nBandList,
int nDatasetTLX,
int nDatasetTLY,
int nDatasetBRX,
int nDatasetBRY,
int nWidth,
int nHeight)
throws JNCSInvalidSetViewException,
JNCSFileNotOpenException
nBands - The number of bands to be outputnBansList - The bandlistnDatasetTLX - Top left X in dataset coordinatesnDatasetTLY - Top left Y in dataset coordinatesnDatasetBRX - Bottom right X in dataset coordinatesnDatasetBRY - Bottom right Y in dataset coordinatesnWidth - Output view widthnHeight - Output view heightJNCSInvalidSetViewException - indicating that the parameters passed to setView where incorrect.JNCSFileNotOpenException - indicating that there is no current valid file open.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
nBands - The number of bands to be outputnBansList - The bandlistdWorldTLX - Top left X in world coordinatesdWorldTLY - Top left Y in world coordinatesdWorldBRX - Bottom right X in world coordinatesdWorldBRY - Bottom right Y in world coordinatesnWidth - Output view widthnHeight - Output view heightJNCSInvalidSetViewException - indicating that the parameters passed to setView where incorrect.JNCSFileNotOpenException - indicating that there is no current valid file open.setView(int, int[], int, int, int, int, int, int)
public int readLineRGBA(int[] pRGBArray)
throws JNCSException
pRGBArray - The input array which should be of dimension nWidth.JNCSException - indicating there was an error in the read process.setView(int, int[], int, int, int, int, int, int),
getLastErrorText(int),
readLineBGRA(int[]),
readLineBIL(int[])
public int readLineBGRA(int[] pRGBArray)
throws JNCSException
PARAMETER - DESCRIPTIONJNCSException - indicating there was an error in the read process.setView(int, int[], int, int, int, int, int, int),
getLastErrorText(int),
readLineRGBA(int[]),
readLineBIL(int[])
public int readLineBIL(int[] pRGBArray)
throws JNCSException
PARAMETER - DESCRIPTIONJNCSException - indicating there was an error in the read process.setView(int, int[], int, int, int, int, int, int),
getLastErrorText(int),
com.ermapper.ecw.JNCSFile#readLineRGB,
readLineRGBA(int[]),
com.ermapper.ecw.JNCSFile#readLineBGR,
readLineBGRA(int[])
public int readLineBIL(double[] pRGBArray)
throws JNCSException
PARAMETER - DESCRIPTIONJNCSException - indicating there was an error in the read process.setView(int, int[], int, int, int, int, int, int),
getLastErrorText(int),
com.ermapper.ecw.JNCSFile#readLineRGB,
readLineRGBA(int[]),
com.ermapper.ecw.JNCSFile#readLineBGR,
readLineBGRA(int[])
public int readImageRGBA(int[] pRGBAImageArray,
int width,
int height)
throws JNCSException
pRGBAImageArray - An array of integer data, the size of which will be the width of the setView * height of the setView.width - The width of the set viewheight - The height of the set viewJNCSException - indicating there was an error in the read process.setView(int, int[], int, int, int, int, int, int),
getLastErrorText(int),
readLineBIL(int[])public java.lang.String getLastErrorText(int errorNum)
errorNum - The error number returned from a previous routine.
public JNCSDatasetPoint convertWorldToDataset(double dWorldX,
double dWorldY)
throws JNCSFileNotOpenException
dWorldX - The input world x coordinate.dWorldY - The input world y coordinate.JNCSFileNotOpenException - indicating there is currently no valid open file.convertDatasetToWorld(int, int)
public JNCSWorldPoint convertDatasetToWorld(int nDatasetX,
int nDatasetY)
throws JNCSFileNotOpenException
nDatasetX - The input dataset x cell.nDatasetY - The input dataset y cellJNCSFileNotOpenException - indicating there is currently no valid open file.convertWorldToDataset(double, double)public short getPercentComplete()
setView(int, int[], int, int, int, int, int, int)public static java.lang.String getLibVersion()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||