private void decodeImage(boolean useInterlacing) {
        if (!useInterlacing) {
            decodePass(theTile, 0, 0, 1, 1, width, height);
        } else {
            decodePass(theTile, 0, 0, 8, 8, (width + 7)/8, (height + 7)/8);
            decodePass(theTile, 4, 0, 8, 8, (width + 3)/8, (height + 7)/8);
            decodePass(theTile, 0, 4, 4, 8, (width + 3)/4, (height + 3)/8);
            decodePass(theTile, 2, 0, 4, 4, (width + 1)/4, (height + 3)/4);
            decodePass(theTile, 0, 2, 2, 4, (width + 1)/2, (height + 1)/4);
            decodePass(theTile, 1, 0, 2, 2, width/2, (height + 1)/2);
            decodePass(theTile, 0, 1, 1, 2, width, height/2);
        }
    }
Reads in an image of a given size and returns it as a
WritableRaster.
plugins/svg-plugin/batik-codec-fix/src/main/java/org/apache/batik/ext/awt/image/codec/png/PNGImageDecoder.java