diff --git a/include/vips/Makefile.am b/include/vips/Makefile.am index 0db88828..05b60712 100644 --- a/include/vips/Makefile.am +++ b/include/vips/Makefile.am @@ -11,6 +11,7 @@ pkginclude_HEADERS = \ format.h \ fmask.h \ mosaic.h \ + vinterpolate.h \ proto.h \ rect.h \ region.h \ diff --git a/include/vips/interpolate.h b/include/vips/interpolate.h deleted file mode 100644 index 124c4492..00000000 --- a/include/vips/interpolate.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Various interpolators. - * - * J.Cupitt, 15/10/08 - */ - -/* - - This file is part of VIPS. - - VIPS is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - */ - -/* - - These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk - - */ - -#ifndef IM_INTERPOLATE_H -#define IM_INTERPOLATE_H - -#ifdef __cplusplus -extern "C" { -#endif /*__cplusplus*/ - -#define TYPE_MODEL (model_get_type()) -#define MODEL( obj ) \ - (G_TYPE_CHECK_INSTANCE_CAST( (obj), TYPE_MODEL, Model )) -#define MODEL_CLASS( klass ) \ - (G_TYPE_CHECK_CLASS_CAST( (klass), TYPE_MODEL, ModelClass)) -#define IS_MODEL( obj ) \ - (G_TYPE_CHECK_INSTANCE_TYPE( (obj), TYPE_MODEL )) -#define IS_MODEL_CLASS( klass ) \ - (G_TYPE_CHECK_CLASS_TYPE( (klass), TYPE_MODEL )) -#define MODEL_GET_CLASS( obj ) \ - (G_TYPE_INSTANCE_GET_CLASS( (obj), TYPE_MODEL, ModelClass )) - -struct _Model { - iContainer parent; - - /* My instance vars. - */ -}; - -typedef struct _ModelClass { - iContainerClass parent_class; - -} ModelClass; - - -#ifdef __cplusplus -} -#endif /*__cplusplus*/ - -#endif /*IM_REGION_H*/ - diff --git a/include/vips/vinterpolate.h b/include/vips/vinterpolate.h new file mode 100644 index 00000000..2e2d0595 --- /dev/null +++ b/include/vips/vinterpolate.h @@ -0,0 +1,107 @@ +/* Various interpolators. + * + * J.Cupitt, 15/10/08 + */ + +/* + + This file is part of VIPS. + + VIPS is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + */ + +/* + + These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +#ifndef IM_VINTERPOLATE_H +#define IM_VINTERPOLATE_H + +#ifdef __cplusplus +extern "C" { +#endif /*__cplusplus*/ + +#define TYPE_VINTERPOLATE (vinterpolate_get_type()) +#define VINTERPOLATE( obj ) \ + (G_TYPE_CHECK_INSTANCE_CAST( (obj), TYPE_VINTERPOLATE, VInterpolate )) +#define VINTERPOLATE_CLASS( klass ) \ + (G_TYPE_CHECK_CLASS_CAST( (klass), \ + TYPE_VINTERPOLATE, VInterpolateClass)) +#define IS_VINTERPOLATE( obj ) \ + (G_TYPE_CHECK_INSTANCE_TYPE( (obj), TYPE_VINTERPOLATE )) +#define IS_VINTERPOLATE_CLASS( klass ) \ + (G_TYPE_CHECK_CLASS_TYPE( (klass), TYPE_VINTERPOLATE )) +#define VINTERPOLATE_GET_CLASS( obj ) \ + (G_TYPE_INSTANCE_GET_CLASS( (obj), \ + TYPE_VINTERPOLATE, VInterpolateClass )) + +typedef struct _VInterpolate { + VObject parent; + +} VInterpolate; + +typedef struct _VInterpolateClass { + VObjectClass parent_class; + + /* Write to pixel out(x,y), interpolating from in(x,y). The caller has + * to set the regions up. + */ + void (*interpolate)( VInterpolate *, REGION *out, REGION *in, + int out_x, int out_y, double in_x, double in_y ); + + /* This interpolator needs a window of pixels this big. + */ + int window; + +} VInterpolateClass; + +#define TYPE_VINTERPOLATE_YAFR (vinterpolate_yafr_get_type()) +#define VINTERPOLATE_YAFR( obj ) \ + (G_TYPE_CHECK_INSTANCE_CAST( (obj), TYPE_VINTERPOLATE_YAFR, VInterpolateYafr )) +#define VINTERPOLATE_YAFR_CLASS( klass ) \ + (G_TYPE_CHECK_CLASS_CAST( (klass), \ + TYPE_VINTERPOLATE_YAFR, VInterpolateYafrClass)) +#define IS_VINTERPOLATE_YAFR( obj ) \ + (G_TYPE_CHECK_INSTANCE_TYPE( (obj), TYPE_VINTERPOLATE_YAFR )) +#define IS_VINTERPOLATE_YAFR_CLASS( klass ) \ + (G_TYPE_CHECK_CLASS_TYPE( (klass), TYPE_VINTERPOLATE_YAFR )) +#define VINTERPOLATE_YAFR_GET_CLASS( obj ) \ + (G_TYPE_INSTANCE_GET_CLASS( (obj), \ + TYPE_VINTERPOLATE_YAFR, VInterpolateYafrClass )) + +typedef struct _VInterpolateYafr { + VObject parent; + +} VInterpolateYafr; + +typedef struct _VInterpolateYafrClass { + VObjectClass parent_class; + +} VInterpolateYafrClass; + +VInterpolate *vinterpolate_bilinear_new( void ); + +VInterpolateYafr *vinterpolate_yafr_new( void ); +void vinterpolate_yafr_set_thing( VInterpolateYafr *, double thing ); + +#ifdef __cplusplus +} +#endif /*__cplusplus*/ + +#endif /*IM_VINTERPOLATE_H*/ + diff --git a/include/vips/vips.h b/include/vips/vips.h index cb679cea..e236bc16 100644 --- a/include/vips/vips.h +++ b/include/vips/vips.h @@ -96,6 +96,7 @@ extern "C" { #include #include + #include #include @@ -498,6 +499,7 @@ typedef struct { #include #include #include +#include #include #include #include diff --git a/libsrc/mosaicing/Makefile.am b/libsrc/mosaicing/Makefile.am index 7ebc4c2c..eaf9280a 100644 --- a/libsrc/mosaicing/Makefile.am +++ b/libsrc/mosaicing/Makefile.am @@ -11,6 +11,7 @@ libmosaicing_la_SOURCES = \ im_avgdxdy.c \ im_chkpair.c \ im_clinear.c \ + vinterpolate.c \ im_improve.c \ im_initialize.c \ im_lrcalcon.c \ diff --git a/libsrc/mosaicing/im_interpolate.c b/libsrc/mosaicing/vinterpolate.c similarity index 93% rename from libsrc/mosaicing/im_interpolate.c rename to libsrc/mosaicing/vinterpolate.c index 76996a44..a29763d5 100644 --- a/libsrc/mosaicing/im_interpolate.c +++ b/libsrc/mosaicing/vinterpolate.c @@ -39,10 +39,6 @@ #include #include -#include -#include -#include -#include #include #include