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 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.
im_cache(3) is a convenience function for im_render(3) that caches image pixels synchronously. If you ask for an area not in the cache, execution blocks until the area has been calculated.