geotrellis.raster.io.geotiff.BitGeoTiffMultibandTile.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geotrellis-raster_2.11 Show documentation
Show all versions of geotrellis-raster_2.11 Show documentation
GeoTrellis is an open source geographic data processing engine for high performance applications.
The newest version!
package geotrellis.raster.io.geotiff
import geotrellis.raster._
import geotrellis.raster.io.geotiff.compression._
import java.nio.ByteBuffer
class BitGeoTiffMultibandTile(
compressedBytes: Array[Array[Byte]],
decompressor: Decompressor,
segmentLayout: GeoTiffSegmentLayout,
compression: Compression,
bandCount: Int,
hasPixelInterleave: Boolean,
val cellType: BitCells with NoDataHandling
) extends GeoTiffMultibandTile(compressedBytes, decompressor, segmentLayout, compression, bandCount, hasPixelInterleave)
with BitGeoTiffSegmentCollection {
protected def createSegmentCombiner(targetSize: Int): SegmentCombiner =
new SegmentCombiner(bandCount) {
private val arr = Array.ofDim[Byte](targetSize + 7 / 8)
def set(targetIndex: Int, v: Int): Unit = {
BitArrayTile.update(arr, targetIndex, v)
}
def setDouble(targetIndex: Int, v: Double): Unit = {
BitArrayTile.updateDouble(arr, targetIndex, v)
}
def getBytes(): Array[Byte] =
arr
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy