<!-- manual page source format generated by PolyglotMan v3.2, --> <!-- available at http://polyglotman.sourceforge.net/ --> <html> <head> <title>IM_RENDER(3) manual page</title> </head> <body bgcolor='white'> <a href='#toc'>Table of Contents</a><p> <h2><a name='sect0' href='#toc0'>Name</a></h2> im_render, im_render_fade, im_cache - make image in the background <h2><a name='sect1' href='#toc1'>Synopsis</a></h2> #include <vips/vips.h> <p> int im_render_fade( IMAGE *in, IMAGE *out, IMAGE *mask, <br> int width, int height, int max, <br> <br> int fps, int steps,<br> <br> int priority, <br> <br> void (*notify)( IMAGE *, Rect *, void * ), void *client );<br> <p> int im_render( IMAGE *in, IMAGE *out, IMAGE *mask, <br> int width, int height, int max, <br> <br> void (*notify)( IMAGE *, Rect *, void * ), void *client );<br> <p> int im_cache( IMAGE *in, IMAGE *out, <br> int width, int height, int max );<br> <p> <h2><a name='sect2' href='#toc2'>Description</a></h2> <a href='im_render_fade.3.html'><b>im_render_fade(3)</a> </b> behaves rather like <a href='im_copy.3.html'><b>im_copy(3)</a> </b> between images <b>in</b> and <b>out,</b> except that it keeps a cache of computed pixels. This cache is made of up to <b>max</b> tiles (a value of -1 for <b>max</b> means any number of tiles), and each tile is of size <b>width</b> by <b>height</b> pixels. Each cache tile is made with a call to <a href='im_prepare_thread.3.html'><b>im_prepare_thread(3)</a> ,</b> so cache tile calculation will be accelerated on multi-CPU machines. If image <b>in</b> represents a large computation, <a href='im_render_fade.3.html'><b>im_render_fade(3)</b></a> can save a lot of time. <p> If the <b>notify</b> parameter points to a function, then tiles are not calculated immediately, but are added to a job list and calculated as CPU becomes available. When a tile has been calculated, the notify function is passed the image which was being cached, the area of the image which is now available, and a client pointer. The notify function will be called by a background thread, so you will usually need to implement some mechanism to interrupt your main thread and update. <p> The <b>mask</b> image is a one band uchar image the same size as out, which has 255 for every pixels which is in the cache and 0 everywhere else. You should not read pixels from <b>mask</b> after <b>out</b> has been closed. If mask is NULL, then no mask image is written. <p> If <b>steps </b> is greater than zero, then pixels in mask are moved between 0 and 255 as tiles age in that many steps. The <b>fps</b> parameter sets how many times per second the notify function is called to indicate that an updated tile is ready. <p> If <b>priority </b> is zero, then the render will only run when the system is idle, and only a few renders will run at any time. Higher values will cause the render to happen more quickly. <p> <a href='im_cache.3.html'><b>im_cache(3)</b></a> is a convenience function for <a href='im_render_fade.3.html'><b>im_render_fade(3)</b></a> that caches image pixels synchronously. If you ask for an area not in the cache, execution blocks until the area has been calculated. <p> <a href='im_render.3.html'><b>im_render(3)</b></a> is deprecated: it is the old interface to the render function, before the <b>fps</b> and <b>steps</b> parameters were added. <p> <h2><a name='sect3' href='#toc3'>Return Value</a></h2> The function returns 0 on success, and non-zero on error, setting im_error(). <h2><a name='sect4' href='#toc4'>See Also</a></h2> <a href='im_prepare.3.html'>im_prepare(3)</a> <h2><a name='sect5' href='#toc5'>Author</a></h2> J Cupitt, 2003 <p> <hr><p> <a name='toc'><b>Table of Contents</b></a><p> <ul> <li><a name='toc0' href='#sect0'>Name</a></li> <li><a name='toc1' href='#sect1'>Synopsis</a></li> <li><a name='toc2' href='#sect2'>Description</a></li> <li><a name='toc3' href='#sect3'>Return Value</a></li> <li><a name='toc4' href='#sect4'>See Also</a></li> <li><a name='toc5' href='#sect5'>Author</a></li> </ul> </body> </html>