mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
241 lines
15 KiB
HTML
241 lines
15 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: Saver</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_1Saver.html">Saver</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_1Saver-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">Saver<div class="ingroups"><a class="el" href="group__ThorVG.html">ThorVG</a></div></div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>A class for exporting a paint object into a specified file, from which to recover the paint data later.
|
|
<a href="classtvg_1_1Saver.html#details">More...</a></p>
|
|
<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:acda492a458f3ddc2da01df672ecd85bd"><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_1Saver.html#acda492a458f3ddc2da01df672ecd85bd">save</a> (std::unique_ptr< <a class="el" href="classtvg_1_1Paint.html">Paint</a> > paint, const std::string &path, bool compress=true) noexcept</td></tr>
|
|
<tr class="memdesc:acda492a458f3ddc2da01df672ecd85bd"><td class="mdescLeft"> </td><td class="mdescRight">Exports the given <code>paint</code> data to the given <code>path</code>. <a href="classtvg_1_1Saver.html#acda492a458f3ddc2da01df672ecd85bd">More...</a><br /></td></tr>
|
|
<tr class="separator:acda492a458f3ddc2da01df672ecd85bd"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2fdf9b2208358ea10f912b1877733778"><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_1Saver.html#a2fdf9b2208358ea10f912b1877733778">sync</a> () noexcept</td></tr>
|
|
<tr class="memdesc:a2fdf9b2208358ea10f912b1877733778"><td class="mdescLeft"> </td><td class="mdescRight">Guarantees that the saving task is finished. <a href="classtvg_1_1Saver.html#a2fdf9b2208358ea10f912b1877733778">More...</a><br /></td></tr>
|
|
<tr class="separator:a2fdf9b2208358ea10f912b1877733778"><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:a938c339098e9da63f98f2b182a4cf683"><td class="memItemLeft" align="right" valign="top">static std::unique_ptr< <a class="el" href="classtvg_1_1Saver.html">Saver</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classtvg_1_1Saver.html#a938c339098e9da63f98f2b182a4cf683">gen</a> () noexcept</td></tr>
|
|
<tr class="memdesc:a938c339098e9da63f98f2b182a4cf683"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new <a class="el" href="classtvg_1_1Saver.html" title="A class for exporting a paint object into a specified file, from which to recover the paint data late...">Saver</a> object. <a href="classtvg_1_1Saver.html#a938c339098e9da63f98f2b182a4cf683">More...</a><br /></td></tr>
|
|
<tr class="separator:a938c339098e9da63f98f2b182a4cf683"><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 for exporting a paint object into a specified file, from which to recover the paint data later. </p>
|
|
<p>ThorVG provides a feature for exporting & importing paint data, the <a class="el" href="classtvg_1_1Saver.html" title="A class for exporting a paint object into a specified file, from which to recover the paint data late...">Saver</a> has a role to export it to a file. Basically, this feature is useful when you need to save the composed scene or image from a paint object and recreate it later.</p>
|
|
<p>The file format is decided by the extension name(i.e. "*.tvg") while the supported formats depend on the TVG packaging environment. If it doesn't support the file format, it will return the <code>NonSuppport</code> result by the <a class="el" href="classtvg_1_1Saver.html#acda492a458f3ddc2da01df672ecd85bd" title="Exports the given paint data to the given path.">save()</a> method.</p>
|
|
<p>Once you export a paint to the file successfully, you can recreate it using the <a class="el" href="classtvg_1_1Picture.html" title="A class representing an image read in one of the supported formats: raw, svg, png and etc....">Picture</a> class.</p>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classtvg_1_1Picture.html#aaf06be7d0b572c5ce35315cbddd7d318" title="Loads a picture data directly from a file.">Picture::load()</a></dd></dl>
|
|
<dl class="section since"><dt>Since</dt><dd>0.5 </dd></dl>
|
|
</div><h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a938c339098e9da63f98f2b182a4cf683"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a938c339098e9da63f98f2b182a4cf683">◆ </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_1Saver.html">Saver</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_1Saver.html" title="A class for exporting a paint object into a specified file, from which to recover the paint data late...">Saver</a> object. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>A new <a class="el" href="classtvg_1_1Saver.html" title="A class for exporting a paint object into a specified file, from which to recover the paint data late...">Saver</a> object.</dd></dl>
|
|
<dl class="section since"><dt>Since</dt><dd>0.5 </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="acda492a458f3ddc2da01df672ecd85bd"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#acda492a458f3ddc2da01df672ecd85bd">◆ </a></span>save()</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> save </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::unique_ptr< <a class="el" href="classtvg_1_1Paint.html">Paint</a> > </td>
|
|
<td class="paramname"><em>paint</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const std::string & </td>
|
|
<td class="paramname"><em>path</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>compress</em> = <code>true</code> </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>Exports the given <code>paint</code> data to the given <code>path</code>. </p>
|
|
<p>If the saver module supports any compression mechanism, it will optimize the data size. This might affect the encoding/decoding time slow down in cases, You can turn off the compression if your system whole focus on the speed.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">paint</td><td>The paint to be saved with all its associated properties. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">path</td><td>A path to the file, in which the paint data is to be saved. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">compress</td><td>Use data compression if it's available.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="retval"><dt>Return values</dt><dd>
|
|
<table class="retval">
|
|
<tr><td class="paramname"><a class="el" href="group__ThorVG.html#gga28287671eaf7406afd604bd055ba4066a505a83f220c02df2f85c3810cd9ceb38" title="The value returned in case of a correct request execution.">Result::Success</a></td><td>When succeed. </td></tr>
|
|
<tr><td class="paramname"><a class="el" href="group__ThorVG.html#gga28287671eaf7406afd604bd055ba4066aa0cfd518e4385f31d38720579321ed29" title="The value returned in case of choosing unsupported options.">Result::NonSupport</a></td><td>When trying to save a file with an unknown extension nor non supported format. </td></tr>
|
|
<tr><td class="paramname"><a class="el" href="group__ThorVG.html#gga28287671eaf7406afd604bd055ba4066a88183b946cc5f0e8c96b2e66e1c74a7e" title="The value returned in all other cases.">Result::Unknown</a></td><td>Others.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section note"><dt>Note</dt><dd>Saving can be asynchronous if the assigned thread number is greater than zero. To guarantee the saving is done, call <a class="el" href="classtvg_1_1Saver.html#a2fdf9b2208358ea10f912b1877733778" title="Guarantees that the saving task is finished.">sync()</a> afterwards. </dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classtvg_1_1Saver.html#a2fdf9b2208358ea10f912b1877733778" title="Guarantees that the saving task is finished.">Saver::sync()</a></dd></dl>
|
|
<dl class="section since"><dt>Since</dt><dd>0.5 </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a2fdf9b2208358ea10f912b1877733778"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2fdf9b2208358ea10f912b1877733778">◆ </a></span>sync()</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> sync </td>
|
|
<td>(</td>
|
|
<td class="paramname"></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>Guarantees that the saving task is finished. </p>
|
|
<p>The behavior of the saver will work on a sync/async basis, depending on the threading setting of the <a class="el" href="classtvg_1_1Initializer.html" title="A class that enables initialization and termination of the TVG engines.">Initializer</a>. Thus if you wish to have a benefit of it, you must call <a class="el" href="classtvg_1_1Saver.html#a2fdf9b2208358ea10f912b1877733778" title="Guarantees that the saving task is finished.">sync()</a> after the <a class="el" href="classtvg_1_1Saver.html#acda492a458f3ddc2da01df672ecd85bd" title="Exports the given paint data to the given path.">save()</a> in the proper delayed time. Otherwise, you can call <a class="el" href="classtvg_1_1Saver.html#a2fdf9b2208358ea10f912b1877733778" title="Guarantees that the saving task is finished.">sync()</a> immediately.</p>
|
|
<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>
|
|
<dd>
|
|
<a class="el" href="group__ThorVG.html#gga28287671eaf7406afd604bd055ba4066a119732ff568bf103d744e930ae2404f1" title="The value returned in case the request cannot be processed - e.g. asking for properties of an object,...">Result::InsufficientCondition</a> otherwise.</dd></dl>
|
|
<dl class="section note"><dt>Note</dt><dd>The asynchronous tasking is depend on the saver module implementation. </dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classtvg_1_1Saver.html#acda492a458f3ddc2da01df672ecd85bd" title="Exports the given paint data to the given path.">Saver::save()</a></dd></dl>
|
|
<dl class="section since"><dt>Since</dt><dd>0.5 </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>
|