This commit is contained in:
John Cupitt 2009-11-04 17:20:23 +00:00
parent 64eaeeb6c3
commit 8200afcbb6
19 changed files with 164 additions and 94 deletions

4
TODO
View File

@ -2,6 +2,10 @@
avg is different? used to 120.134, now 120.151
- segment should be in morph
- insertplaceset should be with insert in conversion
- _raw() variants should be deprecated?
- look through more sections for stuff in the wrong place

View File

@ -53,11 +53,11 @@
<xi:include href="xml/other.xml"/>
<xi:include href="xml/video.xml"/>
<xi:include href="xml/cimg_funcs.xml"/>
<xi:include href="xml/interpolate.xml"/>
</chapter>
<chapter>
<title>Other API (no gtkdoc comments yet)</title>
<xi:include href="xml/interpolate.xml"/>
<xi:include href="xml/object.xml"/>
<xi:include href="xml/transform.xml"/>
<xi:include href="xml/util.xml"/>

View File

@ -41,7 +41,7 @@
#include <math.h>
#include <vips/vips.h>
#include <vips/vips.h>
#include <vips/internal.h>
#ifdef WITH_DMALLOC
#include <dmalloc.h>

View File

@ -9,6 +9,7 @@ libdeprecated_la_SOURCES = \
im_printlines.c \
im_convsub.c \
im_line.c \
im_resize_linear.c \
im_debugim.c \
im_gfadd.c \
im_setbox.c \

View File

@ -723,9 +723,41 @@ static im_function line_desc = {
line_args /* Arg list */
};
/* Args for im_resize_linear.
*/
static im_arg_desc resize_linear_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_INT( "X" ),
IM_INPUT_INT( "Y" )
};
/* Call im_resize_linear via arg vector.
*/
static int
resize_linear_vec( im_object *argv )
{
int X = *((int *) argv[2]);
int Y = *((int *) argv[3]);
return( im_resize_linear( argv[0], argv[1], X, Y ) );
}
/* Description of im_resize_linear.
*/
static im_function resize_linear_desc = {
"im_resize_linear", /* Name */
"resize to X by Y pixels with linear interpolation",
0, /* Flags */
resize_linear_vec, /* Dispatch function */
IM_NUMBER( resize_linear_args ), /* Size of arg list */
resize_linear_args /* Arg list */
};
/* Package up all these functions.
*/
static im_function *deprecated_list[] = {
&resize_linear_desc,
&cmulnorm_desc,
&remainderconst_vec_desc,
&fav4_desc,

View File

@ -347,6 +347,8 @@ int im_convsub( IMAGE *in, IMAGE *out, INTMASK *mask, int xskip, int yskip );
int im_bernd( const char *tiffname, int x, int y, int w, int h );
int im_resize_linear( IMAGE *, IMAGE *, int, int );
int im_line( IMAGE *, int, int, int, int, int );
#ifdef __cplusplus

View File

@ -226,6 +226,25 @@ void imb_Lab2LabQ( float *, PEL *, int );
void imb_LabS2Lab( signed short *, float *, int );
void imb_Lab2LabS( float *, signed short *, int n );
void im_copy_dmask_matrix( DOUBLEMASK *mask, double **matrix );
void im_copy_matrix_dmask( double **matrix, DOUBLEMASK *mask );
int *im_ivector();
float *im_fvector();
double *im_dvector();
void im_free_ivector();
void im_free_fvector();
void im_free_dvector();
int **im_imat_alloc();
float **im_fmat_alloc();
double **im_dmat_alloc();
void im_free_imat();
void im_free_fmat();
void im_free_dmat();
int im_invmat( double **, int );
#ifdef __cplusplus
}
#endif /*__cplusplus*/

View File

