Dimension defaultSize = JAI.getDefaultTileSize(); if (defaultSize == null) { defaultSize = GEOTOOLS_DEFAULT_TILE_SIZE;
/** * 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; }
/** * 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; }
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); }
Dimension tileDimensions = rasterLayerResponse.getRequest().getTileDimensions(); if (tileDimensions == null) { tileDimensions = (Dimension) JAI.getDefaultTileSize().clone();
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)); }
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; }
layout = layout.unsetTileLayout(); Dimension defaultSize = JAI.getDefaultTileSize(); if (defaultSize == null) { defaultSize = GEOTOOLS_DEFAULT_TILE_SIZE;
Dimension tileSize = request.getTileDimensions(); if (tileSize == null) { tileSize = JAI.getDefaultTileSize();
/** * 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); } /**
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()); } }
/** * 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); } /**
/** * 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); } /**
/** * 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); } /**
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()); } }
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(); } }
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(); } }
@Before public void init() { savedTileSize = JAI.getDefaultTileSize(); JAI.setDefaultTileSize(new Dimension(WIDTH / 2, WIDTH / 2)); }
@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(); }
layout = layout.unsetTileLayout(); Dimension defaultSize = JAI.getDefaultTileSize(); if (defaultSize == null) { defaultSize = GEOTOOLS_DEFAULT_TILE_SIZE;