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