libvips/man/VipsInterpolate.3

101 lines
2.6 KiB
Groff
Raw Normal View History

2009-03-29 23:20:48 +02:00
.TH VIPS_INTERPOLATE 3 "28 March 2009"
.SH NAME
VipsInterpolate,
vips_interpolate,
vips_interpolate_get_method,
vips_interpolate_get_window_size
\-
base class for VIPS interpolators
.SH SYNOPSIS
#include <vips/vips.h>
typedef void (*VipsInterpolateMethod)( VipsInterpolate *,
.br
PEL *out, REGION *in, double x, double y );
typedef struct _VipsInterpolateClass {
.br
VipsObjectClass parent_class;
VipsInterpolateMethod interpolate;
.br
int (*get_window_size)( VipsInterpolate * );
.br
int window_size;
.br
} VipsInterpolateClass;
void vips_interpolate( VipsInterpolate *interpolate,
.br
PEL *out, REGION *in, double x, double y );
.br
VipsInterpolateMethod vips_interpolate_get_method( VipsInterpolate * );
.br
int vips_interpolate_get_window_size( VipsInterpolate *interpolate );
2009-03-30 22:35:34 +02:00
VipsInterpolate *vips_interpolate_nearest_static( void );
.br
VipsInterpolate *vips_interpolate_bilinear_static( void );
.br
VipsInterpolate *vips_interpolate_bicubic_static( void );
VipsInterpolate *vips_interpolate_new( const char *nickname );
2009-03-29 23:20:48 +02:00
.SH DESCRIPTION
.B VipsInterpolate
is the base class for VIPS interpolators. It provides a simple framework that
subclasses use to implement the various interpolators that VIPS ships with.
You can add new interpolators by subclassing
2009-03-30 15:34:50 +02:00
.B VipsInterpolated
and implementing an
.B interpolate
method.
2009-03-29 23:20:48 +02:00
You can use any interpolator in your code via the methods of
.B VipsInterpolate.
.B vips_interpolate(3)
2009-03-30 15:34:50 +02:00
looks up the interpolate method for the object and calls it for you.
.B vips_interpolate_get_method(3)
just does the lookup and returns a pointer to the interpolate function. You
can use this to take the lookup out of an inner loop.
2009-03-29 23:20:48 +02:00
2009-03-30 15:34:50 +02:00
.B vips_interpolate_get_window_size(3)
either calls
.B get_window_size()
or if it is NULL, returns
.B window_size.
2009-03-29 23:20:48 +02:00
2009-03-30 22:35:34 +02:00
.B vips_interpolate_nearest_static(3),
.B vips_interpolate_bilinear_static(3)
and
.B vips_interpolate_bicubic_static(3)
are convenience functions which return a pointer to a static instance of a
nearest-neighbour, bilinear and bicubic interpolator. You can pass these to
any function which needs a
.B VipsInterpolator
as an argument. No need to free the result.
.B vips_interpolate_new(3)
is a convenience function which makes an interpolator from a nickname. Free
the result with
.B g_object_unref(3)
when you're done with it.
2009-03-29 23:20:48 +02:00
.SH SUPPORTED INTERPOLATORS
2009-03-30 15:34:50 +02:00
You can list the supported interpolators with
$ vips --list classes
look for subclasses of
.B VipsInterpolate.
2009-03-29 23:20:48 +02:00
.SH RETURN VALUE
Unless otherwise noted, functions return 0 success and -1 on error.
.SH SEE ALSO
2009-03-30 15:34:50 +02:00
VipsObject(3), VipsInterpolate(3),
vips_type_find(3), vips(1).
2009-03-29 23:20:48 +02:00
.SH AUTHOR
John Cupitt