1IM_RENDER(3) Library Functions Manual IM_RENDER(3)
2
3
4
6 im_render, im_render_fade, im_cache - make image in the background
7
9 #include <vips/vips.h>
10
11 int im_render_fade( IMAGE *in, IMAGE *out, IMAGE *mask,
12 int width, int height, int max,
13 int fps, int steps,
14 int priority,
15 void (*notify)( IMAGE *, Rect *, void * ), void *client );
16
17 int im_render( IMAGE *in, IMAGE *out, IMAGE *mask,
18 int width, int height, int max,
19 void (*notify)( IMAGE *, Rect *, void * ), void *client );
20
21 int im_cache( IMAGE *in, IMAGE *out,
22 int width, int height, int max );
23
24
26 im_render_fade(3) behaves rather like im_copy(3) between images in and
27 out, except that it keeps a cache of computed pixels. This cache is
28 made of up to max tiles (a value of -1 for max means any number of
29 tiles), and each tile is of size width by height pixels. Each cache
30 tile is made with a call to im_prepare_thread(3), so cache tile calcu‐
31 lation will be accelerated on multi-CPU machines. If image in repre‐
32 sents a large computation, im_render_fade(3) can save a lot of time.
33
34 If the notify parameter points to a function, then tiles are not calcu‐
35 lated immediately, but are added to a job list and calculated as CPU
36 becomes available. When a tile has been calculated, the notify function
37 is passed the image which was being cached, the area of the image which
38 is now available, and a client pointer.
39
40 The mask image is a one band uchar image the same size as out, which
41 has 255 for every pixels which is in the cache and 0 everywhere else.
42 You should not read pixels from mask after out has been closed. If mask
43 is NULL, then no mask image is written.
44
45 If steps is greater than zero, then pixels in mask are moved between 0
46 and 255 as tiles age in that many steps. The fps parameter sets how
47 many times per second the notify function is called to indicate that an
48 updated tile is ready.
49
50 If priority is zero, then the render will only run when the system is
51 idle, and only a few renders will run at any time. Higher values will
52 cause the render to happen more quickly.
53
54 im_cache(3) is a convenience function for im_render_fade(3) that caches
55 image pixels synchronously. If you ask for an area not in the cache,
56 execution blocks until the area has been calculated.
57
58 im_render(3) is deprecated: it is the old interface to the render func‐
59 tion, before the fps and steps parameters were added.
60
61
63 The function returns 0 on success, and non-zero on error, setting
64 im_error().
65
67 im_prepare(3)
68
70 J Cupitt, 2003
71
72
73
74 5 October 2003 IM_RENDER(3)