rfc2301.txt
来自「RFC 的详细文档!」· 文本 代码 · 共 1,339 行 · 第 1/5 页
TXT
1,339 行
Section 2 gives an overview of TIFF. Section 2.1 describes the
structure of TIFF files, including general guidelines for structuring
multi-page TIFF files. Section 2.2 lists the TIFF fields that are
required or recommended for all fax modes. The TIFF fields used only
by specific fax modes are described in Sections 3-8, which describe
the individual fax modes. These sections also specify the ITU-
compatible field values (image parameters) for each mode.
McIntyre, et. al. Standards Track [Page 5]
RFC 2301 File Format for Internet Fax March 1998
The full set of permitted fields of TIFF for facsimile are included
in the current TIFF specification, Section 2 of this document and the
sections on specific modes of facsimile operation. This document
defines profiles of TIFF for facsimile, where a profile is a subset
of the full set of permitted fields and field values of TIFF for
facsimile.
Section 3 defines the minimal black-and-white facsimile mode (Profile
S), which is required in all implementations. Section 4 defines the
extended black-and-white fax mode (Profile F), which provides a
standard definition of TIFF-F. Section 5 describes the lossless
black-and-white mode using JBIG compression (Profile J). Section 6
defines the base color mode, required in all color implementations,
for the lossy JPEG representation of color and grayscale facsimile
data (Profile C). Section 7 defines the lossless JBIG color and
grayscale facsimile mode (Profile L) and Section 8 defines the Mixed
Raster Content facsimile mode (Profile M). Each of these sections
concludes with a table summarizing the required and recommended
fields for each mode and the values they can have.
Section 9 describes the MIME content type image/tiff and the use of
the optional Application parameter in connection with TIFF for
facsimile. Sections 10, 11, 12 and 13 give Security Considerations,
the ISOC Copyright Notice, References and Authors' Addresses. Annex A
gives a summary of the TIFF fields used or defined in this document
and provides a convenient reference for implementors.
To implement only the minimal interchange black-and-white set of
fields and values (Profile S), one need read only Sections 1, 2, 3, 9
and 10.
The following tree diagram shows the relationship among profiles and
between profiles and coding methods.
S (MH)
/ \
B&W / \ Color
------------ ----------
/ \ \
/ F (MMR, MR) C (JPEG)
/ / \
J (JBIG) ---- \
/ \
L (JBIG) \
\
M (MRC)
A profile is based on a collection of ITU-T facsimile coding methods.
McIntyre, et. al. Standards Track [Page 6]
RFC 2301 File Format for Internet Fax March 1998
For example, Profile S, the minimal mode, is based on Modified
Huffman (MH) compression, which are defined in ITU-T Rec. T.4.
Profile F specifies Modified Read (MR) and Modified Modified Read
(MMR) compressions, which are defined in ITU-T Rec. T.4 and T.6.
All implementations of TIFF for facsimile MUST implement Profile S,
which is the root node of the tree. All color implementations of TIFF
for facsimile MUST implement Profile C. The implementation of a
particular profile MUST also implement those profiles on the path
that connect it to the root node, and MAY optionally implement
profiles not on the path connecting it to the root node. For example,
an implementation of Profile M must also implement Profiles C and S,
and may optionally implement Profile F, J or L. For another example,
an implementation of Profile C must also implement Profile S, and may
optionally implement Profile F or J.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", " NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [REQ].
2. TIFF and Fax
2.1. TIFF Overview
TIFF provides a means for describing, storing and interchanging
raster image data. A primary goal of TIFF is to provide a rich
environment within which applications can exchange image data. The
current TIFF specification [TIFF] defines a commonly used, core set
of TIFF fields known as Baseline TIFF. The current specification and
TIFF Technical Notes 1 and 2 [TTN1, TTN2] define several TIFF
extensions. The TIFF- based specification for fax applications uses a
subset of Baseline TIFF fields, with selected extensions, as
described in this document. In a few cases, this document defines new
TIFF fields specifically for fax applications.
2.1.1. File Structure
TIFF is designed for raster images, which makes it a good match for
facsimile documents, which are multi-page raster images. Each raster
image consists of a number of rows or scanlines, each of which has
the same number of pixels, the unit of sampling. Each pixel has at
least one sample or component (exactly one for black-and-white
images).
A TIFF file begins with an 8-byte image file header. The first two
bytes describe the byte order used within the file. Legal values are
"II" (0x4949) when bytes are ordered from least to most significant
(little- endian), and "MM" (0x4D4D), when bytes are ordered from most
McIntyre, et. al. Standards Track [Page 7]
RFC 2301 File Format for Internet Fax March 1998
to least significant (big-endian) within a 16- or 32-bit integer.
Either byte order can be used, except in the case of the minimal
black-and-white mode, which SHALL use value "II". The next two bytes
contain the value 42 that identifies the file as a TIFF file and is
ordered according to the value in the first two bytes of the header.
The last four bytes give the offset that points to the first image
file directory (IFD). This and all other offsets in a TIFF file are
with respect to the beginning of the TIFF file. An IFD can be at any
location in the file after the header but must begin on a word
boundary.
An IFD is a sequence of tagged fields, sorted in ascending order by
tag value. An IFD consists of a 2-byte count of the number of fields,
a sequence of field entries and a 4-byte offset to the next IFD. The
fields contain information about the image and pointers to the image
data. Each separate raster image in the file is represented by an
IFD.
Each field entry in an IFD has 12 bytes and consists of a 2-byte Tag,
2 bytes identifying the field type (e.g. short, long, rational,
ASCII), 4 bytes giving the count (number of values or offsets), and 4
bytes that either contain the offset to a field value stored outside
the IFD, or, based on the type and count, the field value itself.
Resolution and metadata such as dates, names and descriptions are
examples of "long" field values that do not fit in 4 bytes and
therefore use offsets in the field entry. Details are given in the
TIFF specification [TIFF].
A TIFF file can contain more than one IFD, where each IFD is a
subfile whose type is given in the NewSubfileType field. Multiple
IFDs can be organized either as a linked list, with the last entry in
each IFD pointing to the next IFD (the pointer in the last IFD is 0),
or as a tree, using the SubIFDs field in the primary IFD [TTN1]. The
SubIFDs field contains an array of pointers to child IFDs of the
primary IFD.
Child IFDs describe related images, such as reduced resolution
versions of the primary IFD image. The same IFD can point both to a
next IFD and to child IFDs, and child IFDs can themselves point to
other IFDs.
All fax modes represent a multi-page fax image as a linked list of
IFDs, with a NewSubfileType field containing a bit that identifies
the IFD as one page of a multi-page document. Each IFD has a
PageNumber field, identifying the page number in ascending order,
starting at 0 for the first page. While a Baseline TIFF reader is not
McIntyre, et. al. Standards Track [Page 8]
RFC 2301 File Format for Internet Fax March 1998
required to read any IFDs beyond the first, an implementation that
reads the files that comply with this specification SHALL read
multiple IFDs. Only the Mixed Raster Content fax mode, described in
Section 8, requires the use of child IFDs.
The following figure illustrates the structure of a multi-page TIFF
file.
+-----------------------+
| Header |------------+
+-----------------------+ | First IFD
| IFD (page 0) |<-----------+ Offset
+---| |------------+
Value | +-----------------------+ |
Offset +-->| Long Values |--+ |
+-----------------------| | Strip |
| Image Data |<-+ Offset |
| strip 1 page 0 | | |
+-----------------------+ | |
| : | : |
|
+-----------------------+ | Next IFD
| IFD (page 1) |<-----------+ Offset
+---| |------------+
Value | +-----------------------+ |
Offset +-->| Long Values |--+ |
+-----------------------| | Strip |
| Image Data |<-+ Offset |
| strip 1 page 1 | | |
+-----------------------+ | |
| strip 2 page 1 |<-+ |
+-----------------------+ | |
| : | : |
|
+-----------------------+ | Next IFD
| IFD (page 2) |<-----------+ Offset
| : |
2.1.2 Image Structure
An IFD stores an image as one or more strips, as shown in the
preceding figure. A strip consists of 1 or more scanlines (rows) of
raster image data in compressed form. An image may be stored in a
single strip or may be divided into several strips, which would
require less memory to buffer. (Baseline TIFF recommends about 8k
bytes per strip, but existing fax usage is typically one strip per
image.)
McIntyre, et. al. Standards Track [Page 9]
RFC 2301 File Format for Internet Fax March 1998
Each IFD requires three strip-related fields: StripOffsets,
RowsPerStrip and StripByteCounts. The StripOffsets field is an array
of pointers to the strip or strips that contain the actual image
data. The StripByteCounts field gives the number of bytes in each
strip after compression. TIFF requires that each strip, except the
last, contain the same number of scanlines, which is given in the
RowsPerStrip field. This document introduces the new StripRowCounts
field that allows a variable number of scanlines per strip, which is
required by the Mixed Raster Content fax mode (Section 8).
Image data is stored as uninterpreted, compressed image data streams
within a strip. The formats of these streams follow the ITU-T
Recommendations. The Compression field in the IFD indicates the type
of compression, and other TIFF fields in the IFD describe image
attributes, such as color encoding and spatial resolution.
Compression parameters are stored in the compressed data stream,
rather than in TIFF fields. This makes the TIFF representation and
compressed data format specification independent of each another.
This approach, modeled on [TTN2], allows TIFF to gracefully add new
compression schemes as they become available.
Some attributes can be specified both in the compressed data stream
and within a TIFF field. It is possible that the two values will
differ. When this happens for values required to interpret the data
stream, then the values in the data stream take precedence. For
informational values that are not required to interpret the data
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?