![]() |
![]() |
![]() |
VIPS Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
conversionconversion — convert images in some way: change band format, change header, insert, extract, join |
#include <vips/vips.h> enum im_arch_type; gboolean im_isnative (im_arch_type arch
); DOUBLEMASK * im_vips2mask (IMAGE *in
,const char *out
); int im_mask2vips (DOUBLEMASK *in
,IMAGE *out
); int im_copy_set (IMAGE *in
,IMAGE *out
,int type
,float xres
,float yres
,int x
,int y
); int im_copy_set_meta (IMAGE *in
,IMAGE *out
,const char *field
,GValue *meta
); int im_copy_morph (IMAGE *in
,IMAGE *out
,int Bands
,int BandFmt
,int Coding
); int im_copy (IMAGE *in
,IMAGE *out
); int im_copy_swap (IMAGE *in
,IMAGE *out
); int im_copy_from (IMAGE *in
,IMAGE *out
,im_arch_type architecture
); int im_copy_file (IMAGE *in
,IMAGE *out
); int im_clip2fmt (IMAGE *in
,IMAGE *out
,int ofmt
); int im_scale (IMAGE *in
,IMAGE *out
); int im_clip (IMAGE *in
,IMAGE *out
); int im_msb (IMAGE *in
,IMAGE *out
); int im_msb_band (IMAGE *in
,IMAGE *out
,int band
); int im_c2amph (IMAGE *in
,IMAGE *out
); int im_c2rect (IMAGE *in
,IMAGE *out
); int im_ri2c (IMAGE *real_in
,IMAGE *imag_in
,IMAGE *out
); int im_c2imag (IMAGE *in
,IMAGE *out
); int im_c2real (IMAGE *in
,IMAGE *out
); int im_c2ps (IMAGE *in
,IMAGE *out
); int im_scaleps (IMAGE *in
,IMAGE *out
); int im_falsecolour (IMAGE *in
,IMAGE *out
); int im_addgnoise (IMAGE *Param1
,IMAGE *Param2
,double Param3
); int im_gaussnoise (IMAGE *Param1
,...
,...
,double Param4
,double Param5
); int im_black (IMAGE *out
,int width
,int height
,int bands
); int im_text (IMAGE *out
,const char *text
,const char *font
,int width
,int alignment
,int dpi
); int im_extract_band (IMAGE *in
,IMAGE *out
,int band
); int im_extract_bands (IMAGE *in
,IMAGE *out
,int band
,int nbands
); int im_extract_area (IMAGE *in
,IMAGE *out
,int x
,int y
,int w
,int h
); int im_extract_areabands (IMAGE *in
,IMAGE *out
,int left
,int top
,int width
,int height
,int band
,int nbands
); int im_embed (IMAGE *in
,IMAGE *out
,int type
,int left
,int top
,int width
,int height
); int im_bandjoin (IMAGE *in1
,IMAGE *in2
,IMAGE *out
); int im_gbandjoin (IMAGE **in
,IMAGE *out
,int n
); int im_insert (IMAGE *main
,IMAGE *sub
,IMAGE *out
,int x
,int y
); int im_insert_noexpand (IMAGE *main
,IMAGE *sub
,IMAGE *out
,int x
,int y
); int im_insertset (IMAGE *main
,IMAGE *sub
,IMAGE *out
,int n
,int *x
,int *y
); int im_lrjoin (IMAGE *in1
,IMAGE *in2
,IMAGE *out
); int im_tbjoin (IMAGE *in1
,IMAGE *in2
,IMAGE *out
); int im_replicate (IMAGE *in
,IMAGE *out
,int across
,int down
); int im_grid (IMAGE *in
,IMAGE *out
,int tile_height
,int across
,int down
); int im_wrap (IMAGE *in
,IMAGE *out
,int x
,int y
); int im_fliphor (IMAGE *in
,IMAGE *out
); int im_flipver (IMAGE *in
,IMAGE *out
); int im_rot90 (IMAGE *in
,IMAGE *out
); int im_rot180 (IMAGE *in
,IMAGE *out
); int im_rot270 (IMAGE *in
,IMAGE *out
); int im_subsample (IMAGE *in
,IMAGE *out
,int x
,int y
); int im_zoom (IMAGE *in
,IMAGE *out
,int x
,int y
); int im_system (IMAGE *im
,const char *cmd
,char **out
);
These operations convert an image in some way. They can be split into a two main groups.
The first set of operations change an image's format in some way. You can change the band format (for example, cast to 32-bit unsigned int), form complex images from real images, convert images to matrices and back, change header fields, and a few others.
The second group move pixels about in some way. You can flip, rotate, extract, insert and join pairs of iamges in various ways.
typedef enum { IM_ARCH_NATIVE, IM_ARCH_BYTE_SWAPPED, IM_ARCH_LSB_FIRST, IM_ARCH_MSB_FIRST } im_arch_type;
int im_copy_set (IMAGE *in
,IMAGE *out
,int type
,float xres
,float yres
,int x
,int y
);
int im_text (IMAGE *out
,const char *text
,const char *font
,int width
,int alignment
,int dpi
);
int im_extract_areabands (IMAGE *in
,IMAGE *out
,int left
,int top
,int width
,int height
,int band
,int nbands
);
int im_embed (IMAGE *in
,IMAGE *out
,int type
,int left
,int top
,int width
,int height
);
The opposite of im_extract()
: embed an image within a larger image. flag
controls what appears in the new pels:
0 | black pels (all bytes == 0) |
1 | extend pels from image edge |
2 | repeat image |
3 | mirror image |
4 | white pels (all bytes == 255) |
|
input image |
|
output image |
|
how to generate the edge pixels |
|
place in at this x position in out
|
|
place in at this y position in out
|
|
out should be this many pixels across
|
|
out should be this many pixels down
|
Returns : |
0 on success, -1 on error. |