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<>(); // 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); }
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); }