Package org.apache.xmlgraphics.image.codec.png

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


    /**
     * @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

    /**
     * @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

     * @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

Related Classes of org.apache.xmlgraphics.image.codec.png.PNGDecodeParam

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.