/** * 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()) ); }
param.setDestinationType(reader.getRawImageType(0)); if (param.getDestinationType() == null) { Iterator<ImageTypeSpecifier> types = reader.getImageTypes(0); System.err.println("param.getDestinationType(): " + param.getDestinationType());
imageType = param.getDestinationType();
pParam.getDestinationType() != null && pParam.getDestinationType().getBufferedImageType() != image.getType())) { BufferedImage destination = getDestination(pParam, getImageTypes(pIndex), getWidth(pIndex), getHeight(pIndex));
if (param.getDestinationType() != null) { newParam.setDestinationType(param.getDestinationType());
private WritableRaster getDestinationRaster(ImageReadParam param) { if (param == null) throw new IllegalArgumentException(UNKNOWN_IMAGE_TYPE); BufferedImage bi = param.getDestination(); if (bi != null) { width = bi.getWidth(); height = bi.getHeight(); return bi.getRaster(); } ImageTypeSpecifier imageType = param.getDestinationType(); if (imageType != null) { SampleModel sm = imageType.getSampleModel(); width = sm.getWidth(); height = sm.getHeight(); return Raster.createWritableRaster(sm, null); } throw new IllegalArgumentException(UNKNOWN_IMAGE_TYPE); }
private WritableRaster getDestinationRaster(ImageReadParam param) { if (param == null) throw new IllegalArgumentException(UNKNOWN_IMAGE_TYPE); BufferedImage bi = param.getDestination(); if (bi != null) { width = bi.getWidth(); height = bi.getHeight(); return bi.getRaster(); } ImageTypeSpecifier imageType = param.getDestinationType(); if (imageType != null) { SampleModel sm = imageType.getSampleModel(); width = sm.getWidth(); height = sm.getHeight(); return Raster.createWritableRaster(sm, null); } throw new IllegalArgumentException(UNKNOWN_IMAGE_TYPE); }
private BufferedImage getDestination(ImageReadParam param) { if (param == null) throw new IllegalArgumentException(UNKNOWN_IMAGE_TYPE); BufferedImage bi = param.getDestination(); if (bi != null) { width = bi.getWidth(); height = bi.getHeight(); return bi; } ImageTypeSpecifier imageType = param.getDestinationType(); if (imageType != null) { SampleModel sm = imageType.getSampleModel(); width = sm.getWidth(); height = sm.getHeight(); return imageType.createBufferedImage(width, height); } throw new IllegalArgumentException(UNKNOWN_IMAGE_TYPE); }
private BufferedImage getDestination(ImageReadParam param) { if (param == null) throw new IllegalArgumentException(UNKNOWN_IMAGE_TYPE); BufferedImage bi = param.getDestination(); if (bi != null) { width = bi.getWidth(); height = bi.getHeight(); return bi; } ImageTypeSpecifier imageType = param.getDestinationType(); if (imageType != null) { SampleModel sm = imageType.getSampleModel(); width = sm.getWidth(); height = sm.getHeight(); return imageType.createBufferedImage(width, height); } throw new IllegalArgumentException(UNKNOWN_IMAGE_TYPE); }
/** * 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()) ); }
sb.append(" destOff:").append(param.getDestinationOffset()); ImageTypeSpecifier its = param.getDestinationType(); if(its != null) { sb.append(" its:").append(its.getSampleModel());
private ImageReadParam decompressParam(ImageReadParam param) { ImageReadParam decompressParam = decompressor.getDefaultReadParam(); ImageTypeSpecifier imageType = null; BufferedImage dest = null; if (param != null) { imageType = param.getDestinationType(); dest = param.getDestination(); } if (rle && imageType == null && dest == null) imageType = createImageType(bitsStored, dataType, true); decompressParam.setDestinationType(imageType); decompressParam.setDestination(dest); return decompressParam; }
ImageTypeSpecifier type = param.getDestinationType(); if (type != null) colorModel = type.getColorModel();
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); } }
if (param.getDestinationType() != null) { newParam.setDestinationType(param.getDestinationType());
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()); }