Package org.apache.batik.ext.awt.image.spi

Examples of org.apache.batik.ext.awt.image.spi.ImageWriter.writeImage()


    public void encodeImage(BufferedImage buf, OutputStream os)
            throws IOException {
        Base64EncoderStream b64Encoder = new Base64EncoderStream(os);
        ImageWriter writer = ImageWriterRegistry.getInstance()
            .getWriterFor("image/png");
        writer.writeImage(buf, b64Encoder);
        b64Encoder.close();
    }

    public int getBufferedImageType(){
        return BufferedImage.TYPE_INT_ARGB;
View Full Code Here


        try {
            OutputStream os = new FileOutputStream(imageFile);
            try {
                ImageWriter writer = ImageWriterRegistry.getInstance()
                    .getWriterFor("image/png");
                writer.writeImage(buf, os);
               
            } finally {
                os.close();
            }
        } catch (IOException e) {
View Full Code Here

            try {
                ImageWriter writer = ImageWriterRegistry.getInstance()
                    .getWriterFor("image/jpeg");
                ImageWriterParams params = new ImageWriterParams();
                params.setJPEGQuality(1, false);
                writer.writeImage(buf, os, params);
               
            } finally {
                os.close();
            }
        } catch(IOException e) {
View Full Code Here

     */
    protected void saveImage(BufferedImage img, OutputStream os)
            throws IOException {
        ImageWriter writer = ImageWriterRegistry.getInstance()
            .getWriterFor("image/png");
        writer.writeImage(img, os);
    }

    /**
     * Builds a new BufferedImage that is the difference between the
     * two input images
View Full Code Here

                     "candidate-variation/"+s);
                ImageWriter writer = ImageWriterRegistry.getInstance()
                    .getWriterFor("image/png");
                OutputStream out = new FileOutputStream(s);
                try {
                    writer.writeImage(diff, out);
                } finally {
                    out.close();
                }
                report.addDescriptionEntry(DIFFERENCE_IMAGE,new File(s));
            } catch (Exception e) { }
View Full Code Here

    public void encodeImage(RenderedImage buf, OutputStream os)
        throws SVGGraphics2DIOException {
        try{
            ImageWriter writer = ImageWriterRegistry.getInstance()
                .getWriterFor("image/png");
            writer.writeImage(buf, os);
        } catch(IOException e) {
            // We are doing in-memory processing. This should not happen.
            throw new SVGGraphics2DIOException(ERR_UNEXPECTED);
        }
    }
View Full Code Here

            throws IOException {
        ImageWriter writer = ImageWriterRegistry.getInstance()
                .getWriterFor("image/jpeg");
        ImageWriterParams params = new ImageWriterParams();
        params.setJPEGQuality(1, false);
        writer.writeImage(buf, os, params);
    }

    public int getBufferedImageType(){
        return BufferedImage.TYPE_INT_RGB;
    }
View Full Code Here

     */
    public void encodeImage(BufferedImage buf, OutputStream os)
            throws IOException {
        ImageWriter writer = ImageWriterRegistry.getInstance()
            .getWriterFor("image/png");
        writer.writeImage(buf, os);
    }

    public int getBufferedImageType(){
        return BufferedImage.TYPE_INT_ARGB;
    }
View Full Code Here

        int PixSzInch = (int)(25.4 / PixSzMM + 0.5);
        params.setResolution(PixSzInch);

        try {
            OutputStream ostream = output.getOutputStream();
            writer.writeImage(img, ostream, params);
            ostream.flush();
        } catch (IOException ex) {
            throw new TranscoderException(ex);
        }
    }
View Full Code Here

                off[i] = i;
            SampleModel sm = new PixelInterleavedSampleModel
                (DataBuffer.TYPE_BYTE, w, h, bands, w * bands, off);
           
            RenderedImage rimg = new FormatRed(GraphicsUtil.wrap(img), sm);
            writer.writeImage(rimg, ostream, params);
            ostream.flush();
        } catch (IOException ex) {
            throw new TranscoderException(ex);
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.