|
[
Permalink
| « Hide
]
Norman Fomferra added a comment - 27/May/10 01:17 PM
Cause: The bug has obviously been introduced in BEAM 4.5 from where on we use JAI images (RenderedImage/PlanarImage) as primary raster data source. A RenderedImage interface provides sample data through the Raster class, which again holds a DataBuffer, whose only 8-bit data is unsigned byte.
Here are a number of locations in BEAM code, where the bug has an imapact and/or where the fix shall be applied:
(1) ImageManager.createRescaleOp() - perfoms a scaling from raw to geophysical image (2) TileImpl.getSampleInt() / setSample(...., int s) - also converts to and from raw and geophysical sample values (3) BandOpImageTest.testThatAwtRastersAreWrittenCorrectly() - commented out assertion that fails because of this bug Actually, the issue becomes a bug only when raw sample data is converted to geo-physical samples. It is fully ok to store signed data types in unsigned data buffers. Only when the data needs to be interpreted, the unsigned byte type needs a special treatment. Fixed
Tile.getSample<T>(int x, int y):T Tile.setSample(int x, int y, T s):void Tile.getSamples<T>():T[] Tile.setSamples<T>(T[] s):void Fixed (1) computation of geophysical image
Fixed (3) and computation of statistics
|
|||||||||||||||||||||||||||||||||||||||