|
1 | 1 | %!TEX root = io2d.tex |
2 | 2 | \rSec0 [\iotwod.brush] {Class \tcode{brush}} |
3 | 3 |
|
4 | | -\rSec1 [\iotwod.brush.intro] {\tcode{brush} Description} |
| 4 | +\rSec1 [\iotwod.brush.intro] {\tcode{brush} summary} |
5 | 5 |
|
6 | 6 | \pnum |
7 | 7 | \indexlibrary{\idxcode{brush}}% |
8 | | -The class \tcode{brush} describes an opaque wrapper for a graphics data graphics resource. |
| 8 | +The class \tcode{brush} describes an opaque wrapper for graphics data. |
9 | 9 |
|
10 | 10 | \pnum |
11 | 11 | A \tcode{brush} object is usable with any \tcode{surface} or \tcode{surface}-derived object. |
12 | 12 |
|
13 | 13 | \pnum |
14 | | -A \tcode{brush} object's graphics data is immutable. It is observable only by the effect that it produces when the brush is used as a Source Brush or as a Mask Brush (\ref{\iotwod.surface.rendering.brushes}). |
| 14 | +A \tcode{brush} object's graphics data is immutable. It is observable only by the effect that it produces when the brush is used as a \term{ |
| 15 | +source brush} or as a \term{mask brush} (\ref{\iotwod.surface.rendering.brushes}). |
15 | 16 |
|
16 | 17 | \pnum |
17 | 18 | A \tcode{brush} object has a brush type of \tcode{brush_type}, which indicates which type of brush it is (Table~\ref{tab:\iotwod.brushtype.meanings}). |
18 | 19 |
|
19 | 20 | \pnum |
20 | | -As a result of technological limitations and considerations, a \tcode{brush} object's graphics data can have less precision than the data from which it was created. |
21 | | - |
22 | | -\pnum |
23 | | -\begin{example} |
24 | | -Several graphics and rendering technologies that are currently widely used typically store individual color and alpha channel data as 8-bit unsigned normalized integer values while the \tcode{float} type that is used by the \tcode{rgba_color} class for individual color and alpha is often a 64-bit value. As such, it is possible for a loss of precision when transforming the 64-bit channel data of an \tcode{rgba_color} object to the 8-bit channel data that is commonly used internally in such graphics and rendering technologies. |
25 | | -\end{example} |
| 21 | +As a result of technological limitations and considerations, a \tcode{brush} object's graphics data may have less precision than the data from which it was created. |
26 | 22 |
|
| 23 | +%\pnum |
| 24 | +%\begin{example} |
| 25 | +%Several graphics and rendering technologies that are currently widely used typically store individual color and alpha channel data as 8-bit unsigned normalized integer values while the \tcode{float} type that is used by the \tcode{rgba_color} class for individual color and alpha is often a 64-bit value. As such, it is possible for a loss of precision when transforming the 64-bit channel data of an \tcode{rgba_color} object to the 8-bit channel data that is commonly used internally in such graphics and rendering technologies. |
| 26 | +%\end{example} |
| 27 | +% |
27 | 28 | \rSec1 [\iotwod.brush.synopsis] {\tcode{brush} synopsis} |
28 | 29 |
|
29 | 30 | \begin{codeblock} |
|
64 | 65 | \rSec2 [\iotwod.brush.sampling.color] {Sampling from a solid color brush} |
65 | 66 |
|
66 | 67 | \pnum |
67 | | -When \tcode{b} is a solid color brush, then when sampling from \tcode{b}, the visual data returned shall always be the visual data equivalent \tcode{rgba_color} used to construct \tcode{b}, regardless of the point which is to be sampled and regardless of the return values of Wrap Mode, Filter, and Matrix. |
| 68 | +When \tcode{b} is a solid color brush, then when sampling from \tcode{b}, the visual data returned is always the visual data used to construct \tcode{b}, regardless of the point which is to be sampled and regardless of the return values of wrap mode, filter, and brush matrix or mask matrix. |
68 | 69 |
|
69 | 70 | \rSec2 [\iotwod.brush.sampling.linear] {Sampling from a linear gradient brush} |
70 | 71 |
|
71 | 72 | \pnum |
72 | | -When \tcode{b} is a linear gradient brush, when sampling point \tcode{pt}, where \tcode{pt} is the return value of calling the \tcode{transform_point} member function of Matrix using the requested point, from \tcode{b}, the visual data returned shall be as specified by \ref{\iotwod.gradients.linear} and \ref{\iotwod.gradients.sampling}. |
| 73 | +When \tcode{b} is a linear gradient brush, when sampling point \tcode{pt}, where \tcode{pt} is the return value of calling the \tcode{transform_point} member function of brush matrix or mask matrix using the requested point, from \tcode{b}, the visual data returned are as specified by \ref{\iotwod.gradients.linear} and \ref{\iotwod.gradients.sampling}. |
73 | 74 |
|
74 | 75 | \rSec2 [\iotwod.brush.sampling.radial] {Sampling from a radial gradient brush} |
75 | 76 |
|
76 | 77 | \pnum |
77 | | -When \tcode{b} is a radial gradient brush, when sampling point \tcode{pt}, where \tcode{pt} is the return value of calling the \tcode{transform_point} member function of Matrix using the requested point, from \tcode{b}, the visual data returned shall be as specified by \ref{\iotwod.gradients.radial} and \ref{\iotwod.gradients.sampling}. |
| 78 | +When \tcode{b} is a radial gradient brush, when sampling point \tcode{pt}, where \tcode{pt} is the return value of calling the \tcode{transform_point} member function of brush matrix or mask matrix using the requested point, from \tcode{b}, the visual data are as specified by \ref{\iotwod.gradients.radial} and \ref{\iotwod.gradients.sampling}. |
78 | 79 |
|
79 | 80 | \rSec2 [\iotwod.brush.sampling.surface] {Sampling from a surface brush} |
80 | 81 |
|
81 | 82 | \pnum |
82 | | -When \tcode{b} is a surface brush, when sampling point \tcode{pt}, where \tcode{pt} is the return value of calling the \tcode{transform_point} member function of Matrix using the requested point, from \tcode{b}, the visual data returned shall be from the point \tcode{pt} in the graphics data of the brush, taking into account the values of Wrap Mode and Filter. |
| 83 | +When \tcode{b} is a surface brush, when sampling point \tcode{pt}, where \tcode{pt} is the return value of calling the \tcode{transform_point} member function of brush matrix or mask matrix using the requested point, from \tcode{b}, the visual data returned are from the point \tcode{pt} in the graphics data of the brush, taking into account the values of wrap mode and filter. |
83 | 84 |
|
84 | 85 | \rSec1 [\iotwod.brush.cons] {\tcode{brush} constructors and assignment operators} |
85 | 86 |
|
|
96 | 97 | The brush's brush type shall be set to the value \tcode{brush_type::solid_color}. |
97 | 98 |
|
98 | 99 | \pnum |
99 | | -The graphics data of the brush shall be created from the value of \tcode{c}. The visual data format of the graphics data shall be as-if it is that specified by \tcode{format::argb}. |
| 100 | +The graphics data of the brush are created from the value of \tcode{c}. The visual data format of the graphics data are as-if it is that specified by \tcode{format::argb32}. |
100 | 101 |
|
101 | 102 | \pnum |
102 | 103 | \remarks |
|
112 | 113 | \begin{itemdescr} |
113 | 114 | \pnum |
114 | 115 | \effects |
115 | | -Constructs a linear gradient \tcode{brush} object with a begin point of \tcode{begin}, an end point of \tcode{end}, and a color stop collection containing the values in the range \range{first}{last}. |
| 116 | +Constructs a linear gradient \tcode{brush} object with a begin point of \tcode{begin}, an end point of \tcode{end}, and a sequential series of \tcode{color stop} values beginning at {first} and ending at {last - 1}. |
116 | 117 |
|
117 | 118 | \pnum |
118 | 119 | The brush's brush type is \tcode{brush_type::linear}. |
|
130 | 131 | \begin{itemdescr} |
131 | 132 | \pnum |
132 | 133 | \effects |
133 | | -Constructs a linear gradient \tcode{brush} object with a begin point of \tcode{begin}, an end point of \tcode{end}, and a color stop collection containing the \tcode{color_stop} objects in \tcode{il}. |
| 134 | +Constructs a linear gradient \tcode{brush} object with a begin point of \tcode{begin}, an end point of \tcode{end}, and the sequential series of \tcode{color stop} values in \tcode{il}. |
134 | 135 |
|
135 | 136 | \pnum |
136 | 137 | The brush's brush type is \tcode{brush_type::linear}. |
|
149 | 150 | \begin{itemdescr} |
150 | 151 | \pnum |
151 | 152 | \effects |
152 | | -Constructs a radial gradient \tcode{brush} object with a start circle of \tcode{start}, an end circle of \tcode{end}, and a color stop collection containing the values in the range \range{first}{last}. |
| 153 | +Constructs a radial gradient \tcode{brush} object with a start circle of \tcode{start}, an end circle of \tcode{end}, and a sequential series of \tcode{color stop} values beginning at {first} and ending at {last - 1}. |
153 | 154 |
|
154 | 155 | \pnum |
155 | 156 | The brush's brush type is \tcode{brush_type::radial}. |
|
167 | 168 | \begin{itemdescr} |
168 | 169 | \pnum |
169 | 170 | \effects |
170 | | -Constructs a radial gradient \tcode{brush} object with a start circle of \tcode{start}, an end circle of \tcode{end}, and a color stop collection containing the \tcode{color_stop} objects in \tcode{il}. |
| 171 | +Constructs a radial gradient \tcode{brush} object with a start circle of \tcode{start}, an end circle of \tcode{end}, and the sequential series of \tcode{color stop} values in \tcode{il}. |
171 | 172 |
|
172 | 173 | \pnum |
173 | 174 | The brush's brush type is \tcode{brush_type::radial}. |
|
191 | 192 | The brush's brush type is \tcode{brush_type::surface}. |
192 | 193 |
|
193 | 194 | \pnum |
194 | | -The graphics data of the brush is as-if it is the \underlyingimagesurface of \tcode{img}. |
| 195 | +The graphics data of the brush is as-if it is the raster graphics data of \tcode{img}. |
195 | 196 |
|
196 | 197 | \pnum |
197 | 198 | \remarks |
198 | | -Sampling from this brush shall produce the results specified in \ref{\iotwod.brush.sampling.surface}. |
| 199 | +Sampling from this brush produces the results specified in \ref{\iotwod.brush.sampling.surface}. |
199 | 200 | \end{itemdescr} |
200 | 201 |
|
201 | 202 | \rSec1 [\iotwod.brush.observers]{\tcode{brush} observers} |
|
0 commit comments