mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
285 lines
20 KiB
HTML
285 lines
20 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.17"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>ThorVG: LinearGradient</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="small_logo.svg"/></td>
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">ThorVG
|
|
 <span id="projectnumber">v0.5</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.17 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><b>tvg</b></li><li class="navelem"><a class="el" href="classtvg_1_1LinearGradient.html">LinearGradient</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="#pub-static-methods">Static Public Member Functions</a> |
|
|
<a href="classtvg_1_1LinearGradient-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<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>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<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.
|
|
<a href="classtvg_1_1LinearGradient.html#details">More...</a></p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for LinearGradient:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="classtvg_1_1LinearGradient__inherit__graph.png" border="0" usemap="#LinearGradient_inherit__map" alt="Inheritance graph"/></div>
|
|
<map name="LinearGradient_inherit__map" id="LinearGradient_inherit__map">
|
|
<area shape="rect" title="A class representing the linear gradient fill of the Shape object." alt="" coords="5,80,124,107"/>
|
|
<area shape="rect" href="classtvg_1_1Fill.html" title="An abstract class representing the gradient fill of the Shape object." alt="" coords="44,5,85,32"/>
|
|
</map>
|
|
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<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>
|
|
<tr class="memdesc:aa881eb89e14ade6a30bc41d7eb8eaf52"><td class="mdescLeft"> </td><td class="mdescRight">Sets the linear gradient bounds. <a href="classtvg_1_1LinearGradient.html#aa881eb89e14ade6a30bc41d7eb8eaf52">More...</a><br /></td></tr>
|
|
<tr class="separator:aa881eb89e14ade6a30bc41d7eb8eaf52"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<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>
|
|
<tr class="memdesc:a5c77e9f6e855a595945f45a6b19ee983"><td class="mdescLeft"> </td><td class="mdescRight">Gets the linear gradient bounds. <a href="classtvg_1_1LinearGradient.html#a5c77e9f6e855a595945f45a6b19ee983">More...</a><br /></td></tr>
|
|
<tr class="separator:a5c77e9f6e855a595945f45a6b19ee983"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<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>
|
|
<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>
|
|
<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>
|
|
<tr class="separator:a92717fc84a7d5df56e42e3bc863fce1a inherit pub_methods_classtvg_1_1Fill"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<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>
|
|
<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>
|
|
<tr class="separator:aed49d00ca09e69fdf97aaae235f8e950 inherit pub_methods_classtvg_1_1Fill"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<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>
|
|
<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>
|
|
<tr class="separator:addbc9de36b4427639f3cc1dceeccb734 inherit pub_methods_classtvg_1_1Fill"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<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>
|
|
<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>
|
|
<tr class="separator:a55f6de063e5ac8023243c9cef5cb9a12 inherit pub_methods_classtvg_1_1Fill"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<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>
|
|
<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>
|
|
<tr class="separator:a48e358abab4478ff7f84dfb85608eaf3 inherit pub_methods_classtvg_1_1Fill"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
|
|
Static Public Member Functions</h2></td></tr>
|
|
<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>
|
|
<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="classtvg_1_1LinearGradient.html#a346e161f12d8e8ad26b6eaaf5d0f5c5c">More...</a><br /></td></tr>
|
|
<tr class="separator:a346e161f12d8e8ad26b6eaaf5d0f5c5c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<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>
|
|
<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>
|
|
</div><h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a346e161f12d8e8ad26b6eaaf5d0f5c5c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a346e161f12d8e8ad26b6eaaf5d0f5c5c">◆ </a></span>gen()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static std::unique_ptr<<a class="el" href="classtvg_1_1LinearGradient.html">LinearGradient</a>> gen </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">noexcept</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<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>
|
|
<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>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a5c77e9f6e855a595945f45a6b19ee983"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a5c77e9f6e855a595945f45a6b19ee983">◆ </a></span>linear() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__ThorVG.html#ga28287671eaf7406afd604bd055ba4066">Result</a> linear </td>
|
|
<td>(</td>
|
|
<td class="paramtype">float * </td>
|
|
<td class="paramname"><em>x1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float * </td>
|
|
<td class="paramname"><em>y1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float * </td>
|
|
<td class="paramname"><em>x2</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float * </td>
|
|
<td class="paramname"><em>y2</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Gets the linear gradient bounds. </p>
|
|
<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>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<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>
|
|
<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>
|
|
<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>
|
|
<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>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<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>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa881eb89e14ade6a30bc41d7eb8eaf52"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa881eb89e14ade6a30bc41d7eb8eaf52">◆ </a></span>linear() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__ThorVG.html#ga28287671eaf7406afd604bd055ba4066">Result</a> linear </td>
|
|
<td>(</td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>x1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>y1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>x2</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>y2</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the linear gradient bounds. </p>
|
|
<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>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<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>
|
|
<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>
|
|
<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>
|
|
<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>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<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>
|
|
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.17
|
|
</small></address>
|
|
</body>
|
|
</html>
|