![]() |
![]() |
![]() |
VIPS Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <vips/vips.h> int im_grey (VipsImage *out
,const int xsize
,const int ysize
); int im_fgrey (VipsImage *out
,const int xsize
,const int ysize
); int im_make_xy (VipsImage *out
,const int xsize
,const int ysize
); int im_feye (VipsImage *out
,const int xsize
,const int ysize
,const double factor
); int im_eye (VipsImage *out
,const int xsize
,const int ysize
,const double factor
); int im_zone (VipsImage *out
,int size
); int im_fzone (VipsImage *out
,int size
); int im_sines (VipsImage *out
,int xsize
,int ysize
,double horfreq
,double verfreq
); int im_benchmarkn (VipsImage *in
,VipsImage *out
,int n
); int im_benchmark2 (VipsImage *in
,double *out
);
These functions generate various test images. You can combine them with the arithmetic and rotate functions to build more complicated images.
The im_benchmark()
operations are for testing the VIPS SMP system.
int im_grey (VipsImage *out
,const int xsize
,const int ysize
);
Create a one-band uchar image with the left-most column zero and the right-most 255. Intermediate pixels are a linear ramp.
See also: im_fgrey()
, im_make_xy()
, im_identity()
.
|
output image |
|
image size |
|
image size |
Returns : |
0 on success, -1 on error |
int im_fgrey (VipsImage *out
,const int xsize
,const int ysize
);
Create a one-band float image with the left-most column zero and the right-most 1. Intermediate pixels are a linear ramp.
See also: im_grey()
, im_make_xy()
, im_identity()
.
|
output image |
|
image size |
|
image size |
Returns : |
0 on success, -1 on error |
int im_make_xy (VipsImage *out
,const int xsize
,const int ysize
);
Create a two-band uint32 image where the elements in the first band have the value of their x coordinate and elements in the second band have their y coordinate.
You can make any image where the value of a pixel is a function of its (x, y) coordinate by combining this operator with the arithmetic operators.
See also: im_grey()
, im_identity()
.
|
output image |
|
image size |
|
image size |
Returns : |
0 on success, -1 on error |
int im_feye (VipsImage *out
,const int xsize
,const int ysize
,const double factor
);
Create a test pattern with increasing spatial frequence in X and
amplitude in Y. factor
should be between 0 and 1 and determines the
maximum spatial frequency.
Creates an one band float image with values in +1 to -1.
See also: im_eye()
.
|
output image |
|
image size |
|
image size |
|
image size |
Returns : |
0 on success, -1 on error |
int im_eye (VipsImage *out
,const int xsize
,const int ysize
,const double factor
);
Exactly as im_feye()
, but make a UCHAR image with pixels in the range [0,
255].
See also: im_feye()
.
|
output image |
|
image size |
|
image size |
|
image size |
Returns : |
0 on success, -1 on error |
int im_zone (VipsImage *out
,int size
);
Create a one-band uchar image of size size
by size
pixels of a zone
plate. Pixels are in [0, 255].
See also: im_grey()
, im_make_xy()
, im_identity()
.
|
output image |
|
image size |
Returns : |
0 on success, -1 on error |
int im_fzone (VipsImage *out
,int size
);
Create a one-band float image of size size
by size
pixels of a zone
plate. Pixels are in [-1, +1].
See also: im_grey()
, im_make_xy()
, im_identity()
.
|
output image |
|
image size |
Returns : |
0 on success, -1 on error |
int im_sines (VipsImage *out
,int xsize
,int ysize
,double horfreq
,double verfreq
);
im_sines()
creates a float one band image of the a sine waveform in two
dimensions.
The number of horizontal and vertical spatial frequencies are
determined by the variables horfreq
and verfreq
respectively. The
function is useful for creating displayable sine waves and
square waves in two dimensions.
If horfreq and verfreq are integers the resultant image is periodical and therfore the Fourier transform doesnot present spikes
See also: im_grey()
, im_make_xy()
.
|
output image |
|
image size |
|
image size |
|
horizontal frequency |
|
vertical frequency |
Returns : |
0 on success, -1 on error |
int im_benchmarkn (VipsImage *in
,VipsImage *out
,int n
);
This operation runs a complicated set of other operations on image in
,
producing image out
. Use n
to set the number of iterations to run: a
larger number will make the operation more CPU-bound, a smaller number will
make the operation more IO-bound.
See http://www.vips.ecs.soton.ac.uk/index.php?title=Benchmarks for a detailed discussion of the benchmark and some sample results.
See also: im_benchmark2()
.
|
input image |
|
output image |
|
iterations |
Returns : |
0 on success, -1 on error |
int im_benchmark2 (VipsImage *in
,double *out
);
This operation runs a single im_benchmarkn()
and calculates the average
pixel value. It's useful if you just want to test image input.
See also: im_benchmarkn()
.
|
input image |
|
average image value |
Returns : |
0 on success, -1 on error |