1IM_EXTRACT(3) Library Functions Manual IM_EXTRACT(3)
2
3
4
6 im_extract, im_extract_band, im_extract_bands, im_etract_area - extract
7 a portion of an image
8
10 #include <vips/vips.h>
11
12 int im_extract(in, out, pbox)
13 IMAGE *in, *out;
14 IMAGE_BOX *pbox;
15
16 int im_extract_band(in, out, band)
17 IMAGE *in, *out;
18 int band;
19
20 int im_extract_bands(in, out, band, nbands)
21 IMAGE *in, *out;
22 int band;
23 int nbands;
24
25 int im_extract_area(in, out, x, y, w, h)
26 IMAGE *in, *out;
27 int x, y, w, h;
28
29
31 im_extract(3) extracts a portion of the image pointed by in and writes
32 the result to out. pbox specifies the size and position of the area to
33 be extracted and is defined as
34
35 /* Used to define a region of interest for
36 * im_extract() etc.
37 */
38 typedef struct {
39 int xstart;
40 int ystart;
41 int xsize;
42 int ysize;
43 int chsel;
44 } IMAGE_BOX;
45
46 see <vips/vips.h>. if pbox->chsel is set to -1, all bands are
47 extracted; otherwise pbox->chsel gives the band to extract, numbering
48 from zero. The area specified by pbox must lie entirely within the
49 image.
50
51 Works for any size image, any number of bands, any type. Works for LAB‐
52 PACK coded images too! But disallows band extraction in this case.
53
54 If used as part of a pipeline of partial image operations, im_extract()
55 magically vanishes if chsel is -1. See the VIPS IO System Guide.
56
57 im_extract_area(3) is a convenience function which extracts an area
58 from an image, leaving the bands the same.
59
60 im_extract_bands(3) takes nbands out of an image, starting from band
61 band. So, for example, nbands == 2, bands == 1 will form a two band
62 image from an RGB image, where the two bands are the G and the B bands.
63
64 im_extract_band(3) is a convenience function which extracts a single
65 band from an image.
66
67
69 The function returns 0 on success and -1 on error.
70
72 im_insert(3), im_lrjoin(3), im_lrmerge(3), im_stats(3),
73 im_region_region(3).
74
76 J. Cupitt,
77
79 J. Cupitt - 11/04/1990
80
81
82
83 11 April 1990 IM_EXTRACT(3)