int im_render_fade( IMAGE *in, IMAGE *out, IMAGE *mask,
int width, int height, int max,
int fps, int steps,
int priority,
void (*notify)( IMAGE *, Rect *, void * ), void *client );
int im_render( IMAGE *in, IMAGE *out, IMAGE *mask,
int width, int height, int max,
void (*notify)( IMAGE *, Rect *, void * ), void *client );
int im_cache( IMAGE *in, IMAGE *out,
int width, int height, int max );
If the notify 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.
The mask 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 mask after out has been closed. If mask is NULL, then no mask image is written.
If steps is greater than zero, then pixels in mask are moved between 0 and 255 as tiles age in that many steps. The fps parameter sets how many times per second the notify function is called to indicate that an updated tile is ready.
If priority 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.
im_cache(3) is a convenience function for im_render_fade(3) that caches image pixels synchronously. If you ask for an area not in the cache, execution blocks until the area has been calculated.
im_render(3) is deprecated: it is the old interface to the render function, before the fps and steps parameters were added.