| VIPS Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <vips/vips.h> int im_affinei (VipsImage *in,VipsImage *out,VipsInterpolate *interpolate,double a,double b,double c,double d,double dx,double dy,int ox,int oy,int ow,int oh); int im_affinei_all (VipsImage *in,VipsImage *out,VipsInterpolate *interpolate,double a,double b,double c,double d,double dx,double dy); int im_match_linear (VipsImage *ref,VipsImage *sec,VipsImage *out,int xr1,int yr1,int xs1,int ys1,int xr2,int yr2,int xs2,int ys2); int im_match_linear_search (VipsImage *ref,VipsImage *sec,VipsImage *out,int xr1,int yr1,int xs1,int ys1,int xr2,int yr2,int xs2,int ys2,int hwindowsize,int hsearchsize); int im_rightshift_size (VipsImage *in,VipsImage *out,int xshift,int yshift,int band_fmt); int im_shrink (VipsImage *in,VipsImage *out,double xshrink,double yshrink);
Resample an image in various ways, using a VipsInterpolator to generate intermediate values.
int im_affinei (VipsImage *in,VipsImage *out,VipsInterpolate *interpolate,double a,double b,double c,double d,double dx,double dy,int ox,int oy,int ow,int oh);
This operator performs an affine transform on an image using interpolate.
The transform is:
X = a * x + b * y + dx
Y = c * x + d * y + dy
x and y are the coordinates in input image. X and Y are the coordinates in output image. (0,0) is the upper left corner.
The section of the output space defined by ox, oy, ow, oh is written to
out. See im_affinei_all() for a function which outputs all the transformed
pixels.
See also: im_affinei_all(), VipsInterpolate.
|
input image |
|
output image |
|
interpolation method |
|
transformation matrix |
|
transformation matrix |
|
transformation matrix |
|
transformation matrix |
|
output offset |
|
output offset |
|
output region |
|
output region |
|
output region |
|
output region |
Returns : |
0 on success, -1 on error |
int im_affinei_all (VipsImage *in,VipsImage *out,VipsInterpolate *interpolate,double a,double b,double c,double d,double dx,double dy);
As im_affinei(), but the entire image is output.
See also: im_affinei(), VipsInterpolate.
|
input image |
|
output image |
|
interpolation method |
|
transformation matrix |
|
transformation matrix |
|
transformation matrix |
|
transformation matrix |
|
output offset |
|
output offset |
Returns : |
0 on success, -1 on error |
int im_match_linear (VipsImage *ref,VipsImage *sec,VipsImage *out,int xr1,int yr1,int xs1,int ys1,int xr2,int yr2,int xs2,int ys2);
Scale, rotate and translate sec so that the tie-points line up.
See also: im_match_linear_search().
|
reference image |
|
secondary image |
|
output image |
|
first reference tie-point |
|
first reference tie-point |
|
first secondary tie-point |
|
first secondary tie-point |
|
second reference tie-point |
|
second reference tie-point |
|
second secondary tie-point |
|
second secondary tie-point |
Returns : |
0 on success, -1 on error |
int im_match_linear_search (VipsImage *ref,VipsImage *sec,VipsImage *out,int xr1,int yr1,int xs1,int ys1,int xr2,int yr2,int xs2,int ys2,int hwindowsize,int hsearchsize);
Scale, rotate and translate sec so that the tie-points line up.
Before performing the transformation, the tie-points are improved by
searching an area of sec of size hsearchsize for a
match of size hwindowsize to ref.
This function will only work well for small rotates and scales.
See also: im_match_linear().
|
reference image |
|
secondary image |
|
output image |
|
first reference tie-point |
|
first reference tie-point |
|
first secondary tie-point |
|
first secondary tie-point |
|
second reference tie-point |
|
second reference tie-point |
|
second secondary tie-point |
|
second secondary tie-point |
|
half window size |
|
half search size |
Returns : |
0 on success, -1 on error |
int im_rightshift_size (VipsImage *in,VipsImage *out,int xshift,int yshift,int band_fmt);
Shrink in by a pair of power-of-two factors, shifting to give
output of the specified band format. This is faster than im_shrink().
See also: im_shrink(), im_affinei().
|
input image |
|
output image |
|
horizontal shrink |
|
vertical shrink |
|
output format |
Returns : |
0 on success, -1 on error |
int im_shrink (VipsImage *in,VipsImage *out,double xshrink,double yshrink);
Shrink in by a pair of factors with a simple box filter.
You will get aliasing for non-integer shrinks. In this case, shrink with
this function to the nearest integer size above the target shrink, then
downsample to the exact size with im_affinei() and your choice of
interpolator.
im_rightshift_size() is faster for factors which are integer powers of two.
See also: im_rightshift_size(), im_affinei().
|
input image |
|
output image |
|
horizontal shrink |
|
vertical shrink |
Returns : |
0 on success, -1 on error |