rasterMapWidth = activeReadRegion.getCols();
rasterMapHeight = activeReadRegion.getRows();
if (sampleModel == null) {
if (numberOfBytesPerValue == 8) {
if (!castDoubleToFloating) {
sampleModel = new ComponentSampleModelJAI(DataBuffer.TYPE_DOUBLE,
rasterMapWidth, rasterMapHeight, 1, rasterMapWidth, bands, bandOffsets);
} else {
sampleModel = new ComponentSampleModelJAI(DataBuffer.TYPE_FLOAT,
rasterMapWidth, rasterMapHeight, 1, rasterMapWidth, bands, bandOffsets);
}
} else if (numberOfBytesPerValue == 4 && readerMapType < 0) {
sampleModel = new ComponentSampleModelJAI(DataBuffer.TYPE_FLOAT, rasterMapWidth,
rasterMapHeight, 1, rasterMapWidth, bands, bandOffsets);
} else if (readerMapType > -1) {
sampleModel = new ComponentSampleModelJAI(DataBuffer.TYPE_INT, rasterMapWidth,
rasterMapHeight, 1, rasterMapWidth, bands, bandOffsets);
}
}
return sampleModel;
}