@ -55,26 +55,11 @@ typedef struct im__DOUBLEMASK {
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 );
@ -86,40 +71,38 @@ 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 );
int im_free_imask( INTMASK *m );
int im_free_dmask( DOUBLEMASK *m );
DOUBLEMASK *im_mattrn( DOUBLEMASK *, const char * );
DOUBLEMASK *im_matcat( DOUBLEMASK *, DOUBLEMASK *, const char * );
DOUBLEMASK *im_matmul( DOUBLEMASK *, DOUBLEMASK *, const char * );
INTMASK *im_log_imask( const char *filename, double sigma, double min_ampl );
DOUBLEMASK *im_log_dmask( const char *filename, double sigma, double min_ampl );
INTMASK *im_gauss_imask( const char *filename, double sigma, double min_ampl );
INTMASK *im_gauss_imask_sep( const char *filename,
double sigma, double min_ampl );
DOUBLEMASK *im_gauss_dmask( const char *filename,
double sigma, double min_ampl );
INTMASK *im_dup_imask( INTMASK *m, const char *name );
DOUBLEMASK *im_dup_dmask( DOUBLEMASK *m, const char *name );
INTMASK *im_scale_dmask( DOUBLEMASK *m, const char *filename );
void im_norm_dmask( DOUBLEMASK *mask );
int *im_offsets45( int size );
int *im_offsets90( int size );
INTMASK *im_rotate_imask90( INTMASK *m, const char *filename );
INTMASK *im_rotate_imask45( INTMASK *m, const char *filename );
DOUBLEMASK *im_rotate_dmask90( DOUBLEMASK *m, const char *filename );
DOUBLEMASK *im_rotate_dmask45( DOUBLEMASK *m, const char *filename );
DOUBLEMASK *im_mattrn( DOUBLEMASK *in, const char *name );
DOUBLEMASK *im_matcat( DOUBLEMASK *in1, DOUBLEMASK *in2, const char *name );
DOUBLEMASK *im_matmul( DOUBLEMASK *in1, DOUBLEMASK *in2, const char *name );
DOUBLEMASK *im_lu_decomp( const DOUBLEMASK *mat, const char *name );
int im_lu_solve( const DOUBLEMASK *lu, double *vec );
DOUBLEMASK *im_matinv( const DOUBLEMASK *mat, const char *name );
int im_matinv_inplace( DOUBLEMASK *mat );
int *im_ivector();
float *im_fvector();
double *im_dvector();
void im_free_ivector();
void im_free_fvector();
void im_free_dvector();
int **im_imat_alloc();
float **im_fmat_alloc();
double **im_dmat_alloc();
void im_free_imat();
void im_free_fmat();
void im_free_dmat();
int im_invmat( double **, int );
#ifdef __cplusplus
}
#endif /*__cplusplus*/

View File

@ -42,14 +42,13 @@ int im_dilate_raw( IMAGE *in, IMAGE *out, INTMASK *m );
int im_erode( IMAGE *in, IMAGE *out, INTMASK *m );
int im_erode_raw( IMAGE *in, IMAGE *out, INTMASK *m );
int im_rank( IMAGE *in, IMAGE *out, int width, int height, int rank );
int im_rank_raw( IMAGE *in, IMAGE *out, int xsize, int ysize, int n );
int im_rank( IMAGE *in, IMAGE *out, int xsize, int ysize, int order );
int im_rank_raw( IMAGE *in, IMAGE *out, int xsize, int ysize, int order );
int im_rank_image( IMAGE **in, IMAGE *out, int n, int index );
int im_maxvalue( IMAGE **in, IMAGE *out, int n );
int im_cntlines( IMAGE *im, double *nolines, int flag );
int im_zerox( IMAGE *, IMAGE *, int );
int im_zerox( IMAGE *in, IMAGE *out, int flag );
int im_profile( IMAGE *in, IMAGE *out, int dir );
#ifdef __cplusplus

View File

@ -37,6 +37,18 @@
extern "C" {
#endif /*__cplusplus*/
int im_affinei( IMAGE *in, IMAGE *out,
VipsInterpolate *interpolate,
double a, double b, double c, double d, double dx, double dy,
int ox, int oy, int ow, int oh );
int im_affinei_all( IMAGE *in, IMAGE *out, VipsInterpolate *interpolate,
double a, double b, double c, double d, double dx, double dy ) ;
int im_stretch3( IMAGE *in, IMAGE *out, double dx, double dy );
int im_shrink( IMAGE *in, IMAGE *out, double xshrink, double yshrink );
int im_rightshift_size( IMAGE *in, IMAGE *out, int xshift, int yshift, int band_fmt );
int im_match_linear( IMAGE *ref, IMAGE *sec, IMAGE *out,
int xr1, int yr1, int xs1, int ys1,
int xr2, int yr2, int xs2, int ys2 );
@ -45,19 +57,6 @@ int im_match_linear_search( IMAGE *ref, IMAGE *sec, IMAGE *out,
int xr2, int yr2, int xs2, int ys2,
int hwindowsize, int hsearchsize );
int im_affinei( IMAGE *in, IMAGE *out,
VipsInterpolate *interpolate,
double a, double b, double c, double d, double dx, double dy,
int ox, int oy, int ow, int oh );
int im_affinei_all( IMAGE *in, IMAGE *out, VipsInterpolate *interpolate,
double a, double b, double c, double d, double dx, double dy ) ;
int im_resize_linear( IMAGE *, IMAGE *, int, int );
int im_stretch3( IMAGE *in, IMAGE *out, double dx, double dy );
int im_shrink( IMAGE *, IMAGE *, double, double );
int im_rightshift_size( IMAGE *in, IMAGE *out, int xshift, int yshift, int band_fmt );
#ifdef __cplusplus
}
#endif /*__cplusplus*/

