Examples of PNGDecodeParam


Examples of org.apache.batik.ext.awt.image.codec.PNGDecodeParam

    /**
     * @see org.apache.fop.image.BatikImage#decodeImage(org.apache.batik.ext.awt.image.codec.SeekableStream)
     */
    protected CachableRed decodeImage(SeekableStream stream) throws IOException {
        PNGDecodeParam param = new PNGDecodeParam();
        param.setPerformGammaCorrection(true);
        param.setDisplayExponent(2.2f); // sRGB gamma
        PNGRed red = new PNGRed(stream, param);
        String unit = (String)red.getProperty("pixel_units");
        if ("Meters".equals(unit)) {
            this.dpiHorizontal = ((Integer)red.getProperty("x_pixels_per_unit")).intValue()
                * 25.4f / 1000f;
View Full Code Here

Examples of org.apache.batik.ext.awt.image.codec.png.PNGDecodeParam

    drawChart(sosContext, gr, vls);
    i++;
  }

  // encode into PNG
  PNGDecodeParam decodeParam = new PNGDecodeParam();
  decodeParam.setGenerateEncodeParam(true);

  PNGImageEncoder enc = new PNGImageEncoder(output, decodeParam.getEncodeParam());
  enc.encode(image);

  gr.dispose();
}
View Full Code Here

Examples of org.apache.flex.forks.batik.ext.awt.image.codec.PNGDecodeParam

        Thread t = new Thread() {
                public void run() {
                    Filter filt;
                    try {
                        PNGDecodeParam param = new PNGDecodeParam();
                        param.setExpandPalette(true);
                       
                        if (raw)
                            param.setPerformGammaCorrection(false);
                        else {
                            param.setPerformGammaCorrection(true);
                            param.setDisplayExponent(2.2f); // sRGB gamma
                        }
                        CachableRed cr = new PNGRed(is, param);
                        dr.setBounds(new Rectangle2D.Double
                                     (0, 0, cr.getWidth(), cr.getHeight()));
View Full Code Here

Examples of org.apache.xmlgraphics.image.codec.png.PNGDecodeParam

        Source src = session.needSource(info.getOriginalURI());
        ImageInputStream imgStream = ImageUtil.needImageInputStream(src);

        SeekableStream seekStream = new ImageInputStreamSeekableStreamAdapter(imgStream);

        PNGImageDecoder decoder = new PNGImageDecoder(seekStream, new PNGDecodeParam());
        RenderedImage image = decoder.decodeAsRenderedImage();

        // need transparency here?
        return new ImageRendered(info, image, null);
    }
View Full Code Here

Examples of org.apache.xmlgraphics.image.codec.png.PNGDecodeParam

    /**
     * @see org.apache.fop.image.XmlGraphicsCommonsImage#decodeImage(
     *          org.apache.xmlgraphics.image.codec.util.SeekableStream)
     */
    protected CachableRed decodeImage(SeekableStream stream) throws IOException {
        PNGDecodeParam param = new PNGDecodeParam();
        param.setPerformGammaCorrection(true);
        param.setDisplayExponent(2.2f); // sRGB gamma
        PNGRed red = new PNGRed(stream, param);
        String unit = (String)red.getProperty("pixel_units");
        if ("Meters".equals(unit)) {
            this.dpiHorizontal = ((Integer)red.getProperty("x_pixels_per_unit")).intValue()
                * 25.4f / 1000f;
View Full Code Here

Examples of org.apache.xmlgraphics.image.codec.png.PNGDecodeParam

    /**
     * @see org.apache.fop.image.XmlGraphicsCommonsImage#decodeImage(
     *          org.apache.xmlgraphics.image.codec.util.SeekableStream)
     */
    protected CachableRed decodeImage(SeekableStream stream) throws IOException {
        PNGDecodeParam param = new PNGDecodeParam();
        param.setPerformGammaCorrection(true);
        param.setDisplayExponent(2.2f); // sRGB gamma
        PNGRed red = new PNGRed(stream, param);
        String unit = (String)red.getProperty("pixel_units");
        if ("Meters".equals(unit)) {
            this.dpiHorizontal = ((Integer)red.getProperty("x_pixels_per_unit")).intValue()
                * 25.4f / 1000f;
View Full Code Here

Examples of org.apache.xmlgraphics.image.codec.png.PNGDecodeParam

     * @return the decoded image
     * @throws IOException in case an I/O problem occurs
     */
    protected CachableRed decodeImage(final SeekableStream stream)
            throws IOException {
        final PNGDecodeParam param = new PNGDecodeParam();
        param.setPerformGammaCorrection(true);
        param.setDisplayExponent(PNGGraphic.SRGB_GAMMA);
        final PNGRed red = new PNGRed(stream, param);
//        final String unit = (String) red.getProperty("pixel_units");
//        if ("Meters".equals(unit)) {
//            int dpi = ((Integer)red.getProperty(
//                    "x_pixels_per_unit")).intValue();
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.