    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.util.Arrays;
    020import java.util.Collections;
    021import java.util.List;
    022
    023import org.apache.commons.imaging.formats.tiff.taginfos.TagInfo;
    024import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoByte;
    025import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoBytes;
    026import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoDirectory;
    027import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoLong;
    028import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoLongs;
    029import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoRationals;
    030import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoShort;
    031import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoShortOrLong;
    032import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoShorts;
    033
    034/**
    035 * RFC 2301: File Format for Internet Fax
    036 * <BR>
    037 * www.ietf.org/rfc/rfc2301.txt
    038 * <BR>
    039 * Also subsumes  "The spirit of TIFF class F"
    040 * <BR>
    041 * http://cool.conservation-us.org/bytopic/imaging/std/tiff-f.html
    042 */
    043public final class Rfc2301TagConstants {
    044
    045    public static final TagInfoShortOrLong TIFF_TAG_BAD_FAX_LINES = new TagInfoShortOrLong(
    046            "BadFaxLines", 0x0146, 1,
    047            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    048
    049    public static final TagInfoShort TIFF_TAG_CLEAN_FAX_DATA = new TagInfoShort(
    050            "CleanFaxData", 0x0147,
    051            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    052    public static final int CLEAN_FAX_DATA_VALUE_CLEAN = 0;
    053    public static final int CLEAN_FAX_DATA_VALUE_REGENERATED = 1;
    054    public static final int CLEAN_FAX_DATA_VALUE_UNCLEAN = 2;
    055
    056    public static final TagInfoShortOrLong TIFF_TAG_CONSECUTIVE_BAD_FAX_LINES = new TagInfoShortOrLong(
    057            "ConsecutiveBadFaxLines", 0x0148, 1,
    058            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    059
    060    public static final TagInfoDirectory TIFF_TAG_GLOBAL_PARAMETERS_IFD = new TagInfoDirectory(
    061            "GlobalParametersIFD", 0x0190,
    062            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    063
    064    public static final TagInfoLong TIFF_TAG_PROFILE_TYPE = new TagInfoLong(
    065            "ProfileType", 0x0191,
    066            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    067    public static final int PROFILE_TYPE_VALUE_UNSPECIFIED = 0;
    068    public static final int PROFILE_TYPE_VALUE_GROUP_3_FAX = 1;
    069
    070    public static final TagInfoByte TIFF_TAG_FAX_PROFILE = new TagInfoByte(
    071            "FaxProfile", 0x0192,
    072            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    073    public static final int FAX_PROFILE_VALUE_UNKNOWN = 0;
    074    public static final int FAX_PROFILE_VALUE_MINIMAL_B_AND_W_LOSSLESS_S = 1;
    075    public static final int FAX_PROFILE_VALUE_EXTENDED_B_AND_W_LOSSLESS_F = 2;
    076    public static final int FAX_PROFILE_VALUE_LOSSLESS_JBIG_B_AND_W_J = 3;
    077    public static final int FAX_PROFILE_VALUE_LOSSY_COLOR_AND_GRAYSCALE_C = 4;
    078    public static final int FAX_PROFILE_VALUE_LOSSLESS_COLOR_AND_GRAYSCALE_L = 5;
    079    public static final int FAX_PROFILE_VALUE_MIXED_RASTER_CONTENT_M = 6;
    080
    081    public static final TagInfoLong TIFF_TAG_CODING_METHODS = new TagInfoLong(
    082            "CodingMethods", 0x0193,
    083            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    084    public static final int CODING_METHODS_VALUE_T4_1D = 2;
    085    public static final int CODING_METHODS_VALUE_T4_2D = 4;
    086    public static final int CODING_METHODS_VALUE_T6 = 8;
    087    public static final int CODING_METHODS_VALUE_T82_T85 = 16;
    088    public static final int CODING_METHODS_VALUE_T81 = 32;
    089    public static final int CODING_METHODS_VALUE_T82_T43 = 64;
    090
    091    public static final TagInfoBytes TIFF_TAG_VERSION_YEAR = new TagInfoBytes(
    092            "VersionYear", 0x0194, 4,
    093            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    094
    095    public static final TagInfoByte TIFF_TAG_MODE_NUMBER = new TagInfoByte(
    096            "ModeNumber", 0x0195,
    097            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    098
    099    public static final TagInfoRationals TIFF_TAG_DECODE = new TagInfoRationals(
    100            "Decode", 0x01b1, -1,
    101            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    102
    103    public static final TagInfoShorts TIFF_TAG_DEFAULT_IMAGE_COLOR = new TagInfoShorts(
    104            "DefaultImageColor", 0x01b2, -1,
    105            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    106
    107    public static final TagInfoLongs TIFF_TAG_STRIP_ROW_COUNTS = new TagInfoLongs(
    108            "StripRowCounts", 0x022f, -1,
    109            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    110
    111    public static final TagInfoShortOrLong TIFF_TAG_IMAGE_LAYER = new TagInfoShortOrLong(
    112            "ImageLayer", 0x87ac, 2,
    113            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    114
    115    public static final List<TagInfo> ALL_RFC_2301_TAGS =
    116            Collections.unmodifiableList(Arrays.asList(
    117                    TIFF_TAG_BAD_FAX_LINES,
    118                    TIFF_TAG_CLEAN_FAX_DATA,
    119                    TIFF_TAG_CONSECUTIVE_BAD_FAX_LINES,
    120                    TIFF_TAG_GLOBAL_PARAMETERS_IFD,
    121                    TIFF_TAG_PROFILE_TYPE,
    122                    TIFF_TAG_FAX_PROFILE,
    123                    TIFF_TAG_CODING_METHODS,
    124                    TIFF_TAG_VERSION_YEAR,
    125                    TIFF_TAG_MODE_NUMBER,
    126                    TIFF_TAG_DECODE,
    127                    TIFF_TAG_DEFAULT_IMAGE_COLOR,
    128                    TIFF_TAG_STRIP_ROW_COUNTS,
    129                    TIFF_TAG_IMAGE_LAYER));
    130
    131    private Rfc2301TagConstants() {
    132    }
    133}