1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <meta name="generator" content="Doxygen 1.8.13"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>ThorVG: LinearGradient</title>
9 <link href="tabs.css" rel="stylesheet" type="text/css"/>
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="dynsections.js"></script>
12 <link href="search/search.css" rel="stylesheet" type="text/css"/>
13 <script type="text/javascript" src="search/searchdata.js"></script>
14 <script type="text/javascript" src="search/search.js"></script>
15 <link href="doxygen.css" rel="stylesheet" type="text/css" />
16 <link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
19 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
21 <table cellspacing="0" cellpadding="0">
23 <tr style="height: 56px;">
24 <td id="projectlogo"><img alt="Logo" src="small_logo.svg"/></td>
25 <td id="projectalign" style="padding-left: 0.5em;">
26 <div id="projectname">ThorVG
27  <span id="projectnumber">v0.4</span>
34 <!-- end header part -->
35 <!-- Generated by Doxygen 1.8.13 -->
36 <script type="text/javascript">
37 var searchBox = new SearchBox("searchBox", "search",false,'Search');
39 <script type="text/javascript" src="menudata.js"></script>
40 <script type="text/javascript" src="menu.js"></script>
41 <script type="text/javascript">
43 initMenu('',true,false,'search.php','Search');
44 $(document).ready(function() { init_search(); });
47 <div id="main-nav"></div>
48 <!-- window showing the filter options -->
49 <div id="MSearchSelectWindow"
50 onmouseover="return searchBox.OnSearchSelectShow()"
51 onmouseout="return searchBox.OnSearchSelectHide()"
52 onkeydown="return searchBox.OnSearchSelectKey(event)">
55 <!-- iframe showing the search results (closed by default) -->
56 <div id="MSearchResultsWindow">
57 <iframe src="javascript:void(0)" frameborder="0"
58 name="MSearchResults" id="MSearchResults">
62 <div id="nav-path" class="navpath">
64 <li class="navelem"><b>tvg</b></li><li class="navelem"><a class="el" href="classtvg_1_1LinearGradient.html">LinearGradient</a></li> </ul>
69 <a href="#pub-methods">Public Member Functions</a> |
70 <a href="#pub-static-methods">Static Public Member Functions</a> |
71 <a href="classtvg_1_1LinearGradient-members.html">List of all members</a> </div>
72 <div class="headertitle">
73 <div class="title">LinearGradient<span class="mlabels"><span class="mlabel">final</span></span><div class="ingroups"><a class="el" href="group__ThorVG.html">ThorVG</a></div></div> </div>
75 <div class="contents">
77 <p>A class representing the linear gradient fill of the <a class="el" href="classtvg_1_1Shape.html" title="A class representing two-dimensional figures and their properties. ">Shape</a> object.
78 <a href="classtvg_1_1LinearGradient.html#details">More...</a></p>
79 <div class="dynheader">
80 Inheritance diagram for LinearGradient:</div>
81 <div class="dyncontent">
82 <div class="center"><img src="classtvg_1_1LinearGradient__inherit__graph.png" border="0" usemap="#LinearGradient_inherit__map" alt="Inheritance graph"/></div>
83 <map name="LinearGradient_inherit__map" id="LinearGradient_inherit__map">
84 <area shape="rect" id="node2" href="classtvg_1_1Fill.html" title="An abstract class representing the gradient fill of the Shape object. " alt="" coords="39,5,78,32"/>
86 <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
87 <table class="memberdecls">
88 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
89 Public Member Functions</h2></td></tr>
90 <tr class="memitem:aa881eb89e14ade6a30bc41d7eb8eaf52"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ThorVG.html#ga28287671eaf7406afd604bd055ba4066">Result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classtvg_1_1LinearGradient.html#aa881eb89e14ade6a30bc41d7eb8eaf52">linear</a> (float x1, float y1, float x2, float y2) noexcept</td></tr>
91 <tr class="memdesc:aa881eb89e14ade6a30bc41d7eb8eaf52"><td class="mdescLeft"> </td><td class="mdescRight">Sets the linear gradient bounds. <a href="#aa881eb89e14ade6a30bc41d7eb8eaf52">More...</a><br /></td></tr>
92 <tr class="separator:aa881eb89e14ade6a30bc41d7eb8eaf52"><td class="memSeparator" colspan="2"> </td></tr>
93 <tr class="memitem:a5c77e9f6e855a595945f45a6b19ee983"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ThorVG.html#ga28287671eaf7406afd604bd055ba4066">Result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classtvg_1_1LinearGradient.html#a5c77e9f6e855a595945f45a6b19ee983">linear</a> (float *x1, float *y1, float *x2, float *y2) const noexcept</td></tr>
94 <tr class="memdesc:a5c77e9f6e855a595945f45a6b19ee983"><td class="mdescLeft"> </td><td class="mdescRight">Gets the linear gradient bounds. <a href="#a5c77e9f6e855a595945f45a6b19ee983">More...</a><br /></td></tr>
95 <tr class="separator:a5c77e9f6e855a595945f45a6b19ee983"><td class="memSeparator" colspan="2"> </td></tr>
96 <tr class="inherit_header pub_methods_classtvg_1_1Fill"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classtvg_1_1Fill')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classtvg_1_1Fill.html">Fill</a></td></tr>
97 <tr class="memitem:a92717fc84a7d5df56e42e3bc863fce1a inherit pub_methods_classtvg_1_1Fill"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ThorVG.html#ga28287671eaf7406afd604bd055ba4066">Result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classtvg_1_1Fill.html#a92717fc84a7d5df56e42e3bc863fce1a">colorStops</a> (const <a class="el" href="structtvg_1_1Fill_1_1ColorStop.html">ColorStop</a> *colorStops, uint32_t cnt) noexcept</td></tr>
98 <tr class="memdesc:a92717fc84a7d5df56e42e3bc863fce1a inherit pub_methods_classtvg_1_1Fill"><td class="mdescLeft"> </td><td class="mdescRight">Sets the parameters of the colors of the gradient and their position. <a href="classtvg_1_1Fill.html#a92717fc84a7d5df56e42e3bc863fce1a">More...</a><br /></td></tr>
99 <tr class="separator:a92717fc84a7d5df56e42e3bc863fce1a inherit pub_methods_classtvg_1_1Fill"><td class="memSeparator" colspan="2"> </td></tr>
100 <tr class="memitem:aed49d00ca09e69fdf97aaae235f8e950 inherit pub_methods_classtvg_1_1Fill"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ThorVG.html#ga28287671eaf7406afd604bd055ba4066">Result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classtvg_1_1Fill.html#aed49d00ca09e69fdf97aaae235f8e950">spread</a> (<a class="el" href="group__ThorVG.html#ga0cfa2c92260cca776292cc9e8964f2da">FillSpread</a> s) noexcept</td></tr>
101 <tr class="memdesc:aed49d00ca09e69fdf97aaae235f8e950 inherit pub_methods_classtvg_1_1Fill"><td class="mdescLeft"> </td><td class="mdescRight">Sets the FillSpread value, which specifies how to fill the area outside the gradient bounds. <a href="classtvg_1_1Fill.html#aed49d00ca09e69fdf97aaae235f8e950">More...</a><br /></td></tr>
102 <tr class="separator:aed49d00ca09e69fdf97aaae235f8e950 inherit pub_methods_classtvg_1_1Fill"><td class="memSeparator" colspan="2"> </td></tr>
103 <tr class="memitem:addbc9de36b4427639f3cc1dceeccb734 inherit pub_methods_classtvg_1_1Fill"><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classtvg_1_1Fill.html#addbc9de36b4427639f3cc1dceeccb734">colorStops</a> (const <a class="el" href="structtvg_1_1Fill_1_1ColorStop.html">ColorStop</a> **colorStops) const noexcept</td></tr>
104 <tr class="memdesc:addbc9de36b4427639f3cc1dceeccb734 inherit pub_methods_classtvg_1_1Fill"><td class="mdescLeft"> </td><td class="mdescRight">Gets the parameters of the colors of the gradient, their position and number. <a href="classtvg_1_1Fill.html#addbc9de36b4427639f3cc1dceeccb734">More...</a><br /></td></tr>
105 <tr class="separator:addbc9de36b4427639f3cc1dceeccb734 inherit pub_methods_classtvg_1_1Fill"><td class="memSeparator" colspan="2"> </td></tr>
106 <tr class="memitem:a55f6de063e5ac8023243c9cef5cb9a12 inherit pub_methods_classtvg_1_1Fill"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ThorVG.html#ga0cfa2c92260cca776292cc9e8964f2da">FillSpread</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classtvg_1_1Fill.html#a55f6de063e5ac8023243c9cef5cb9a12">spread</a> () const noexcept</td></tr>
107 <tr class="memdesc:a55f6de063e5ac8023243c9cef5cb9a12 inherit pub_methods_classtvg_1_1Fill"><td class="mdescLeft"> </td><td class="mdescRight">Gets the FillSpread value of the fill. <a href="classtvg_1_1Fill.html#a55f6de063e5ac8023243c9cef5cb9a12">More...</a><br /></td></tr>
108 <tr class="separator:a55f6de063e5ac8023243c9cef5cb9a12 inherit pub_methods_classtvg_1_1Fill"><td class="memSeparator" colspan="2"> </td></tr>
109 <tr class="memitem:a48e358abab4478ff7f84dfb85608eaf3 inherit pub_methods_classtvg_1_1Fill"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classtvg_1_1Fill.html">Fill</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classtvg_1_1Fill.html#a48e358abab4478ff7f84dfb85608eaf3">duplicate</a> () const noexcept</td></tr>
110 <tr class="memdesc:a48e358abab4478ff7f84dfb85608eaf3 inherit pub_methods_classtvg_1_1Fill"><td class="mdescLeft"> </td><td class="mdescRight">Creates a copy of the <a class="el" href="classtvg_1_1Fill.html" title="An abstract class representing the gradient fill of the Shape object. ">Fill</a> object. <a href="classtvg_1_1Fill.html#a48e358abab4478ff7f84dfb85608eaf3">More...</a><br /></td></tr>
111 <tr class="separator:a48e358abab4478ff7f84dfb85608eaf3 inherit pub_methods_classtvg_1_1Fill"><td class="memSeparator" colspan="2"> </td></tr>
112 </table><table class="memberdecls">
113 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
114 Static Public Member Functions</h2></td></tr>
115 <tr class="memitem:a346e161f12d8e8ad26b6eaaf5d0f5c5c"><td class="memItemLeft" align="right" valign="top">static std::unique_ptr< <a class="el" href="classtvg_1_1LinearGradient.html">LinearGradient</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classtvg_1_1LinearGradient.html#a346e161f12d8e8ad26b6eaaf5d0f5c5c">gen</a> () noexcept</td></tr>
116 <tr class="memdesc:a346e161f12d8e8ad26b6eaaf5d0f5c5c"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new <a class="el" href="classtvg_1_1LinearGradient.html" title="A class representing the linear gradient fill of the Shape object. ">LinearGradient</a> object. <a href="#a346e161f12d8e8ad26b6eaaf5d0f5c5c">More...</a><br /></td></tr>
117 <tr class="separator:a346e161f12d8e8ad26b6eaaf5d0f5c5c"><td class="memSeparator" colspan="2"> </td></tr>
119 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
120 <div class="textblock"><p>A class representing the linear gradient fill of the <a class="el" href="classtvg_1_1Shape.html" title="A class representing two-dimensional figures and their properties. ">Shape</a> object. </p>
121 <p>Besides the APIs inherited from the <a class="el" href="classtvg_1_1Fill.html" title="An abstract class representing the gradient fill of the Shape object. ">Fill</a> class, it enables setting and getting the linear gradient bounds. The behavior outside the gradient bounds depends on the value specified in the spread API. </p>
122 </div><h2 class="groupheader">Member Function Documentation</h2>
123 <a id="a346e161f12d8e8ad26b6eaaf5d0f5c5c"></a>
124 <h2 class="memtitle"><span class="permalink"><a href="#a346e161f12d8e8ad26b6eaaf5d0f5c5c">◆ </a></span>gen()</h2>
126 <div class="memitem">
127 <div class="memproto">
128 <table class="mlabels">
130 <td class="mlabels-left">
131 <table class="memname">
133 <td class="memname">static std::unique_ptr<<a class="el" href="classtvg_1_1LinearGradient.html">LinearGradient</a>> gen </td>
135 <td class="paramname"></td><td>)</td>
140 <td class="mlabels-right">
141 <span class="mlabels"><span class="mlabel">static</span><span class="mlabel">noexcept</span></span> </td>
144 </div><div class="memdoc">
146 <p>Creates a new <a class="el" href="classtvg_1_1LinearGradient.html" title="A class representing the linear gradient fill of the Shape object. ">LinearGradient</a> object. </p>
147 <dl class="section return"><dt>Returns</dt><dd>A new <a class="el" href="classtvg_1_1LinearGradient.html" title="A class representing the linear gradient fill of the Shape object. ">LinearGradient</a> object. </dd></dl>
151 <a id="aa881eb89e14ade6a30bc41d7eb8eaf52"></a>
152 <h2 class="memtitle"><span class="permalink"><a href="#aa881eb89e14ade6a30bc41d7eb8eaf52">◆ </a></span>linear() <span class="overload">[1/2]</span></h2>
154 <div class="memitem">
155 <div class="memproto">
156 <table class="mlabels">
158 <td class="mlabels-left">
159 <table class="memname">
161 <td class="memname"><a class="el" href="group__ThorVG.html#ga28287671eaf7406afd604bd055ba4066">Result</a> linear </td>
163 <td class="paramtype">float </td>
164 <td class="paramname"><em>x1</em>, </td>
167 <td class="paramkey"></td>
169 <td class="paramtype">float </td>
170 <td class="paramname"><em>y1</em>, </td>
173 <td class="paramkey"></td>
175 <td class="paramtype">float </td>
176 <td class="paramname"><em>x2</em>, </td>
179 <td class="paramkey"></td>
181 <td class="paramtype">float </td>
182 <td class="paramname"><em>y2</em> </td>
191 <td class="mlabels-right">
192 <span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
195 </div><div class="memdoc">
197 <p>Sets the linear gradient bounds. </p>
198 <p>The bounds of the linear gradient are defined as a surface constrained by two parallel lines crossing the given points (<code>x1</code>, <code>y1</code>) and (<code>x2</code>, <code>y2</code>), respectively. Both lines are perpendicular to the line linking (<code>x1</code>, <code>y1</code>) and (<code>x2</code>, <code>y2</code>).</p>
199 <dl class="params"><dt>Parameters</dt><dd>
200 <table class="params">
201 <tr><td class="paramdir">[in]</td><td class="paramname">x1</td><td>The horizontal coordinate of the first point used to determine the gradient bounds. </td></tr>
202 <tr><td class="paramdir">[in]</td><td class="paramname">y1</td><td>The vertical coordinate of the first point used to determine the gradient bounds. </td></tr>
203 <tr><td class="paramdir">[in]</td><td class="paramname">x2</td><td>The horizontal coordinate of the second point used to determine the gradient bounds. </td></tr>
204 <tr><td class="paramdir">[in]</td><td class="paramname">y2</td><td>The vertical coordinate of the second point used to determine the gradient bounds.</td></tr>
208 <dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__ThorVG.html#gga28287671eaf7406afd604bd055ba4066a505a83f220c02df2f85c3810cd9ceb38" title="The value returned in case of a correct request execution. ">Result::Success</a> when succeed, <a class="el" href="group__ThorVG.html#gga28287671eaf7406afd604bd055ba4066ae73a2e92f1c87086c838b442552a4775" title="The value returned in the event of a problem with the arguments given to the API - e...">Result::InvalidArguments</a> otherwise. </dd></dl>
212 <a id="a5c77e9f6e855a595945f45a6b19ee983"></a>
213 <h2 class="memtitle"><span class="permalink"><a href="#a5c77e9f6e855a595945f45a6b19ee983">◆ </a></span>linear() <span class="overload">[2/2]</span></h2>
215 <div class="memitem">
216 <div class="memproto">
217 <table class="mlabels">
219 <td class="mlabels-left">
220 <table class="memname">
222 <td class="memname"><a class="el" href="group__ThorVG.html#ga28287671eaf7406afd604bd055ba4066">Result</a> linear </td>
224 <td class="paramtype">float * </td>
225 <td class="paramname"><em>x1</em>, </td>
228 <td class="paramkey"></td>
230 <td class="paramtype">float * </td>
231 <td class="paramname"><em>y1</em>, </td>
234 <td class="paramkey"></td>
236 <td class="paramtype">float * </td>
237 <td class="paramname"><em>x2</em>, </td>
240 <td class="paramkey"></td>
242 <td class="paramtype">float * </td>
243 <td class="paramname"><em>y2</em> </td>
248 <td></td><td> const</td>
252 <td class="mlabels-right">
253 <span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
256 </div><div class="memdoc">
258 <p>Gets the linear gradient bounds. </p>
259 <p>The bounds of the linear gradient are defined as a surface constrained by two parallel lines crossing the given points (<code>x1</code>, <code>y1</code>) and (<code>x2</code>, <code>y2</code>), respectively. Both lines are perpendicular to the line linking (<code>x1</code>, <code>y1</code>) and (<code>x2</code>, <code>y2</code>).</p>
260 <dl class="params"><dt>Parameters</dt><dd>
261 <table class="params">
262 <tr><td class="paramdir">[out]</td><td class="paramname">x1</td><td>The horizontal coordinate of the first point used to determine the gradient bounds. </td></tr>
263 <tr><td class="paramdir">[out]</td><td class="paramname">y1</td><td>The vertical coordinate of the first point used to determine the gradient bounds. </td></tr>
264 <tr><td class="paramdir">[out]</td><td class="paramname">x2</td><td>The horizontal coordinate of the second point used to determine the gradient bounds. </td></tr>
265 <tr><td class="paramdir">[out]</td><td class="paramname">y2</td><td>The vertical coordinate of the second point used to determine the gradient bounds.</td></tr>
269 <dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__ThorVG.html#gga28287671eaf7406afd604bd055ba4066a505a83f220c02df2f85c3810cd9ceb38" title="The value returned in case of a correct request execution. ">Result::Success</a> when succeed. </dd></dl>
273 </div><!-- contents -->
274 <!-- start footer part -->
275 <hr class="footer"/><address class="footer"><small>
276 Generated by  <a href="http://www.doxygen.org/index.html">
277 <img class="footer" src="doxygen.png" alt="doxygen"/>