throw new ImagingOpException( "BufferedImageOp [" + op.toString()
/** * {@inheritDoc }. * @throws java.lang.IllegalArgumentException if TileCache is in memoryMode only and the * requested raster is not found on cache. * @throws java.lang.RuntimeException if raster can't be retrieve from cache (nested IOException). */ @Override public Raster getTile(RenderedImage ri, int tileX, int tileY) { final ImageTilesCache cache; synchronized(tileManagers){ cache = tileManagers.get(ri); } if (cache == null){ throw new IllegalArgumentException("renderedImage doesn't exist in this "+LargeCache.class.getName()); } try { return cache.getRaster(tileX, tileY); } catch (IOException ex) { throw (RuntimeException)(new ImagingOpException(ex.getMessage()).initCause(ex)); } }
private void assertResampleBufferedImageTypes(final int pFilterType) { List<String> exceptions = new ArrayList<>(); // Test all image types in BufferedImage for (int type = BufferedImage.TYPE_INT_ARGB; type <= BufferedImage.TYPE_BYTE_INDEXED; type++) { // TODO: Does not currently work with TYPE_BYTE_GRAY or TYPE_USHORT_GRAY // TODO: FixMe! if ((pFilterType == ResampleOp.FILTER_POINT || pFilterType == ResampleOp.FILTER_TRIANGLE) && (type == BufferedImage.TYPE_BYTE_GRAY || type == BufferedImage.TYPE_USHORT_GRAY)) { continue; } BufferedImage image = createImage(10, 10, type); try { assertResample(image, 15, 5, pFilterType); } catch (ImagingOpException e) { // NOTE: It is currently allowed for filters to throw this exception and it is PLATFORM DEPENDENT.. System.err.println("WARNING: " + e.getMessage() + ", image: " + image); //e.printStackTrace(); } catch (Throwable t) { exceptions.add(t.toString() + ": " + image.toString()); } } assertEquals("Filter threw exceptions: ", Collections.EMPTY_LIST, exceptions); }
private void assertResampleBufferedImageTypes(final int pFilterType) { List<String> exceptions = new ArrayList<String>(); // Test all image types in BufferedImage for (int type = BufferedImage.TYPE_INT_ARGB; type <= BufferedImage.TYPE_BYTE_INDEXED; type++) { // TODO: Does not currently work with TYPE_BYTE_GRAY or TYPE_USHORT_GRAY // TODO: FixMe! if ((pFilterType == ResampleOp.FILTER_POINT || pFilterType == ResampleOp.FILTER_TRIANGLE) && (type == BufferedImage.TYPE_BYTE_GRAY || type == BufferedImage.TYPE_USHORT_GRAY)) { continue; } BufferedImage image = createImage(10, 10, type); try { assertResample(image, 15, 5, pFilterType); } catch (ImagingOpException e) { // NOTE: It is currently allowed for filters to throw this exception and it is PLATFORM DEPENDENT.. System.err.println("WARNING: " + e.getMessage() + ", image: " + image); //e.printStackTrace(); } catch (Throwable t) { exceptions.add(t.toString() + ": " + image.toString()); } } assertEquals("Filter threw exceptions: ", Collections.EMPTY_LIST, exceptions); }
/** * Saves the current image as a PNG image in the given file. This is sometime useful for visual * check purpose, and is used only as a helper tools for tuning the test suites. Floating-point * images are converted to grayscale before to be saved. * * @param filename the name (optionally with its path) of the file to create. * @throws ImagingOpException if an error occurred while writing the file. */ protected final synchronized void saveCurrentImage(final String filename) throws ImagingOpException { try { savePNG(image, new File(filename)); } catch (IOException e) { throw new ImagingOpException(e.toString()); } }
private void assertResampleBufferedImageTypes(final int pFilterType) { List<String> exceptions = new ArrayList<>(); // Test all image types in BufferedImage for (int type = BufferedImage.TYPE_INT_ARGB; type <= BufferedImage.TYPE_BYTE_INDEXED; type++) { // TODO: Does not currently work with TYPE_BYTE_GRAY or TYPE_USHORT_GRAY // TODO: FixMe! if ((pFilterType == ResampleOp.FILTER_POINT || pFilterType == ResampleOp.FILTER_TRIANGLE) && (type == BufferedImage.TYPE_BYTE_GRAY || type == BufferedImage.TYPE_USHORT_GRAY)) { continue; } BufferedImage image = createImage(10, 10, type); try { assertResample(image, 15, 5, pFilterType); } catch (ImagingOpException e) { // NOTE: It is currently allowed for filters to throw this exception and it is PLATFORM DEPENDENT.. System.err.println("WARNING: " + e.getMessage() + ", image: " + image); //e.printStackTrace(); } catch (Throwable t) { exceptions.add(t.toString() + ": " + image.toString()); } } assertEquals("Filter threw exceptions: ", Collections.EMPTY_LIST, exceptions); }
/** * Saves the current image as a PNG image in the given file. This is sometime useful for visual * check purpose, and is used only as a helper tools for tuning the test suites. Floating-point * images are converted to grayscale before to be saved. * * @param filename The name (optionally with its path) of the file to create. * @throws ImagingOpException If an error occurred while writing the file. * * @since 3.19 */ protected final synchronized void saveCurrentImage(final String filename) throws ImagingOpException { try { savePNG(image, new File(filename)); } catch (IOException e) { throw new ImagingOpException(e.toString()); } }
private void assertResampleBufferedImageTypes(final int pFilterType) { List<String> exceptions = new ArrayList<>(); // Test all image types in BufferedImage for (int type = BufferedImage.TYPE_INT_ARGB; type <= BufferedImage.TYPE_BYTE_INDEXED; type++) { // TODO: Does not currently work with TYPE_BYTE_GRAY or TYPE_USHORT_GRAY // TODO: FixMe! if ((pFilterType == ResampleOp.FILTER_POINT || pFilterType == ResampleOp.FILTER_TRIANGLE) && (type == BufferedImage.TYPE_BYTE_GRAY || type == BufferedImage.TYPE_USHORT_GRAY)) { continue; } BufferedImage image = createImage(10, 10, type); try { assertResample(image, 15, 5, pFilterType); } catch (ImagingOpException e) { // NOTE: It is currently allowed for filters to throw this exception and it is PLATFORM DEPENDENT.. System.err.println("WARNING: " + e.getMessage() + ", image: " + image); //e.printStackTrace(); } catch (Throwable t) { exceptions.add(t.toString() + ": " + image.toString()); } } assertEquals("Filter threw exceptions: ", Collections.EMPTY_LIST, exceptions); }
throw new ImagingOpException( "BufferedImageOp [" + op.toString()
throw new ImagingOpException( "BufferedImageOp [" + op.toString()
throw new ImagingOpException("Could not clone unknown ColorModel Type.");
throw new ImagingOpException("Could not clone unknown ColorModel Type.");