/** * Tests if param has explicit destination. * * @param pParam the image read parameter, or {@code null} * @return true if {@code pParam} is non-{@code null} and either its {@code getDestination}, * {@code getDestinationType} returns a non-{@code null} value, * or {@code getDestinationOffset} returns a {@link Point} that is not the upper left corner {@code (0, 0)}. */ protected static boolean hasExplicitDestination(final ImageReadParam pParam) { return pParam != null && ( pParam.getDestination() != null || pParam.getDestinationType() != null || !ORIGIN.equals(pParam.getDestinationOffset()) ); }
final Point offset = pParam == null ? new Point(0, 0) : pParam.getDestinationOffset();
final Point offset = pParam == null ? new Point(0, 0) : pParam.getDestinationOffset();
public String render(Object o) { ImageReadParam param = (ImageReadParam) o; StringBuilder sb = new StringBuilder(); sb.append('[').append(o.getClass().toString()).append("\n"); int ssx = param.getSourceXSubsampling(); int ssy = param.getSourceYSubsampling(); Rectangle rect = param.getSourceRegion(); Point p = param.getDestinationOffset(); int[] bands = param.getSourceBands(); if (rect != null) { sb.append(String.format( " SourceRegion(Rectangle)[x:%d, y:%d, width:%d, height:%d]\n", rect.x, rect.y, rect.width, rect.height)); } sb.append(String.format(" SourceSubsampling[ssx:%d, ssy:%d]\n", ssx, ssy)); if (bands != null) { sb.append(" SourceBands[").append(HTMLBuilder.render(bands)).append("]\n"); } if (p != null) { sb.append(String.format(" DestinationOffset(Point)[x:%d, y:%d]", p.x, p.y)); } sb.append("]"); return sb.toString(); }
public String render(Object o) { ImageReadParam param = (ImageReadParam) o; StringBuilder sb = new StringBuilder(); sb.append('[').append(o.getClass().toString()).append("\n"); int ssx = param.getSourceXSubsampling(); int ssy = param.getSourceYSubsampling(); Rectangle rect = param.getSourceRegion(); Point p = param.getDestinationOffset(); int[] bands = param.getSourceBands(); if (rect != null) { sb.append(String.format( " SourceRegion(Rectangle)[x:%d, y:%d, width:%d, height:%d]\n", rect.x, rect.y, rect.width, rect.height)); } sb.append(String.format(" SourceSubsampling[ssx:%d, ssy:%d]\n", ssx, ssy)); if (bands != null) { sb.append(" SourceBands[").append(HTMLBuilder.render(bands)).append("]\n"); } if (p != null) { sb.append(String.format(" DestinationOffset(Point)[x:%d, y:%d]", p.x, p.y)); } sb.append("]"); return sb.toString(); }
sb.append(" subYoff:").append(param.getSubsamplingYOffset()); sb.append(" srcRegion:").append(param.getSourceRegion()); sb.append(" destOff:").append(param.getDestinationOffset());
newParam.setDestinationOffset(param.getDestinationOffset());
/** * Tests if param has explicit destination. * * @param pParam the image read parameter, or {@code null} * @return true if {@code pParam} is non-{@code null} and either its {@code getDestination}, * {@code getDestinationType} returns a non-{@code null} value, * or {@code getDestinationOffset} returns a {@link Point} that is not the upper left corner {@code (0, 0)}. */ protected static boolean hasExplicitDestination(final ImageReadParam pParam) { return pParam != null && ( pParam.getDestination() != null || pParam.getDestinationType() != null || !ORIGIN.equals(pParam.getDestinationOffset()) ); }
/** Makes a copy of the incoming parameters into the parameter that is used for the nested image reader */ protected void copyReadParam(ImageReadParam src, ImageReadParam dst) { dst.setDestination(src.getDestination()); dst.setSourceRegion(src.getSourceRegion()); dst.setSourceSubsampling(src.getSourceXSubsampling(), src .getSourceYSubsampling(), src.getSubsamplingXOffset(), src .getSubsamplingYOffset()); dst.setDestinationOffset(src.getDestinationOffset()); if (ImageReaderFactory.getInstance().needsImageTypeSpecifier(tsuid)) { dst.setDestinationType(createImageTypeSpecifier()); } //if lossy jpeg2000 and using the jai j2k reader //a workaround for http://java.net/jira/browse/JAI_IMAGEIO_CORE-175 if(J2KIMAGE_READ_PARAM_CLASS != null && J2KIMAGE_READ_PARAM_CLASS.isAssignableFrom(dst.getClass())) { try { J2KIMAGE_READ_PARAM_SET_RESOLUTION.invoke(dst, Integer.MAX_VALUE); } catch (Exception e) { log.info("A Failure occurred attempting to set the resolution for a jai J2KImageReadParam. This may result in degraded image quality.", e); } } }
RawRenderedImage image = new RawRenderedImage(iis, this, param, imageIndex); Point offset = param.getDestinationOffset(); WritableRaster raster;
RawRenderedImage image = new RawRenderedImage(iis, this, param, imageIndex); Point offset = param.getDestinationOffset(); WritableRaster raster;
RawRenderedImage image = new RawRenderedImage(iis, this, param, imageIndex); Point offset = param.getDestinationOffset(); WritableRaster raster;
newParam.setSourceBands(param.getSourceBands()); newParam.setDestinationBands(param.getDestinationBands()); newParam.setDestinationOffset(param.getDestinationOffset());
protected void initialize(ImageReadParam param) { if (param.hasController()) setController(param.getController()); setSourceRegion(param.getSourceRegion()); setSourceBands(param.getSourceBands()); setDestinationBands(param.getDestinationBands()); setDestination(param.getDestination()); setDestinationOffset(param.getDestinationOffset()); setSourceSubsampling(param.getSourceXSubsampling(), param .getSourceYSubsampling(), param.getSubsamplingXOffset(), param .getSubsamplingYOffset()); final ImageTypeSpecifier type = param.getDestinationType(); if (type != null) setDestinationType(type); } }
public J2KImageReadParamJava(ImageReadParam param) { super(); // Generic settings. if(param.hasController()) { setController(param.getController()); } setSourceRegion(param.getSourceRegion()); setSourceBands(param.getSourceBands()); setDestinationBands(param.getDestinationBands()); setDestination(param.getDestination()); setDestinationOffset(param.getDestinationOffset()); setSourceSubsampling(param.getSourceXSubsampling(), param.getSourceYSubsampling(), param.getSubsamplingXOffset(), param.getSubsamplingYOffset()); setDestinationType(param.getDestinationType()); // J2K settings. J2KImageReadParam j2kParam; if(param instanceof J2KImageReadParam) { j2kParam = (J2KImageReadParam)param; } else { j2kParam = new J2KImageReadParam(); } setDecodingRate(j2kParam.getDecodingRate()); setResolution(j2kParam.getResolution()); }
public J2KImageReadParamJava(ImageReadParam param) { super(); // Generic settings. if(param.hasController()) { setController(param.getController()); } setSourceRegion(param.getSourceRegion()); setSourceBands(param.getSourceBands()); setDestinationBands(param.getDestinationBands()); setDestination(param.getDestination()); setDestinationOffset(param.getDestinationOffset()); setSourceSubsampling(param.getSourceXSubsampling(), param.getSourceYSubsampling(), param.getSubsamplingXOffset(), param.getSubsamplingYOffset()); setDestinationType(param.getDestinationType()); // J2K settings. J2KImageReadParam j2kParam; if(param instanceof J2KImageReadParam) { j2kParam = (J2KImageReadParam)param; } else { j2kParam = new J2KImageReadParam(); } setDecodingRate(j2kParam.getDecodingRate()); setResolution(j2kParam.getResolution()); }
public J2KImageReadParamJava(ImageReadParam param) { super(); // Generic settings. if(param.hasController()) { setController(param.getController()); } setSourceRegion(param.getSourceRegion()); setSourceBands(param.getSourceBands()); setDestinationBands(param.getDestinationBands()); setDestination(param.getDestination()); setDestinationOffset(param.getDestinationOffset()); setSourceSubsampling(param.getSourceXSubsampling(), param.getSourceYSubsampling(), param.getSubsamplingXOffset(), param.getSubsamplingYOffset()); setDestinationType(param.getDestinationType()); // J2K settings. J2KImageReadParam j2kParam; if(param instanceof J2KImageReadParam) { j2kParam = (J2KImageReadParam)param; } else { j2kParam = new J2KImageReadParam(); } setDecodingRate(j2kParam.getDecodingRate()); setResolution(j2kParam.getResolution()); }
public J2KImageReadParamJava(ImageReadParam param) { super(); // Generic settings. if(param.hasController()) { setController(param.getController()); } setSourceRegion(param.getSourceRegion()); setSourceBands(param.getSourceBands()); setDestinationBands(param.getDestinationBands()); setDestination(param.getDestination()); setDestinationOffset(param.getDestinationOffset()); setSourceSubsampling(param.getSourceXSubsampling(), param.getSourceYSubsampling(), param.getSubsamplingXOffset(), param.getSubsamplingYOffset()); setDestinationType(param.getDestinationType()); // J2K settings. J2KImageReadParam j2kParam; if(param instanceof J2KImageReadParam) { j2kParam = (J2KImageReadParam)param; } else { j2kParam = new J2KImageReadParam(); } setDecodingRate(j2kParam.getDecodingRate()); setResolution(j2kParam.getResolution()); }
public J2KImageReadParamJava(ImageReadParam param) { super(); // Generic settings. if(param.hasController()) { setController(param.getController()); } setSourceRegion(param.getSourceRegion()); setSourceBands(param.getSourceBands()); setDestinationBands(param.getDestinationBands()); setDestination(param.getDestination()); setDestinationOffset(param.getDestinationOffset()); setSourceSubsampling(param.getSourceXSubsampling(), param.getSourceYSubsampling(), param.getSubsamplingXOffset(), param.getSubsamplingYOffset()); setDestinationType(param.getDestinationType()); // J2K settings. J2KImageReadParam j2kParam; if(param instanceof J2KImageReadParam) { j2kParam = (J2KImageReadParam)param; } else { j2kParam = new J2KImageReadParam(); } setDecodingRate(j2kParam.getDecodingRate()); setResolution(j2kParam.getResolution()); }
newParam.setDestinationOffset(param.getDestinationOffset());