/** * Returns the overall height of the current tile in pixels. * * @return The total image height in pixels. */ public int getTileHeight() { int height = tileHeight; int maxY = getImgULY() + getImgHeight(); int y = co.y * tileHeight + tileYOffset; if (y + tileHeight >= maxY) height = maxY - y; return height; }
/** * Returns the width of the current tile in pixels. * * @return The total image width in pixels. * */ public int getTileWidth() { int width = tileWidth; int maxX = getImgULX() + getImgWidth(); int x = co.x * tileWidth + tileXOffset; if (x + tileWidth >= maxX) width = maxX - x; return width; }
imgsrc = new RenderedImageSrc(raster, j2kwparam, this); else imgsrc = new RenderedImageSrc(input, j2kwparam, this); if (bands != null) { for (int i=0; i<ncomp; i++) imsigned[i] = ((RenderedImageSrc)imgsrc).isOrigSigned(bands[i]); } else { for (int i=0; i<ncomp; i++) imsigned[i] = ((RenderedImageSrc)imgsrc).isOrigSigned(i); int nc= imgsrc.getNumComps() ; int[] bpc = new int[nc]; for(int comp = 0; comp<nc; comp++) bpc[comp]=imgsrc.getNomRangeBits(comp); imgsrc.getImgWidth(), imgsrc.getImgHeight(), param, this); imgsrc.getImgHeight(), imgsrc.getImgWidth(), nc, bpc, fileLength, colorModel,
/** * Creates <code>RenderedImageSrc</code> for encoding a <code>Raster</code>. * * @param raster The <code>Raster</code> to be encoded. * @param param The <code>J2KImageWriteParamJava</code> used in encoding. * @param writer The <code>J2KImageWriter</code> performs the encoding. * * @param IOException If an error occurs while opening the file. */ public RenderedImageSrc(Raster raster, J2KImageWriteParamJava param, J2KImageWriter writer) { this.raster = raster; this.param = param; this.writer = writer; this.inputIsRaster = true; sourceRegion = param.getSourceRegion(); if (sourceRegion == null) sourceRegion = new Rectangle(raster.getMinX(), raster.getMinY(), raster.getWidth(), raster.getHeight()); else sourceRegion = sourceRegion.intersection(raster.getBounds()); if (sourceRegion.isEmpty()) throw new RuntimeException(I18N.getString("J2KImageWriterCodecLib0")); sm = raster.getSampleModel(); getFromParam(); setSampleModelAndMore(); setTile(0, 0); }
/** Sets <code>precinctPartition</code> */ public void setPrecinctPartition(String values) { String[] strBoolean = {"true","false"}; if (imgsrc != null) precinctPartition = new PrecinctSizeSpec(numTiles, numComponents, ModuleSpec.SPEC_TYPE_TILE_COMP, new RenderedImageSrc(imgsrc, this, null), decompositionLevel, this, values); else if (raster != null) precinctPartition = new PrecinctSizeSpec(numTiles, numComponents, ModuleSpec.SPEC_TYPE_TILE_COMP, new RenderedImageSrc(raster, this, null), decompositionLevel, this, values); }