![]() |
![]() |
![]() |
VIPS Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <vips/vips.h> int vips_affine (VipsImage *in
,VipsImage **out
,double a
,double b
,double c
,double d
,...
); int vips_quadratic (VipsImage *in
,VipsImage **out
,VipsImage *coeff
,...
); int vips_shrink (VipsImage *in
,VipsImage **out
,double xshrink
,double yshrink
,...
);
Resample an image in various ways, using a VipsInterpolator to generate intermediate values.
int vips_affine (VipsImage *in
,VipsImage **out
,double a
,double b
,double c
,double d
,...
);
Optional arguments:
interpolate
: interpolate pixels with this
oarea
: output rectangle
idx
: input horizontal offset
idy
: input vertical offset
odx
: output horizontal offset
ody
: output vertical offset
This operator performs an affine transform on an image using interpolate
.
The transform is:
X = a
* (x + idx
) + b
* (y + idy
) + odx
Y = c
* (x + idx
) + d
* (y + idy
) + doy
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 oarea
is written to
out
. oarea
is a four-element int array of left, top, width, height.
By default oarea
is just large enough to cover the whole of the
transformed input image.
interpolate
defaults to bilinear.
idx
, idy
, odx
, ody
default to zero.
See also: vips_shrink()
, VipsInterpolate.
|
input image |
|
output image |
|
transformation matrix coefficient |
|
transformation matrix coefficient |
|
transformation matrix coefficient |
|
transformation matrix coefficient |
Returns : |
0 on success, -1 on error |
int vips_quadratic (VipsImage *in
,VipsImage **out
,VipsImage *coeff
,...
);
Optional arguments:
interpolate
: use this interpolator (default bilinear)
See also: im_affinei()
.
|
input image |
|
output image |
|
horizontal quadratic |
Returns : |
0 on success, -1 on error |
int vips_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 vips_affine()
and your choice of
interpolator.
See also: vips_affine()
.
|
input image |
|
output image |
|
horizontal shrink |
|
vertical shrink |
Returns : |
0 on success, -1 on error |