org.gdal.gdal.gdal.GetDataTypeSize()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中org.gdal.gdal.gdal.GetDataTypeSize()方法的一些代码示例,展示了gdal.GetDataTypeSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。gdal.GetDataTypeSize()方法的具体详情如下:
包路径:org.gdal.gdal.gdal
类名称:gdal
方法名:GetDataTypeSize

gdal.GetDataTypeSize介绍

暂无

代码示例

代码示例来源:origin: org.gdal/gdal

public java.nio.ByteBuffer ReadRaster_Direct(int xoff, int yoff, int xsize, int ysize,
                      int buf_xsize, int buf_ysize, int buf_type)
{
  long buf_size = buf_xsize * buf_ysize * (gdal.GetDataTypeSize(buf_type) / 8);
  if ((int)buf_size != buf_size)
      throw new OutOfMemoryError();
  java.nio.ByteBuffer nioBuffer = java.nio.ByteBuffer.allocateDirect((int)buf_size);
  int ret = ReadRaster_Direct(xoff, yoff, xsize, ysize, buf_xsize, buf_ysize, buf_type, nioBuffer);
  if (ret == gdalconstConstants.CE_None)
      return nioBuffer;
  else
      return null;
}

代码示例来源:origin: com.revolsys.open/com.revolsys.open.gdal

public java.nio.ByteBuffer ReadRaster_Direct(final int xoff, final int yoff,
 final int xsize, final int ysize, final int buf_xsize, final int buf_ysize,
 final int buf_type) {
 final long buf_size = buf_xsize * buf_ysize
  * (gdal.GetDataTypeSize(buf_type) / 8);
 if ((int)buf_size != buf_size) {
  throw new OutOfMemoryError();
 }
 final java.nio.ByteBuffer nioBuffer = java.nio.ByteBuffer.allocateDirect((int)buf_size);
 final int ret = ReadRaster_Direct(xoff, yoff, xsize, ysize, buf_xsize,
  buf_ysize, buf_type, nioBuffer);
 if (ret == gdalconstConstants.CE_None) {
  return nioBuffer;
 } else {
  return null;
 }
}

代码示例来源:origin: senbox-org/s2tbx

int pixels = imageWidth * imageHeight;
int gdalBufferDataType = this.band.getDataType();
int bufferSize = pixels * gdal.GetDataTypeSize(gdalBufferDataType);
ByteBuffer data = ByteBuffer.allocateDirect(bufferSize);
data.order(ByteOrder.nativeOrder());
  BufferedImage image = null;
  if (this.band.GetRasterColorInterpretation() == gdalconstConstants.GCI_PaletteIndex) {
    ColorModel cm = this.band.GetRasterColorTable().getIndexColorModel(gdal.GetDataTypeSize(gdalBufferDataType));
    image = new BufferedImage(cm, writableRaster, false, null);
  } else if (imageDataBuffer instanceof DataBufferByte || imageDataBuffer instanceof DataBufferUShort) {

代码示例来源:origin: geosolutions-it/imageio-ext

typeSizeInBytes = gdal.GetDataTypeSize(bufferType) / 8;
bufferSize = nBands * pixels * typeSizeInBytes;

代码示例来源:origin: deegree/deegree3

if ( BufferedImage.TYPE_BYTE_INDEXED == dataType ) {
  ColorTable ct = band.GetRasterColorTable();
  IndexColorModel cm = ct.getIndexColorModel( gdal.GetDataTypeSize( bufType ) );
  img = new BufferedImage( xSize, ySize, dataType, cm );
} else {

代码示例来源:origin: it.geosolutions.imageio-ext/imageio-ext-gdalframework

typeSizeInBytes = gdal.GetDataTypeSize(bufferType) / 8;
bufferSize = nBands * pixels * typeSizeInBytes;

代码示例来源:origin: com.revolsys.open/com.revolsys.open.gdal

* gdal.GetDataTypeSize(bandDataType) / 8;
 colorModel = rasterColorTable.getIndexColorModel(gdal.GetDataTypeSize(bandDataType));
 image = new BufferedImage(colorModel, raster, false, null);
} else {

代码示例来源:origin: geosolutions-it/imageio-ext

final int threshold = getMaxMemorySizeForGDALMemoryDataset();
final int neededMemory = width * height * nBands
    * gdal.GetDataTypeSize(dataType) / 8;

代码示例来源:origin: it.geosolutions.imageio-ext/imageio-ext-gdalframework

final int threshold = getMaxMemorySizeForGDALMemoryDataset();
final int neededMemory = width * height * nBands
    * gdal.GetDataTypeSize(dataType) / 8;

代码示例来源:origin: it.geosolutions.imageio-ext/imageio-ext-gdalframework

* (gdal.GetDataTypeSize(rband.getDataType()) / 8);
try {
  ct = rband.GetRasterColorTable();
  IndexColorModel icm = ct.getIndexColorModel(gdal.GetDataTypeSize(buf_type));
  setColorModel(icm);
} finally {

代码示例来源:origin: geosolutions-it/imageio-ext

* (gdal.GetDataTypeSize(rband.getDataType()) / 8);
try {
  ct = rband.GetRasterColorTable();
  IndexColorModel icm = ct.getIndexColorModel(gdal.GetDataTypeSize(buf_type));
  setColorModel(icm);
} finally {

代码示例来源:origin: geosolutions-it/imageio-ext

final int nBands, final int dataType, int xSubsamplingFactor,
  int ySubsamplingFactor) {
final int typeSizeInBytes = gdal.GetDataTypeSize(dataType) / 8;

代码示例来源:origin: it.geosolutions.imageio-ext/imageio-ext-gdalframework

final int nBands, final int dataType, int xSubsamplingFactor,
  int ySubsamplingFactor) {
final int typeSizeInBytes = gdal.GetDataTypeSize(dataType) / 8;

相关文章