Revision 20374 trunk/libraries/libjni-mrsid/src/main/java/es/gva/cit/jmrsid/LTISceneBuffer.java

View differences:

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
	

Also available in: Unified diff