/usr/share/doc/mathgl/mathgl_en/mathgl_en_34.html is in mathgl-doc-en 2.1.3.1-4ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- This manual is for MathGL (version 2.1.2), a collection of classes and routines for scientific plotting. Please report any errors in this manual to mathgl.abalakin@gmail.org.
Copyright C 2008-2012 Alexey A. Balakin.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled "GNU
Free Documentation License."
-->
<!-- Created on December 22, 2013 by texi2html 1.82
texi2html was written by:
Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>MathGL 2.1.2: 4.5 Export picture</title>
<meta name="description" content="MathGL 2.1.2: 4.5 Export picture">
<meta name="keywords" content="MathGL 2.1.2: 4.5 Export picture">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Export-picture"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="mathgl_en_33.html#Subplots-and-rotation" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Export-to-file" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en_29.html#MathGL-core" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_29.html#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_47.html#Widget-classes" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_88.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Export-picture-1"></a>
<h2 class="section">4.5 Export picture</h2>
<a name="index-SetSize"></a>
<p>Functions in this group save or give access to produced picture. So, usually they should be called after plotting is done.
</p>
<p><a name="setsize"></a>
</p><dl>
<dt><a name="index-setsize"></a><u>MGL command:</u> <b>setsize</b><i> <code>w h</code></i></dt>
<dt><a name="index-SetSize-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>SetSize</b><i> (<code>int</code> width, <code>int</code> height)</i></dt>
<dt><a name="index-mgl_005fset_005fsize"></a><u>C function:</u> <code>void</code> <b>mgl_set_size</b><i> (<code>HMGL</code> gr, <code>int</code> width, <code>int</code> height)</i></dt>
<dd><p>Sets size of picture in pixels. This function <strong>must be</strong> called before any other plotting because it completely remove picture contents.
</p></dd></dl>
<p><a name="quality"></a>
</p><dl>
<dt><a name="index-quality"></a><u>MGL command:</u> <b>quality</b><i> [<code>val</code>=2]</i></dt>
<dt><a name="index-SetQuality"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>SetQuality</b><i> (<code>int</code> val=<code>MGL_DRAW_NORM</code>)</i></dt>
<dt><a name="index-mgl_005fset_005fquality"></a><u>C function:</u> <code>void</code> <b>mgl_set_quality</b><i> (<code>HMGL</code> gr, <code>int</code> val)</i></dt>
<dd><p>Sets quality of the plot depending on value <var>val</var>: <code>MGL_DRAW_WIRE=0</code> – no face drawing (fastest), <code>MGL_DRAW_FAST=1</code> – no color interpolation (fast), <code>MGL_DRAW_NORM=2</code> – high quality (normal), <code>MGL_DRAW_HIGH=3</code> – high quality with 3d primitives (arrows and marks). If <code>MGL_DRAW_LMEM=0x4</code> is set then direct bitmap drawing is used (low memory usage).
</p></dd></dl>
<dl>
<dt><a name="index-GetQuality"></a><u>Method on <code>mglGraph</code>:</u> <code>int</code> <b>GetQuality</b><i> ()</i></dt>
<dt><a name="index-mgl_005fget_005fquality"></a><u>C function:</u> <code>int</code> <b>mgl_get_quality</b><i> (<code>HMGL</code> gr)</i></dt>
<dd><p>Gets quality of the plot: <code>MGL_DRAW_WIRE=0</code> – no face drawing (fastest), <code>MGL_DRAW_FAST=1</code> – no color interpolation (fast), <code>MGL_DRAW_NORM=2</code> – high quality (normal), <code>MGL_DRAW_HIGH=3</code> – high quality with 3d primitives (arrows and marks). If <code>MGL_DRAW_LMEM=0x4</code> is set then direct bitmap drawing is used (low memory usage).
</p></dd></dl>
<dl>
<dt><a name="index-StartGroup"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>StartGroup</b><i> (const char *name)</i></dt>
<dt><a name="index-mgl_005fstart_005fgroup"></a><u>C function:</u> <code>void</code> <b>mgl_start_group</b><i> (<code>HMGL</code> gr, <code>const char *</code>name)</i></dt>
<dd><p>Starts group definition. Groups contain objects and other groups, they are used to select a part of a model to zoom to or to make invizible or to make semitransparent and so on.
</p></dd></dl>
<dl>
<dt><a name="index-EndGroup"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>EndGroup</b><i> ()</i></dt>
<dt><a name="index-mgl_005fend_005fgroup"></a><u>C function:</u> <code>void</code> <b>mgl_end_group</b><i> (<code>HMGL</code> gr)</i></dt>
<dd><p>Ends group definition.
</p></dd></dl>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Export-to-file">4.5.1 Export to file</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Frames_002fAnimation">4.5.2 Frames/Animation</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Bitmap-in-memory">4.5.3 Bitmap in memory</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Parallelization">4.5.4 Parallelization</a></td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr size="6">
<a name="Export-to-file"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Export-picture" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Frames_002fAnimation" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en_29.html#MathGL-core" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Export-picture" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_47.html#Widget-classes" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_88.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Export-to-file-1"></a>
<h3 class="subsection">4.5.1 Export to file</h3>
<a name="index-Write"></a>
<a name="index-WriteFrame"></a>
<a name="index-WritePNG"></a>
<a name="index-WriteGIF"></a>
<a name="index-WriteSVG"></a>
<a name="index-WriteBMP"></a>
<a name="index-WriteEPS"></a>
<a name="index-WriteBPS"></a>
<a name="index-WriteTGA"></a>
<a name="index-WriteTEX"></a>
<a name="index-WritePRC"></a>
<a name="index-WriteOBJ"></a>
<a name="index-WriteWGL"></a>
<a name="index-WriteJPEG"></a>
<a name="index-ShowImage"></a>
<p>These functions export current view to a graphic file. The filename <var>fname</var> should have appropriate extension. Parameter <var>descr</var> gives the short description of the picture. Just now the transparency is supported in PNG, SVG, OBJ and PRC files.
</p>
<p><a name="write"></a>
</p><dl>
<dt><a name="index-write"></a><u>MGL command:</u> <b>write</b><i> ['fname'='']</i></dt>
<dt><a name="index-WriteFrame-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteFrame</b><i> (<code>const char *</code>fname=<code>""</code>, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005fframe"></a><u>C function:</u> <code>void</code> <b>mgl_write_frame</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to a file <var>fname</var> which type is determined by the extension. Parameter <var>descr</var> adds description to file (can be <code>""</code>). If <var>fname</var>=<code>""</code> then the file ‘<samp>frame####.jpg</samp>’ is used, where ‘<samp>####</samp>’ is current frame id and name ‘<samp>frame</samp>’ is defined by <a href="mathgl_en_31.html#plotid">plotid</a> class property.
</p></dd></dl>
<dl>
<dt><a name="index-WritePNG-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WritePNG</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>, <code>int</code> compr=<code>""</code>, <code>bool</code> alpha=<code>true</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005fpng"></a><u>C function:</u> <code>void</code> <b>mgl_write_png</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dt><a name="index-mgl_005fwrite_005fpng_005fsolid"></a><u>C function:</u> <code>void</code> <b>mgl_write_png_solid</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to PNG file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file, <var>alpha</var> gives the transparency type. By default there are no description added and semitransparent image used. This function does nothing if HAVE_PNG isn’t defined during compilation of MathGL library.
</p></dd></dl>
<dl>
<dt><a name="index-WriteJPEG-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteJPEG</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005fjpg"></a><u>C function:</u> <code>void</code> <b>mgl_write_jpg</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to JPEG file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file. By default there is no description added. This function does nothing if HAVE_JPEG isn’t defined during compilation of MathGL library.
</p></dd></dl>
<dl>
<dt><a name="index-WriteGIF-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteGIF</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005fgif"></a><u>C function:</u> <code>void</code> <b>mgl_write_gif</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to GIF file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file. By default there is no description added. This function does nothing if HAVE_GIF isn’t defined during compilation of MathGL library.
</p></dd></dl>
<dl>
<dt><a name="index-WriteBMP-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteBMP</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005fbmp"></a><u>C function:</u> <code>void</code> <b>mgl_write_bmp</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to BMP file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file. There is no compression used.
</p></dd></dl>
<dl>
<dt><a name="index-WriteTGA-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteTGA</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005ftga"></a><u>C function:</u> <code>void</code> <b>mgl_write_tga</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to TGA file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file. There is no compression used.
</p></dd></dl>
<dl>
<dt><a name="index-WriteEPS-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteEPS</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005feps"></a><u>C function:</u> <code>void</code> <b>mgl_write_eps</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to EPS file using vector representation. So it is not recommended for the export of large data plot. It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file. By default there is no description added. If file name is terminated by ‘<samp>z</samp>’ (for example, ‘<samp>fname.eps.gz</samp>’) then file will be compressed in gzip format.
</p></dd></dl>
<dl>
<dt><a name="index-WriteBPS-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteBPS</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005feps-1"></a><u>C function:</u> <code>void</code> <b>mgl_write_eps</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to EPS file using bitmap representation. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file. By default there is no description added. If file name is terminated by ‘<samp>z</samp>’ (for example, ‘<samp>fname.eps.gz</samp>’) then file will be compressed in gzip format.
</p></dd></dl>
<dl>
<dt><a name="index-WriteSVG-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteSVG</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005fsvg"></a><u>C function:</u> <code>void</code> <b>mgl_write_svg</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to SVG (Scalable Vector Graphics) file using vector representation. In difference of EPS format, SVG format support transparency that allows to correctly draw semitransparent plot (like <a href="mathgl_en_42.html#surfa">surfa</a>, <a href="mathgl_en_42.html#surf3a">surf3a</a> or <a href="mathgl_en_41.html#cloud">cloud</a>). Note, the output file may be too large for graphic of large data array (especially for surfaces). It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file (default is file name). If file name is terminated by ‘<samp>z</samp>’ (for example, ‘<samp>fname.svgz</samp>’) then file will be compressed in gzip format.
</p></dd></dl>
<dl>
<dt><a name="index-WriteTEX-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteTEX</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005ftex"></a><u>C function:</u> <code>void</code> <b>mgl_write_tex</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to LaTeX (package Tikz/PGF) file using vector representation. Note, the output file may be too large for graphic of large data array (especially for surfaces). It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file (default is file name). Note, there is no text scaling now (for example, in subplots), what may produce miss-aligned labels.
</p></dd></dl>
<dl>
<dt><a name="index-WritePRC-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WritePRC</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>, <code>bool</code> make_pdf=<code>true</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005fprc"></a><u>C function:</u> <code>void</code> <b>mgl_write_prc</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr, <code>int</code> make_pdf)</i></dt>
<dd><p>Exports current frame to PRC file using vector representation (see <a href="http://en.wikipedia.org/wiki/PRC_%28file_format%29">http://en.wikipedia.org/wiki/PRC_%28file_format%29</a>). Note, the output file may be too large for graphic of large data array (especially for surfaces). It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file (default is file name). If parameter <var>make_pdf</var>=<code>true</code> and PDF was enabled at MathGL configure then corresponding PDF file with 3D image will be created.
</p></dd></dl>
<dl>
<dt><a name="index-WriteOBJ-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteOBJ</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005fobj"></a><u>C function:</u> <code>void</code> <b>mgl_write_obj</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to OBJ/MTL file using vector representation (see <a href="http://en.wikipedia.org/wiki/Wavefront_.obj_file">OBJ format</a> for details). Note, the output file may be too large for graphic of large data array (especially for surfaces). It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file (default is file name).
</p></dd></dl>
<dl>
<dt><a name="index-WriteXYZ"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteXYZ</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005fxyz"></a><u>C function:</u> <code>void</code> <b>mgl_write_xyz</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to XYZ/XYZL/XYZF files using vector representation (see <a href="http://people.sc.fsu.edu/~jburkardt/data/xyz/xyz.html">XYZ format</a> for details). Note, the output file may be too large for graphic of large data array (especially for surfaces). It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file (default is file name).
</p></dd></dl>
<dl>
<dt><a name="index-WriteSTL"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteSTL</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005fstl"></a><u>C function:</u> <code>void</code> <b>mgl_write_stl</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to STL file using vector representation (see <a href="http://en.wikipedia.org/wiki/STL_(file_format)">STL format</a> for details). Note, the output file may be too large for graphic of large data array (especially for surfaces). It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file (default is file name.
</p></dd></dl>
<dl>
<dt><a name="index-WriteOFF"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteOFF</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>, <code>bool</code> colored=<code>false</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005foff"></a><u>C function:</u> <code>void</code> <b>mgl_write_off</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr, <code>bool</code> colored)</i></dt>
<dd><p>Exports current frame to OFF file using vector representation (see <a href="http://people.sc.fsu.edu/~jburkardt/data/off/off.html">OFF format</a> for details). Note, the output file may be too large for graphic of large data array (especially for surfaces). It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file (default is file name).
</p></dd></dl>
<dl>
<dt><a name="index-ShowImage-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>ShowImage</b><i> (<code>const char *</code>viewer, <code>bool</code> nowait=<code>false</code>)</i></dt>
<dt><a name="index-mgl_005fshow_005fimage"></a><u>C function:</u> <code>void</code> <b>mgl_show_image</b><i> (<code>const char *</code>viewer, <code>int</code> nowait)</i></dt>
<dd><p>Displays the current picture using external program <var>viewer</var> for viewing. The function save the picture to temporary file and call <var>viewer</var> to display it. If <var>nowait</var>=<code>true</code> then the function return immediately (it will not wait while window will be closed).
</p></dd></dl>
<dl>
<dt><a name="index-WriteJSON"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>WriteJSON</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fwrite_005fjson"></a><u>C function:</u> <code>void</code> <b>mgl_write_json</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports current frame to textual file using <a href="mathgl_en_85.html#JSON-format">JSON format</a>. Later this file can be used for faster loading and viewing by JavaScript script. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file.
</p></dd></dl>
<dl>
<dt><a name="index-ExportMGLD"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>ExportMGLD</b><i> (<code>const char *</code>fname, <code>const char *</code>descr=<code>""</code>)</i></dt>
<dt><a name="index-mgl_005fexport_005fmgld"></a><u>C function:</u> <code>void</code> <b>mgl_export_mgld</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>const char *</code>descr)</i></dt>
<dd><p>Exports points and primitives in file using <a href="mathgl_en_84.html#MGLD-format">MGLD format</a>. Later this file can be used for faster loading and viewing by <code>mglview</code> utility. Parameter <var>fname</var> specifies the file name, <var>descr</var> adds description to file (default is file name).
</p></dd></dl>
<dl>
<dt><a name="index-ImportMGLD"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>ImportMGLD</b><i> (<code>const char *</code>fname, <code>bool</code> add=<code>false</code>)</i></dt>
<dt><a name="index-mgl_005fimport_005fmgld"></a><u>C function:</u> <code>void</code> <b>mgl_import_mgld</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>int</code> add)</i></dt>
<dd><p>Imports points and primitives in file using <a href="mathgl_en_84.html#MGLD-format">MGLD format</a>. Later this file can be used for faster loading and viewing by <code>mglview</code> utility. Parameter <var>fname</var> specifies the file name, <var>add</var> sets to append or replace primitives to existed ones.
</p></dd></dl>
<hr size="6">
<a name="Frames_002fAnimation"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Export-to-file" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Bitmap-in-memory" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en_29.html#MathGL-core" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Export-picture" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_47.html#Widget-classes" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_88.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Frames_002fAnimation-1"></a>
<h3 class="subsection">4.5.2 Frames/Animation</h3>
<a name="index-NewFrame"></a>
<a name="index-EndFrame"></a>
<a name="index-GetNumFrame"></a>
<a name="index-ResetFrames"></a>
<a name="index-StartGIF"></a>
<a name="index-CloseGIF"></a>
<p>These functions provide ability to create several pictures simultaneously. For most of cases it is useless but for widget classes (see <a href="mathgl_en_47.html#Widget-classes">Widget classes</a>) they can provide a way to show animation. Also you can write several frames into animated GIF file.
</p>
<dl>
<dt><a name="index-NewFrame-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>NewFrame</b><i> ()</i></dt>
<dt><a name="index-mgl_005fnew_005fframe"></a><u>C function:</u> <code>void</code> <b>mgl_new_frame</b><i> (<code>HMGL</code> gr)</i></dt>
<dd><p>Creates new frame. Function returns current frame id. This is not thread safe function in OpenGL mode! Use direct list creation in multi-threading drawing. The function <code>EndFrame()</code> <strong>must</strong> be call after the finishing of the frame drawing for each call of this function.
</p></dd></dl>
<dl>
<dt><a name="index-EndFrame-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>EndFrame</b><i> ()</i></dt>
<dt><a name="index-mgl_005fend_005fframe"></a><u>C function:</u> <code>void</code> <b>mgl_end_frame</b><i> (<code>HMGL</code> gr)</i></dt>
<dd><p>Finishes the frame drawing.
</p></dd></dl>
<dl>
<dt><a name="index-GetNumFrame-1"></a><u>Method on <code>mglGraph</code>:</u> <code>int</code> <b>GetNumFrame</b><i> ()</i></dt>
<dt><a name="index-mgl_005fget_005fnum_005fframe"></a><u>C function:</u> <code>int</code> <b>mgl_get_num_frame</b><i> (<code>HMGL</code> gr)</i></dt>
<dd><p>Gets the number of created frames.
</p></dd></dl>
<dl>
<dt><a name="index-SetFrame"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>SetFrame</b><i> (<code>int</code> i)</i></dt>
<dt><a name="index-mgl_005fset_005fframe"></a><u>C function:</u> <code>void</code> <b>mgl_set_frame</b><i> (<code>HMGL</code> gr, <code>int</code> i)</i></dt>
<dd><p>Finishes the frame drawing and sets drawing data to frame <var>i</var>, which should be in range [0, <code>GetNumFrame()</code>-1]. This function is similar to <code>EndFrame()</code> but don’t add frame to the GIF image.
</p></dd></dl>
<dl>
<dt><a name="index-GetFrame"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>GetFrame</b><i> (<code>int</code> i)</i></dt>
<dt><a name="index-mgl_005fget_005fframe"></a><u>C function:</u> <code>void</code> <b>mgl_get_frame</b><i> (<code>HMGL</code> gr, <code>int</code> i)</i></dt>
<dd><p>Replaces drawing data by one from frame <var>i</var>. Function work if <code>MGL_VECT_FRAME</code> is set on (by default).
</p></dd></dl>
<dl>
<dt><a name="index-ShowFrame"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>ShowFrame</b><i> (<code>int</code> i)</i></dt>
<dt><a name="index-mgl_005fshow_005fframe"></a><u>C function:</u> <code>void</code> <b>mgl_show_frame</b><i> (<code>HMGL</code> gr, <code>int</code> i)</i></dt>
<dd><p>Appends drawing data from frame <var>i</var> to current one. Function work if <code>MGL_VECT_FRAME</code> is set on (by default).
</p></dd></dl>
<dl>
<dt><a name="index-DelFrame"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>DelFrame</b><i> (<code>int</code> i)</i></dt>
<dt><a name="index-mgl_005fdel_005fframe"></a><u>C function:</u> <code>void</code> <b>mgl_del_frame</b><i> (<code>HMGL</code> gr, <code>int</code> i)</i></dt>
<dd><p>Deletes drawing data for frame <var>i</var> and shift all later frame indexes. Function work if <code>MGL_VECT_FRAME</code> is set on (by default). Do nothing in OpenGL mode.
</p></dd></dl>
<dl>
<dt><a name="index-ResetFrames-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>ResetFrames</b><i> ()</i></dt>
<dt><a name="index-mgl_005freset_005fframes"></a><u>C function:</u> <code>void</code> <b>mgl_reset_frames</b><i> (<code>HMGL</code> gr)</i></dt>
<dd><p>Reset frames counter (start it from zero).
</p></dd></dl>
<dl>
<dt><a name="index-StartGIF-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>StartGIF</b><i> (<code>const char *</code>fname, <code>int</code> ms=<code>100</code>)</i></dt>
<dt><a name="index-mgl_005fstart_005fgif"></a><u>C function:</u> <code>void</code> <b>mgl_start_gif</b><i> (<code>HMGL</code> gr, <code>const char *</code>fname, <code>int</code> ms)</i></dt>
<dd><p>Start writing frames into animated GIF file <var>fname</var>. Parameter <var>ms</var> set the delay between frames in milliseconds. You <strong>should not</strong> change the picture size during writing the cinema. Use <code>CloseGIF()</code> to finalize writing. Note, that this function is disabled in OpenGL mode.
</p></dd></dl>
<dl>
<dt><a name="index-CloseGIF-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>CloseGIF</b><i> ()</i></dt>
<dt><a name="index-mgl_005fclose_005fgif"></a><u>C function:</u> <code>void</code> <b>mgl_close_gif</b><i> (<code>HMGL</code> gr)</i></dt>
<dd><p>Finish writing animated GIF and close connected pointers.
</p></dd></dl>
<hr size="6">
<a name="Bitmap-in-memory"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Frames_002fAnimation" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Parallelization" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en_29.html#MathGL-core" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Export-picture" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_47.html#Widget-classes" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_88.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Bitmap-in-memory-1"></a>
<h3 class="subsection">4.5.3 Bitmap in memory</h3>
<p>These functions return the created picture (bitmap), its width and height. You may display it by yourself in any graphical library (see also, <a href="mathgl_en_47.html#Widget-classes">Widget classes</a>) or save in file (see also, <a href="#Export-to-file">Export to file</a>).
</p>
<dl>
<dt><a name="index-GetRGB"></a><u>Method on <code>mglGraph</code>:</u> <code>const unsigned char *</code> <b>GetRGB</b><i> ()</i></dt>
<dt><a name="index-GetRGB-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>GetRGB</b><i> (<code>char *</code>buf, <code>int</code> size)</i></dt>
<dt><a name="index-GetBGRN"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>GetBGRN</b><i> (<code>char *</code>buf, <code>int</code> size)</i></dt>
<dt><a name="index-mgl_005fget_005frgb"></a><u>C function:</u> <code>const unsigned char *</code> <b>mgl_get_rgb</b><i> (<code>HMGL</code> gr)</i></dt>
<dd><p>Gets RGB bitmap of the current state of the image. Format of each element of bits is: {red, green, blue}. Number of elements is Width*Height. Position of element {i,j} is [3*i + 3*Width*j] (or is [4*i + 4*Width*j] for <code>GetBGRN()</code>). You have to provide the proper <var>size</var> of the buffer, <var>buf</var>, i.e. the code for Python should look like
</p><pre class="verbatim">from mathgl import *
gr = mglGraph();
bits='\t';
bits=bits.expandtabs(4*gr.GetWidth()*gr.GetHeight());
gr.GetBGRN(bits, len(bits));
</pre></dd></dl>
<dl>
<dt><a name="index-GetRGBA"></a><u>Method on <code>mglGraph</code>:</u> <code>const unsigned char *</code> <b>GetRGBA</b><i> ()</i></dt>
<dt><a name="index-GetRGBA-1"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>GetRGBA</b><i> (<code>char *</code>buf, <code>int</code> size)</i></dt>
<dt><a name="index-mgl_005fget_005frgba"></a><u>C function:</u> <code>const unsigned char *</code> <b>mgl_get_rgba</b><i> (<code>HMGL</code> gr)</i></dt>
<dd><p>Gets RGBA bitmap of the current state of the image. Format of each element of bits is: {red, green, blue, alpha}. Number of elements is Width*Height. Position of element {i,j} is [4*i + 4*Width*j].
</p></dd></dl>
<dl>
<dt><a name="index-GetWidth"></a><u>Method on <code>mglGraph</code>:</u> <code>int</code> <b>GetWidth</b><i> ()</i></dt>
<dt><a name="index-GetHeight"></a><u>Method on <code>mglGraph</code>:</u> <code>int</code> <b>GetHeight</b><i> ()</i></dt>
<dt><a name="index-mgl_005fget_005fwidth"></a><u>C function:</u> <code>int</code> <b>mgl_get_width</b><i> (<code>HMGL</code> gr)</i></dt>
<dt><a name="index-mgl_005fget_005fheight"></a><u>C function:</u> <code>int</code> <b>mgl_get_height</b><i> (<code>HMGL</code> gr)</i></dt>
<dd><p>Gets width and height of the image.
</p></dd></dl>
<dl>
<dt><a name="index-CalcXYZ"></a><u>Method on <code>mglGraph</code>:</u> <code>mglPoint</code> <b>CalcXYZ</b><i> (<code>int</code> xs, <code>int</code> ys)</i></dt>
<dt><a name="index-mgl_005fcalc_005fxyz"></a><u>C function:</u> <code>void</code> <b>mgl_calc_xyz</b><i> (<code>HMGL</code> gr, <code>int</code> xs, <code>int</code> ys, <code>mreal *</code>x, <code>mreal *</code>y, <code>mreal *</code>z)</i></dt>
<dd><p>Calculate 3D coordinate {x,y,z} for screen point {xs,ys}. At this moment it ignore perspective and transformation formulas (curvilinear coordinates). The calculation are done for the last used InPlot (see <a href="mathgl_en_33.html#Subplots-and-rotation">Subplots and rotation</a>).
</p></dd></dl>
<dl>
<dt><a name="index-CalcScr"></a><u>Method on <code>mglGraph</code>:</u> <code>mglPoint</code> <b>CalcScr</b><i> (<code>mglPoint</code> p)</i></dt>
<dt><a name="index-mgl_005fcalc_005fscr"></a><u>C function:</u> <code>void</code> <b>mgl_calc_scr</b><i> (<code>HMGL</code> gr, <code>mreal</code> x, <code>mreal</code> y, <code>mreal</code> z, <code>int *</code>xs, <code>int *</code>ys)</i></dt>
<dd><p>Calculate screen point {xs,ys} for 3D coordinate {x,y,z}. The calculation are done for the last used InPlot (see <a href="mathgl_en_33.html#Subplots-and-rotation">Subplots and rotation</a>).
</p></dd></dl>
<dl>
<dt><a name="index-SetObjId"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>SetObjId</b><i> (<code>int</code> id)</i></dt>
<dt><a name="index-mgl_005fset_005fobj_005fid"></a><u>C function:</u> <code>void</code> <b>mgl_set_obj_id</b><i> (<code>HMGL</code> gr, <code>int</code> id)</i></dt>
<dd><p>Set the numeric id for object or subplot/inplot.
</p></dd></dl>
<dl>
<dt><a name="index-GetObjId"></a><u>Method on <code>mglGraph</code>:</u> <code>int</code> <b>GetObjId</b><i> (<code>int</code> xs, <code>int</code> ys)</i></dt>
<dt><a name="index-mgl_005fget_005fobj_005fid"></a><u>C function:</u> <code>int</code> <b>mgl_get_obj_id</b><i> (<code>HMGL</code> gr, <code>int</code> xs, <code>int</code> ys)</i></dt>
<dd><p>Get the numeric id for most upper object at pixel {xs, ys} of the picture.
</p></dd></dl>
<dl>
<dt><a name="index-GetSplId"></a><u>Method on <code>mglGraph</code>:</u> <code>int</code> <b>GetSplId</b><i> (<code>int</code> xs, <code>int</code> ys)</i></dt>
<dt><a name="index-mgl_005fget_005fspl_005fid"></a><u>C function:</u> <code>int</code> <b>mgl_get_spl_id</b><i> (<code>HMGL</code> gr, <code>int</code> xs, <code>int</code> ys)</i></dt>
<dd><p>Get the numeric id for most subplot/inplot at pixel {xs, ys} of the picture.
</p></dd></dl>
<dl>
<dt><a name="index-Highlight"></a><u>Method on <code>mglGraph</code>:</u> <code>void</code> <b>Highlight</b><i> (<code>int</code> id)</i></dt>
<dt><a name="index-mgl_005fhighlight"></a><u>C function:</u> <code>void</code> <b>mgl_highlight</b><i> (<code>HMGL</code> gr, <code>int</code> id)</i></dt>
<dd><p>Highlight the object with given <var>id</var>.
</p></dd></dl>
<dl>
<dt><a name="index-IsActive"></a><u>Method on <code>mglGraph</code>:</u> <code>long</code> <b>IsActive</b><i> (<code>int</code> xs, <code>int</code> ys, <code>int</code> d=<code>1</code>)</i></dt>
<dt><a name="index-mgl_005fis_005factive"></a><u>C function:</u> <code>long</code> <b>mgl_is_active</b><i> (<code>HMGL</code> gr, <code>int</code> xs, <code>int</code> ys, <code>int</code> d)</i></dt>
<dd><p>Checks if point {<var>xs</var>, <var>ys</var>} is close to one of active point (i.e. mglBase::Act) with accuracy <var>d</var> and return its index or <code>-1</code> if not found. Active points are special points which characterize primitives (like edges and so on). This function for advanced users only.
</p></dd></dl>
<hr size="6">
<a name="Parallelization"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Bitmap-in-memory" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_35.html#Primitives" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en_29.html#MathGL-core" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Export-picture" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_47.html#Widget-classes" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_88.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Parallelization-1"></a>
<h3 class="subsection">4.5.4 Parallelization</h3>
<a name="index-Combine"></a>
<a name="index-MPI_005fSend"></a>
<a name="index-MPI_005fRecv"></a>
<p>Many of things MathGL do in parallel by default (if MathGL was built with pthread). However, there is function which set the number of threads to be used.
</p>
<dl>
<dt><a name="index-mgl_005fset_005fnum_005fthr"></a><u>C function:</u> <code>int</code> <b>mgl_set_num_thr</b><i> (<code>int</code> n)</i></dt>
<dd><p>Set the number of threads to be used by MathGL. If <var>n</var><1 then the number of threads is set as maximal number of processors (cores). If <var>n</var>=1 then single thread will be used (this is default if pthread was disabled).
</p></dd></dl>
<p>Another option is combining bitmap image (taking into account Z-ordering) from different instances of <code>mglGraph</code>. This method is most appropriate for computer clusters when the data size is so large that it exceed the memory of single computer node.
</p>
<dl>
<dt><a name="index-Combine-1"></a><u>Method on <code>mglGraph</code>:</u> <code>int</code> <b>Combine</b><i> (<code>const mglGraph *</code>g)</i></dt>
<dt><a name="index-mgl_005fcombine_005fgr"></a><u>C function:</u> <code>int</code> <b>mgl_combine_gr</b><i> (<code>HMGL</code> gr, <code>HMGL</code> g)</i></dt>
<dd><p>Combine drawing from instance <var>g</var> with <var>gr</var> (or with this) taking into account Z-ordering of pixels. The width and height of both instances must be the same.
</p></dd></dl>
<dl>
<dt><a name="index-MPI_005fSend-1"></a><u>Method on <code>mglGraph</code>:</u> <code>int</code> <b>MPI_Send</b><i> (<code>int</code> id)</i></dt>
<dt><a name="index-mgl_005fmpi_005fsend"></a><u>C function:</u> <code>int</code> <b>mgl_mpi_send</b><i> (<code>HMGL</code> gr, <code>int</code> id)</i></dt>
<dd><p>Send graphical information from node <var>id</var> using MPI. The width and height in both nodes must be the same.
</p></dd></dl>
<dl>
<dt><a name="index-MPI_005fRecv-1"></a><u>Method on <code>mglGraph</code>:</u> <code>int</code> <b>MPI_Recv</b><i> (<code>int</code> id)</i></dt>
<dt><a name="index-mgl_005fmpi_005fsend-1"></a><u>C function:</u> <code>int</code> <b>mgl_mpi_send</b><i> (<code>HMGL</code> gr, <code>int</code> id)</i></dt>
<dd><p>Receive graphical information from node <var>id</var> using MPI. The width and height in both nodes must be the same.
</p></dd></dl>
<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Bitmap-in-memory" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_35.html#Primitives" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mathgl_en_29.html#MathGL-core" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Export-picture" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="mathgl_en_47.html#Widget-classes" title="Next chapter"> >> </a>]</td>
</tr></table>
<p>
<font size="-1">
This document was generated by <em>Build Daemon user</em> on <em>December 22, 2013</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
</font>
<br>
</p>
</body>
</html>
|