Skip to content

Commit 5d9d86b

Browse files
committed
Added TIFF image file format and its ISO standard to normative references. Added ability to allow implementations to support additional image file formats.
1 parent c8d3bfa commit 5d9d86b

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

source/image-file-format.tex

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@
55
\rSec1 [\iotwod.imagefileformat.summary] {\tcode{image_file_format} summary}
66

77
\pnum
8-
The \tcode{image_file_format} enum class specifies the data format that an \tcode{image_surface} object shall be constructed from or shall be saved to.
8+
The \tcode{image_file_format} enum class specifies the data format that an \tcode{image_surface} object is constructed from or saved to. This allows data in a format that is required to be supported to be read or written regardless of its extension.
99

1010
\pnum
11-
This allows data in a format that is required to be supported to be read or written regardless of its extension.
11+
It also has a value that allows implementations to support additional file formats if it recognizes them.
1212

1313
\rSec1 [\iotwod.imagefileformat.synopsis] {\tcode{image_file_format} synopsis}
1414

1515
\indexlibrary{\idxcode{image_file_format}}
1616
\begin{codeblock}
1717
namespace std::experimental::io2d::v1 {
1818
enum class image_file_format {
19+
unknown,
1920
png,
20-
jpg
21+
jpg,
22+
tiff
2123
};
2224
}
2325
\end{codeblock}
@@ -38,10 +40,16 @@
3840
& \rhdr{Meaning}
3941
\\ \capsep
4042
\endhead
43+
\tcode{unknown}
44+
& The format is unknown because it is not an image file format that is required to be supported. It may be known and supported by the implementation.
45+
\\
4146
\tcode{png}
42-
& The data is in the PNG format.
47+
& The PNG format.
4348
\\
4449
\tcode{jpg}
45-
& The data is in the JPEG format.
50+
& The JPEG format.
51+
\\
52+
\tcode{tiff}
53+
& The TIFF format.
4654
\\
4755
\end{libreqtab2}

source/image-surface.tex

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,23 @@
8484
\pnum
8585
The data of \tcode{f} is processed into uncompressed raster graphics data as specified by the value of \tcode{i}.
8686

87+
\pnum
88+
If \tcode{i} is \tcode{image_file_format::unknown}, it is \impldefplain{image_surface!constructor} whether the surface is created in the image file format, if any, that the implementation associates with \tcode{p.extension()} provided that \tcode{p.has_extension() == true}. If \tcode{p.has_extension() == false}, the implementation does not associate an image file format with \tcode{p.extension()}, or the implementation does not support reading in graphics data in that image file format, the error specified below occurs.
89+
8790
\pnum
8891
The resulting uncompressed raster graphics data is then transformed into the data format specified by \tcode{fmt}. If the format specified by \tcode{fmt} only contains an alpha channel, the values of the color channels, if any, of the \underlyingimagesurface are \unspecnorm. If the format specified by \tcode{fmt} only contains color channels and the resulting uncompressed raster graphics data is in a premultiplied format, then the value of each color channel for each pixel shall be divided by the value of the alpha channel for that pixel. The visual data shall then be set as the visual data of the \underlyingimagesurface.
8992

9093
\pnum
9194
\throws
92-
As specified in Error reporting [\iotwod.fs.err.report] in \cppseventeen.
95+
As specified in Error reporting [\iotwod.err.report].
9396

9497
\pnum
9598
\errors
9699
Any error that could result from trying to access \tcode{f}, open \tcode{f} for reading, or reading data from \tcode{f}.
97100

101+
\pnum
102+
\tcode{errc::not_supported} if \tcode{image_file_format::unknown} is passed as an argument and the implementation is unable to determine the file format or does not support saving in the image file format it determined.
103+
98104
\pnum
99105
Other errors, if any, produced by this function are \impldefplain{image_surface!data}.
100106
\end{itemdescr}
@@ -115,19 +121,25 @@
115121

116122
\pnum
117123
\effects
118-
Any pending rendering and composing operations (\ref{\iotwod.surface.rendering}) shall be performed.
124+
Any pending rendering and composing operations (\ref{\iotwod.surface.rendering}) are performed.
119125

120126
\pnum
121127
The visual data of the \underlyingimagesurface is written to \tcode{p} in the data format specified by \tcode{i}.
122128

129+
\pnum
130+
If \tcode{i} is \tcode{image_file_format::unknown}, it is \impldefplain{image_surface!save} whether the surface is saved in the image file format, if any, that the implementation associates with \tcode{p.extension()} provided that \tcode{p.has_extension() == true}. If \tcode{p.has_extension() == false}, the implementation does not associate an image file format with \tcode{p.extension()}, or the implementation does not support saving in that image file format, the error specified below occurs.
131+
123132
\pnum
124133
\throws
125-
As specified in Error reporting [\iotwod.fs.err.report] in \cppseventeen.
134+
As specified in Error reporting [\iotwod.err.report].
126135

127136
\pnum
128137
\errors
129138
Any error that could result from trying to create \tcode{f}, access \tcode{f}, or write data to \tcode{f}.
130139

140+
\pnum
141+
\tcode{errc::not_supported} if \tcode{image_file_format::unknown} is passed as an argument and the implementation is unable to determine the file format or does not support saving in the image file format it determined.
142+
131143
\pnum
132144
Other errors, if any, produced by this function are \impldefplain{image_surface!data}.
133145
\end{itemdescr}

source/normative-references.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
Multiple-Octet Coded Character Set (UCS) --- Part 1: Architecture and Basic
1717
Multilingual Plane}
1818
\item ISO/IEC 10918-1, \doccite{Information technology -- Digital compression and coding of continuous-tone still images: Requirements and guidelines}
19+
\item ISO 12639, \doccite{Graphic technology -- Prepress digital data exchange -- Tag image file format for image technology (TIFF/IT)}
1920
\item ISO/IEC 15948 \doccite{Information technology -- Computer graphics and image processing -- Portable Network Graphics (PNG) Functional specification}
2021
\item ISO/IEC TR 19769:2004, \doccite{Information technology --- Programming
2122
languages, their environments and system software interfaces --- Extensions for
@@ -35,6 +36,8 @@
3536
\pnum
3637
The compressed image data format described in ISO/IEC 10918-1 is hereinafter called the \indexdefn{format!JPEG}\term{JPEG format}.
3738

39+
\pnum
40+
The tag image file format described in ISO 12639 is hereinafter called the \indexdefn{format!TIFF}\term{TIFF format}.
3841
\pnum
3942
The datastream and associated file format described in ISO/IEC 15948 is hereinafter called the \indexdefn{format!PNG}\term{PNG format}.
4043

0 commit comments

Comments
 (0)