View File

@ -42,6 +42,19 @@
#include <dmalloc.h>
#endif /*WITH_DMALLOC*/
/**
* SECTION: mask
* @short_description: load, save and process mask (matrix) objects
* @stability: Stable
* @include: vips/vips.h
*
* These operations load, save and process mask objects. Masks are used as
* paramaters to convolution and morphology operators, and to represent
* matrices.
*
* This API is horrible and clunky. Surely it will be replaced soon.
*/
/* One matrix in, one out.
*/
static im_arg_desc one_in_one_out[] = {

View File

@ -42,6 +42,17 @@
#include <dmalloc.h>
#endif /*WITH_DMALLOC*/
/**
* SECTION: morphology
* @short_description: morphological operators, rank filters and related image
* analysis
* @see_also: <link linkend="libvips-boolean">boolean</link>
* @stability: Stable
* @include: vips/vips.h
*
* Erode, dilate, rank, count lines, number regions, etc.
*/
/* Args to im_profile.
*/
static im_arg_desc profile_args[] = {

View File

@ -56,6 +56,7 @@
#include <math.h>
#include <vips/vips.h>
#include <vips/internal.h>
#include "mosaic.h"

View File

@ -46,6 +46,16 @@
#include <dmalloc.h>
#endif /*WITH_DMALLOC*/
/**
* SECTION: mosaicing
* @short_description: build image mosaics
* @stability: Stable
* @include: vips/vips.h
*
* A set of operations for assembling large image mosaics.
*
*/
/* Merge args.
*/
static im_arg_desc merge_args[] = {

View File

@ -42,6 +42,16 @@
#include <dmalloc.h>
#endif /*WITH_DMALLOC*/
/**
* SECTION: other
* @short_description: miscellaneous operators
* @stability: Stable
* @include: vips/vips.h
*
* Various small things.
*
*/
/* Args for im_eye.
*/
static im_arg_desc eye_args[] = {

View File

@ -5,7 +5,6 @@ libresample_la_SOURCES = \
bicubic.cpp \
interpolate.c \
yafrsmooth.cpp \
im_resize_linear.c \
im_shrink.c \
im_stretch3.c \
im_rightshift_size.c \

View File

@ -48,6 +48,15 @@
#include <dmalloc.h>
#endif /*WITH_DMALLOC*/
/**
* SECTION: interpolate
* @short_description: shrink, expand, rotate with a choice of interpolators
* @stability: Stable
* @include: vips/vips.h
*
* A number of image interpolators.
*/
/*
* FAST_PSEUDO_FLOOR is a floor and floorf replacement which has been
* found to be faster on several linux boxes than the library

View File

@ -44,6 +44,16 @@
#include <dmalloc.h>
#endif /*WITH_DMALLOC*/
/**
* SECTION: resample
* @short_description: shrink, expand, rotate with a choice of interpolators
* @stability: Stable
* @include: vips/vips.h
*
* Resample an image in various ways, using a #VipsInterpolator to generate
* intermediate values.
*/
/* Args to im_rightshift_size.
*/
static im_arg_desc rightshift_size_args[] = {
@ -202,37 +212,6 @@ static im_function shrink_desc = {
shrink_args /* Arg list */
};
/* Args for im_resize_linear.
*/
static im_arg_desc resize_linear_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_INT( "X" ),
IM_INPUT_INT( "Y" )
};
/* Call im_resize_linear via arg vector.
*/
static int
resize_linear_vec( im_object *argv )
{
int X = *((int *) argv[2]);
int Y = *((int *) argv[3]);
return( im_resize_linear( argv[0], argv[1], X, Y ) );
}
/* Description of im_resize_linear.
*/
static im_function resize_linear_desc = {
"im_resize_linear", /* Name */
"resize to X by Y pixels with linear interpolation",
0, /* Flags */
resize_linear_vec, /* Dispatch function */
IM_NUMBER( resize_linear_args ), /* Size of arg list */
resize_linear_args /* Arg list */
};
/* Args to im_stretch3.
*/
static im_arg_desc stretch3_args[] = {
@ -267,7 +246,6 @@ static im_function stretch3_desc = {
/* Package up all these functions.
*/
static im_function *resample_list[] = {
&resize_linear_desc,
&rightshift_size_desc,
&shrink_desc,
&stretch3_desc,