1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <?xml-stylesheet type=
"text/xsl" href=
"formats/html.xsl"?>
4 <!-- This file is part of Shapes. -->
6 <!-- Shapes is free software: you can redistribute it and/or modify -->
7 <!-- it under the terms of the GNU General Public License as published by -->
8 <!-- the Free Software Foundation, either version 3 of the License, or -->
9 <!-- any later version. -->
11 <!-- Shapes is distributed in the hope that it will be useful, -->
12 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
13 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
14 <!-- GNU General Public License for more details. -->
16 <!-- You should have received a copy of the GNU General Public License -->
17 <!-- along with Shapes. If not, see <http://www.gnu.org/licenses/>. -->
19 <!-- Copyright 2015 Henrik Tidefelt -->
23 <namespace>..Shapes..Traits
</namespace>
25 <p>Traits of graphical elements, such as color, reflection properties, and stroke width.
</p>
28 <title><self /></title>
29 <up-link><parent-namespace /></up-link>
30 <base href=
<!--#expand-next-string-->"$(BASE)" />
31 <examples-home href=
<!--#expand-next-string-->"$(EXAMPLES)" />
32 <shapes-version number=
<!--#expand-next-string-->"$(SHAPES_VERSION)" />
34 <!--#include virtual="^/toc.xml" -->
39 <p>The
<self /> namespace is organized with basic and general things directly at the top, while constants are grouped inside nested namespaces. There is also the
<namespace relative=
"Light" /> namespace that gathers the more advanced features of light and reflections.
</p>
41 <p>The bindings in this namespace are closely related to the
<em>graphics state parameters
</em> in
<str-PDF />.
</p>
42 <p>Many of these dynamic variables can be set to a
<named-type name=
"Void" /> value, which means that painted objects do not specify the property for themselves, but inherit the property from the context where they appear. This feature is a low-level
<str-PDF /> trick, and the effects may be (or at least seem) unpredictable.
</p>
47 <section id=
"namespace/shapes/traits/strokes">
48 <title>Strokes
</title>
51 <dynamic-variable name=
"width">
52 <type><union-type><named-type name=
"Length" /> <named-type name=
"Void" /></union-type></type>
53 <default><physical><scalar>1</scalar><unit>bp
</unit></physical></default>
54 <constraint><self /> ≥
<physical><scalar>0</scalar><unit>bp
</unit></physical></constraint>
56 <p>Intended to be used as the width when paths are stroked. A value of
<physical><scalar>0</scalar><unit>bp
</unit></physical> has a special meaning in
<str-PDF />, being that the stroke shall be as thin as possible without dissappearing on the rendering device. On high resolution printers, this may result in a line which is very hard to read, while such a line shall allways be clearly visible on a computer screen.
</p>
57 <p>Note that if the width is inherited from the context, it will not be possible to compute a correct bounding box of a stroked object.
</p>
61 <dynamic-variable name=
"stroking">
62 <type><union-type><named-type name=
"Color" /> <named-type name=
"Void" /></union-type></type>
63 <default><value namespace=
"..Shapes..Traits..BW" name=
"BLACK" /></default>
65 <p>Color used when paths are stroked.
</p>
68 <dynamic name=
"strokingalpha" />
72 <dynamic-variable name=
"cap">
73 <type><union-type><named-type name=
"CapStyle" /> <named-type name=
"Void" /></union-type></type>
74 <default><value namespace=
"..Shapes..Traits..Cap" name=
"BUTT" /></default>
76 <p>Line cap style.
</p>
80 <dynamic-variable name=
"join">
81 <type><union-type><named-type name=
"JoinStyle" /> <named-type name=
"Void" /></union-type></type>
82 <default><value namespace=
"..Shapes..Traits..Join" name=
"MITER" /></default>
84 <p>Line join style.
</p>
87 <dynamic name=
"miterlimit" />
91 <dynamic-variable name=
"miterlimit">
92 <type><union-type><named-type name=
"Float" /> <named-type name=
"Void" /></union-type></type>
93 <default><eq>10</eq></default>
94 <constraint><self /> ≥
<eq>1</eq></constraint>
96 <p>Miter limit value to use when
<dynamic name=
"join" /> is
<value namespace=
"..Shapes..Traits..Join" name=
"MITER" />.
</p>
100 <dynamic-variable name=
"dash">
101 <type><union-type><named-type name=
"Dash" /> <named-type name=
"Void" /></union-type></type>
102 <default><inline>[dashpattern]
</inline></default>
104 <p>Dash pattern to use for strokes. (The default value gives solid lines.)
</p>
107 <value name=
"dashpattern" />
111 <system-binding name=
"dashpattern">
113 <case constructor-of=
"Dash">
116 <type><named-type name=
"Length" /></type>
119 <dynamic-references></dynamic-references>
121 <p>Creates a dash pattern from a sequence of lengths, to be used with
<dynamic name=
"dash" />.
</p>
122 <p>If called with no arguments, the constructed pattern gives a solid line. Otherwise, the lengths determine where along a stroked line the pen shall be switched between on and off, with the pen initially being on.
</p>
123 <p>Note that a dash pattern can be scaled and shifted by means of operators, see
<named-type name=
"Dash" />.
</p>
129 <dynamic-variable name=
"strokingalpha">
130 <type><union-type><named-type name=
"Alpha" /> <named-type name=
"Void" /></union-type></type>
131 <default><inline>[shape
1]
</inline></default>
133 <p>Alpha settings for stroking operations.
</p>
136 <value name=
"alphashape" /> <value name=
"alphaopacity" /> <dynamic name=
"stroking" />
141 </section><!-- End of namespace/shapes/traits/strokes -->
144 <section id=
"namespace/shapes/traits/fills">
148 <dynamic-variable name=
"nonstroking">
149 <type><union-type><named-type name=
"Color" /> <named-type name=
"Void" /></union-type></type>
150 <default><value namespace=
"..Shapes..Traits..BW" name=
"BLACK" /></default>
152 <p>Color used when paths are filled (or, more generally, anything but stroked). (The name is inherited from
<str-PDF />.)
</p>
155 <dynamic name=
"nonstrokingalpha" />
159 <dynamic-variable name=
"nonstrokingalpha">
160 <type><union-type><named-type name=
"Alpha" /> <named-type name=
"Void" /></union-type></type>
161 <default><inline>[shape
1]
</inline></default>
163 <p>Alpha settings for nonstroking operations.
</p>
166 <value name=
"alphashape" /> <value name=
"alphaopacity" /> <dynamic name=
"nonstroking" />
171 </section><!-- End of namespace/shapes/traits/fills -->
174 <section id=
"namespace/shapes/traits/color">
175 <title>Color and transparency
</title>
178 <dynamic-variable name=
"blend">
179 <type><union-type><named-type name=
"BlendMode" /> <named-type name=
"Void" /></union-type></type>
180 <default><value namespace=
"..Shapes..Traits..Blend" name=
"NORMAL" /></default>
186 <dynamic-variable name=
"blendspace">
187 <type><named-type name=
"ColorSpace" /></type>
188 <default><em>(inherited)
</em></default>
190 <p>Color space for blending.
</p>
194 <system-binding name=
"alphashape">
196 <case constructor-of=
"Alpha">
199 <type><named-type name=
"Float" /></type>
202 <dynamic-references></dynamic-references>
204 <p>Creates a
<em>shape alpha
</em> value (refer to the
<str-PDF /> reference for details), to be used with
<dynamic name=
"alpha" />.
</p>
207 <value name=
"alphaopacity" /> <value name=
"alphamask" /> <value name=
"clip" />
213 <system-binding name=
"alphaopacity">
215 <case constructor-of=
"Alpha">
218 <type><named-type name=
"Float" /></type>
221 <dynamic-references></dynamic-references>
223 <p>Creates an
<em>opacity alpha
</em> value (refer to the
<str-PDF /> reference for details), to be used with
<dynamic name=
"alpha" />.
</p>
226 <value name=
"alphashape" /> <value name=
"alphamask" /> <value name=
"clip" />
232 <system-binding name=
"newColorInterpolator">
234 <constructor-of><named-statetype name=
"ColorInterpolator" /></constructor-of>
235 <description></description>
240 </section><!-- End of namespace/shapes/traits/color -->
243 <section id=
"namespace/shapes/traits/misc">
244 <title>Miscellaneous
</title>
247 <system-binding name=
"NO_MASK">
249 <type><named-type name=
"SoftMask" /></type>
251 <p>Value for
<dynamic name=
"alpha" /> and
<dynamic name=
"luminosity" /> that indicates that the transparent imaging shall not be used.
</p>
257 </section><!-- End of namespace/shapes/traits/misc -->