it.geosolutions.jaiext.range.RangeFactory.convertToByteRange()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(69)

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

RangeFactory.convertToByteRange介绍

暂无

代码示例

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

private void initLookupTable(Range nodata) {
  // Convert the Range to Byte Range
  Range nd = RangeFactory.convertToByteRange(nodata);
  // Init the Boolean LookupTable
  lookupTable = new boolean[256];
  // Init the lookuptable containing
  for (int i = 0; i < lookupTable.length; i++) {
    byte b = (byte) i;
    lookupTable[i] = !nd.contains(b);
  }
}

代码示例来源:origin: it.geosolutions.jaiext.errordiffusion/jt-errordiffusion

private void initLookupTable(Range nodata) {
  // Convert the Range to Byte Range
  Range nd = RangeFactory.convertToByteRange(nodata);
  // Init the Boolean LookupTable
  lookupTable = new boolean[256];
  // Init the lookuptable containing
  for (int i = 0; i < lookupTable.length; i++) {
    byte b = (byte) i;
    lookupTable[i] = !nd.contains(b);
  }
}

代码示例来源:origin: it.geosolutions.jaiext.colorindexer/jt-colorindexer

public ColorIndexerOpImage(RenderedImage image, ColorIndexer palette, ROI roi, Range nodata,
    int destNoData, RenderingHints hints) {
  super(image, buildLayout(image, palette.toIndexColorModel()), hints, false);
  this.icm = palette.toIndexColorModel();
  this.setSource(image, 0);
  this.palette = palette;
  // Checking for NoData
  hasNoData = nodata != null;
  if (hasNoData) {
    this.nodata = RangeFactory.convertToByteRange(nodata);
    initLookupTable();
  }
  // Checking for ROI
  hasROI = roi != null;
  if (hasROI) {
    this.roi = roi;
    roiBounds = roi.getBounds();
  }
  // Setting the Index for the NoData value
  this.destNoData = (byte) (destNoData & 0xFF);
  // Definition of the possible cases that can be found
  // caseA = no ROI nor No Data
  // caseB = ROI present but No Data not present
  // caseC = No Data present but ROI not present
  // Last case not defined = both ROI and No Data are present
  caseA = !hasROI && !hasNoData;
  caseB = hasROI && !hasNoData;
  caseC = !hasROI && hasNoData;
}

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

public ColorIndexerOpImage(RenderedImage image, ColorIndexer palette, ROI roi, Range nodata,
    int destNoData, RenderingHints hints) {
  super(image, buildLayout(image, palette.toIndexColorModel()), hints, false);
  this.icm = palette.toIndexColorModel();
  this.setSource(image, 0);
  this.palette = palette;
  // Checking for NoData
  hasNoData = nodata != null;
  if (hasNoData) {
    this.nodata = RangeFactory.convertToByteRange(nodata);
    initLookupTable();
  }
  // Checking for ROI
  hasROI = roi != null;
  if (hasROI) {
    this.roi = roi;
    roiBounds = roi.getBounds();
  }
  // Setting the Index for the NoData value
  this.destNoData = (byte) (destNoData & 0xFF);
  // Definition of the possible cases that can be found
  // caseA = no ROI nor No Data
  // caseB = ROI present but No Data not present
  // caseC = No Data present but ROI not present
  // Last case not defined = both ROI and No Data are present
  caseA = !hasROI && !hasNoData;
  caseB = hasROI && !hasNoData;
  caseC = !hasROI && hasNoData;
}

相关文章