Class PngImageHelper


  • class PngImageHelper
    extends java.lang.Object
    • Constructor Detail

      • PngImageHelper

        PngImageHelper()
    • Method Detail

      • processImage

        public static void processImage​(ImageData image)
      • processPng

        private static void processPng​(java.io.InputStream pngStream,
                                       PngImageHelper.PngParameters png)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • readPng

        private static void readPng​(java.io.InputStream pngStream,
                                    PngImageHelper.PngParameters png)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • checkMarker

        private static boolean checkMarker​(java.lang.String s)
      • decodePass

        private static void decodePass​(int xOffset,
                                       int yOffset,
                                       int xStep,
                                       int yStep,
                                       int passWidth,
                                       int passHeight,
                                       PngImageHelper.PngParameters png)
      • processPixels

        private static void processPixels​(byte[] curr,
                                          int xOffset,
                                          int step,
                                          int y,
                                          int width,
                                          PngImageHelper.PngParameters png)
      • getPixel

        private static int getPixel​(byte[] image,
                                    int x,
                                    int y,
                                    int bitDepth,
                                    int bytesPerRow)
      • setPixel

        static void setPixel​(byte[] image,
                             int[] data,
                             int offset,
                             int size,
                             int x,
                             int y,
                             int bitDepth,
                             int bytesPerRow)
      • decodeSubFilter

        private static void decodeSubFilter​(byte[] curr,
                                            int count,
                                            int bpp)
      • decodeUpFilter

        private static void decodeUpFilter​(byte[] curr,
                                           byte[] prev,
                                           int count)
      • decodeAverageFilter

        private static void decodeAverageFilter​(byte[] curr,
                                                byte[] prev,
                                                int count,
                                                int bpp)
      • paethPredictor

        private static int paethPredictor​(int a,
                                          int b,
                                          int c)
      • decodePaethFilter

        private static void decodePaethFilter​(byte[] curr,
                                              byte[] prev,
                                              int count,
                                              int bpp)
      • getInt

        public static int getInt​(java.io.InputStream pngStream)
                          throws java.io.IOException
        Gets an int from an InputStream.
        Parameters:
        pngStream - an InputStream
        Returns:
        the value of an int
        Throws:
        java.io.IOException
      • getWord

        public static int getWord​(java.io.InputStream pngStream)
                           throws java.io.IOException
        Gets a word from an InputStream.
        Parameters:
        pngStream - an InputStream
        Returns:
        the value of an int
        Throws:
        java.io.IOException
      • getString

        public static java.lang.String getString​(java.io.InputStream pngStream)
                                          throws java.io.IOException
        Gets a String from an InputStream.
        Parameters:
        pngStream - an InputStream
        Returns:
        the value of an int
        Throws:
        java.io.IOException