Revision 20374
trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/MrSIDImageReaderBase.java | ||
---|---|---|
82 | 82 |
* |
83 | 83 |
*/ |
84 | 84 |
public void close(){ |
85 |
if(cPtr > 0){
|
|
85 |
if(cPtr != 0){
|
|
86 | 86 |
FreeMrSIDImageReaderBaseNat(cPtr); |
87 |
cPtr = -1;
|
|
87 |
cPtr = 0;
|
|
88 | 88 |
} |
89 | 89 |
} |
90 | 90 |
} |
trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/LTISceneBuffer.java | ||
---|---|---|
102 | 102 |
if(flag)cPtr=LTISceneBufferNat(pixel.cPtr, totalNumCols, totalNumRows, 1); |
103 | 103 |
else cPtr=LTISceneBufferNat(pixel.cPtr, totalNumCols, totalNumRows, 0); |
104 | 104 |
|
105 |
if(cPtr<0)
|
|
105 |
if(cPtr == 0)
|
|
106 | 106 |
throw new MrSIDException("Error en el constructor nativo LTIScene."); |
107 | 107 |
} |
108 | 108 |
|
... | ... | |
120 | 120 |
* @throws MrSIDException |
121 | 121 |
*/ |
122 | 122 |
public LTISceneBuffer(LTIPixel pixel, int totalNumCols, int totalNumRows, int colOffset, int rowOffset, int windowNumCols, int windowNumRows, boolean flag)throws MrSIDException{ |
123 |
|
|
124 |
if(totalNumCols<0 || totalNumRows<0 || colOffset<0 || rowOffset<0 || windowNumCols<0 || windowNumRows<0 || pixel==null) |
|
123 |
|
|
124 |
/*if ((colOffset < 0) || (rowOffset < 0) || (colOffset > baseSimpleFunction(3, "", "")) || (colOffset > baseSimpleFunction(4, "", ""))) |
|
125 |
throw new MrSIDException("Posicion inicial de la escena no valida"); |
|
126 |
|
|
127 |
if ((windowNumCols < 1) || (windowNumRows < 1) || (windowNumCols > baseSimpleFunction(3, "", "")) || (windowNumRows > baseSimpleFunction(4, "", ""))) |
|
128 |
throw new MrSIDException("Tama?o de la escena no valido"); |
|
129 |
|
|
130 |
if (((colOffset + windowNumCols) > baseSimpleFunction(3, "", "")) || ((rowOffset + windowNumRows) > baseSimpleFunction(4, "", ""))) |
|
131 |
throw new MrSIDException("Valores de la escena no validos"); |
|
132 |
|
|
133 |
if(totalNumCols<0 || totalNumRows<0 || pixel==null) |
|
125 | 134 |
throw new MrSIDException("Valores no validos para el tama?o de ventana."); |
126 |
|
|
135 |
*/ |
|
127 | 136 |
this.cPtrbuffer=-1; |
128 | 137 |
this.flag=flag; |
129 | 138 |
|
... | ... | |
140 | 149 |
if(flag)cPtr=LTISceneBuffer1Nat(pixel.cPtr, totalNumCols, totalNumRows, colOffset, rowOffset, windowNumCols, windowNumRows, 1); |
141 | 150 |
else cPtr=LTISceneBuffer1Nat(pixel.cPtr, totalNumCols, totalNumRows, colOffset, rowOffset, windowNumCols, windowNumRows, 0); |
142 | 151 |
|
143 |
if(cPtr<0)
|
|
152 |
if(cPtr == 0)
|
|
144 | 153 |
throw new MrSIDException("Error en el constructor nativo LTIScene."); |
145 | 154 |
} |
146 | 155 |
|
... | ... | |
149 | 158 |
*/ |
150 | 159 |
public void finalize(){ |
151 | 160 |
//System.out.println("Finalizando LTIsceneBuffer ..."+cPtrbuffer); |
152 |
if(cPtr > 0)
|
|
161 |
if(cPtr != 0)
|
|
153 | 162 |
FreeLTISceneBufferNat(cPtr, cPtrbuffer); |
154 | 163 |
} |
155 | 164 |
|
trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/MrSIDImageReader.java | ||
---|---|---|
62 | 62 |
*/ |
63 | 63 |
|
64 | 64 |
protected void finalize(){ |
65 |
this.close(); |
|
65 |
if (cPtr != 0) |
|
66 |
this.close(); |
|
66 | 67 |
} |
67 | 68 |
|
68 | 69 |
/** |
... | ... | |
70 | 71 |
* |
71 | 72 |
*/ |
72 | 73 |
public void close(){ |
73 |
if(cPtr > 0){
|
|
74 |
if(cPtr != 0){
|
|
74 | 75 |
FreeMrSIDImageReaderNat(cPtr); |
75 |
cPtr = -1;
|
|
76 |
cPtr = 0;
|
|
76 | 77 |
} |
77 | 78 |
} |
78 | 79 |
|
... | ... | |
85 | 86 |
|
86 | 87 |
public MrSIDImageReader(String pszFilename)throws MrSIDException, IOException{ |
87 | 88 |
|
89 |
/*if ((pszFilename == null) || (pszFilename.equals(""))) |
|
90 |
throw new MrSIDException("Nombre de fichero incorrecto"); |
|
91 |
|
|
88 | 92 |
File f = new File( pszFilename ); |
89 | 93 |
if(!f.exists()) |
90 | 94 |
throw new IOException("The file "+pszFilename+" don't exists"); |
91 | 95 |
|
92 | 96 |
if(!f.canRead()) |
93 |
throw new IOException("I can't read the file"); |
|
97 |
throw new IOException("I can't read the file");*/
|
|
94 | 98 |
|
95 |
cPtr=MrSIDImageReaderArrayNat(pszFilename.getBytes());
|
|
99 |
cPtr = MrSIDImageReaderArrayNat(pszFilename.getBytes());
|
|
96 | 100 |
|
97 |
if(cPtr<0)
|
|
101 |
if(cPtr == 0)
|
|
98 | 102 |
throw new MrSIDException("Error in MrDID Open"); |
99 | 103 |
|
100 | 104 |
} |
trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/LTIScene.java | ||
---|---|---|
79 | 79 |
|
80 | 80 |
public void finalize(){ |
81 | 81 |
//System.out.println("Finalizando LTIscene ..."+cPtr); |
82 |
if(cPtr > 0)
|
|
82 |
if(cPtr != 0)
|
|
83 | 83 |
FreeLTISceneNat(cPtr); |
84 | 84 |
} |
85 | 85 |
|
... | ... | |
93 | 93 |
*/ |
94 | 94 |
|
95 | 95 |
public LTIScene(double xinic,double yinic,double tamx,double tamy, double magnification)throws MrSIDException{ |
96 |
|
|
97 |
if(xinic<0 || yinic<0 || tamx<0 || tamy<0 || magnification<0) |
|
98 |
throw new MrSIDException("Invalid values to scene creation"); |
|
99 | 96 |
|
100 | 97 |
cPtr=LTISceneNat(xinic, yinic, tamx, tamy, magnification); |
101 | 98 |
|
102 |
if(cPtr<0)
|
|
99 |
if(cPtr == 0)
|
|
103 | 100 |
throw new MrSIDException("Error in native constructor LTIScene"); |
104 | 101 |
} |
105 | 102 |
} |
trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/LTIUtils.java | ||
---|---|---|
79 | 79 |
*/ |
80 | 80 |
|
81 | 81 |
protected void finalize(){ |
82 |
if(cPtr > 0)
|
|
82 |
if(cPtr != 0)
|
|
83 | 83 |
FreeLTIUtilsNat(cPtr); |
84 | 84 |
} |
85 | 85 |
|
... | ... | |
93 | 93 |
|
94 | 94 |
double mag = levelToMagNat(level); |
95 | 95 |
|
96 |
if(mag<0)
|
|
96 |
if(mag < 0)
|
|
97 | 97 |
throw new MrSIDException("Error LTIUtils::levelToMag. Se obtuvo un valor erroneoen la llamada nativa levelToMag."); |
98 | 98 |
else |
99 | 99 |
return mag; |
trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/TestReadMrSid.java | ||
---|---|---|
8 | 8 |
import es.gva.cit.jmrsid.MrSIDException; |
9 | 9 |
import es.gva.cit.jmrsid.MrSIDImageReader; |
10 | 10 |
|
11 |
/** |
|
12 |
* Test de lectura de jmrsid. |
|
13 |
* @author Miguel ?ngel Querol Carratal? <miguelangel.querol@iver.es> |
|
14 |
* |
|
15 |
*/ |
|
11 | 16 |
public class TestReadMrSid extends TestCase{ |
12 | 17 |
|
13 | 18 |
private MrSIDImageReader sid = null; |
trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/LTIMetadataDatabase.java | ||
---|---|---|
80 | 80 |
* Destructor |
81 | 81 |
*/ |
82 | 82 |
protected void finalize(){ |
83 |
//System.out.println("Finalizando LTIMetadataDatabase ..."+cPtr); |
|
84 | 83 |
|
85 |
if(cPtr > 0)
|
|
84 |
if(cPtr != 0)
|
|
86 | 85 |
FreeLTIMetadataDatabaseNat(cPtr); |
87 | 86 |
} |
88 | 87 |
|
... | ... | |
108 | 107 |
*/ |
109 | 108 |
public LTIMetadataRecord getDataByIndex(int i)throws MrSIDException{ |
110 | 109 |
|
111 |
if(cPtr <= 0)
|
|
110 |
if(cPtr == 0)
|
|
112 | 111 |
throw new MrSIDException("Error en getDataByIndex. La referencia al objeto no es valida."); |
113 | 112 |
|
114 | 113 |
LTIMetadataRecord metadata=new LTIMetadataRecord(getDataByIndexNat(cPtr,i)); |
115 | 114 |
|
116 | 115 |
if(metadata==null) |
117 | 116 |
throw new MrSIDException("Objeto LTIMetadataRecord nulo"); |
118 |
else return metadata; |
|
119 | 117 |
|
118 |
return metadata; |
|
119 |
|
|
120 | 120 |
} |
121 | 121 |
|
122 | 122 |
|
trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/LTIImageReader.java | ||
---|---|---|
79 | 79 |
*/ |
80 | 80 |
|
81 | 81 |
protected void finalize(){ |
82 |
this.close(); |
|
82 |
if (cPtr != 0) |
|
83 |
this.close(); |
|
83 | 84 |
} |
84 | 85 |
|
85 | 86 |
/** |
... | ... | |
87 | 88 |
* |
88 | 89 |
*/ |
89 | 90 |
public void close(){ |
90 |
if(cPtr > 0){
|
|
91 |
if(cPtr != 0){
|
|
91 | 92 |
FreeLTIImageReaderNat(cPtr); |
92 |
cPtr = -1;
|
|
93 |
cPtr = 0;
|
|
93 | 94 |
} |
94 | 95 |
} |
95 | 96 |
|
trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/LTIImageStage.java | ||
---|---|---|
77 | 77 |
* Destructor |
78 | 78 |
*/ |
79 | 79 |
protected void finalize(){ |
80 |
if(cPtr > 0)
|
|
80 |
if(cPtr != 0)
|
|
81 | 81 |
FreeLTIImageStageNat(cPtr); |
82 | 82 |
} |
83 | 83 |
|
... | ... | |
92 | 92 |
if(scene==null || buffer==null) |
93 | 93 |
throw new MrSIDException("Los argumentos no pueden ser nulos"); |
94 | 94 |
|
95 |
int res=readNat(cPtr,scene.cPtr,buffer.cPtr,buffer.cPtrbuffer, buffer); |
|
95 |
if (cPtr == 0) |
|
96 |
throw new MrSIDException("No se puede acceder al dato"); |
|
96 | 97 |
|
98 |
int res = readNat(cPtr,scene.cPtr,buffer.cPtr,buffer.cPtrbuffer, buffer); |
|
99 |
|
|
97 | 100 |
if(res!=0) |
98 | 101 |
throw new MrSIDException("En el m?todo read se ha devuelto un c?digo "+res); |
99 | 102 |
|
trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/LTIMetadataRecord.java | ||
---|---|---|
82 | 82 |
* Destructor |
83 | 83 |
*/ |
84 | 84 |
protected void finalize(){ |
85 |
if(cPtr > 0)
|
|
85 |
if(cPtr != 0)
|
|
86 | 86 |
FreeLTIMetadataRecordNat(cPtr); |
87 | 87 |
} |
88 | 88 |
|
... | ... | |
103 | 103 |
*/ |
104 | 104 |
public String getTagName()throws MrSIDException{ |
105 | 105 |
|
106 |
if(cPtr <= 0)
|
|
106 |
if(cPtr == 0)
|
|
107 | 107 |
throw new MrSIDException("Error en getTagName. La referencia al objeto no es valida."); |
108 | 108 |
|
109 | 109 |
String tagname = getTagNameNat(cPtr); |
110 | 110 |
|
111 |
if(tagname==null)
|
|
111 |
if(tagname == null)
|
|
112 | 112 |
throw new MrSIDException("No se ha devuelto un nombre de tag valido"); |
113 |
else return tagname; |
|
113 |
|
|
114 |
return tagname; |
|
114 | 115 |
} |
115 | 116 |
|
116 | 117 |
/** |
... | ... | |
120 | 121 |
*/ |
121 | 122 |
public boolean isScalar()throws MrSIDException{ |
122 | 123 |
|
123 |
if(cPtr <= 0)
|
|
124 |
if (cPtr == 0)
|
|
124 | 125 |
throw new MrSIDException("Error en getTagName. La referencia al objeto no es valida."); |
126 |
|
|
125 | 127 |
int res = isScalarNat(cPtr); |
126 | 128 |
|
127 |
if(res==1)return true;
|
|
129 |
if (res == 1)return true;
|
|
128 | 130 |
else return false; |
129 |
|
|
131 |
|
|
130 | 132 |
} |
131 | 133 |
|
132 | 134 |
/** |
... | ... | |
135 | 137 |
* @return true si es vector y false si no lo es |
136 | 138 |
*/ |
137 | 139 |
public boolean isVector()throws MrSIDException{ |
138 |
if(cPtr <= 0)
|
|
140 |
if(cPtr == 0)
|
|
139 | 141 |
throw new MrSIDException("Error en isVector. La referencia al objeto no es valida."); |
140 | 142 |
|
141 | 143 |
int res = isVectorNat(cPtr); |
... | ... | |
151 | 153 |
* @return true si es array y false si no lo es |
152 | 154 |
*/ |
153 | 155 |
public boolean isArray()throws MrSIDException{ |
154 |
if(cPtr <= 0)
|
|
156 |
if(cPtr == 0)
|
|
155 | 157 |
throw new MrSIDException("Error en getTagName. La referencia al objeto no es valida."); |
156 | 158 |
|
157 | 159 |
int res = isArrayNat(cPtr); |
... | ... | |
182 | 184 |
* |
183 | 185 |
*/ |
184 | 186 |
public int getDataType()throws MrSIDException{ |
185 |
if(cPtr <= 0)
|
|
187 |
if(cPtr == 0)
|
|
186 | 188 |
throw new MrSIDException("Error en getDataType. La referencia al objeto no es valida."); |
187 | 189 |
|
188 | 190 |
int res = getDataTypeNat(cPtr); |
189 | 191 |
|
190 |
if(res<0)
|
|
192 |
if(res < 0)
|
|
191 | 193 |
throw new MrSIDException("Error en getDataType. No se ha obtenido un tipo de datos valido"); |
192 |
else return res; |
|
194 |
|
|
195 |
return res; |
|
193 | 196 |
} |
194 | 197 |
|
195 | 198 |
/** |
... | ... | |
202 | 205 |
|
203 | 206 |
String datos=null; |
204 | 207 |
|
205 |
if(cPtr <= 0)
|
|
208 |
if(cPtr == 0)
|
|
206 | 209 |
throw new MrSIDException("Error en getScalarData. La referencia al objeto no es valida."); |
207 | 210 |
|
208 | 211 |
datos = getScalarDataNat(cPtr); |
... | ... | |
217 | 220 |
* @return vector de strings con los valores del metadato |
218 | 221 |
*/ |
219 | 222 |
public String[] getVectorData()throws MrSIDException{ |
220 |
if(cPtr <= 0)
|
|
223 |
if(cPtr == 0)
|
|
221 | 224 |
throw new MrSIDException("Error en getVectorData. La referencia al objeto no es valida."); |
222 | 225 |
|
223 | 226 |
StringArray res = getVectorDataNat(cPtr); |
224 | 227 |
|
225 |
if(res!=null)return res.array;
|
|
228 |
if(res != null)return res.array;
|
|
226 | 229 |
else return null; |
227 | 230 |
} |
228 | 231 |
|
... | ... | |
233 | 236 |
* @return vector de strings con los valores del metadato |
234 | 237 |
*/ |
235 | 238 |
public String[] getArrayData()throws MrSIDException{ |
236 |
if(cPtr <= 0)
|
|
239 |
if(cPtr == 0)
|
|
237 | 240 |
throw new MrSIDException("Error en getArrayData. La referencia al objeto no es valida."); |
238 | 241 |
|
239 | 242 |
StringArray res = getArrayDataNat(cPtr); |
240 | 243 |
|
241 |
if(res!=null)return res.array;
|
|
244 |
if(res != null)return res.array;
|
|
242 | 245 |
else return null; |
243 | 246 |
} |
244 | 247 |
|
... | ... | |
250 | 253 |
|
251 | 254 |
public int getNumDims()throws MrSIDException{ |
252 | 255 |
|
253 |
if(cPtr <= 0)
|
|
256 |
if(cPtr == 0)
|
|
254 | 257 |
throw new MrSIDException("Error en getNumDims. La referencia al objeto no es valida."); |
255 | 258 |
|
256 | 259 |
int res = getNumDimsNat(cPtr); |
... | ... | |
268 | 271 |
*/ |
269 | 272 |
public int[] getDims()throws MrSIDException{ |
270 | 273 |
|
271 |
if(cPtr <= 0)
|
|
274 |
if(cPtr == 0)
|
|
272 | 275 |
throw new MrSIDException("Error en getDims. La referencia al objeto no es valida."); |
273 | 276 |
|
274 | 277 |
int[] res = getDimsNat(cPtr); |
trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/LTIPixel.java | ||
---|---|---|
67 | 67 |
*/ |
68 | 68 |
|
69 | 69 |
protected void finalize(){ |
70 |
//System.out.println("Finalizando LTIPixel ..."+cPtr); |
|
71 |
if(cPtr > 0) |
|
70 |
if(cPtr != 0) |
|
72 | 71 |
FreeLTIPixelNat(cPtr); |
73 | 72 |
} |
74 | 73 |
|
... | ... | |
92 | 91 |
*/ |
93 | 92 |
public LTIPixel(int eColorSpace, int nBands, int eSampleType)throws MrSIDException{ |
94 | 93 |
|
95 |
cPtr=LTIPixelNat(eColorSpace, nBands, eSampleType);
|
|
94 |
cPtr = LTIPixelNat(eColorSpace, nBands, eSampleType);
|
|
96 | 95 |
|
97 |
if(cPtr<0)
|
|
96 |
if(cPtr == 0)
|
|
98 | 97 |
throw new MrSIDException("Error in native constructor LTIPixel"); |
99 | 98 |
|
100 | 99 |
} |
trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/LTIImage.java | ||
---|---|---|
88 | 88 |
* Destructor |
89 | 89 |
*/ |
90 | 90 |
protected void finalize(){ |
91 |
//System.out.println("Finalizando LTIImage ..."+cPtr); |
|
92 |
if(cPtr > 0){ |
|
91 |
if(cPtr != 0){ |
|
93 | 92 |
FreeLTIImageNat(cPtr); |
94 | 93 |
cPtr = -1; |
95 | 94 |
} |
... | ... | |
105 | 104 |
String msg1="Error en initialize. El Open del MrSID no tuvo ?xito"; |
106 | 105 |
String msg2="La llamada nativa a initialize ha devuelto un c?digo de error"; |
107 | 106 |
int codigo = super.baseSimpleFunction(1,msg1,msg2); |
108 |
if( codigo>0) |
|
107 |
|
|
108 |
if( codigo > 0) |
|
109 | 109 |
throw new MrSIDException("La llamada nativa a initialize ha devuelto el c?digo de error "+codigo); |
110 | 110 |
|
111 |
|
|
112 | 111 |
} |
113 | 112 |
|
114 | 113 |
|
... | ... | |
119 | 118 |
*/ |
120 | 119 |
public LTIMetadataDatabase getMetadata()throws MrSIDException{ |
121 | 120 |
|
122 |
|
|
123 |
if(cPtr <= 0) |
|
124 |
throw new MrSIDException("Error en getMetadataDatabase. El Open del MrSID no tuvo ?xito"); |
|
121 |
if(cPtr == 0) |
|
122 |
throw new MrSIDException("Error en getMetadataDatabase. El Open del MrSID no tuvo ?xito"); |
|
125 | 123 |
|
126 |
LTIMetadataDatabase metadata=new LTIMetadataDatabase(getMetadataNat(cPtr));
|
|
127 |
|
|
124 |
LTIMetadataDatabase metadata = new LTIMetadataDatabase(getMetadataNat(cPtr));
|
|
125 |
|
|
128 | 126 |
if(metadata==null) |
129 |
throw new MrSIDException("Objeto LTIMetadataDatabase nulo"); |
|
130 |
else return metadata; |
|
127 |
throw new MrSIDException("Objeto LTIMetadataDatabase nulo"); |
|
128 |
|
|
129 |
return metadata; |
|
131 | 130 |
} |
132 |
|
|
131 |
|
|
133 | 132 |
/** |
134 | 133 |
* Obtiene el ancho de la im?gen. |
135 | 134 |
* |
... | ... | |
209 | 208 |
*/ |
210 | 209 |
public int[] getDimsAtMag(double mag)throws MrSIDException{ |
211 | 210 |
|
212 |
if(cPtr <= 0)
|
|
211 |
if(cPtr == 0)
|
|
213 | 212 |
throw new MrSIDException("Error en getDimsAtMag. El Open del MrSID no tuvo ?xito"); |
214 | 213 |
|
215 | 214 |
magsize[0]=getDimsAtMagWidthNat(cPtr,mag); |
216 | 215 |
magsize[1]=getDimsAtMagHeightNat(cPtr,mag); |
217 | 216 |
|
218 |
if(magsize[0]<0 || magsize[1]<0)
|
|
217 |
if(magsize[0] < 0 || magsize[1] < 0)
|
|
219 | 218 |
throw new MrSIDException("Error en getDimsAtMag. El Open del MrSID no tuvo ?xito"); |
220 | 219 |
|
221 | 220 |
return magsize; |
... | ... | |
228 | 227 |
*/ |
229 | 228 |
public LTIPixel getPixelProps()throws MrSIDException{ |
230 | 229 |
|
231 |
if(cPtr <= 0)
|
|
230 |
if(cPtr == 0)
|
|
232 | 231 |
throw new MrSIDException("Error en getPixelProps. El Open del MrSID no tuvo ?xito"); |
233 | 232 |
|
234 | 233 |
LTIPixel props=new LTIPixel(getPixelPropsNat(cPtr)); |
235 | 234 |
|
236 |
if(props==null)
|
|
235 |
if(props == null)
|
|
237 | 236 |
throw new MrSIDException("Error en getPixelProps. No se ha podido obtener LTIPixel"); |
238 |
else |
|
239 |
return props; |
|
240 | 237 |
|
238 |
return props; |
|
239 |
|
|
241 | 240 |
} |
242 | 241 |
|
243 | 242 |
/** |
... | ... | |
249 | 248 |
|
250 | 249 |
int res=0; |
251 | 250 |
|
252 |
if(cPtr <= 0)
|
|
251 |
if(cPtr == 0)
|
|
253 | 252 |
throw new MrSIDException("Error en getGeoCoord. El Open del MrSID no tuvo ?xito"); |
254 | 253 |
|
255 |
if(geocoord==null){
|
|
254 |
if(geocoord == null){
|
|
256 | 255 |
geocoord= new LTIGeoCoord(); |
257 | 256 |
res = getGeoCoordNat(cPtr,geocoord); |
258 | 257 |
} |
259 | 258 |
|
260 |
if(res<0)
|
|
259 |
if(res < 0)
|
|
261 | 260 |
throw new MrSIDException("Error en getGeoCoord. No se ha podido obtener un LTIGeoCoord valido"); |
262 |
else |
|
263 |
return geocoord; |
|
264 | 261 |
|
262 |
return geocoord; |
|
263 |
|
|
265 | 264 |
} |
266 | 265 |
|
267 | 266 |
/** |
... | ... | |
272 | 271 |
*/ |
273 | 272 |
public LTIPixel getBackgroundPixel()throws MrSIDException{ |
274 | 273 |
|
275 |
if(cPtr <= 0)
|
|
274 |
if(cPtr == 0)
|
|
276 | 275 |
throw new MrSIDException("Error en getBackgroundPixel. El Open del MrSID no tuvo ?xito"); |
277 | 276 |
|
278 | 277 |
LTIPixel pixel=new LTIPixel(getBackgroundPixelNat(cPtr)); |
279 | 278 |
|
280 |
if(pixel.getPtr()<=0)return null;
|
|
279 |
if(pixel.getPtr() == 0)return null;
|
|
281 | 280 |
else return pixel; |
282 | 281 |
|
283 | 282 |
} |
... | ... | |
290 | 289 |
*/ |
291 | 290 |
public LTIPixel getNoDataPixel()throws MrSIDException{ |
292 | 291 |
|
293 |
if(cPtr <= 0)
|
|
292 |
if(cPtr == 0)
|
|
294 | 293 |
throw new MrSIDException("Error en getNoData. El Open del MrSID no tuvo ?xito"); |
295 | 294 |
|
296 |
LTIPixel pixel=new LTIPixel(getNoDataPixelNat(cPtr));
|
|
295 |
LTIPixel pixel = new LTIPixel(getNoDataPixelNat(cPtr));
|
|
297 | 296 |
|
298 |
if(pixel.getPtr()<=0)return null;
|
|
297 |
if(pixel.getPtr() == 0)return null;
|
|
299 | 298 |
else return pixel; |
300 | 299 |
|
301 | 300 |
} |
... | ... | |
307 | 306 |
* @throws MrSIDException |
308 | 307 |
* @return the minimum magnification |
309 | 308 |
*/ |
310 |
public double getMinMagnification()throws MrSIDException{
|
|
311 |
|
|
312 |
if(cPtr <= 0)
|
|
313 |
throw new MrSIDException("Error en getMinMagnification(). El Open del MrSID no tuvo ?xito");
|
|
314 |
|
|
315 |
return this.getMinMagnificationNat(cPtr); |
|
316 |
|
|
317 |
}
|
|
309 |
public double getMinMagnification()throws MrSIDException{ |
|
310 |
|
|
311 |
if(cPtr == 0)
|
|
312 |
throw new MrSIDException("Error en getMinMagnification(). El Open del MrSID no tuvo ?xito");
|
|
313 |
|
|
314 |
return this.getMinMagnificationNat(cPtr);
|
|
315 |
|
|
316 |
} |
|
318 | 317 |
|
319 | 318 |
/** |
320 | 319 |
* This function returns the minimum magnification of the image. |
... | ... | |
325 | 324 |
*/ |
326 | 325 |
public double getMaxMagnification()throws MrSIDException{ |
327 | 326 |
|
328 |
if(cPtr <= 0)
|
|
327 |
if(cPtr == 0)
|
|
329 | 328 |
throw new MrSIDException("Error en getMaxMagnification(). El Open del MrSID no tuvo ?xito"); |
330 | 329 |
|
331 | 330 |
return this.getMaxMagnificationNat(cPtr); |
trunk/libraries/libjni-mrsid/readme.txt | ||
---|---|---|
1 |
Notas de compilaci?n de la librer?a jmrsid. |
|
2 |
|
|
3 |
La compilaci?n de la librer?a jmrsid se realiza autom?ticamente ejecutando el build.xml |
|
4 |
del proyecto. Para ello el sistema tiene que tener instalado y accesible: |
|
5 |
|
|
6 |
- CMake - Probado con la versi?n 2.4 |
|
7 |
- Compilador gcc - g++ en el caso de Linux - La versi?n de dicho compilador tiene que ser |
|
8 |
compatible con el SDK que disponga el usuario. Se ha compilado con gcc 3.3 |
|
9 |
- Entorno de desarrollo Visual Studio en caso de Windows con las variables de |
|
10 |
entorno cargadas. La versi?n del compilador tambi?n depende del SDK que el ususario |
|
11 |
tenga. - Compilado con Visual Studio 2005 |
|
12 |
- SDK de LizardTech instalado y accesible. Si el SDK est? en alguna ruta distinta a las que |
|
13 |
se incluyen en el archivo FindMRSID, habr? que a?adirla a dicho archivo o instalar el SDK |
|
14 |
en alguna de las indicadas. |
|
15 |
- JDK de Java. |
|
16 |
|
|
17 |
Con ejecutar el build.xml es suficiente para generar la librer?a y el jar. |
trunk/libraries/libjni-mrsid/build.xml | ||
---|---|---|
11 | 11 |
<property name="cmake_build" location="BMCMake/" /> |
12 | 12 |
<property name="sdk-dir" location="/home/miguel/mrsid/Geo_DSDK-6.0.7.1407" /> |
13 | 13 |
<property environment="env"/> |
14 |
<condition property="jmrsid_version" value="0.0.5">
|
|
14 |
<condition property="jmrsid_version" value="0.0.6">
|
|
15 | 15 |
<os family="unix"/> |
16 | 16 |
</condition> |
17 |
<condition property="jecw_version" value="005">
|
|
17 |
<condition property="jecw_version" value="006">
|
|
18 | 18 |
<os family="windows"/> |
19 | 19 |
</condition> |
20 |
<property name="jmrsid-jar" location="jmrsid-0.0.5.jar" />
|
|
20 |
<property name="jmrsid-jar" location="jmrsid-0.0.6.jar" />
|
|
21 | 21 |
<condition property="cmake_generator" value="'Unix Makefiles'"> |
22 | 22 |
<os family="unix"/> |
23 | 23 |
</condition> |
... | ... | |
30 | 30 |
|
31 | 31 |
<target name="jar" description="makes jar file"> |
32 | 32 |
<mkdir dir="${build}" /> |
33 |
<javac srcdir="${src-java}" destdir="${build}" /> |
|
33 |
<javac srcdir="${src-java}" destdir="${build}" debug="true" />
|
|
34 | 34 |
<mkdir dir="${jar-dist}" /> |
35 | 35 |
<jar jarfile="${jmrsid-jar}" basedir="${build}" includes="es/gva/cit/jmrsid/**" /> |
36 | 36 |
<move file="${jmrsid-jar}" todir="${jar-dist}" /> |
... | ... | |
44 | 44 |
<arg line="-G${cmake_generator}" /> |
45 | 45 |
<arg line="-DMRSID_DIR=${sdk-dir}" /> |
46 | 46 |
<arg line="-DCMAKE_BUILD_TYPE=Release" /> |
47 |
<arg line="-DJGDAL_VERSION=${jmrsid_version}" />
|
|
47 |
<arg line="-DJMRSID_VERSION=${jmrsid_version}" />
|
|
48 | 48 |
</exec> |
49 | 49 |
</target> |
50 | 50 |
|
51 | 51 |
Also available in: Unified diff