Revision 17862
trunk/libraries/libjni-ecwcompress/src/es/gva/cit/jecwcompress/JniObject.java | ||
---|---|---|
58 | 58 |
* @version 0.0 |
59 | 59 |
* @link http://www.gvsig.gva.es |
60 | 60 |
*/ |
61 |
public class JniObject{ |
|
61 |
public class JniObject {
|
|
62 | 62 |
|
63 | 63 |
protected long cPtr; |
64 | 64 |
protected int nNextLine; |
... | ... | |
66 | 66 |
/** |
67 | 67 |
* Obtiene la direcci?n de memoria |
68 | 68 |
*/ |
69 |
public long getPtro(){ |
|
69 |
public long getPtro() {
|
|
70 | 70 |
return cPtr; |
71 | 71 |
} |
72 | 72 |
|
trunk/libraries/libjni-ecwcompress/src/es/gva/cit/jecwcompress/JNIBase.java | ||
---|---|---|
59 | 59 |
* @version 0.0 |
60 | 60 |
* @link http://www.gvsig.gva.es |
61 | 61 |
*/ |
62 |
public class JNIBase{ |
|
62 |
public class JNIBase {
|
|
63 | 63 |
|
64 | 64 |
protected long cPtr; |
65 | 65 |
|
... | ... | |
75 | 75 |
*/ |
76 | 76 |
|
77 | 77 |
|
78 |
protected int baseSimpleFunctions(int n,String msg1,String msg2)throws EcwException{ |
|
78 |
protected int baseSimpleFunctions(int n,String msg1,String msg2)throws EcwException {
|
|
79 | 79 |
|
80 | 80 |
int res = 0; |
81 |
if(cPtr <= 0)
|
|
81 |
if(cPtr == 0)
|
|
82 | 82 |
throw new EcwException(msg1); |
83 | 83 |
|
84 |
switch(n){ |
|
84 |
switch(n) {
|
|
85 | 85 |
case 0: /*res = getRasterBandXSizeNat(cPtr);*/break; |
86 | 86 |
} |
87 | 87 |
|
88 |
if(res<0)
|
|
88 |
if(res < 0)
|
|
89 | 89 |
throw new EcwException(msg2); |
90 | 90 |
else return res; |
91 | 91 |
} |
trunk/libraries/libjni-ecwcompress/src/es/gva/cit/jecwcompress/CellSizeUnits.java | ||
---|---|---|
56 | 56 |
* @version 0.0 |
57 | 57 |
* @link http://www.gvsig.gva.es |
58 | 58 |
*/ |
59 |
public class CellSizeUnits{ |
|
59 |
public class CellSizeUnits {
|
|
60 | 60 |
|
61 | 61 |
private final static int ECW_CELL_UNITS_INVALID = 0; |
62 | 62 |
private final static int ECW_CELL_UNITS_METERS = 1; |
trunk/libraries/libjni-ecwcompress/src/es/gva/cit/jecwcompress/EcwException.java | ||
---|---|---|
59 | 59 |
*/ |
60 | 60 |
|
61 | 61 |
|
62 |
public class EcwException extends Exception{ |
|
62 |
public class EcwException extends Exception {
|
|
63 | 63 |
|
64 |
public EcwException(String msg){ |
|
64 |
public EcwException(String msg) {
|
|
65 | 65 |
super(msg); |
66 | 66 |
} |
67 | 67 |
|
trunk/libraries/libjni-ecwcompress/src/es/gva/cit/jecwcompress/NCSEcwCompressClient.java | ||
---|---|---|
106 | 106 |
/** |
107 | 107 |
* Esta funci?n es llamada desde C para inicializar el buffer que contendr? 1 linea de datos |
108 | 108 |
*/ |
109 |
private void initialize(){ |
|
110 |
buffer=new byte[nInOutSizeX*nInputBands];
|
|
109 |
private void initialize() {
|
|
110 |
buffer = new byte[nInOutSizeX*nInputBands];
|
|
111 | 111 |
} |
112 | 112 |
|
113 | 113 |
/** |
114 | 114 |
* Esta funci?n es llamada desde C para asignar la direcci?n de memoria de la estructura readInfo |
115 | 115 |
*/ |
116 |
private void setReadInfo(long ptr){ |
|
117 |
readInfo=ptr;
|
|
116 |
private void setReadInfo(long ptr) {
|
|
117 |
readInfo = ptr;
|
|
118 | 118 |
} |
119 | 119 |
|
120 | 120 |
/** |
121 | 121 |
* Esta funci?n es llamada desde C para recuperar la direcci?n de memoria de readInfo |
122 | 122 |
*/ |
123 |
private long getReadInfo(){ |
|
123 |
private long getReadInfo() {
|
|
124 | 124 |
return readInfo; |
125 | 125 |
} |
126 | 126 |
|
127 | 127 |
/** |
128 | 128 |
* Devuelve la cantidad de imagen comprimida en tanto por cien. |
129 | 129 |
*/ |
130 |
public int getPercent(){ |
|
130 |
public int getPercent() {
|
|
131 | 131 |
return porcentaje; |
132 | 132 |
} |
133 | 133 |
|
... | ... | |
135 | 135 |
* Contructor |
136 | 136 |
* @throws EcwException Se produce cuando la llamada nativa devuelve un c?digo de error |
137 | 137 |
*/ |
138 |
public NCSEcwCompressClient()throws EcwException{ |
|
138 |
public NCSEcwCompressClient()throws EcwException {
|
|
139 | 139 |
|
140 | 140 |
cPtr = NCSEcwCompressClientNat(); |
141 | 141 |
|
142 |
if(cPtr<=0)
|
|
142 |
if(cPtr == 0)
|
|
143 | 143 |
throw new EcwException("Error en la creaci?n del objeto NCSEcwCompressClient"); |
144 | 144 |
} |
145 | 145 |
|
... | ... | |
147 | 147 |
* Inicializa el compresor |
148 | 148 |
* @throws EcwException Se produce cuando la llamada nativa devuelve un c?digo de error |
149 | 149 |
*/ |
150 |
public void NCSEcwCompressOpen(boolean bCalculateSizesOnly)throws EcwException{ |
|
150 |
public void NCSEcwCompressOpen(boolean bCalculateSizesOnly)throws EcwException {
|
|
151 | 151 |
|
152 |
if(cPtr <= 0)
|
|
152 |
if(cPtr == 0)
|
|
153 | 153 |
throw new EcwException("Error en NCSEcwCompressOpen(). No hay una referencia v?lida al objeto NCSEcwCompressClient."); |
154 | 154 |
|
155 | 155 |
int error = NCSEcwCompressOpenNat(cPtr, bCalculateSizesOnly); |
... | ... | |
165 | 165 |
* Realiza la funci?n de compresi?n |
166 | 166 |
* @throws EcwException Se produce cuando la llamada nativa devuelve un c?digo de error |
167 | 167 |
*/ |
168 |
public void NCSEcwCompress(ReadCallBack read)throws EcwException{ |
|
168 |
public void NCSEcwCompress(ReadCallBack read)throws EcwException {
|
|
169 | 169 |
|
170 |
if(cPtr <= 0)
|
|
170 |
if(cPtr == 0)
|
|
171 | 171 |
throw new EcwException("Error en NCSEcwCompress(). No hay una referencia v?lida al objeto NCSEcwCompressClient."); |
172 | 172 |
|
173 | 173 |
if(read == null) |
... | ... | |
185 | 185 |
* Cierra el compresor |
186 | 186 |
* @throws EcwException Se produce cuando la llamada nativa devuelve un c?digo de error |
187 | 187 |
*/ |
188 |
public void NCSEcwCompressClose()throws EcwException{ |
|
188 |
public void NCSEcwCompressClose()throws EcwException {
|
|
189 | 189 |
|
190 |
if(cPtr <= 0)
|
|
190 |
if(cPtr == 0)
|
|
191 | 191 |
throw new EcwException("Error en NCSEcwCompress(). No hay una referencia v?lida al objeto NCSEcwCompressClient."); |
192 | 192 |
|
193 | 193 |
int error = NCSEcwCompressCloseNat(cPtr); |
... | ... | |
202 | 202 |
* Cancela la compresi?n |
203 | 203 |
* @throws EcwException Se produce cuando la llamada nativa devuelve un c?digo de error |
204 | 204 |
*/ |
205 |
public void NCSEcwCompressCancel()throws EcwException{ |
|
205 |
public void NCSEcwCompressCancel()throws EcwException {
|
|
206 | 206 |
|
207 |
if(cPtr <= 0)
|
|
207 |
if(cPtr == 0)
|
|
208 | 208 |
throw new EcwException("Error en NCSEcwCompress(). No hay una referencia v?lida al objeto NCSEcwCompressClient."); |
209 | 209 |
|
210 | 210 |
NCSEcwCompressCancelNat(cPtr); |
... | ... | |
213 | 213 |
/** |
214 | 214 |
* @throws EcwException Se produce cuando la llamada nativa devuelve un c?digo de error |
215 | 215 |
*/ |
216 |
public void finalize()throws EcwException{ |
|
216 |
public void finalize()throws EcwException {
|
|
217 | 217 |
|
218 |
if(cPtr <= 0)
|
|
218 |
if(cPtr == 0)
|
|
219 | 219 |
throw new EcwException("Error en finalize(). No hay una referencia v?lida al objeto NCSEcwCompressClient y no se ha podido liberar la memoria."); |
220 | 220 |
|
221 |
finalizeNat(cPtr); |
|
221 |
//TODO: Temporalmente deshabilitado. |
|
222 |
//finalizeNat(cPtr); |
|
222 | 223 |
} |
223 | 224 |
|
224 | 225 |
/** |
trunk/libraries/libjni-ecwcompress/src/es/gva/cit/jecwcompress/NCSError.java | ||
---|---|---|
58 | 58 |
* @version 0.0 |
59 | 59 |
* @link http://www.gvsig.gva.es |
60 | 60 |
*/ |
61 |
public class NCSError{ |
|
61 |
public class NCSError {
|
|
62 | 62 |
|
63 | 63 |
/** |
64 | 64 |
* Conversi?n de un c?digo de error pasado por par?metro a cadena |
trunk/libraries/libjni-ecwcompress/src/es/gva/cit/jecwcompress/CompressHint.java | ||
---|---|---|
55 | 55 |
* @version 0.0 |
56 | 56 |
* @link http://www.gvsig.gva.es |
57 | 57 |
*/ |
58 |
public class CompressHint{ |
|
58 |
public class CompressHint {
|
|
59 | 59 |
|
60 | 60 |
public final static int COMPRESS_HINT_NONE = 0; |
61 | 61 |
public final static int COMPRESS_HINT_FAST = 1; |
trunk/libraries/libjni-ecwcompress/src/es/gva/cit/jecwcompress/CompressFormat.java | ||
---|---|---|
60 | 60 |
* @version 0.0 |
61 | 61 |
* @link http://www.gvsig.gva.es |
62 | 62 |
*/ |
63 |
public class CompressFormat{ |
|
63 |
public class CompressFormat {
|
|
64 | 64 |
|
65 | 65 |
public static final int COMPRESS_NONE = 0; |
66 | 66 |
public static final int COMPRESS_UINT8 = 1; |
Also available in: Unified diff