From 6cc135dcc75f0b0e743921968eb88419ecf60cd7 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 3 Nov 2009 11:09:11 +0000 Subject: [PATCH] stuff --- doc/reference/libvips-docs.sgml.in | 2 + libvips/include/vips/Makefile.am | 2 + libvips/include/vips/convolution.h | 87 ++++++++++++++++++++++++ libvips/include/vips/mask.h | 102 +++++++++++++++++++++++++++++ libvips/include/vips/proto.h | 77 ---------------------- libvips/include/vips/vips.h | 23 +------ 6 files changed, 195 insertions(+), 98 deletions(-) create mode 100644 libvips/include/vips/convolution.h create mode 100644 libvips/include/vips/mask.h diff --git a/doc/reference/libvips-docs.sgml.in b/doc/reference/libvips-docs.sgml.in index 110d67fa..dde02293 100644 --- a/doc/reference/libvips-docs.sgml.in +++ b/doc/reference/libvips-docs.sgml.in @@ -41,6 +41,8 @@ VIPS operation API by section (no gtkdoc comments yet) + + diff --git a/libvips/include/vips/Makefile.am b/libvips/include/vips/Makefile.am index 94d4b0b4..8523213a 100644 --- a/libvips/include/vips/Makefile.am +++ b/libvips/include/vips/Makefile.am @@ -19,6 +19,8 @@ pkginclude_HEADERS = \ image.h \ vips \ conversion.h \ + convolution.h \ + mask.h \ rect.h \ region.h \ generate.h \ diff --git a/libvips/include/vips/convolution.h b/libvips/include/vips/convolution.h new file mode 100644 index 00000000..269d6adf --- /dev/null +++ b/libvips/include/vips/convolution.h @@ -0,0 +1,87 @@ +/* convolution.h + * + * 20/9/09 + * - from proto.h + */ + +/* + + 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_CONVOLUTION_H +#define IM_CONVOLUTION_H + +#ifdef __cplusplus +extern "C" { +#endif /*__cplusplus*/ + +int im_rank( IMAGE *in, IMAGE *out, int width, int height, int rank ); +int im_rank_image( IMAGE **in, IMAGE *out, int n, int index ); +int im_rank_raw( IMAGE *in, IMAGE *out, int xsize, int ysize, int n ); +int im_zerox( IMAGE *, IMAGE *, int ); + +int im_sharpen( IMAGE *, IMAGE *, int, double, double, double, double, double ); +int im_addgnoise( IMAGE *, IMAGE *, double ); +int im_gaussnoise( IMAGE *, int, int, double, double ); + +int im_maxvalue( IMAGE **in, IMAGE *out, int n ); +int im_compass( IMAGE *, IMAGE *, INTMASK * ); +int im_gradient( IMAGE *, IMAGE *, INTMASK * ); +int im_lindetect( IMAGE *, IMAGE *, INTMASK * ); +int im_conv( IMAGE *, IMAGE *, INTMASK * ); +int im_conv_raw( IMAGE *, IMAGE *, INTMASK * ); +int im_convf( IMAGE *, IMAGE *, DOUBLEMASK * ); +int im_convf_raw( IMAGE *, IMAGE *, DOUBLEMASK * ); +int im_convsep( IMAGE *, IMAGE *, INTMASK * ); +int im_convsep_raw( IMAGE *, IMAGE *, INTMASK * ); +int im_convsepf( IMAGE *, IMAGE *, DOUBLEMASK * ); +int im_convsepf_raw( IMAGE *, IMAGE *, DOUBLEMASK * ); +int im_convsub( IMAGE *, IMAGE *, INTMASK *, int, int ); + +int im_grad_x( IMAGE *in, IMAGE *out ); +int im_grad_y( IMAGE *in, IMAGE *out ); + +int im_phasecor_fft( IMAGE *in1, IMAGE *in2, IMAGE *out ); +int im_fastcor( IMAGE *, IMAGE *, IMAGE * ); +int im_fastcor_raw( IMAGE *, IMAGE *, IMAGE * ); +int im_spcor( IMAGE *, IMAGE *, IMAGE * ); +int im_spcor_raw( IMAGE *, IMAGE *, IMAGE * ); +int im_gradcor( IMAGE *, IMAGE *, IMAGE * ); +int im_gradcor_raw( IMAGE *, IMAGE *, IMAGE * ); +int im_contrast_surface( IMAGE *, IMAGE *, int, int ); +int im_contrast_surface_raw( IMAGE *, IMAGE *, int, int ); + +int im_resize_linear( IMAGE *, IMAGE *, int, int ); +int im_mpercent( IMAGE *, double, int * ); +int im_embed( IMAGE *, IMAGE *, int, int, int, int, int ); + +int im_stretch3( IMAGE *in, IMAGE *out, double dx, double dy ); +int im_shrink( IMAGE *, IMAGE *, double, double ); + +#ifdef __cplusplus +} +#endif /*__cplusplus*/ + +#endif /*IM_CONVOLUTION_H*/ diff --git a/libvips/include/vips/mask.h b/libvips/include/vips/mask.h new file mode 100644 index 00000000..1d194954 --- /dev/null +++ b/libvips/include/vips/mask.h @@ -0,0 +1,102 @@ +/* convolution.h + * + * 20/9/09 + * - from proto.h + */ + +/* + + 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_MASK_H +#define IM_MASK_H + +#ifdef __cplusplus +extern "C" { +#endif /*__cplusplus*/ + +typedef struct im__INTMASK { + int xsize; + int ysize; + int scale; + int offset; + int *coeff; + char *filename; +} INTMASK ; + +typedef struct im__DOUBLEMASK { + int xsize; + int ysize; + double scale; + double offset; + double *coeff; + char *filename; +} DOUBLEMASK ; + +void im_copy_dmask_matrix( DOUBLEMASK *mask, double **matrix ); +void im_copy_matrix_dmask( double **matrix, DOUBLEMASK *mask ); + +INTMASK *im_create_imask( const char *name, int width, int height ); +INTMASK *im_create_imaskv( const char *name, int width, int height, ... ); +DOUBLEMASK *im_create_dmask( const char *name, int width, int height ); +DOUBLEMASK *im_create_dmaskv( const char *name, int width, int height, ... ); + +INTMASK *im_log_imask( const char *name, double, double ); +DOUBLEMASK *im_log_dmask( const char *name, double, double ); +INTMASK *im_gauss_imask( const char *name, double, double ); +INTMASK *im_gauss_imask_sep( const char *name, double, double ); +DOUBLEMASK *im_gauss_dmask( const char *name, double, double ); + +INTMASK *im_dup_imask( INTMASK *m, const char *name ); +DOUBLEMASK *im_dup_dmask( DOUBLEMASK *m, const char *name ); + +int im_free_imask( INTMASK *m ); +int im_free_dmask( DOUBLEMASK *m ); + +INTMASK *im_read_imask( const char *filename ); +DOUBLEMASK *im_read_dmask( const char *filename ); + +void im_print_imask( INTMASK *m ); +void im_print_dmask( DOUBLEMASK *m ); + +int im_write_imask( INTMASK *m ); +int im_write_dmask( DOUBLEMASK *m ); +int im_write_imask_name( INTMASK *m, const char *filename ); +int im_write_dmask_name( DOUBLEMASK *m, const char *filename ); + +INTMASK *im_scale_dmask( DOUBLEMASK *m, const char *name ); +void im_norm_dmask( DOUBLEMASK *mask ); +int *im_offsets45( int ); +int *im_offsets90( int ); +INTMASK *im_rotate_imask90( INTMASK *m, const char *name ); +INTMASK *im_rotate_imask45( INTMASK *m, const char *name ); +DOUBLEMASK *im_rotate_dmask90( DOUBLEMASK *m, const char *name ); +DOUBLEMASK *im_rotate_dmask45( DOUBLEMASK *m, const char *name ); + +#ifdef __cplusplus +} +#endif /*__cplusplus*/ + +#endif /*IM_MASK_H*/ diff --git a/libvips/include/vips/proto.h b/libvips/include/vips/proto.h index 803c2d4a..34f1b5f1 100644 --- a/libvips/include/vips/proto.h +++ b/libvips/include/vips/proto.h @@ -73,83 +73,6 @@ int im_erode_raw( IMAGE *in, IMAGE *out, INTMASK *m ); int im_cntlines( IMAGE *im, double *nolines, int flag ); int im_profile( IMAGE *in, IMAGE *out, int dir ); -/* convolution - */ -void im_copy_dmask_matrix( DOUBLEMASK *mask, double **matrix ); -void im_copy_matrix_dmask( double **matrix, DOUBLEMASK *mask ); -INTMASK *im_create_imask( const char *, int, int ); -INTMASK *im_create_imaskv( const char *, int, int, ... ); -DOUBLEMASK *im_create_dmask( const char *, int, int ); -DOUBLEMASK *im_create_dmaskv( const char *, int, int, ... ); -INTMASK *im_dup_imask( INTMASK *, const char * ); -DOUBLEMASK *im_dup_dmask( DOUBLEMASK *, const char * ); -int im_free_imask( INTMASK * ); -int im_free_dmask( DOUBLEMASK * ); -INTMASK *im_read_imask( const char * ); -DOUBLEMASK *im_read_dmask( const char * ); -void im_print_imask( INTMASK * ); -void im_print_dmask( DOUBLEMASK * ); -int im_write_imask( INTMASK * ); -int im_write_dmask( DOUBLEMASK * ); -int im_write_imask_name( INTMASK *, const char * ); -int im_write_dmask_name( DOUBLEMASK *, const char * ); -INTMASK *im_scale_dmask( DOUBLEMASK *, const char * ); -void im_norm_dmask( DOUBLEMASK *mask ); -int *im_offsets45( int ); -int *im_offsets90( int ); -INTMASK *im_rotate_imask90( INTMASK *, const char * ); -INTMASK *im_rotate_imask45( INTMASK *, const char * ); -DOUBLEMASK *im_rotate_dmask90( DOUBLEMASK *, const char * ); -DOUBLEMASK *im_rotate_dmask45( DOUBLEMASK *, const char * ); -INTMASK *im_log_imask( const char *, double, double ); -DOUBLEMASK *im_log_dmask( const char *, double, double ); -INTMASK *im_gauss_imask( const char *, double, double ); -INTMASK *im_gauss_imask_sep( const char *, double, double ); -DOUBLEMASK *im_gauss_dmask( const char *, double, double ); - -int im_rank( IMAGE *, IMAGE *, int, int, int ); -int im_sharpen( IMAGE *, IMAGE *, int, double, double, double, double, double ); -int im_addgnoise( IMAGE *, IMAGE *, double ); -int im_gaussnoise( IMAGE *, int, int, double, double ); - -int im_zerox( IMAGE *, IMAGE *, int ); - -int im_maxvalue( IMAGE **in, IMAGE *out, int n ); -int im_rank_image( IMAGE **in, IMAGE *out, int n, int index ); -int im_compass( IMAGE *, IMAGE *, INTMASK * ); -int im_gradient( IMAGE *, IMAGE *, INTMASK * ); -int im_lindetect( IMAGE *, IMAGE *, INTMASK * ); -int im_conv( IMAGE *, IMAGE *, INTMASK * ); -int im_conv_raw( IMAGE *, IMAGE *, INTMASK * ); -int im_convf( IMAGE *, IMAGE *, DOUBLEMASK * ); -int im_convf_raw( IMAGE *, IMAGE *, DOUBLEMASK * ); -int im_convsep( IMAGE *, IMAGE *, INTMASK * ); -int im_convsep_raw( IMAGE *, IMAGE *, INTMASK * ); -int im_convsepf( IMAGE *, IMAGE *, DOUBLEMASK * ); -int im_convsepf_raw( IMAGE *, IMAGE *, DOUBLEMASK * ); -int im_convsub( IMAGE *, IMAGE *, INTMASK *, int, int ); - -int im_grad_x( IMAGE *in, IMAGE *out ); -int im_grad_y( IMAGE *in, IMAGE *out ); - -int im_phasecor_fft( IMAGE *in1, IMAGE *in2, IMAGE *out ); -int im_fastcor( IMAGE *, IMAGE *, IMAGE * ); -int im_fastcor_raw( IMAGE *, IMAGE *, IMAGE * ); -int im_spcor( IMAGE *, IMAGE *, IMAGE * ); -int im_spcor_raw( IMAGE *, IMAGE *, IMAGE * ); -int im_gradcor( IMAGE *, IMAGE *, IMAGE * ); -int im_gradcor_raw( IMAGE *, IMAGE *, IMAGE * ); -int im_contrast_surface( IMAGE *, IMAGE *, int, int ); -int im_contrast_surface_raw( IMAGE *, IMAGE *, int, int ); - -int im_resize_linear( IMAGE *, IMAGE *, int, int ); -int im_mpercent( IMAGE *, double, int * ); -int im_shrink( IMAGE *, IMAGE *, double, double ); -int im_embed( IMAGE *, IMAGE *, int, int, int, int, int ); - -int im_stretch3( IMAGE *in, IMAGE *out, double dx, double dy ); -int im_rank_raw( IMAGE *in, IMAGE *out, int xsize, int ysize, int n ); - /* freq_filt */ int im_fractsurf( IMAGE *out, int size, double frd ); diff --git a/libvips/include/vips/vips.h b/libvips/include/vips/vips.h index 30d33baa..59d5ef6b 100644 --- a/libvips/include/vips/vips.h +++ b/libvips/include/vips/vips.h @@ -101,27 +101,7 @@ extern "C" { #include -/* Argh, these horrible things must go :( - */ - -typedef struct im__INTMASK { - int xsize; - int ysize; - int scale; - int offset; - int *coeff; - char *filename; -} INTMASK ; - -typedef struct im__DOUBLEMASK { - int xsize; - int ysize; - double scale; - double offset; - double *coeff; - char *filename; -} DOUBLEMASK ; - +#include #include #include #include @@ -145,6 +125,7 @@ typedef struct im__DOUBLEMASK { #include #include #include +#include #include #include