    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 * <p>
    037 * www.ietf.org/rfc/rfc2301.txt
    038 * </p>
    039 * <p>
    040 * Also subsumes "The spirit of TIFF class F"
    041 * </p>
    042 * <p>
    043 * https://cool.culturalheritage.org/bytopic/imaging/std/tiff-f.html
    044 * </p>
    045 */
    046public final class Rfc2301TagConstants {
    047
    048    public static final TagInfoShortOrLong TIFF_TAG_BAD_FAX_LINES = new TagInfoShortOrLong("BadFaxLines", 0x0146, 1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    049
    050    public static final TagInfoShort TIFF_TAG_CLEAN_FAX_DATA = new TagInfoShort("CleanFaxData", 0x0147, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    051    public static final int CLEAN_FAX_DATA_VALUE_CLEAN = 0;
    052    public static final int CLEAN_FAX_DATA_VALUE_REGENERATED = 1;
    053    public static final int CLEAN_FAX_DATA_VALUE_UNCLEAN = 2;
    054
    055    public static final TagInfoShortOrLong TIFF_TAG_CONSECUTIVE_BAD_FAX_LINES = new TagInfoShortOrLong("ConsecutiveBadFaxLines", 0x0148, 1,
    056            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    057
    058    public static final TagInfoDirectory TIFF_TAG_GLOBAL_PARAMETERS_IFD = new TagInfoDirectory("GlobalParametersIFD", 0x0190,
    059            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    060
    061    public static final TagInfoLong TIFF_TAG_PROFILE_TYPE = new TagInfoLong("ProfileType", 0x0191, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    062    public static final int PROFILE_TYPE_VALUE_UNSPECIFIED = 0;
    063    public static final int PROFILE_TYPE_VALUE_GROUP_3_FAX = 1;
    064
    065    public static final TagInfoByte TIFF_TAG_FAX_PROFILE = new TagInfoByte("FaxProfile", 0x0192, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    066    public static final int FAX_PROFILE_VALUE_UNKNOWN = 0;
    067    public static final int FAX_PROFILE_VALUE_MINIMAL_B_AND_W_LOSSLESS_S = 1;
    068    public static final int FAX_PROFILE_VALUE_EXTENDED_B_AND_W_LOSSLESS_F = 2;
    069    public static final int FAX_PROFILE_VALUE_LOSSLESS_JBIG_B_AND_W_J = 3;
    070    public static final int FAX_PROFILE_VALUE_LOSSY_COLOR_AND_GRAYSCALE_C = 4;
    071    public static final int FAX_PROFILE_VALUE_LOSSLESS_COLOR_AND_GRAYSCALE_L = 5;
    072    public static final int FAX_PROFILE_VALUE_MIXED_RASTER_CONTENT_M = 6;
    073
    074    public static final TagInfoLong TIFF_TAG_CODING_METHODS = new TagInfoLong("CodingMethods", 0x0193, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    075    public static final int CODING_METHODS_VALUE_T4_1D = 2;
    076    public static final int CODING_METHODS_VALUE_T4_2D = 4;
    077    public static final int CODING_METHODS_VALUE_T6 = 8;
    078    public static final int CODING_METHODS_VALUE_T82_T85 = 16;
    079    public static final int CODING_METHODS_VALUE_T81 = 32;
    080    public static final int CODING_METHODS_VALUE_T82_T43 = 64;
    081
    082    public static final TagInfoBytes TIFF_TAG_VERSION_YEAR = new TagInfoBytes("VersionYear", 0x0194, 4, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    083
    084    public static final TagInfoByte TIFF_TAG_MODE_NUMBER = new TagInfoByte("ModeNumber", 0x0195, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    085
    086    public static final TagInfoRationals TIFF_TAG_DECODE = new TagInfoRationals("Decode", 0x01b1, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    087
    088    public static final TagInfoShorts TIFF_TAG_DEFAULT_IMAGE_COLOR = new TagInfoShorts("DefaultImageColor", 0x01b2, -1,
    089            TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    090
    091    public static final TagInfoLongs TIFF_TAG_STRIP_ROW_COUNTS = new TagInfoLongs("StripRowCounts", 0x022f, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    092
    093    public static final TagInfoShortOrLong TIFF_TAG_IMAGE_LAYER = new TagInfoShortOrLong("ImageLayer", 0x87ac, 2, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN);
    094
    095    public static final List<TagInfo> ALL_RFC_2301_TAGS = Collections.unmodifiableList(Arrays.asList(TIFF_TAG_BAD_FAX_LINES, TIFF_TAG_CLEAN_FAX_DATA,
    096            TIFF_TAG_CONSECUTIVE_BAD_FAX_LINES, TIFF_TAG_GLOBAL_PARAMETERS_IFD, TIFF_TAG_PROFILE_TYPE, TIFF_TAG_FAX_PROFILE, TIFF_TAG_CODING_METHODS,
    097            TIFF_TAG_VERSION_YEAR, TIFF_TAG_MODE_NUMBER, TIFF_TAG_DECODE, TIFF_TAG_DEFAULT_IMAGE_COLOR, TIFF_TAG_STRIP_ROW_COUNTS, TIFF_TAG_IMAGE_LAYER));
    098
    099    private Rfc2301TagConstants() {
    100    }
    101}