public int getBitDepth() {
        if (!bitDepthSet) {
            throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam11"));
        }
        return bitDepth;
    }
Returns the desired bit depth for a grayscale image.

<p> If the bit depth has not previously been set, or has been
unset, an <code>IllegalStateException</code> will be thrown.

@throws IllegalStateException if the bit depth is not set.
plugins/svg-plugin/batik-codec-fix/src/main/java/org/apache/batik/ext/awt/image/codec/png/PNGEncodeParam.java