Api.h
1/* Copyright (C) 2015 Marc Boris Duerner
2 SPDX-License-Identifier: LGPL-2.1-or-later WITH mif-exception
3*/
4
5#ifndef PT_GFX_API_H
6#define PT_GFX_API_H
7
8#include <Pt/Api.h>
9#include <cstddef>
10
11#define PT_GFX_VERSION_MAJOR PT_VERSION_MAJOR
12#define PT_GFX_VERSION_MINOR PT_VERSION_MINOR
13#define PT_GFX_VERSION_REVISION PT_VERSION_REVISION
14#define PT_GFX_VERSION_PRERELEASE PT_VERSION_PRERELEASE
15
16#if defined(PT_GFX_API_EXPORT)
17# define PT_GFX_API PT_EXPORT
18#else
19# define PT_GFX_API PT_IMPORT
20#endif
21
22namespace Pt {
23
30namespace Gfx {
31
32typedef std::ptrdiff_t Int;
33
34typedef double Float;
35const Float FloatNearlyZero = Float(1) / (1 << 12);
36
37class Canvas;
38class FontMetrics;
39class Paint;
40class PainterBase;
41class Painter;
42class PaintSurface;
43class TextMetrics;
44
45//
46// Images and views
47//
48
49class ColorF;
50class Color;
51typedef Color Color;
52
53template <typename FormatT>
54struct ImageTraits;
55
56template <typename FormatT, typename TraitsT = ImageTraits<FormatT> >
57class BasicImage;
58
59template <typename FormatT, typename TraitsT = ImageTraits<FormatT> >
60class BasicConstImage;
61
62template <typename FormatT, typename TraitsT = ImageTraits<FormatT>>
63class BasicView;
64
65template <typename FormatT, typename TraitsT = ImageTraits<FormatT>>
66class BasicConstView;
67
68template <typename FormatT, typename TraitsT = ImageTraits<FormatT> >
69class BasicPixelView;
70
71template <typename FormatT, typename TraitsT = ImageTraits<FormatT> >
72class BasicConstPixelView;
73
74template <typename FormatT, typename TraitsT = ImageTraits<FormatT> >
75class BasicLineView;
76
77template <typename FormatT, typename TraitsT = ImageTraits<FormatT> >
78class BasicConstLineView;
79
80template <typename FormatT, typename TraitsT = ImageTraits<FormatT> >
81class Span;
82
83template <typename FormatT, typename TraitsT = ImageTraits<FormatT> >
84class ConstSpan;
85
86//
87// Generic images
88//
89
90class ImageFormat;
91
92template <typename ColorT>
93class Pixel;
94
95template <typename ColorT>
96class ConstPixel;
97
98
99typedef BasicImage<ImageFormat> Image;
100
101typedef BasicConstImage<ImageFormat> ConstImage;
102
103typedef BasicView<ImageFormat> ImageView;
104
105typedef BasicConstView<ImageFormat> ConstImageView;
106
107typedef BasicPixelView<ImageFormat> PixelView;
108
109typedef BasicConstPixelView<ImageFormat> ConstPixelView;
110
111typedef BasicLineView<ImageFormat> LineView;
112
113typedef BasicConstLineView<ImageFormat> ConstLineView;
114
115typedef Span<ImageFormat> ImageSpan;
116
117typedef ConstSpan<ImageFormat> ConstImageSpan;
118
119
120struct ImageTraitsF;
121
123
125
126typedef BasicView<ImageFormat, ImageTraitsF> ImageViewF;
127
128typedef BasicConstView<ImageFormat, ImageTraitsF> ConstImageViewF;
129
130typedef BasicPixelView<ImageFormat, ImageTraitsF> PixelViewF;
131
132typedef BasicConstPixelView<ImageFormat, ImageTraitsF> ConstPixelViewF;
133
134typedef BasicLineView<ImageFormat, ImageTraitsF> LineViewF;
135
136typedef BasicConstLineView<ImageFormat, ImageTraitsF> ConstLineViewF;
137
138typedef Span<ImageFormat, ImageTraitsF> ImageSpanF;
139
140typedef ConstSpan<ImageFormat, ImageTraitsF> ConstImageSpanF;
141
142//
143// ARGB-32
144//
145
146class Argb32;
147class Argb32Pixel;
148class Argb32ConstPixel;
149
151
155
159
163
166typedef BasicPixelView<Argb32> Argb32PixelView;
167
170typedef BasicConstPixelView<Argb32> Argb32ConstPixelView;
171
174typedef BasicLineView<Argb32> Argb32LineView;
175
178typedef BasicConstLineView<Argb32> Argb32ConstLineView;
179
182typedef Span<Argb32> Argb32Span;
183
186typedef ConstSpan<Argb32> Argb32ConstSpan;
187
188//
189// RGB-16
190//
191
192class Rgb16;
193class Rgb16Pixel;
194class Rgb16ConstPixel;
195
199
203
207
211
214typedef BasicPixelView<Rgb16> Rgb16PixelView;
215
218typedef BasicConstPixelView<Rgb16> Rgb16ConstPixelView;
219
222typedef BasicLineView<Rgb16> Rgb16LineView;
223
226typedef BasicConstLineView<Rgb16> Rgb16ConstLineView;
227
230typedef Span<Rgb16> Rgb16Span;
231
234typedef ConstSpan<Rgb16> Rgb16ConstSpan;
235
236//
237// RGB-32 (Premultiplied ARGB-32)
238//
239
240class Rgb32;
241class Rgb32Pixel;
242class Rgb32ConstPixel;
243
245
249
253
257
260typedef BasicPixelView<Rgb32> Rgb32PixelView;
261
264typedef BasicConstPixelView<Rgb32> Rgb32ConstPixelView;
265
268typedef BasicLineView<Rgb32> Rgb32LineView;
269
272typedef BasicConstLineView<Rgb32> Rgb32ConstLineView;
273
276typedef Span<Rgb32> Rgb32Span;
277
280typedef ConstSpan<Rgb32> Rgb32ConstSpan;
281
282//
283// YUV-12
284//
285
286class Yuv12;
287class Yuv12Pixel;
288class Yuv12ConstPixel;
289
293
297
301
305
308typedef BasicPixelView<Yuv12> Yuv12PixelView;
309
312typedef BasicConstPixelView<Yuv12> Yuv12ConstPixelView;
313
316typedef BasicLineView<Yuv12> Yuv12LineView;
317
320typedef BasicConstLineView<Yuv12> Yuv12ConstLineView;
321
324typedef Span<Yuv12> Yuv12Span;
325
328typedef ConstSpan<Yuv12> Yuv12ConstSpan;
329} // namespace
330
331} // namespace
332
333#endif
Read-only cursor to one ARGB-32 pixel.
Definition Argb32.h:140
ARGB-32 image.
Definition Api-Argb32Image.h:30
Cursor to one ARGB-32 pixel.
Definition Argb32.h:53
ARGB-32 image format.
Definition Argb32.h:220
Read-only wrap of pixel data.
Definition Image.h:189
Read-only image region.
Definition View.h:125
Image that owns or wraps pixel data.
Definition Image.h:83
Non-owning image region.
Definition View.h:65
Backend that executes drawing commands.
Definition Canvas.h:66
Floating-point RGBA color.
Definition Color.h:173
8-bit ARGB color.
Definition Color.h:65
Read-only cursor to one pixel.
Definition ImageFormat.h:345
Ascent, descent and line height of a font.
Definition FontMetrics.h:50
Runtime pixel format.
Definition ImageFormat.h:72
Target for drawing operations.
Definition PaintSurface.h:66
Pen, brush, font and composition mode.
Definition Paint.h:53
Drawing commands and paint state.
Definition PainterBase.h:85
Painter for a surface or a paint context.
Definition Painter.h:62
Cursor to one pixel.
Definition ImageFormat.h:219
RGB-565 const pixel.
Definition Rgb16.h:190
RGB-565 pixel.
Definition Rgb16.h:101
RGB-565 image format.
Definition Rgb16.h:270
Premultiplied ARGB-32 const pixel.
Definition Rgb32.h:226
Premultiplied ARGB-32 image.
Definition Api-Rgb32Image.h:31
RGB-32 pixel as premultiplied ARGB-32.
Definition Rgb32.h:125
Premultiplied ARGB-32 image format.
Definition Rgb32.h:315
Width and bounds of a text run.
Definition TextMetrics.h:49
YV12 const pixel.
Definition Yuv12.h:137
YV-12 pixel.
Definition Yuv12.h:44
YV-12 image format.
Definition Yuv12.h:234
Graphics and imaging services.
Definition Api-Argb32Image.h:12
BasicConstView< Rgb32 > Rgb32ConstView
RGB-32 const view.
Definition Api.h:256
BasicView< Rgb32 > Rgb32View
RGB-32 view.
Definition Api.h:252
BasicView< Yuv12 > Yuv12ConstView
YUV-12 conmst view.
Definition Api.h:304
Span< Rgb16 > Rgb16Span
RGB-16 span.
Definition Api.h:230
ConstSpan< Rgb32 > Rgb32ConstSpan
RGB-32 const span.
Definition Api.h:280
ConstSpan< Argb32 > Argb32ConstSpan
ARGB-32 const span.
Definition Api.h:186
BasicPixelView< Rgb32 > Rgb32PixelView
RGB-32 pixel view.
Definition Api.h:260
ConstSpan< Rgb16 > Rgb16ConstSpan
RGB-16 const span.
Definition Api.h:234
BasicLineView< Rgb32 > Rgb32LineView
RGB-32 line view.
Definition Api.h:268
BasicLineView< Yuv12 > Yuv12LineView
YUV-12 line view.
Definition Api.h:316
BasicPixelView< Rgb16 > Rgb16PixelView
RGB-16 pixel view.
Definition Api.h:214
BasicConstImage< Argb32 > Argb32ConstImage
ARGB-32 const image.
Definition Api.h:154
BasicConstPixelView< Argb32 > Argb32ConstPixelView
ARGB-32 const pixel view.
Definition Api.h:170
BasicImage< Rgb16 > Rgb16Image
RGB-16 image.
Definition Api.h:198
BasicPixelView< Argb32 > Argb32PixelView
ARGB-32 pixel view.
Definition Api.h:166
BasicConstImage< Yuv12 > Yuv12ConstImage
YUV-12 const image.
Definition Api.h:296
BasicConstLineView< Rgb16 > Rgb16ConstLineView
RGB-16 const line view.
Definition Api.h:226
BasicImage< Yuv12 > Yuv12Image
YUV-12 image.
Definition Api.h:292
BasicView< Yuv12 > Yuv12View
YUV-12 view.
Definition Api.h:300
BasicConstLineView< Rgb32 > Rgb32ConstLineView
RGB-32 const line view.
Definition Api.h:272
Span< Argb32 > Argb32Span
ARGB-32 span.
Definition Api.h:182
BasicConstPixelView< Rgb16 > Rgb16ConstPixelView
RGB-16 const pixel view.
Definition Api.h:218
BasicConstPixelView< Rgb32 > Rgb32ConstPixelView
RGB-32 const pixel view.
Definition Api.h:264
Span< Rgb32 > Rgb32Span
RGB-32 span.
Definition Api.h:276
ConstSpan< Yuv12 > Yuv12ConstSpan
YUV-12 const span.
Definition Api.h:328
BasicConstLineView< Yuv12 > Yuv12ConstLineView
YUV-12 const line view.
Definition Api.h:320
BasicConstImage< Rgb16 > Rgb16ConstImage
RGB-16 const image.
Definition Api.h:202
BasicView< Rgb16 > Rgb16View
RGB-16 view.
Definition Api.h:206
BasicConstView< Rgb16 > Rgb16ConstView
RGB-16 const view.
Definition Api.h:210
Span< Yuv12 > Yuv12Span
YUV-12 span.
Definition Api.h:324
BasicConstPixelView< Yuv12 > Yuv12ConstPixelView
YUV-12 const pixel view.
Definition Api.h:312
BasicView< Argb32 > Argb32View
ARGB-32 view.
Definition Api.h:158
BasicConstLineView< Argb32 > Argb32ConstLineView
ARGB-32 const line view.
Definition Api.h:178
BasicConstImage< Rgb32 > Rgb32ConstImage
RGB-32 const image.
Definition Api.h:248
BasicConstView< Argb32 > Argb32ConstView
ARGB-32 const view.
Definition Api.h:162
BasicLineView< Argb32 > Argb32LineView
ARGB-32 line view.
Definition Api.h:174
BasicPixelView< Yuv12 > Yuv12PixelView
YUV-12 pixel view.
Definition Api.h:308
BasicLineView< Rgb16 > Rgb16LineView
RGB-16 line view.
Definition Api.h:222
Core module.
Definition Allocator.h:33
Image traits.
Definition ImageTraits.h:44