Revision 8797
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.buffer/org.gvsig.raster.lib.buffer.impl/src/main/java/org/gvsig/raster/lib/buffer/impl/DefaultBufferManager.java | ||
---|---|---|
499 | 499 |
Coercion coercion = null; |
500 | 500 |
switch (dataType) { |
501 | 501 |
case BufferManager.TYPE_BYTE: |
502 |
coercion = new CoerceToByte(); |
|
503 |
return coercion.coerce(value); |
|
502 |
// coercion = new CoerceToByte(); |
|
503 |
// return coercion.coerce(value); |
|
504 |
coercion = new CoerceToInt(); |
|
505 |
return new Integer(Math.abs(0xFF & ((Integer) coercion.coerce(value)).intValue())).byteValue(); |
|
504 | 506 |
case BufferManager.TYPE_USHORT: |
505 |
coercion = new CoerceToInt(); |
|
506 |
return Math.abs(0xFFFF & ((Integer) coercion.coerce(value)).intValue()); |
|
507 | 507 |
case BufferManager.TYPE_SHORT: |
508 | 508 |
coercion = new CoerceToInt(); |
509 |
return 0xFF & ((Integer) coercion.coerce(value)).intValue(); |
|
509 |
return 0xFFFF & ((Integer) coercion.coerce(value)).intValue();
|
|
510 | 510 |
case BufferManager.TYPE_INT: |
511 | 511 |
coercion = new CoerceToInt(); |
512 | 512 |
return coercion.coerce(value); |
Also available in: Unified diff