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