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;
018
019/**
020 * Defines constants that may be used in passing options to
021 * ImageParser read/write implementations, the utility routines
022 * implemented in the Imaging class, and throughout the
023 * Apache Commons Imaging package.  Individual ImageParser
024 * implementations may define their own format-specific options.
025 */
026public final class ImagingConstants {
027
028    /**
029     * Parameter key. Used to hint the filename when reading from a byte array
030     * or InputStream. The filename hint can help disambiguate what file the
031     * image format.
032     * <p>
033     * Applies to read operations.
034     * <p>
035     * Valid values: filename as string
036     * <p>
037     *
038     * @see java.io.InputStream
039     */
040    public static final String PARAM_KEY_FILENAME = "FILENAME";
041
042    /**
043     * Parameter key. Used in write operations to indicate desired image format.
044     * <p>
045     * Valid values: Any format defined in ImageFormat, such as
046     * ImageFormat.IMAGE_FORMAT_PNG.
047     * <p>
048     *
049     * @see org.apache.commons.imaging.ImageFormats
050     */
051    public static final String PARAM_KEY_FORMAT = "FORMAT";
052
053    /**
054     * Parameter key. Used in write operations to indicate desired compression
055     * algorithm.
056     * <p>
057     * Currently only applies to writing TIFF image files.
058     * <p>
059     * Valid values: TiffConstants.TIFF_COMPRESSION_UNCOMPRESSED,
060     * TiffConstants.TIFF_COMPRESSION_CCITT_1D,
061     * TiffConstants.TIFF_COMPRESSION_LZW,
062     * TiffConstants.TIFF_COMPRESSION_PACKBITS.
063     * <p>
064     *
065     * @see org.apache.commons.imaging.formats.tiff.constants.TiffConstants
066     */
067    public static final String PARAM_KEY_COMPRESSION = "COMPRESSION";
068
069    public static final String BUFFERED_IMAGE_FACTORY = "BUFFERED_IMAGE_FACTORY";
070
071    /**
072     * Parameter key. Indicates whether to read embedded thumbnails.
073     * <p>
074     * Only applies to read EXIF metadata from JPEG/JFIF files.
075     * <p>
076     * Valid values: Boolean.TRUE and Boolean.FALSE.
077     * <p>
078     *
079     * @see org.apache.commons.imaging.formats.tiff.constants.TiffConstants
080     */
081    public static final String PARAM_KEY_READ_THUMBNAILS = "READ_THUMBNAILS";
082
083    /**
084     * Parameter key. Indicates whether to throw exceptions when parsing invalid
085     * files, or whether to tolerate small problems.
086     * <p>
087     * Valid values: Boolean.TRUE and Boolean.FALSE. Default value:
088     * Boolean.FALSE.
089     * <p>
090     *
091     * @see org.apache.commons.imaging.formats.tiff.constants.TiffConstants
092     */
093    public static final String PARAM_KEY_STRICT = "STRICT";
094
095    /**
096     * Parameter key.
097     *
098     * Only used when writing images.
099     * <p>
100     * Valid values: TiffOutputSet to write into the image's EXIF metadata.
101     * <p>
102     *
103     * @see org.apache.commons.imaging.formats.tiff.write.TiffOutputSet
104     */
105    public static final String PARAM_KEY_EXIF = "EXIF";
106
107    /**
108     * Parameter key.
109     *
110     * Only used when writing images.
111     * <p>
112     * Valid values: String of XMP XML.
113     * <p>
114     */
115    public static final String PARAM_KEY_XMP_XML = "XMP_XML";
116
117    /**
118     * Parameter key. Used in write operations to indicate the desired pixel
119     * density (DPI), and/or aspect ratio.
120     * <p>
121     * Valid values: PixelDensity
122     * <p>
123     *
124     * @see org.apache.commons.imaging.PixelDensity
125     */
126    public static final String PARAM_KEY_PIXEL_DENSITY = "PIXEL_DENSITY";
127
128    private ImagingConstants() {
129    }
130}