Skip to content

Commit c93ecbd

Browse files
committed
Began adding loading and saving image files to image_surface. Could only find normative references for PNG and JPEG. No function descriptions yet. Going to rename rgba_color to bgra_color since that matches the byte order on little-endian systems and since the proper name on big-endian systems would be argb. While rgba is a known term, it doesn't reflect modern data organization. Using bgra is a better reflection of modern realities, and swizzling can always be used internally if needed.
1 parent 3ff4b3f commit c93ecbd

File tree

2 files changed

+22
-27
lines changed

2 files changed

+22
-27
lines changed

source/image-surface.tex

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
%!TEX root = io2d.tex
22
\rSec0 [imagesurface] {Class \tcode{image_surface}}
33

4+
\rSec1 [imagesurface.summary] {\tcode{image_surface} summary}
5+
6+
\pnum
7+
\indexlibrary{\idxcode{image_surface}}
8+
The class \tcode{image_surface} derives from the \tcode{surface} class and provides an interface to a raster graphics data graphics resource.
9+
10+
\pnum
11+
\enternote
12+
Because of the functionality it provides and what it can be used for, it is expected that developers familiar with other graphics technologies will think of the \tcode{image_surface} class as being a form of \term{render target}. This is intentional, though this \documenttypename{} does not formally define or use that term to avoid any minor ambiguities and differences in its meaning between the various graphics technologies that do use the term render target.
13+
\exitnote
14+
415
\rSec1 [imagesurface.synopsis] {\tcode{image_surface} synopsis}
516

617
\begin{codeblock}
@@ -9,24 +20,11 @@
920
public:
1021
// \ref{imagesurface.cons}, construct/copy/move/destroy:
1122
image_surface() = delete;
12-
image_surface(const image_surface&) = delete;
13-
image_surface& operator=(const image_surface&) = delete;
14-
image_surface(image_surface&& other) noexcept;
15-
image_surface& operator=(image_surface&& other) noexcept;
1623
image_surface(experimental::io2d::format fmt, int width, int height);
17-
image_surface(experimental::io2d::format fmt, int width, int height,
18-
error_code& ec) noexcept;
19-
image_surface(vector<unsigned char>& data, experimental::io2d::format fmt,
20-
int width, int height);
21-
image_surface(vector<unsigned char>& data, experimental::io2d::format fmt,
22-
int width, int height, error_code& ec) noexcept;
23-
virtual ~image_surface();
24+
image_surface(filesystem::path f, experimental::io2d::format fmt);
2425

25-
// \ref{imagesurface.modifiers}, modifiers:
26-
void data(const vector<unsigned char>& data);
27-
void data(const vector<unsigned char>& data, error_code& ec) noexcept;
28-
vector<unsigned char> data();
29-
vector<unsigned char> data(error_code& ec) noexcept;
26+
// \ref{imagesurface.members}, members:
27+
void save(filesystem::path p);
3028

3129
// \ref{imagesurface.observers}, observers:
3230
experimental::io2d::format format() const noexcept;
@@ -37,17 +35,6 @@
3735
} } } }
3836
\end{codeblock}
3937

40-
\rSec1 [imagesurface.intro] {\tcode{image_surface} Description}
41-
42-
\pnum
43-
\indexlibrary{\idxcode{image_surface}}
44-
The class \tcode{image_surface} derives from the \tcode{surface} class and provides an interface to a raster graphics data graphics resource.
45-
46-
\pnum
47-
\enternote
48-
Because of the functionality it provides and what it can be used for, it is expected that developers familiar with other graphics technologies will think of the \tcode{image_surface} class as being a form of \term{render target}. This is intentional, though this \documenttypename{} does not formally define or use that term to avoid any minor ambiguities and differences in its meaning between the various graphics technologies that do use it.
49-
\exitnote
50-
5138
\rSec1 [imagesurface.cons] {\tcode{image_surface} constructors and assignment operators}
5239

5340
\indexlibrary{\idxcode{image_surface}!constructor}

source/normative-references.tex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
\item ISO/IEC 10646-1:1993, \doccite{Information technology --- Universal
1616
Multiple-Octet Coded Character Set (UCS) --- Part 1: Architecture and Basic
1717
Multilingual Plane}
18+
\item ISO/IEC 10918-1, \doccite{Information technology -- Digital compression and coding of continuous-tone still images: Requirements and guidelines}
19+
\item ISO/IEC 15948 \doccite{Information technology -- Computer graphics and image processing -- Portable Network Graphics (PNG) Functional specification}
1820
\item ISO/IEC TR 19769:2004, \doccite{Information technology --- Programming
1921
languages, their environments and system software interfaces --- Extensions for
2022
the programming language C to support new character data types}
@@ -30,6 +32,12 @@
3032
Keio)
3133
\end{itemize}
3234

35+
\pnum
36+
The compressed image data format described in ISO/IEC 10918-1 is hereinafter called the \indexdefn{format!JPEG}\term{JPEG format}.
37+
38+
\pnum
39+
The datastream and associated file format described in ISO/IEC 15948 is hereinafter called the \indexdefn{format!PNG}\term{PNG format}.
40+
3341
\pnum
3442
The library described in ISO/IEC TR 19769:2004 is hereinafter called the
3543
\indexdefn{C!Unicode TR}\term{C Unicode TR}.

0 commit comments

Comments
 (0)