/** * Returns wether the JAI library is available by checking the available formats. * * @return <code>true</code> if JAI is available * @see #getSupportedFormats() */ public static boolean isJaiAvailable() { return getSupportedFormats().size() > 0; }
/** * @param legend a {@link BufferedImageLegendGraphic} * @param output destination for the image written by {@link ImageIO} in the {@link * #getContentType() supported format} * @see Response#write(Object, OutputStream, Operation) */ @Override public void write(Object legend, OutputStream output, Operation operation) throws IOException, ServiceException { Assert.isInstanceOf(BufferedImageLegendGraphic.class, legend); BufferedImage legendImage = ((BufferedImageLegendGraphic) legend).getLegend(); JAISupport.encode(JPEGLegendOutputFormat.MIME_TYPE, legendImage, output); }