Package org.apache.xmlgraphics.image.writer

Examples of org.apache.xmlgraphics.image.writer.ImageWriterParams


        MultiImageWriter writer = null;
        try {
            writer = imageWriter.createMultiImageWriter(out);
            // retrieve writer
            if (imageWriter != null) {
                ImageWriterParams iwp = new ImageWriterParams();
                iwp.setCompressionMethod("JPEG");

                for (int pageNumber = 0; pageNumber <= 2; pageNumber++) {
                    BufferedImage image = new BufferedImage(200, 200, BufferedImage.TYPE_BYTE_GRAY);
                    writer.writeImage(image, iwp);
                }
View Full Code Here


        ImageWriter writer = ImageWriterRegistry.getInstance().getWriterFor(MimeConstants.MIME_PNG);
        if (writer == null) {
            throw new ImageException("Cannot convert image to PNG. No suitable ImageWriter found.");
        }
        ByteArrayOutputStream baout = new ByteArrayOutputStream();
        ImageWriterParams params = new ImageWriterParams();
        params.setResolution((int)Math.round(src.getSize().getDpiHorizontal()));
        writer.writeImage(rendered.getRenderedImage(), baout, params);
        return new ImageRawStream(src.getInfo(), getTargetFlavor(),
                new java.io.ByteArrayInputStream(baout.toByteArray()));
    }
View Full Code Here

            }
        }
    }

    private void writeImage(OutputStream os, RenderedImage image) throws IOException {
        ImageWriterParams params = new ImageWriterParams();
        params.setResolution(Math.round(userAgent.getTargetResolution()));

        // Encode PNG image
        ImageWriter writer = ImageWriterRegistry.getInstance().getWriterFor(getMimeType());
        if (writer == null) {
            BitmapRendererEventProducer eventProducer
View Full Code Here

    /**
     * Default constructor. Initializes the settings to their default values.
     */
    public BitmapRenderingSettings() {
        writerParams = new ImageWriterParams();
    }
View Full Code Here

        return MIME_TYPE;
    }

    /** Creates TIFF renderer. */
    public TIFFRenderer() {
        writerParams = new ImageWriterParams();
        writerParams.setCompressionMethod(COMPRESSION_PACKBITS);
    }
View Full Code Here

            }
        }
    }

    private void writeImage(OutputStream os, RenderedImage image) throws IOException {
        ImageWriterParams params = new ImageWriterParams();
        params.setResolution(Math.round(userAgent.getTargetResolution()));

        // Encode PNG image
        ImageWriter writer = ImageWriterRegistry.getInstance().getWriterFor(getMimeType());
        if (writer == null) {
            BitmapRendererEventProducer eventProducer
View Full Code Here

     *
     * @param userAgent the user agent that contains configuration details. This cannot be null.
     */
    public TIFFRenderer(FOUserAgent userAgent) {
        super(userAgent);
        writerParams = new ImageWriterParams();
        writerParams.setCompressionMethod(COMPRESSION_PACKBITS);

        int dpi = Math.round(userAgent.getTargetResolution());
        writerParams.setResolution(dpi);
    }
View Full Code Here

        }

        private void encodeToBaselineDCT(RenderedImage image,
                float quality, int resolution, OutputStream out) throws IOException {
            ImageWriter writer = ImageWriterRegistry.getInstance().getWriterFor("image/jpeg");
            ImageWriterParams params = new ImageWriterParams();
            params.setJPEGQuality(quality, true);
            params.setResolution(resolution);
            writer.writeImage(image, out, params);
        }
View Full Code Here

                RenderedImage image = (RenderedImage) getPageImage((PageViewport) pageViewportList
                        .get(i));
   
                // Encode this image
                log.debug("Encoding page " + (i + 1));
                ImageWriterParams params = new ImageWriterParams();
                params.setResolution(Math.round(userAgent.getTargetResolution()));
               
                // Encode PNG image
                ImageWriter writer = ImageWriterRegistry.getInstance().getWriterFor(getMimeType());
                if (writer == null) {
                    throw new IOException("Could not get an ImageWriter to produce "
View Full Code Here

        return MIME_TYPE;
    }

    /** Creates TIFF renderer. */
    public TIFFRenderer() {
        writerParams = new ImageWriterParams();
        writerParams.setCompressionMethod(COMPRESSION_PACKBITS);
    }
View Full Code Here

TOP

Related Classes of org.apache.xmlgraphics.image.writer.ImageWriterParams

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.