001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.imaging.formats.png;
018
019import org.apache.commons.imaging.common.BinaryConstant;
020
021public final class PngConstants {
022
023    public static final int COMPRESSION_DEFLATE_INFLATE = 0;
024
025    public static final BinaryConstant PNG_SIGNATURE = new BinaryConstant(
026            new byte[] { (byte) 0x89, 'P', 'N', 'G', '\r', '\n', 0x1A, '\n', });
027
028    public static final String PARAM_KEY_PNG_BIT_DEPTH = "PNG_BIT_DEPTH";
029    public static final String PARAM_KEY_PNG_FORCE_INDEXED_COLOR = "PNG_FORCE_INDEXED_COLOR";
030    public static final String PARAM_KEY_PNG_FORCE_TRUE_COLOR = "PNG_FORCE_TRUE_COLOR";
031
032    // public static final Object PARAM_KEY_PNG_BIT_DEPTH_YES = "YES";
033    // public static final Object PARAM_KEY_PNG_BIT_DEPTH_NO = "NO";
034
035    public static final byte COMPRESSION_TYPE_INFLATE_DEFLATE = 0;
036    public static final byte FILTER_METHOD_ADAPTIVE = 0;
037
038    /*
039     * Background colour Solid background colour to be used when presenting the
040     * image if no better option is available. Gamma and chromaticity Gamma
041     * characteristic of the image with respect to the desired output intensity,
042     * and chromaticity characteristics of the RGB values used in the image. ICC
043     * profile Description of the colour space (in the form of an International
044     * Color Consortium (ICC) profile) to which the samples in the image
045     * conform. Image histogram Estimates of how frequently the image uses each
046     * palette entry. Physical pixel dimensions Intended pixel size and aspect
047     * ratio to be used in presenting the PNG image. Significant bits The number
048     * of bits that are significant in the samples. sRGB colour space A
049     * rendering intent (as defined by the International Color Consortium) and
050     * an indication that the image samples conform to this colour space.
051     * Suggested palette A reduced palette that may be used when the display
052     * device is not capable of displaying the full range of colours in the
053     * image. Textual data Textual information (which may be compressed)
054     * associated with the image. Time The time when the PNG image was last
055     * modified. Transparency Alpha information that allows the reference image
056     * to be reconstructed when the alpha channel is not retained in the PNG
057     * image.
058     */
059
060    public static final String XMP_KEYWORD = "XML:com.adobe.xmp";
061
062    /**
063     * Parameter key.
064     *
065     * <p>Only used when writing Png images.</p>
066     *
067     * <p>Valid values: a list of WriteTexts.</p>
068     */
069    public static final String PARAM_KEY_PNG_TEXT_CHUNKS = "PNG_TEXT_CHUNKS";
070
071    /**
072     * Parameter key. Used in write operations to indicate the Physical Scale - sCAL.
073     *
074     * <p>Valid values: PhysicalScale</p>
075     *
076     * @see org.apache.commons.imaging.formats.png.PhysicalScale
077     */
078    public static final String PARAM_KEY_PHYSICAL_SCALE = "PHYSICAL_SCALE_CHUNK";
079
080    /**
081     * Parameter key. Used to indicate the PNG compression level to be used.
082     *
083     * <p>For valid values, see {@link java.util.zip.Deflater}. If no value is specified, it will use
084     * the default compression level.</p>
085     *
086     * @see java.util.zip.Deflater
087     */
088    public static final String PARAM_KEY_PNG_COMPRESSION_LEVEL = "PNG_COMPRESSION_LEVEL";
089
090    private PngConstants() {
091    }
092}