javax.media.jai.JAI.getDefaultTileSize()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(9.6k)|赞(0)|评价(0)|浏览(168)

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

JAI.getDefaultTileSize介绍

暂无

代码示例

代码示例来源:origin: geotools/geotools

Dimension defaultSize = JAI.getDefaultTileSize();
if (defaultSize == null) {
  defaultSize = GEOTOOLS_DEFAULT_TILE_SIZE;

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

/**
 * Suggests a tile size for the specified image size. On input, {@code size}
 * is the image's size. On output, it is the tile size. This method write
 * the result directly in the supplied object and returns {@code size} for
 * convenience.
 * <p>
 */
public static Dimension toTileSize(final Dimension size) {
  Dimension defaultSize = JAI.getDefaultTileSize();
  if (defaultSize == null) {
    defaultSize = DEFAULT_TILE_SIZE;
  }
  size.height = defaultSize.height;
  size.width = defaultSize.width;
  return size;
}

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

/**
 * Suggests a tile size for the specified image size. On input, {@code size}
 * is the image's size. On output, it is the tile size. This method write
 * the result directly in the supplied object and returns {@code size} for
 * convenience.
 * <p>
 */
public static Dimension toTileSize(final Dimension size) {
  Dimension defaultSize = JAI.getDefaultTileSize();
  if (defaultSize == null) {
    defaultSize = DEFAULT_TILE_SIZE;
  }
  size.height = defaultSize.height;
  size.width = defaultSize.width;
  return size;
}

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

private static Dimension getTileDim(int width, int height) {
  return new Dimension(width < JAI.getDefaultTileSize().width ? width : JAI.getDefaultTileSize().width,
      height < JAI.getDefaultTileSize().height ? height : JAI.getDefaultTileSize().height);
}

代码示例来源:origin: geotools/geotools

Dimension tileDimensions = rasterLayerResponse.getRequest().getTileDimensions();
if (tileDimensions == null) {
  tileDimensions = (Dimension) JAI.getDefaultTileSize().clone();

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

private static Dimension getTileDimension(int width, int height) {
  Dimension defaultTileSize = JAI.getDefaultTileSize();
  return new Dimension(Math.min(width, defaultTileSize.width), Math.min(height, defaultTileSize.height));
}

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

private String getTileDimensionValuesForBenchmark(String tileDimension) {
  StringBuilder defaultTileSizeValues = new StringBuilder();
  defaultTileSizeValues.append("128");
  defaultTileSizeValues.append(BENCHMARK_SEPARATOR);
  defaultTileSizeValues.append("256");
  defaultTileSizeValues.append(BENCHMARK_SEPARATOR);
  defaultTileSizeValues.append("512");
  defaultTileSizeValues.append(BENCHMARK_SEPARATOR);
  defaultTileSizeValues.append("*");
  defaultTileSizeValues.append(BENCHMARK_SEPARATOR);
  //return defaultTileSizeValues.toString();
  return JAI.getDefaultTileSize().width + "," + JAI.getDefaultTileSize().height;
}

代码示例来源:origin: geotools/geotools

layout = layout.unsetTileLayout();
Dimension defaultSize = JAI.getDefaultTileSize();
if (defaultSize == null) {
  defaultSize = GEOTOOLS_DEFAULT_TILE_SIZE;

代码示例来源:origin: geotools/geotools

Dimension tileSize = request.getTileDimensions();
if (tileSize == null) {
  tileSize = JAI.getDefaultTileSize();

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

/**
 * Creates a new TiledImage object with one or more bands of constant value.
 * The number of bands in the output image corresponds to the length of
 * the input values array and the data type of the image corresponds to the
 * {@code Number} class used.
 *
 * @param minx minimum image X ordinate
 *
 * @param miny minimum image Y ordinate
 *
 * @param width image width in pixels
 *
 * @param height image height in pixels
 *
 * @param values array of values (must contain at least one element)
 *
 * @return a new TiledImage object
 */
public static TiledImage createConstantImage(int minx, int miny, int width, int height, Number[] values) {
  Dimension tileSize = JAI.getDefaultTileSize();
  return createConstantImage(minx, miny, width, height, tileSize.width, tileSize.height, values);
}
/**

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

private Dimension getPreferredTileSize(ParameterBlock pb) {
  if (pb.getSources() == null || pb.getSources().size() == 0) {
    return JAI.getDefaultTileSize();
  } else {
    // align to the first input, should reduce the computation cost as the source
    // tiles are pulled only once
    RenderedImage ref = (RenderedImage) pb.getSource(0);
    return new Dimension(ref.getWidth(), ref.getHeight());
  }
}

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

/**
 * Creates a new TiledImage object with one or more bands of constant value.
 * The number of bands in the output image corresponds to the length of
 * the input values array and the data type of the image corresponds to the
 * {@code Number} class used.
 *
 * @param minx minimum image X ordinate
 *
 * @param miny minimum image Y ordinate
 *
 * @param width image width in pixels
 *
 * @param height image height in pixels
 *
 * @param values array of values (must contain at least one element)
 *
 * @return a new TiledImage object
 */
public static TiledImage createConstantImage(int minx, int miny, int width, int height, Number[] values) {
  Dimension tileSize = JAI.getDefaultTileSize();
  return createConstantImage(minx, miny, width, height, tileSize.width, tileSize.height, values);
}
/**

代码示例来源:origin: org.jaitools/jt-utils

/**
 * Creates a new TiledImage object with one or more bands of constant value.
 * The number of bands in the output image corresponds to the length of
 * the input values array and the data type of the image corresponds to the
 * {@code Number} class used.
 *
 * @param minx minimum image X ordinate
 *
 * @param miny minimum image Y ordinate
 *
 * @param width image width in pixels
 *
 * @param height image height in pixels
 *
 * @param values array of values (must contain at least one element)
 *
 * @return a new TiledImage object
 */
public static TiledImage createConstantImage(int minx, int miny, int width, int height, Number[] values) {
  Dimension tileSize = JAI.getDefaultTileSize();
  return createConstantImage(minx, miny, width, height, tileSize.width, tileSize.height, values);
}
/**

代码示例来源:origin: com.googlecode.jaitools/jt-utils

/**
 * Creates a new TiledImage object with one or more bands of constant value.
 * The number of bands in the output image corresponds to the length of
 * the input values array and the data type of the image corresponds to the
 * {@code Number} class used.
 *
 * @param minx minimum image X ordinate
 *
 * @param miny minimum image Y ordinate
 *
 * @param width image width in pixels
 *
 * @param height image height in pixels
 *
 * @param values array of values (must contain at least one element)
 *
 * @return a new TiledImage object
 */
public static TiledImage createConstantImage(int minx, int miny, int width, int height, Number[] values) {
  Dimension tileSize = JAI.getDefaultTileSize();
  return createConstantImage(minx, miny, width, height, tileSize.width, tileSize.height, values);
}
/**

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

private Dimension getPreferredTileSize(ParameterBlock pb) {
  if (pb.getSources() == null || pb.getSources().size() == 0) {
    return JAI.getDefaultTileSize();
  } else {
    // align to the first input, should reduce the computation cost as the source
    // tiles are pulled only once
    RenderedImage ref = (RenderedImage) pb.getSource(0);
    return new Dimension(ref.getWidth(), ref.getHeight());
  }
}

代码示例来源:origin: org.geoserver.community/importer-core

private Dimension getTileSize(TilingConfiguration tiling) {
  // setup tiling sizes, will be used both for inner
  // tiling and overviews
  if (tiling.isEnabled()) {
    return new Dimension(tiling.getTileWidth(), tiling.getTileHeight());
  } else {
    return JAI.getDefaultTileSize();
  }
}

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

private void processingParamsComputeButtonActionPerformed(java.awt.event.ActionEvent evt) {
  if(validCompute()){
    //Create performance parameters benchmark lists
    java.util.List<String> tileDimensionList = new ArrayList<>();
    java.util.List<Integer> cacheSizesList = new ArrayList<>();
    java.util.List<Integer> nbThreadsList = new ArrayList<>();
    //for(String dimension : StringUtils.split(benchmarkTileDimensionTextField.getText(), ';')){
    //    tileDimensionList.add(dimension);
    //}
    tileDimensionList.add(JAI.getDefaultTileSize().width + "," + JAI.getDefaultTileSize().height);
    for(String cacheSize : StringUtils.split(benchmarkCacheSizeTextField.getText(), ';')){
      cacheSizesList.add(Integer.parseInt(cacheSize));
    }
    for(String nbThread : StringUtils.split(benchmarkNbThreadsTextField.getText(), ';')){
      nbThreadsList.add(Integer.parseInt(nbThread));
    }
    Benchmark benchmarkModel = new Benchmark(tileDimensionList, cacheSizesList, nbThreadsList);
    String opName = procGraphJComboBox.getSelectedItem().toString();
    AppContext appContext = SnapApp.getDefault().getAppContext();
    //launch Benchmark dialog
    BenchmarkDialog productDialog = new BenchmarkDialog(this, opName, benchmarkModel, appContext);
    productDialog.show();
  }
}

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

@Before
public void init() {
  savedTileSize = JAI.getDefaultTileSize();
  JAI.setDefaultTileSize(new Dimension(WIDTH / 2, WIDTH / 2));
}

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

@Override
public void initialize() {
  validateSourceProducts();
  if (StringHelper.isNullOrEmpty(this.landCoverName)) {
    throw new OperatorException("No land cover name specified.");
  }
  if (StringHelper.isNullOrEmpty(this.landCoverMapIndices)) {
    throw new OperatorException("No land cover map indices specified.");
  }
  this.currentProductBandsNames = findBandNames(this.currentSourceProduct);
  this.previousProductBandsNames = findBandNames(this.previousSourceProduct);
  int sceneWidth = this.currentSourceProduct.getSceneRasterWidth();
  int sceneHeight = this.currentSourceProduct.getSceneRasterHeight();
  Dimension tileSize = JAI.getDefaultTileSize();
  this.targetProduct = new Product("ForestCoverChange", this.currentSourceProduct.getProductType(), sceneWidth, sceneHeight);
  this.targetProduct.setPreferredTileSize(tileSize);
  ProductUtils.copyGeoCoding(this.currentSourceProduct, this.targetProduct);
  Band targetBand = new Band("band_1", ProductData.TYPE_INT32, sceneWidth, sceneHeight);
  this.targetProduct.addBand(targetBand);
  this.threadCount = Runtime.getRuntime().availableProcessors() - 1;
  this.threadPool = Executors.newCachedThreadPool();
}

代码示例来源:origin: org.geotools/gt2-coverage

layout = layout.unsetTileLayout();
Dimension defaultSize = JAI.getDefaultTileSize();
if (defaultSize == null) {
  defaultSize = GEOTOOLS_DEFAULT_TILE_SIZE;

相关文章