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

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


     */
    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;
            this.dpiVertical = ((Integer)red.getProperty("y_pixels_per_unit")).intValue()
                * 25.4f / 1000f;
        }
        return red;
    }
View Full Code Here


     */
    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;
            this.dpiVertical = ((Integer)red.getProperty("y_pixels_per_unit")).intValue()
                * 25.4f / 1000f;
        }
        return red;
    }
View Full Code Here

    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();
//            this.dpiHorizontal = dpi * 25.4f / 1000f;
View Full Code Here

TOP

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

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.