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.tiff.constants;
018
019import java.nio.ByteOrder;
020
021/**
022 * Defines constants for internal elements from TIFF files and for allowing applications to define parameters for reading and writing TIFF files.
023 */
024public final class TiffConstants {
025
026    public static final ByteOrder DEFAULT_TIFF_BYTE_ORDER = ByteOrder.LITTLE_ENDIAN;
027
028    public static final int TIFF_VERSION_STANDARD = 42;
029    public static final int TIFF_VERSION_BIG = 43;
030
031    public static final int TIFF_HEADER_SIZE = 8;
032    public static final int TIFF_DIRECTORY_HEADER_LENGTH = 2;
033    public static final int TIFF_DIRECTORY_FOOTER_LENGTH = 4;
034    public static final int TIFF_ENTRY_LENGTH = 12;
035    public static final int TIFF_ENTRY_MAX_VALUE_LENGTH = 4;
036    public static final int TIFF_ENTRY_LENGTH_BIG = 12;
037    public static final int TIFF_ENTRY_MAX_VALUE_LENGTH_BIG = 8;
038
039    public static final int TIFF_COMPRESSION_UNCOMPRESSED_1 = 1;
040    public static final int TIFF_COMPRESSION_UNCOMPRESSED = TIFF_COMPRESSION_UNCOMPRESSED_1;
041    public static final int TIFF_COMPRESSION_CCITT_1D = 2;
042    public static final int TIFF_COMPRESSION_CCITT_GROUP_3 = 3;
043    public static final int TIFF_COMPRESSION_CCITT_GROUP_4 = 4;
044    public static final int TIFF_COMPRESSION_LZW = 5;
045    public static final int TIFF_COMPRESSION_JPEG_OBSOLETE = 6;
046    public static final int TIFF_COMPRESSION_JPEG = 7;
047    public static final int TIFF_COMPRESSION_UNCOMPRESSED_2 = 32771;
048    public static final int TIFF_COMPRESSION_PACKBITS = 32773;
049    public static final int TIFF_COMPRESSION_DEFLATE_PKZIP = 32946;
050    public static final int TIFF_COMPRESSION_DEFLATE_ADOBE = 8;
051
052    public static final int TIFF_FLAG_T4_OPTIONS_2D = 1;
053    public static final int TIFF_FLAG_T4_OPTIONS_UNCOMPRESSED_MODE = 2;
054    public static final int TIFF_FLAG_T4_OPTIONS_FILL = 4;
055    public static final int TIFF_FLAG_T6_OPTIONS_UNCOMPRESSED_MODE = 2;
056
057    /**
058     * Specifies a larger strip-size to be used for compression. This setting generally produces smaller output files, but requires a slightly longer processing
059     * time. Used in conjunction with the PARAM_KEY_LZW_COMPRESSION_STRIP_SIZE
060     */
061    public static final int TIFF_LZW_COMPRESSION_BLOCK_SIZE_MEDIUM = 32768;
062
063    /**
064     * Specifies a larger strip-size to be used for compression. This setting generally produces smaller output files, but requires a slightly longer processing
065     * time. Used in conjunction with the PARAM_KEY_LZW_COMPRESSION_STRIP_SIZE
066     */
067    public static final int TIFF_LZW_COMPRESSION_BLOCK_SIZE_LARGE = 65536;
068
069    private TiffConstants() {
070    }
071}