![]() |
![]() |
![]() |
VIPS Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <vips/vips.h> im_thread_t; int (*im__work_fn) (im_thread_t *thr, REGION *, void *, void *, void *); im_threadgroup_t; void im_concurrency_set (int concurrency); int im_concurrency_get (void); im_threadgroup_t * im_threadgroup_create (IMAGE *im); int im_threadgroup_free (im_threadgroup_t *tg); im_thread_t * im_threadgroup_get (im_threadgroup_t *tg); void im_threadgroup_trigger (im_thread_t *thr); void im_threadgroup_wait (im_threadgroup_t *tg); int im_threadgroup_iserror (im_threadgroup_t *tg); int im_prepare_thread (im_threadgroup_t *tg, REGION *oreg, Rect *r); int (*im_wbuffer_fn) (REGION *region, Rect *area, void *a, void *b); int im_wbuffer (im_threadgroup_t *tg, im_wbuffer_fn write_fn, void *a, void *b);
VIPS has its own threadpool system, used by (for example)
im_prepare_thread()
.
Most of this is internal to VIPS and does not need to be documented. You
should only need im_threadgroup_create()
and im_threadgroup_free()
.
im_threadgroup_t * im_threadgroup_create (IMAGE *im);
Makes a threadgroup attached to the image. The threadgroup will be freed
for you if the image is closed, but you can free it yourself with
im_threadgroup_free()
if you wish.
See also: im_threadgroup_free()
, im_prepare_thread()
.
|
image to create the threadgroup on |
Returns : |
an im_threadgroup_t on success, NULL on error.
|
int im_threadgroup_free (im_threadgroup_t *tg);
Frees a threadgroup. This function can be called multiple times, though only the first time will have any effect.
All worker threads are terminated and all resources freed.
See also: im_threadgroup_create()
.
|
threadgroup to free |
Returns : |
0. |
int im_prepare_thread (im_threadgroup_t *tg, REGION *oreg, Rect *r);
im_prepare_thread()
fills reg
with pixels. After calling, you can address
at
least the area r
with IM_REGION_ADDR()
and get valid pixels.
im_prepare_thread()
uses tg
, a group of threads, to calculate pixels.
Computation blocks until the pixels are ready.
Use im_prepare()
to calculate an area of pixels in-line.
Use im_render_priority()
to calculate an area of pixels in the background.
See also: im_prepare()
, im_render_priority()
, im_prepare_to()
.
|
group of threads to evaluate with |
|
region to prepare |
|
Rect of pixels you need to be able to address |
Returns : |
0 on success, or -1 on error |