This commit is contained in:
John Cupitt 2009-11-03 19:03:47 +00:00
parent 6cc135dcc7
commit 42b73f0dc8
49 changed files with 1268 additions and 1083 deletions

4
TODO
View File

@ -2,6 +2,10 @@
avg is different? used to 120.134, now 120.151
- mask isn't showing up in docs?
- _raw() variants should be deprecated?
- more stuff from util.c? too much to do it all now
- maybe im_insertplaceset() should be im_insertset()? it's not an inplace

View File

@ -515,7 +515,7 @@ AC_OUTPUT([
libvips/histograms_lut/Makefile
libvips/inplace/Makefile
libvips/iofuncs/Makefile
libvips/matrix/Makefile
libvips/mask/Makefile
libvips/morphology/Makefile
libvips/mosaicing/Makefile
libvips/other/Makefile

View File

@ -59,7 +59,7 @@ EXTRA_HFILES=
# Header files to ignore when scanning. Use base file name, no paths
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
IGNORE_HFILES=merge.h debug.h internal.h intl.h CImg.h im_video_v4l1.h global_balance.h dbh.h base64.h templates.h mosaic.h deprecated.h thread.h private.h internal.h almostdeprecated.h fmask.h inlines.h struct.h disp.h
IGNORE_HFILES=merge.h debug.h internal.h intl.h CImg.h im_video_v4l1.h global_balance.h dbh.h base64.h templates.h mosaic.h deprecated.h thread.h private.h internal.h almostdeprecated.h inlines.h struct.h disp.h
# Images to copy into HTML directory.
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png

View File

@ -9,9 +9,9 @@
<title>VIPS Reference Manual</title>
<releaseinfo>
for VIPS @IM_VERSION@
The latest version of this documentation can be found on-line at
The latest version of this documentation can be found on the
<ulink role="online-location"
url="http://http://www.vips.ecs.soton.ac.uk/index.php?title=Documentation">http://www.vips.ecs.soton.ac.uk/index.php?title=Documentation</ulink>.
url="http://http://www.vips.ecs.soton.ac.uk/index.php?title=Documentation">VIPS website</ulink>.
</releaseinfo>
</bookinfo>
@ -42,6 +42,10 @@
<title>VIPS operation API by section (no gtkdoc comments yet)</title>
<xi:include href="xml/conversion.xml"/>
<xi:include href="xml/convolution.xml"/>
<xi:include href="xml/morphology.xml"/>
<xi:include href="xml/resample.xml"/>
<xi:include href="xml/histograms_lut.xml"/>
<xi:include href="xml/freq_filt.xml"/>
<xi:include href="xml/mask.xml"/>
</chapter>

View File

@ -25,7 +25,7 @@ SUBDIRS = \
histograms_lut \
inplace \
iofuncs \
matrix \
mask \
morphology \
mosaicing \
other \
@ -53,7 +53,7 @@ libvips_la_LIBADD = \
histograms_lut/libhistograms_lut.la \
inplace/libinplace.la \
iofuncs/libiofuncs.la \
matrix/libmatrix.la \
mask/libmask.la \
morphology/libmorphology.la \
mosaicing/libmosaicing.la \
other/libother.la \

View File

@ -18,6 +18,7 @@ libconversion_la_SOURCES = \
im_fliphor.c \
im_flipver.c \
im_gbandjoin.c \
im_embed.c \
im_insert.c \
im_lrjoin.c \
im_mask2vips.c \

View File

@ -1321,6 +1321,42 @@ static im_function wrap_desc = {
wrap_args /* Arg list */
};
/* Args for im_embed.
*/
static im_arg_desc embed_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_INT( "type" ),
IM_INPUT_INT( "x" ),
IM_INPUT_INT( "y" ),
IM_INPUT_INT( "w" ),
IM_INPUT_INT( "h" )
};
/* Call im_embed via arg vector.
*/
static int
embed_vec( im_object *argv )
{
int type = *((int *) argv[2]);
int x = *((int *) argv[3]);
int y = *((int *) argv[4]);
int w = *((int *) argv[5]);
int h = *((int *) argv[6]);
return( im_embed( argv[0], argv[1], type, x, y, w, h ) );
}
/* Description of im_embed.
*/
static im_function embed_desc = {
"im_embed", /* Name */
"embed in within a set of borders",
IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */
embed_vec, /* Dispatch function */
IM_NUMBER( embed_args ), /* Size of arg list */
embed_args /* Arg list */
};
/* Package up all these functions.
*/
@ -1353,6 +1389,7 @@ static im_function *conv_list[] = {
&grid_desc,
&insert_desc,
&insert_noexpand_desc,
&embed_desc,
&lrjoin_desc,
&mask2vips_desc,
&msb_desc,

View File

@ -1,8 +1,6 @@
noinst_LTLIBRARIES = libconvolution.la
libconvolution_la_SOURCES = \
rotmask.c \
rw_mask.c \
convol_dispatch.c \
im_addgnoise.c \
im_compass.c \
@ -12,21 +10,10 @@ libconvolution_la_SOURCES = \
im_convsepf.c \
im_convsub.c \
im_contrast_surface.c \
im_embed.c \
im_fastcor.c \
im_gaussmasks.c \
im_gaussnoise.c \
im_gradcor.c \
im_logmasks.c \
im_rank_image.c \
im_mpercent.c \
im_phasecor_fft.c \
im_rank.c \
im_resize_linear.c \
im_sharpen.c \
im_shrink.c \
im_spcor.c \
im_stretch3.c \
im_zerox.c
im_spcor.c
INCLUDES = -I${top_srcdir}/libvips/include @VIPS_CFLAGS@ @VIPS_INCLUDES@

View File

@ -57,37 +57,6 @@ static im_arg_desc two_in_one_out[] = {
IM_OUTPUT_IMAGE( "out" )
};
/* Args to im_stretch3.
*/
static im_arg_desc stretch3_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_DOUBLE( "xdisp" ),
IM_INPUT_DOUBLE( "ydisp" )
};
/* Call im_stretch3 via arg vector.
*/
static int
stretch3_vec( im_object *argv )
{
double xdisp = *((int *) argv[2]);
double ydisp = *((int *) argv[3]);
return( im_stretch3( argv[0], argv[1], xdisp, ydisp ) );
}
/* Description of im_stretch3.
*/
static im_function stretch3_desc = {
"im_stretch3", /* Name */
"stretch 3%, sub-pixel displace by xdisp/ydisp",
IM_FN_PIO, /* Flags */
stretch3_vec, /* Dispatch function */
IM_NUMBER( stretch3_args ), /* Size of arg list */
stretch3_args /* Arg list */
};
/* Args to im_contrast_surface.
*/
static im_arg_desc contrast_surface_args[] = {
@ -152,81 +121,6 @@ static im_function contrast_surface_raw_desc = {
contrast_surface_raw_args /* Arg list */
};
/* Call im_phasecor_fft via arg vector.
*/
static int
phasecor_fft_vec( im_object *argv )
{
return( im_phasecor_fft( argv[0], argv[1], argv[2] ) );
}
/* Description of im_phasecor_fft.
*/
static im_function phasecor_fft_desc = {
"im_phasecor_fft", /* Name */
"non-normalised correlation of gradient of in2 within in1",
IM_FN_TRANSFORM, /* Flags */
phasecor_fft_vec, /* Dispatch function */
IM_NUMBER( two_in_one_out ), /* Size of arg list */
two_in_one_out /* Arg list */
};
/* Args to im_rank.
*/
static im_arg_desc rank_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_INT( "xsize" ),
IM_INPUT_INT( "ysize" ),
IM_INPUT_INT( "n" )
};
/* Call im_rank via arg vector.
*/
static int
rank_vec( im_object *argv )
{
int xsize = *((int *) argv[2]);
int ysize = *((int *) argv[3]);
int n = *((int *) argv[4]);
return( im_rank( argv[0], argv[1], xsize, ysize, n ) );
}
/* Description of im_rank.
*/
static im_function rank_desc = {
"im_rank", /* Name */
"rank filter nth element of xsize/ysize window",
IM_FN_PIO, /* Flags */
rank_vec, /* Dispatch function */
IM_NUMBER( rank_args ), /* Size of arg list */
rank_args /* Arg list */
};
/* Call im_rank_raw via arg vector.
*/
static int
rank_raw_vec( im_object *argv )
{
int xsize = *((int *) argv[2]);
int ysize = *((int *) argv[3]);
int n = *((int *) argv[4]);
return( im_rank_raw( argv[0], argv[1], xsize, ysize, n ) );
}
/* Description of im_rank_raw.
*/
static im_function rank_raw_desc = {
"im_rank_raw", /* Name */
"rank filter nth element of xsize/ysize window, no border",
IM_FN_PIO, /* Flags */
rank_raw_vec, /* Dispatch function */
IM_NUMBER( rank_args ), /* Size of arg list */
rank_args /* Arg list */
};
/* Args to im_sharpen.
*/
static im_arg_desc sharpen_args[] = {
@ -295,37 +189,6 @@ static im_function addgnoise_desc = {
addgnoise_args /* Arg list */
};
/* Args for im_read_dmask()
*/
static im_arg_desc read_dmask_args[] = {
IM_INPUT_STRING( "filename" ),
IM_OUTPUT_DMASK( "mask" )
};
/* Call im_read_dmask via arg vector.
*/
static int
read_dmask_vec( im_object *argv )
{
im_mask_object *mo = argv[1];
if( !(mo->mask = im_read_dmask( argv[0] )) )
return( -1 );
return( 0 );
}
/* Description of im_read_dmask().
*/
static im_function read_dmask_desc = {
"im_read_dmask", /* Name */
"read matrix of double from file",
0, /* Flags */
read_dmask_vec, /* Dispatch function */
IM_NUMBER( read_dmask_args ), /* Size of arg list */
read_dmask_args /* Arg list */
};
/* Args for convolver with imask.
*/
static im_arg_desc conv_imask[] = {
@ -602,103 +465,6 @@ static im_function fastcor_raw_desc = {
two_in_one_out /* Arg list */
};
/* Args for im_gauss_dmask.
*/
static im_arg_desc gauss_dmask_args[] = {
IM_OUTPUT_DMASK( "mask" ),
IM_INPUT_DOUBLE( "sigma" ),
IM_INPUT_DOUBLE( "min_amp" )
};
/* Call im_gauss_dmask via arg vector.
*/
static int
gauss_dmask_vec( im_object *argv )
{
im_mask_object *mo = argv[0];
double sigma = *((double *) argv[1]);
double min_amp = *((double *) argv[2]);
if( !(mo->mask =
im_gauss_dmask( mo->name, sigma, min_amp )) )
return( -1 );
return( 0 );
}
/* Description of im_gauss_dmask.
*/
static im_function gauss_dmask_desc = {
"im_gauss_dmask", /* Name */
"generate gaussian DOUBLEMASK",
0, /* Flags */
gauss_dmask_vec, /* Dispatch function */
IM_NUMBER( gauss_dmask_args ), /* Size of arg list */
gauss_dmask_args /* Arg list */
};
/* Args for im_gauss_imask.
*/
static im_arg_desc gauss_imask_args[] = {
IM_OUTPUT_IMASK( "mask" ),
IM_INPUT_DOUBLE( "sigma" ),
IM_INPUT_DOUBLE( "min_amp" )
};
/* Call im_gauss_imask via arg vector.
*/
static int
gauss_imask_vec( im_object *argv )
{
im_mask_object *mo = argv[0];
double sigma = *((double *) argv[1]);
double min_amp = *((double *) argv[2]);
if( !(mo->mask =
im_gauss_imask( mo->name, sigma, min_amp )) )
return( -1 );
return( 0 );
}
/* Description of im_gauss_imask.
*/
static im_function gauss_imask_desc = {
"im_gauss_imask", /* Name */
"generate gaussian INTMASK",
0, /* Flags */
gauss_imask_vec, /* Dispatch function */
IM_NUMBER( gauss_imask_args ), /* Size of arg list */
gauss_imask_args /* Arg list */
};
/* Call im_gauss_imask_sep via arg vector.
*/
static int
gauss_imask_sep_vec( im_object *argv )
{
im_mask_object *mo = argv[0];
double sigma = *((double *) argv[1]);
double min_amp = *((double *) argv[2]);
if( !(mo->mask =
im_gauss_imask_sep( mo->name, sigma, min_amp )) )
return( -1 );
return( 0 );
}
/* Description of im_gauss_imask_sep.
*/
static im_function gauss_imask_sep_desc = {
"im_gauss_imask_sep", /* Name */
"generate separable gaussian INTMASK",
0, /* Flags */
gauss_imask_sep_vec, /* Dispatch function */
IM_NUMBER( gauss_imask_args ), /* Size of arg list */
gauss_imask_args /* Arg list */
};
/* Args for im_gaussnoise.
*/
static im_arg_desc gaussnoise_args[] = {
@ -854,167 +620,6 @@ static im_function lindetect_desc = {
conv_imask /* Arg list */
};
/* Args for im_log_imask.
*/
static im_arg_desc log_imask_args[] = {
IM_OUTPUT_IMASK( "mask" ),
IM_INPUT_DOUBLE( "sigma" ),
IM_INPUT_DOUBLE( "min_amp" )
};
/* Call im_log_imask via arg vector.
*/
static int
log_imask_vec( im_object *argv )
{
im_mask_object *mo = argv[0];
double sigma = *((double *) argv[1]);
double min_amp = *((double *) argv[2]);
if( !(mo->mask =
im_log_imask( mo->name, sigma, min_amp )) )
return( -1 );
return( 0 );
}
/* Description of im_log_imask.
*/
static im_function log_imask_desc = {
"im_log_imask", /* Name */
"generate laplacian of gaussian INTMASK",
0, /* Flags */
log_imask_vec, /* Dispatch function */
IM_NUMBER( log_imask_args ), /* Size of arg list */
log_imask_args /* Arg list */
};
/* Args for im_log_dmask.
*/
static im_arg_desc log_dmask_args[] = {
IM_OUTPUT_DMASK( "maskfile" ),
IM_INPUT_DOUBLE( "sigma" ),
IM_INPUT_DOUBLE( "min_amp" )
};
/* Call im_log_dmask via arg vector.
*/
static int
log_dmask_vec( im_object *argv )
{
im_mask_object *mo = argv[0];
double sigma = *((double *) argv[1]);
double min_amp = *((double *) argv[2]);
if( !(mo->mask =
im_log_dmask( mo->name, sigma, min_amp )) )
return( -1 );
return( 0 );
}
/* Description of im_log_dmask.
*/
static im_function log_dmask_desc = {
"im_log_dmask", /* Name */
"generate laplacian of gaussian DOUBLEMASK",
0, /* Flags */
log_dmask_vec, /* Dispatch function */
IM_NUMBER( log_dmask_args ), /* Size of arg list */
log_dmask_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 for im_mpercent.
*/
static im_arg_desc mpercent_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_INPUT_DOUBLE( "percent" ),
IM_OUTPUT_INT( "thresh" )
};
/* Call im_mpercent via arg vector.
*/
static int
mpercent_vec( im_object *argv )
{
double percent = *((double *) argv[1]);
return( im_mpercent( argv[0], percent, argv[2] ) );
}
/* Description of im_mpercent.
*/
static im_function mpercent_desc = {
"im_mpercent", /* Name */
"find threshold above which there are percent values",
0, /* Flags */
mpercent_vec, /* Dispatch function */
IM_NUMBER( mpercent_args ), /* Size of arg list */
mpercent_args /* Arg list */
};
/* Args for im_shrink.
*/
static im_arg_desc shrink_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_DOUBLE( "xfac" ),
IM_INPUT_DOUBLE( "yfac" )
};
/* Call im_shrink via arg vector.
*/
static int
shrink_vec( im_object *argv )
{
double xshrink = *((double *) argv[2]);
double yshrink = *((double *) argv[3]);
return( im_shrink( argv[0], argv[1], xshrink, yshrink ) );
}
/* Description of im_shrink.
*/
static im_function shrink_desc = {
"im_shrink", /* Name */
"shrink image by xfac, yfac times",
IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */
shrink_vec, /* Dispatch function */
IM_NUMBER( shrink_args ), /* Size of arg list */
shrink_args /* Arg list */
};
/* Call im_spcor via arg vector.
*/
static int
@ -1053,304 +658,6 @@ static im_function spcor_raw_desc = {
two_in_one_out /* Arg list */
};
/* Args for im_zerox.
*/
static im_arg_desc zerox_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_INT( "flag" )
};
/* Call im_zerox via arg vector.
*/
static int
zerox_vec( im_object *argv )
{
int flag = *((int *) argv[2]);
return( im_zerox( argv[0], argv[1], flag ) );
}
/* Description of im_zerox.
*/
static im_function zerox_desc = {
"im_zerox", /* Name */
"find +ve or -ve zero crossings in image",
IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */
zerox_vec, /* Dispatch function */
IM_NUMBER( zerox_args ), /* Size of arg list */
zerox_args /* Arg list */
};
/* Args for im_embed.
*/
static im_arg_desc embed_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_INT( "type" ),
IM_INPUT_INT( "x" ),
IM_INPUT_INT( "y" ),
IM_INPUT_INT( "w" ),
IM_INPUT_INT( "h" )
};
/* Call im_embed via arg vector.
*/
static int
embed_vec( im_object *argv )
{
int type = *((int *) argv[2]);
int x = *((int *) argv[3]);
int y = *((int *) argv[4]);
int w = *((int *) argv[5]);
int h = *((int *) argv[6]);
return( im_embed( argv[0], argv[1], type, x, y, w, h ) );
}
/* Description of im_embed.
*/
static im_function embed_desc = {
"im_embed", /* Name */
"embed in within a set of borders",
IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */
embed_vec, /* Dispatch function */
IM_NUMBER( embed_args ), /* Size of arg list */
embed_args /* Arg list */
};
/* Mask functions!
*/
static im_arg_desc imask_args[] = {
IM_INPUT_IMASK( "in" ),
IM_OUTPUT_IMASK( "out" )
};
static im_arg_desc dmask_args[] = {
IM_INPUT_DMASK( "in" ),
IM_OUTPUT_DMASK( "out" )
};
/* Call im_rotate_imask45 via arg vector.
*/
static int
rotate_imask45_vec( im_object *argv )
{
im_mask_object *min = argv[0];
im_mask_object *mout = argv[1];
if( !(mout->mask = im_rotate_imask45( min->mask, mout->name )) )
return( -1 );
return( 0 );
}
/* Description of im_rotate_imask45.
*/
static im_function rotate_imask45_desc = {
"im_rotate_imask45", /* Name */
"rotate INTMASK clockwise by 45 degrees",
0, /* Flags */
rotate_imask45_vec, /* Dispatch function */
IM_NUMBER( imask_args ), /* Size of arg list */
imask_args /* Arg list */
};
/* Call im_rotate_imask90 via arg vector.
*/
static int
rotate_imask90_vec( im_object *argv )
{
im_mask_object *min = argv[0];
im_mask_object *mout = argv[1];
if( !(mout->mask = im_rotate_imask90( min->mask, mout->name )) )
return( -1 );
return( 0 );
}
/* Description of im_rotate_imask90.
*/
static im_function rotate_imask90_desc = {
"im_rotate_imask90", /* Name */
"rotate INTMASK clockwise by 90 degrees",
0, /* Flags */
rotate_imask90_vec, /* Dispatch function */
IM_NUMBER( imask_args ), /* Size of arg list */
imask_args /* Arg list */
};
/* Call im_rotate_dmask45 via arg vector.
*/
static int
rotate_dmask45_vec( im_object *argv )
{
im_mask_object *min = argv[0];
im_mask_object *mout = argv[1];
if( !(mout->mask = im_rotate_dmask45( min->mask, mout->name )) )
return( -1 );
return( 0 );
}
/* Description of im_rotate_dmask45.
*/
static im_function rotate_dmask45_desc = {
"im_rotate_dmask45", /* Name */
"rotate DOUBLEMASK clockwise by 45 degrees",
0, /* Flags */
rotate_dmask45_vec, /* Dispatch function */
IM_NUMBER( dmask_args ), /* Size of arg list */
dmask_args /* Arg list */
};
/* Call im_rotate_dmask90 via arg vector.
*/
static int
rotate_dmask90_vec( im_object *argv )
{
im_mask_object *min = argv[0];
im_mask_object *mout = argv[1];
if( !(mout->mask = im_rotate_dmask90( min->mask, mout->name )) )
return( -1 );
return( 0 );
}
/* Description of im_rotate_dmask90.
*/
static im_function rotate_dmask90_desc = {
"im_rotate_dmask90", /* Name */
"rotate DOUBLEMASK clockwise by 90 degrees",
0, /* Flags */
rotate_dmask90_vec, /* Dispatch function */
IM_NUMBER( dmask_args ), /* Size of arg list */
dmask_args /* Arg list */
};
static im_arg_desc maxvalue_args[] = {
IM_INPUT_IMAGEVEC( "in" ),
IM_OUTPUT_IMAGE( "out" )
};
static int
maxvalue_vec( im_object *argv )
{
im_imagevec_object *iv = (im_imagevec_object *) argv[0];
return( im_maxvalue( iv->vec, argv[1], iv->n ) );
}
static im_function maxvalue_desc = {
"im_maxvalue", /* Name */
"point-wise maximum value", /* Description */
IM_FN_PIO, /* Flags */
maxvalue_vec, /* Dispatch function */
IM_NUMBER( maxvalue_args ), /* Size of arg list */
maxvalue_args /* Arg list */
};
static im_arg_desc rank_image_args[] = {
IM_INPUT_IMAGEVEC( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_INT( "index" )
};
static int
rank_image_vec( im_object *argv )
{
im_imagevec_object *iv = (im_imagevec_object *) argv[0];
int index = *((int *) argv[2]);
return( im_rank_image( iv->vec, argv[1], iv->n, index ) );
}
static im_function rank_image_desc = {
"im_rank_image", /* Name */
"point-wise pixel rank", /* Description */
IM_FN_PIO, /* Flags */
rank_image_vec, /* Dispatch function */
IM_NUMBER( rank_image_args ), /* Size of arg list */
rank_image_args /* Arg list */
};
static int
imask_xsize_vec( im_object *argv )
{
*( (int*) argv[1] )= ( (INTMASK*) ( ( (im_mask_object*) argv[0] )-> mask ) )-> xsize;
return 0;
}
static int
imask_ysize_vec( im_object *argv )
{
*( (int*) argv[1] )= ( (INTMASK*) ( ( (im_mask_object*) argv[0] )-> mask ) )-> ysize;
return 0;
}
static int
dmask_xsize_vec( im_object *argv )
{
*( (int*) argv[1] )= ( (DOUBLEMASK*) ( ( (im_mask_object*) argv[0] )-> mask ) )-> xsize;
return 0;
}
static int
dmask_ysize_vec( im_object *argv )
{
*( (int*) argv[1] )= ( (DOUBLEMASK*) ( ( (im_mask_object*) argv[0] )-> mask ) )-> ysize;
return 0;
}
static im_arg_desc imask_size_args[] = {
IM_INPUT_IMASK( "mask" ),
IM_OUTPUT_INT( "size" )
};
static im_arg_desc dmask_size_args[] = {
IM_INPUT_DMASK( "mask" ),
IM_OUTPUT_INT( "size" )
};
static im_function imask_xsize_desc = {
"im_imask_xsize", /* Name */
"horizontal size of an intmask", /* Description */
0, /* Flags */
imask_xsize_vec, /* Dispatch function */
IM_NUMBER( imask_size_args ), /* Size of arg list */
imask_size_args /* Arg list */
};
static im_function imask_ysize_desc = {
"im_imask_ysize", /* Name */
"vertical size of an intmask", /* Description */
0, /* Flags */
imask_ysize_vec, /* Dispatch function */
IM_NUMBER( imask_size_args ), /* Size of arg list */
imask_size_args /* Arg list */
};
static im_function dmask_xsize_desc = {
"im_dmask_xsize", /* Name */
"horizontal size of a doublemask", /* Description */
0, /* Flags */
dmask_xsize_vec, /* Dispatch function */
IM_NUMBER( dmask_size_args ), /* Size of arg list */
dmask_size_args /* Arg list */
};
static im_function dmask_ysize_desc = {
"im_dmask_ysize", /* Name */
"vertical size of a doublemask", /* Description */
0, /* Flags */
dmask_ysize_vec, /* Dispatch function */
IM_NUMBER( dmask_size_args ), /* Size of arg list */
dmask_size_args /* Arg list */
};
/* Package up all these functions.
*/
static im_function *convol_list[] = {
@ -1359,51 +666,26 @@ static im_function *convol_list[] = {
&contrast_surface_desc,
&contrast_surface_raw_desc,
&conv_desc,
&conv_raw_desc,
&convf_desc,
&convf_raw_desc,
&conv_raw_desc,
&convsep_desc,
&convsep_raw_desc,
&convsepf_desc,
&convsepf_raw_desc,
&convsep_raw_desc,
&convsub_desc,
&dmask_xsize_desc,
&dmask_ysize_desc,
&embed_desc,
&fastcor_desc,
&fastcor_raw_desc,
&gauss_dmask_desc,
&gauss_imask_desc,
&gauss_imask_sep_desc,
&gaussnoise_desc,
&grad_x_desc,
&grad_y_desc,
&gradcor_desc,
&gradcor_raw_desc,
&gradient_desc,
&imask_xsize_desc,
&imask_ysize_desc,
&rank_image_desc,
&grad_x_desc,
&grad_y_desc,
&lindetect_desc,
&log_dmask_desc,
&log_imask_desc,
&maxvalue_desc,
&mpercent_desc,
&phasecor_fft_desc,
&rank_desc,
&rank_raw_desc,
&read_dmask_desc,
&resize_linear_desc,
&rotate_dmask45_desc,
&rotate_dmask90_desc,
&rotate_imask45_desc,
&rotate_imask90_desc,
&sharpen_desc,
&shrink_desc,
&spcor_desc,
&spcor_raw_desc,
&stretch3_desc,
&zerox_desc
&spcor_raw_desc
};
/* Package of functions.

View File

@ -3,6 +3,7 @@ noinst_LTLIBRARIES = libfreq_filt.la
libfreq_filt_la_SOURCES = \
fft_sp.c \
fmask4th.c \
im_phasecor_fft.c \
fmaskcir.c \
freq_dispatch.c \
im_disp_ps.c \

View File

@ -53,6 +53,14 @@ static im_arg_desc one_in_one_out[] = {
IM_OUTPUT_IMAGE( "out" )
};
/* Two images in, one out.
*/
static im_arg_desc two_in_one_out[] = {
IM_INPUT_IMAGE( "in1" ),
IM_INPUT_IMAGE( "in2" ),
IM_OUTPUT_IMAGE( "out" )
};
/* Args to im_create_fmask().
*/
static im_arg_desc create_fmask_args[] = {
@ -288,6 +296,25 @@ static im_function invfftr_desc = {
one_in_one_out /* Arg list */
};
/* Call im_phasecor_fft via arg vector.
*/
static int
phasecor_fft_vec( im_object *argv )
{
return( im_phasecor_fft( argv[0], argv[1], argv[2] ) );
}
/* Description of im_phasecor_fft.
*/
static im_function phasecor_fft_desc = {
"im_phasecor_fft", /* Name */
"non-normalised correlation of gradient of in2 within in1",
IM_FN_TRANSFORM, /* Flags */
phasecor_fft_vec, /* Dispatch function */
IM_NUMBER( two_in_one_out ), /* Size of arg list */
two_in_one_out /* Arg list */
};
/* Package up all these functions.
*/
static im_function *freq_list[] = {
@ -299,6 +326,7 @@ static im_function *freq_list[] = {
&fwfft_desc,
&rotquad_desc,
&invfft_desc,
&phasecor_fft_desc,
&invfftr_desc
};

View File

@ -12,6 +12,7 @@ libhistograms_lut_la_SOURCES = \
im_histindexed.c \
im_histspec.c \
im_hsp.c \
im_mpercent.c \
im_identity.c \
im_invertlut.c \
im_lhisteq.c \

View File

@ -796,6 +796,35 @@ static im_function tone_map_desc = {
tone_map_args /* Arg list */
};
/* Args for im_mpercent.
*/
static im_arg_desc mpercent_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_INPUT_DOUBLE( "percent" ),
IM_OUTPUT_INT( "thresh" )
};
/* Call im_mpercent via arg vector.
*/
static int
mpercent_vec( im_object *argv )
{
double percent = *((double *) argv[1]);
return( im_mpercent( argv[0], percent, argv[2] ) );
}
/* Description of im_mpercent.
*/
static im_function mpercent_desc = {
"im_mpercent", /* Name */
"find threshold above which there are percent values",
0, /* Flags */
mpercent_vec, /* Dispatch function */
IM_NUMBER( mpercent_args ), /* Size of arg list */
mpercent_args /* Arg list */
};
/* Package up all these functions.
*/
static im_function *hist_list[] = {
@ -815,6 +844,7 @@ static im_function *hist_list[] = {
&identity_ushort_desc,
&ismonotonic_desc,
&lhisteq_desc,
&mpercent_desc,
&lhisteq_raw_desc,
&invertlut_desc,
&buildlut_desc,

View File

@ -1,43 +1,47 @@
pkginclude_HEADERS = \
arithmetic.h \
relational.h \
colour.h \
boolean.h \
debug.h \
dispatch.h \
format.h \
header.h \
callback.h \
error.h \
fmask.h \
mosaic.h \
check.h \
interpolate.h \
object.h \
almostdeprecated.h \
proto.h \
image.h \
vips \
arithmetic.h \
boolean.h \
buf.h \
callback.h \
check.h \
colour.h \
conversion.h \
convolution.h \
debug.h \
dispatch.h \
disp.h \
error.h \
fmask.h \
format.h \
generate.h \
header.h \
histograms_lut.h \
freq_filt.h \
image.h \
interpolate.h \
intl.h \
mask.h \
memory.h \
meta.h \
morphology.h \
mosaic.h \
object.h \
private.h \
proto.h \
rect.h \
region.h \
generate.h \
memory.h \
struct.h \
disp.h \
private.h \
relational.h \
resample.h \
semaphore.h \
transform.h \
struct.h \
threadgroup.h \
thread.h \
transform.h \
util.h \
meta.h \
version.h \
vips.h \
intl.h \
buf.h
vips \
vips.h
vipsc++.h:
vips --cpph all > vipsc++.h

View File

@ -66,6 +66,8 @@ int im_extract_bands( IMAGE *in, IMAGE *out, int band, int nbands );
int im_extract_area( IMAGE *in, IMAGE *out, int x, int y, int w, int h );
int im_extract_areabands( IMAGE *in, IMAGE *out,
int left, int top, int width, int height, int band, int nbands );
int im_embed( IMAGE *in, IMAGE *out, int type,
int left, int top, int width, int height );
int im_subsample( IMAGE *in, IMAGE *out, int x, int y );
int im_zoom( IMAGE *in, IMAGE *out, int x, int y );

View File

@ -37,16 +37,10 @@
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 * );
@ -73,13 +67,6 @@ 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*/

View File

@ -0,0 +1,52 @@
/* freq_filt.h
*
* 2/11/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_FREQ_H
#define IM_FREQ_H
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/
int im_fractsurf( IMAGE *out, int size, double frd );
int im_freqflt( IMAGE *, IMAGE *, IMAGE * );
int im_disp_ps( IMAGE *, IMAGE * );
int im_rotquad( IMAGE *, IMAGE * );
int im_fwfft( IMAGE *, IMAGE * );
int im_invfft( IMAGE *, IMAGE * );
int im_invfftr( IMAGE *, IMAGE * );
#ifdef __cplusplus
}
#endif /*__cplusplus*/
#endif /*IM_FREQ_H*/

View File

@ -0,0 +1,81 @@
/* histograms_lut.h
*
* 3/11/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_HIST_H
#define IM_HIST_H
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/
int im_maplut( IMAGE *, IMAGE *, IMAGE * );
int im_gammacorrect( IMAGE *, IMAGE *, double );
int im_heq( IMAGE *in, IMAGE *out, int bandno );
int im_hist( IMAGE *in, IMAGE *out, int bandno );
int im_hist_indexed( IMAGE *index, IMAGE *value, IMAGE *out );
int im_histeq( IMAGE *in, IMAGE *out );
int im_histnorm( IMAGE *in, IMAGE *out );
int im_histcum( IMAGE *in, IMAGE *out );
int im_histgr( IMAGE *in, IMAGE *out, int bandno );
int im_histnD( IMAGE *in, IMAGE *out, int bins );
int im_histplot( IMAGE *hist, IMAGE *histplot );
int im_histspec( IMAGE *hin, IMAGE *href, IMAGE *lut );
int im_hsp( IMAGE *in, IMAGE *ref, IMAGE *out );
int im_identity( IMAGE *lut, int bands );
int im_identity_ushort( IMAGE *lut, int bands, int sz );
int im_lhisteq( IMAGE *in, IMAGE *out, int xwin, int ywin );
int im_lhisteq_raw( IMAGE *in, IMAGE *out, int xwin, int ywin );
int im_invertlut( DOUBLEMASK *input, IMAGE *output, int lut_size );
int im_buildlut( DOUBLEMASK *input, IMAGE *output );
int im_stdif( IMAGE *in, IMAGE *out,
double a, double m0, double b, double s0, int xwin, int ywin );
int im_stdif_raw( IMAGE *in, IMAGE *out,
double a, double m0, double b, double s0, int xwin, int ywin );
int im_tone_build_range( IMAGE *out,
int in_max, int out_max,
double Lb, double Lw, double Ps, double Pm, double Ph,
double S, double M, double H );
int im_tone_build( IMAGE *out,
double Lb, double Lw, double Ps, double Pm, double Ph,
double S, double M, double H );
int im_tone_analyse( IMAGE *in, IMAGE *lut,
double Ps, double Pm, double Ph, double S, double M, double H );
int im_ismonotonic( IMAGE *lut, int *out );
int im_tone_map( IMAGE *in, IMAGE *out, IMAGE *lut );
int im_project( IMAGE *in, IMAGE *hout, IMAGE *vout );
int im_mpercent( IMAGE *, double, int * );
#ifdef __cplusplus
}
#endif /*__cplusplus*/
#endif /*IM_HIST_H*/

View File

@ -1,4 +1,4 @@
/* convolution.h
/* mask.h
*
* 20/9/09
* - from proto.h
@ -37,6 +37,8 @@
extern "C" {
#endif /*__cplusplus*/
int poop( int poop );
typedef struct im__INTMASK {
int xsize;
int ysize;
@ -44,7 +46,7 @@ typedef struct im__INTMASK {
int offset;
int *coeff;
char *filename;
} INTMASK ;
} INTMASK;
typedef struct im__DOUBLEMASK {
int xsize;
@ -53,7 +55,7 @@ typedef struct im__DOUBLEMASK {
double offset;
double *coeff;
char *filename;
} DOUBLEMASK ;
} DOUBLEMASK;
void im_copy_dmask_matrix( DOUBLEMASK *mask, double **matrix );
void im_copy_matrix_dmask( double **matrix, DOUBLEMASK *mask );
@ -95,6 +97,31 @@ 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 );
DOUBLEMASK *im_mattrn( DOUBLEMASK *, const char * );
DOUBLEMASK *im_matcat( DOUBLEMASK *, DOUBLEMASK *, const char * );
DOUBLEMASK *im_matmul( DOUBLEMASK *, DOUBLEMASK *, const char * );
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

@ -0,0 +1,59 @@
/* 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_MORPHOLOGY_H
#define IM_MORPHOLOGY_H
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/
int im_dilate( IMAGE *in, IMAGE *out, INTMASK *m );
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( 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_profile( IMAGE *in, IMAGE *out, int dir );
#ifdef __cplusplus
}
#endif /*__cplusplus*/
#endif /*IM_MORPHOLOGY_H*/

View File

@ -64,25 +64,6 @@ extern "C" {
# endif
#endif /*SWIG*/
/* morphology
*/
int im_dilate( IMAGE *in, IMAGE *out, INTMASK *m );
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_cntlines( IMAGE *im, double *nolines, int flag );
int im_profile( IMAGE *in, IMAGE *out, int dir );
/* freq_filt
*/
int im_fractsurf( IMAGE *out, int size, double frd );
int im_freqflt( IMAGE *, IMAGE *, IMAGE * );
int im_disp_ps( IMAGE *, IMAGE * );
int im_rotquad( IMAGE *, IMAGE * );
int im_fwfft( IMAGE *, IMAGE * );
int im_invfft( IMAGE *, IMAGE * );
int im_invfftr( IMAGE *, IMAGE * );
/* cimg
*/
int im_greyc_mask( IMAGE *in, IMAGE *out, IMAGE *mask,
@ -90,44 +71,6 @@ int im_greyc_mask( IMAGE *in, IMAGE *out, IMAGE *mask,
float alpha, float sigma, float dl, float da, float gauss_prec,
int interpolation, int fast_approx );
/* histogram
*/
int im_maplut( IMAGE *, IMAGE *, IMAGE * );
int im_gammacorrect( IMAGE *, IMAGE *, double );
int im_heq( IMAGE *in, IMAGE *out, int bandno );
int im_hist( IMAGE *in, IMAGE *out, int bandno );
int im_hist_indexed( IMAGE *index, IMAGE *value, IMAGE *out );
int im_histeq( IMAGE *in, IMAGE *out );
int im_histnorm( IMAGE *in, IMAGE *out );
int im_histcum( IMAGE *in, IMAGE *out );
int im_histgr( IMAGE *in, IMAGE *out, int bandno );
int im_histnD( IMAGE *in, IMAGE *out, int bins );
int im_histplot( IMAGE *hist, IMAGE *histplot );
int im_histspec( IMAGE *hin, IMAGE *href, IMAGE *lut );
int im_hsp( IMAGE *in, IMAGE *ref, IMAGE *out );
int im_identity( IMAGE *lut, int bands );
int im_identity_ushort( IMAGE *lut, int bands, int sz );
int im_lhisteq( IMAGE *in, IMAGE *out, int xwin, int ywin );
int im_lhisteq_raw( IMAGE *in, IMAGE *out, int xwin, int ywin );
int im_invertlut( DOUBLEMASK *input, IMAGE *output, int lut_size );
int im_buildlut( DOUBLEMASK *input, IMAGE *output );
int im_stdif( IMAGE *in, IMAGE *out,
double a, double m0, double b, double s0, int xwin, int ywin );
int im_stdif_raw( IMAGE *in, IMAGE *out,
double a, double m0, double b, double s0, int xwin, int ywin );
int im_tone_build_range( IMAGE *out,
int in_max, int out_max,
double Lb, double Lw, double Ps, double Pm, double Ph,
double S, double M, double H );
int im_tone_build( IMAGE *out,
double Lb, double Lw, double Ps, double Pm, double Ph,
double S, double M, double H );
int im_tone_analyse( IMAGE *in, IMAGE *lut,
double Ps, double Pm, double Ph, double S, double M, double H );
int im_ismonotonic( IMAGE *lut, int *out );
int im_tone_map( IMAGE *in, IMAGE *out, IMAGE *lut );
int im_project( IMAGE *in, IMAGE *hout, IMAGE *vout );
/* other
*/
int im_feye( IMAGE *image,
@ -161,8 +104,6 @@ int im_sines( IMAGE *image,
int xsize, int ysize, double horfreq, double verfreq );
int im_spatres( IMAGE *in, IMAGE *out, int step );
int im_rightshift_size( IMAGE *in, IMAGE *out, int xshift, int yshift, int band_fmt );
/* mosaicing
*/
int im_lrmerge( IMAGE *ref, IMAGE *sec, IMAGE *out,
@ -210,20 +151,6 @@ int im_tbmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out,
int im_global_balance( IMAGE *in, IMAGE *out, double gamma );
int im_global_balancef( IMAGE *in, IMAGE *out, double gamma );
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 );
int im_match_linear_search( IMAGE *ref, IMAGE *sec, IMAGE *out,
int xr1, int yr1, int xs1, int ys1,
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_correl( IMAGE *ref, IMAGE *sec,
int xref, int yref, int xsec, int ysec,
int hwindowsize, int hsearchsize,
@ -255,34 +182,6 @@ int im_segment( IMAGE *test, IMAGE *mask, int *segments );
int im_lineset( IMAGE *in, IMAGE *out, IMAGE *mask, IMAGE *ink,
int n, int *x1v, int *y1v, int *x2v, int *y2v );
/* matrix
*/
DOUBLEMASK *im_mattrn( DOUBLEMASK *, const char * );
DOUBLEMASK *im_matcat( DOUBLEMASK *, DOUBLEMASK *, const char * );
DOUBLEMASK *im_matmul( DOUBLEMASK *, DOUBLEMASK *, const char * );
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 );
/* video
*/
int im_video_v4l1( IMAGE *im, const char *device,

View File

@ -0,0 +1,65 @@
/* resample.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_RESAMPLE_H
#define IM_RESAMPLE_H
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/
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 );
int im_match_linear_search( IMAGE *ref, IMAGE *sec, IMAGE *out,
int xr1, int yr1, int xs1, int ys1,
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*/
#endif /*IM_RESAMPLE_H*/

View File

@ -81,14 +81,6 @@
extern "C" {
#endif /*__cplusplus*/
/* If we're not using GNU C, elide __attribute__
*/
#ifndef __GNUC__
# ifndef __attribute__
# define __attribute__(x) /*NOTHING*/
# endif
#endif
#include <glib.h>
#include <gmodule.h>
#include <glib-object.h>
@ -126,6 +118,10 @@ extern "C" {
#include <vips/relational.h>
#include <vips/conversion.h>
#include <vips/convolution.h>
#include <vips/morphology.h>
#include <vips/histograms_lut.h>
#include <vips/freq_filt.h>
#include <vips/resample.h>
#include <vips/colour.h>
#include <vips/disp.h>

View File

@ -71,7 +71,7 @@ extern im_package im__format;
extern im_package im__freq_filt;
extern im_package im__histograms_lut;
extern im_package im__inplace;
extern im_package im__matrix;
extern im_package im__mask;
extern im_package im__morphology;
extern im_package im__mosaicing;
extern im_package im__other;
@ -457,7 +457,7 @@ static im_package *built_in[] = {
&im__histograms_lut,
&im__inplace,
&im__iofuncs,
&im__matrix,
&im__mask,
&im__morphology,
&im__mosaicing,
&im__other,

View File

@ -1,11 +1,15 @@
noinst_LTLIBRARIES = libmatrix.la
noinst_LTLIBRARIES = libmask.la
libmatrix_la_SOURCES = \
libmask_la_SOURCES = \
rotmask.c \
im_gaussmasks.c \
im_logmasks.c \
rw_mask.c \
im_matcat.c \
im_matinv.c \
im_matmul.c \
im_mattrn.c \
matalloc.c \
matrix_dispatch.c
mask_dispatch.c
INCLUDES = -I${top_srcdir}/libvips/include @VIPS_CFLAGS@ @VIPS_INCLUDES@

View File

@ -0,0 +1,577 @@
/* VIPS function dispatch tables for matricies.
*
* J. Cupitt, 14/2/95.
*/
/*
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
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#include <stdio.h>
#include <vips/vips.h>
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif /*WITH_DMALLOC*/
/* One matrix in, one out.
*/
static im_arg_desc one_in_one_out[] = {
IM_INPUT_DMASK( "in" ),
IM_OUTPUT_DMASK( "out" )
};
/* Two matricies in, one out.
*/
static im_arg_desc two_in_one_out[] = {
IM_INPUT_DMASK( "in1" ),
IM_INPUT_DMASK( "in2" ),
IM_OUTPUT_DMASK( "out" )
};
/* Call im_matinv via arg vector.
*/
static int
matinv_vec( im_object *argv )
{
im_mask_object *in = argv[0];
im_mask_object *out = argv[1];
if( !(out->mask =
im_matinv( in->mask, out->name )) )
return( -1 );
return( 0 );
}
/* Description of im_matinv.
*/
static im_function matinv_desc = {
"im_matinv", /* Name */
"invert matrix",
0, /* Flags */
matinv_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_mattrn via arg vector.
*/
static int
mattrn_vec( im_object *argv )
{
im_mask_object *in = argv[0];
im_mask_object *out = argv[1];
if( !(out->mask =
im_mattrn( in->mask, out->name )) )
return( -1 );
return( 0 );
}
/* Description of im_mattrn.
*/
static im_function mattrn_desc = {
"im_mattrn", /* Name */
"transpose matrix",
0, /* Flags */
mattrn_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_matcat via arg vector.
*/
static int
matcat_vec( im_object *argv )
{
im_mask_object *in1 = argv[0];
im_mask_object *in2 = argv[1];
im_mask_object *out = argv[2];
if( !(out->mask =
im_matcat( in1->mask, in2->mask, out->name )) )
return( -1 );
return( 0 );
}
/* Description of im_matcat.
*/
static im_function matcat_desc = {
"im_matcat", /* Name */
"append matrix in2 to the end of matrix in1",
0, /* Flags */
matcat_vec, /* Dispatch function */
IM_NUMBER( two_in_one_out ), /* Size of arg list */
two_in_one_out /* Arg list */
};
/* Call im_matmul via arg vector.
*/
static int
matmul_vec( im_object *argv )
{
im_mask_object *in1 = argv[0];
im_mask_object *in2 = argv[1];
im_mask_object *out = argv[2];
if( !(out->mask =
im_matmul( in1->mask, in2->mask, out->name )) )
return( -1 );
return( 0 );
}
/* Description of im_matmul.
*/
static im_function matmul_desc = {
"im_matmul", /* Name */
"multiply matrix in1 by matrix in2",
0, /* Flags */
matmul_vec, /* Dispatch function */
IM_NUMBER( two_in_one_out ), /* Size of arg list */
two_in_one_out /* Arg list */
};
/* Args for im_read_dmask()
*/
static im_arg_desc read_dmask_args[] = {
IM_INPUT_STRING( "filename" ),
IM_OUTPUT_DMASK( "mask" )
};
/* Call im_read_dmask via arg vector.
*/
static int
read_dmask_vec( im_object *argv )
{
im_mask_object *mo = argv[1];
if( !(mo->mask = im_read_dmask( argv[0] )) )
return( -1 );
return( 0 );
}
/* Description of im_read_dmask().
*/
static im_function read_dmask_desc = {
"im_read_dmask", /* Name */
"read matrix of double from file",
0, /* Flags */
read_dmask_vec, /* Dispatch function */
IM_NUMBER( read_dmask_args ), /* Size of arg list */
read_dmask_args /* Arg list */
};
/* Args for im_gauss_dmask.
*/
static im_arg_desc gauss_dmask_args[] = {
IM_OUTPUT_DMASK( "mask" ),
IM_INPUT_DOUBLE( "sigma" ),
IM_INPUT_DOUBLE( "min_amp" )
};
/* Call im_gauss_dmask via arg vector.
*/
static int
gauss_dmask_vec( im_object *argv )
{
im_mask_object *mo = argv[0];
double sigma = *((double *) argv[1]);
double min_amp = *((double *) argv[2]);
if( !(mo->mask =
im_gauss_dmask( mo->name, sigma, min_amp )) )
return( -1 );
return( 0 );
}
/* Description of im_gauss_dmask.
*/
static im_function gauss_dmask_desc = {
"im_gauss_dmask", /* Name */
"generate gaussian DOUBLEMASK",
0, /* Flags */
gauss_dmask_vec, /* Dispatch function */
IM_NUMBER( gauss_dmask_args ), /* Size of arg list */
gauss_dmask_args /* Arg list */
};
/* Args for im_gauss_imask.
*/
static im_arg_desc gauss_imask_args[] = {
IM_OUTPUT_IMASK( "mask" ),
IM_INPUT_DOUBLE( "sigma" ),
IM_INPUT_DOUBLE( "min_amp" )
};
/* Call im_gauss_imask via arg vector.
*/
static int
gauss_imask_vec( im_object *argv )
{
im_mask_object *mo = argv[0];
double sigma = *((double *) argv[1]);
double min_amp = *((double *) argv[2]);
if( !(mo->mask =
im_gauss_imask( mo->name, sigma, min_amp )) )
return( -1 );
return( 0 );
}
/* Description of im_gauss_imask.
*/
static im_function gauss_imask_desc = {
"im_gauss_imask", /* Name */
"generate gaussian INTMASK",
0, /* Flags */
gauss_imask_vec, /* Dispatch function */
IM_NUMBER( gauss_imask_args ), /* Size of arg list */
gauss_imask_args /* Arg list */
};
/* Call im_gauss_imask_sep via arg vector.
*/
static int
gauss_imask_sep_vec( im_object *argv )
{
im_mask_object *mo = argv[0];
double sigma = *((double *) argv[1]);
double min_amp = *((double *) argv[2]);
if( !(mo->mask =
im_gauss_imask_sep( mo->name, sigma, min_amp )) )
return( -1 );
return( 0 );
}
/* Description of im_gauss_imask_sep.
*/
static im_function gauss_imask_sep_desc = {
"im_gauss_imask_sep", /* Name */
"generate separable gaussian INTMASK",
0, /* Flags */
gauss_imask_sep_vec, /* Dispatch function */
IM_NUMBER( gauss_imask_args ), /* Size of arg list */
gauss_imask_args /* Arg list */
};
/* Args for im_log_imask.
*/
static im_arg_desc log_imask_args[] = {
IM_OUTPUT_IMASK( "mask" ),
IM_INPUT_DOUBLE( "sigma" ),
IM_INPUT_DOUBLE( "min_amp" )
};
/* Call im_log_imask via arg vector.
*/
static int
log_imask_vec( im_object *argv )
{
im_mask_object *mo = argv[0];
double sigma = *((double *) argv[1]);
double min_amp = *((double *) argv[2]);
if( !(mo->mask =
im_log_imask( mo->name, sigma, min_amp )) )
return( -1 );
return( 0 );
}
/* Description of im_log_imask.
*/
static im_function log_imask_desc = {
"im_log_imask", /* Name */
"generate laplacian of gaussian INTMASK",
0, /* Flags */
log_imask_vec, /* Dispatch function */
IM_NUMBER( log_imask_args ), /* Size of arg list */
log_imask_args /* Arg list */
};
/* Args for im_log_dmask.
*/
static im_arg_desc log_dmask_args[] = {
IM_OUTPUT_DMASK( "maskfile" ),
IM_INPUT_DOUBLE( "sigma" ),
IM_INPUT_DOUBLE( "min_amp" )
};
/* Call im_log_dmask via arg vector.
*/
static int
log_dmask_vec( im_object *argv )
{
im_mask_object *mo = argv[0];
double sigma = *((double *) argv[1]);
double min_amp = *((double *) argv[2]);
if( !(mo->mask =
im_log_dmask( mo->name, sigma, min_amp )) )
return( -1 );
return( 0 );
}
/* Description of im_log_dmask.
*/
static im_function log_dmask_desc = {
"im_log_dmask", /* Name */
"generate laplacian of gaussian DOUBLEMASK",
0, /* Flags */
log_dmask_vec, /* Dispatch function */
IM_NUMBER( log_dmask_args ), /* Size of arg list */
log_dmask_args /* Arg list */
};
static im_arg_desc imask_args[] = {
IM_INPUT_IMASK( "in" ),
IM_OUTPUT_IMASK( "out" )
};
static im_arg_desc dmask_args[] = {
IM_INPUT_DMASK( "in" ),
IM_OUTPUT_DMASK( "out" )
};
/* Call im_rotate_imask45 via arg vector.
*/
static int
rotate_imask45_vec( im_object *argv )
{
im_mask_object *min = argv[0];
im_mask_object *mout = argv[1];
if( !(mout->mask = im_rotate_imask45( min->mask, mout->name )) )
return( -1 );
return( 0 );
}
/* Description of im_rotate_imask45.
*/
static im_function rotate_imask45_desc = {
"im_rotate_imask45", /* Name */
"rotate INTMASK clockwise by 45 degrees",
0, /* Flags */
rotate_imask45_vec, /* Dispatch function */
IM_NUMBER( imask_args ), /* Size of arg list */
imask_args /* Arg list */
};
/* Call im_rotate_imask90 via arg vector.
*/
static int
rotate_imask90_vec( im_object *argv )
{
im_mask_object *min = argv[0];
im_mask_object *mout = argv[1];
if( !(mout->mask = im_rotate_imask90( min->mask, mout->name )) )
return( -1 );
return( 0 );
}
/* Description of im_rotate_imask90.
*/
static im_function rotate_imask90_desc = {
"im_rotate_imask90", /* Name */
"rotate INTMASK clockwise by 90 degrees",
0, /* Flags */
rotate_imask90_vec, /* Dispatch function */
IM_NUMBER( imask_args ), /* Size of arg list */
imask_args /* Arg list */
};
/* Call im_rotate_dmask45 via arg vector.
*/
static int
rotate_dmask45_vec( im_object *argv )
{
im_mask_object *min = argv[0];
im_mask_object *mout = argv[1];
if( !(mout->mask = im_rotate_dmask45( min->mask, mout->name )) )
return( -1 );
return( 0 );
}
/* Description of im_rotate_dmask45.
*/
static im_function rotate_dmask45_desc = {
"im_rotate_dmask45", /* Name */
"rotate DOUBLEMASK clockwise by 45 degrees",
0, /* Flags */
rotate_dmask45_vec, /* Dispatch function */
IM_NUMBER( dmask_args ), /* Size of arg list */
dmask_args /* Arg list */
};
/* Call im_rotate_dmask90 via arg vector.
*/
static int
rotate_dmask90_vec( im_object *argv )
{
im_mask_object *min = argv[0];
im_mask_object *mout = argv[1];
if( !(mout->mask = im_rotate_dmask90( min->mask, mout->name )) )
return( -1 );
return( 0 );
}
/* Description of im_rotate_dmask90.
*/
static im_function rotate_dmask90_desc = {
"im_rotate_dmask90", /* Name */
"rotate DOUBLEMASK clockwise by 90 degrees",
0, /* Flags */
rotate_dmask90_vec, /* Dispatch function */
IM_NUMBER( dmask_args ), /* Size of arg list */
dmask_args /* Arg list */
};
static int
imask_xsize_vec( im_object *argv )
{
*( (int*) argv[1] )= ( (INTMASK*) ( ( (im_mask_object*) argv[0] )-> mask ) )-> xsize;
return 0;
}
static int
imask_ysize_vec( im_object *argv )
{
*( (int*) argv[1] )= ( (INTMASK*) ( ( (im_mask_object*) argv[0] )-> mask ) )-> ysize;
return 0;
}
static int
dmask_xsize_vec( im_object *argv )
{
*( (int*) argv[1] )= ( (DOUBLEMASK*) ( ( (im_mask_object*) argv[0] )-> mask ) )-> xsize;
return 0;
}
static int
dmask_ysize_vec( im_object *argv )
{
*( (int*) argv[1] )= ( (DOUBLEMASK*) ( ( (im_mask_object*) argv[0] )-> mask ) )-> ysize;
return 0;
}
static im_arg_desc imask_size_args[] = {
IM_INPUT_IMASK( "mask" ),
IM_OUTPUT_INT( "size" )
};
static im_arg_desc dmask_size_args[] = {
IM_INPUT_DMASK( "mask" ),
IM_OUTPUT_INT( "size" )
};
static im_function imask_xsize_desc = {
"im_imask_xsize", /* Name */
"horizontal size of an intmask", /* Description */
0, /* Flags */
imask_xsize_vec, /* Dispatch function */
IM_NUMBER( imask_size_args ), /* Size of arg list */
imask_size_args /* Arg list */
};
static im_function imask_ysize_desc = {
"im_imask_ysize", /* Name */
"vertical size of an intmask", /* Description */
0, /* Flags */
imask_ysize_vec, /* Dispatch function */
IM_NUMBER( imask_size_args ), /* Size of arg list */
imask_size_args /* Arg list */
};
static im_function dmask_xsize_desc = {
"im_dmask_xsize", /* Name */
"horizontal size of a doublemask", /* Description */
0, /* Flags */
dmask_xsize_vec, /* Dispatch function */
IM_NUMBER( dmask_size_args ), /* Size of arg list */
dmask_size_args /* Arg list */
};
static im_function dmask_ysize_desc = {
"im_dmask_ysize", /* Name */
"vertical size of a doublemask", /* Description */
0, /* Flags */
dmask_ysize_vec, /* Dispatch function */
IM_NUMBER( dmask_size_args ), /* Size of arg list */
dmask_size_args /* Arg list */
};
/* Package up all these functions.
*/
static im_function *mask_list[] = {
&gauss_dmask_desc,
&log_dmask_desc,
&log_imask_desc,
&gauss_imask_desc,
&gauss_imask_sep_desc,
&dmask_xsize_desc,
&dmask_ysize_desc,
&imask_xsize_desc,
&imask_ysize_desc,
&read_dmask_desc,
&rotate_dmask45_desc,
&rotate_dmask90_desc,
&rotate_imask45_desc,
&rotate_imask90_desc,
&matcat_desc,
&matinv_desc,
&matmul_desc,
&mattrn_desc
};
/* Package of functions.
*/
im_package im__mask = {
"mask",
IM_NUMBER( mask_list ),
mask_list
};

View File

@ -1,181 +0,0 @@
/* VIPS function dispatch tables for matricies.
*
* J. Cupitt, 14/2/95.
*/
/*
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
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#include <stdio.h>
#include <vips/vips.h>
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif /*WITH_DMALLOC*/
/* One matrix in, one out.
*/
static im_arg_desc one_in_one_out[] = {
IM_INPUT_DMASK( "in" ),
IM_OUTPUT_DMASK( "out" )
};
/* Two matricies in, one out.
*/
static im_arg_desc two_in_one_out[] = {
IM_INPUT_DMASK( "in1" ),
IM_INPUT_DMASK( "in2" ),
IM_OUTPUT_DMASK( "out" )
};
/* Call im_matinv via arg vector.
*/
static int
matinv_vec( im_object *argv )
{
im_mask_object *in = argv[0];
im_mask_object *out = argv[1];
if( !(out->mask =
im_matinv( in->mask, out->name )) )
return( -1 );
return( 0 );
}
/* Description of im_matinv.
*/
static im_function matinv_desc = {
"im_matinv", /* Name */
"invert matrix",
0, /* Flags */
matinv_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_mattrn via arg vector.
*/
static int
mattrn_vec( im_object *argv )
{
im_mask_object *in = argv[0];
im_mask_object *out = argv[1];
if( !(out->mask =
im_mattrn( in->mask, out->name )) )
return( -1 );
return( 0 );
}
/* Description of im_mattrn.
*/
static im_function mattrn_desc = {
"im_mattrn", /* Name */
"transpose matrix",
0, /* Flags */
mattrn_vec, /* Dispatch function */
IM_NUMBER( one_in_one_out ), /* Size of arg list */
one_in_one_out /* Arg list */
};
/* Call im_matcat via arg vector.
*/
static int
matcat_vec( im_object *argv )
{
im_mask_object *in1 = argv[0];
im_mask_object *in2 = argv[1];
im_mask_object *out = argv[2];
if( !(out->mask =
im_matcat( in1->mask, in2->mask, out->name )) )
return( -1 );
return( 0 );
}
/* Description of im_matcat.
*/
static im_function matcat_desc = {
"im_matcat", /* Name */
"append matrix in2 to the end of matrix in1",
0, /* Flags */
matcat_vec, /* Dispatch function */
IM_NUMBER( two_in_one_out ), /* Size of arg list */
two_in_one_out /* Arg list */
};
/* Call im_matmul via arg vector.
*/
static int
matmul_vec( im_object *argv )
{
im_mask_object *in1 = argv[0];
im_mask_object *in2 = argv[1];
im_mask_object *out = argv[2];
if( !(out->mask =
im_matmul( in1->mask, in2->mask, out->name )) )
return( -1 );
return( 0 );
}
/* Description of im_matmul.
*/
static im_function matmul_desc = {
"im_matmul", /* Name */
"multiply matrix in1 by matrix in2",
0, /* Flags */
matmul_vec, /* Dispatch function */
IM_NUMBER( two_in_one_out ), /* Size of arg list */
two_in_one_out /* Arg list */
};
/* Package up all these functions.
*/
static im_function *matrix_list[] = {
&matcat_desc,
&matinv_desc,
&matmul_desc,
&mattrn_desc
};
/* Package of functions.
*/
im_package im__matrix = {
"matrix",
IM_NUMBER( matrix_list ),
matrix_list
};

View File

@ -4,6 +4,9 @@ libmorphology_la_SOURCES = \
im_cntlines.c \
im_dilate.c\
im_erode.c\
im_rank.c \
im_rank_image.c \
im_zerox.c \
morph_dispatch.c \
im_profile.c

View File

@ -193,11 +193,147 @@ static im_function cntlines_desc = {
cntlines_args /* Arg list */
};
/* Args to im_rank.
*/
static im_arg_desc rank_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_INT( "xsize" ),
IM_INPUT_INT( "ysize" ),
IM_INPUT_INT( "n" )
};
/* Call im_rank via arg vector.
*/
static int
rank_vec( im_object *argv )
{
int xsize = *((int *) argv[2]);
int ysize = *((int *) argv[3]);
int n = *((int *) argv[4]);
return( im_rank( argv[0], argv[1], xsize, ysize, n ) );
}
/* Description of im_rank.
*/
static im_function rank_desc = {
"im_rank", /* Name */
"rank filter nth element of xsize/ysize window",
IM_FN_PIO, /* Flags */
rank_vec, /* Dispatch function */
IM_NUMBER( rank_args ), /* Size of arg list */
rank_args /* Arg list */
};
/* Args for im_zerox.
*/
static im_arg_desc zerox_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_INT( "flag" )
};
/* Call im_zerox via arg vector.
*/
static int
zerox_vec( im_object *argv )
{
int flag = *((int *) argv[2]);
return( im_zerox( argv[0], argv[1], flag ) );
}
/* Description of im_zerox.
*/
static im_function zerox_desc = {
"im_zerox", /* Name */
"find +ve or -ve zero crossings in image",
IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */
zerox_vec, /* Dispatch function */
IM_NUMBER( zerox_args ), /* Size of arg list */
zerox_args /* Arg list */
};
static im_arg_desc maxvalue_args[] = {
IM_INPUT_IMAGEVEC( "in" ),
IM_OUTPUT_IMAGE( "out" )
};
static int
maxvalue_vec( im_object *argv )
{
im_imagevec_object *iv = (im_imagevec_object *) argv[0];
return( im_maxvalue( iv->vec, argv[1], iv->n ) );
}
static im_function maxvalue_desc = {
"im_maxvalue", /* Name */
"point-wise maximum value", /* Description */
IM_FN_PIO, /* Flags */
maxvalue_vec, /* Dispatch function */
IM_NUMBER( maxvalue_args ), /* Size of arg list */
maxvalue_args /* Arg list */
};
static im_arg_desc rank_image_args[] = {
IM_INPUT_IMAGEVEC( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_INT( "index" )
};
static int
rank_image_vec( im_object *argv )
{
im_imagevec_object *iv = (im_imagevec_object *) argv[0];
int index = *((int *) argv[2]);
return( im_rank_image( iv->vec, argv[1], iv->n, index ) );
}
static im_function rank_image_desc = {
"im_rank_image", /* Name */
"point-wise pixel rank", /* Description */
IM_FN_PIO, /* Flags */
rank_image_vec, /* Dispatch function */
IM_NUMBER( rank_image_args ), /* Size of arg list */
rank_image_args /* Arg list */
};
/* Call im_rank_raw via arg vector.
*/
static int
rank_raw_vec( im_object *argv )
{
int xsize = *((int *) argv[2]);
int ysize = *((int *) argv[3]);
int n = *((int *) argv[4]);
return( im_rank_raw( argv[0], argv[1], xsize, ysize, n ) );
}
/* Description of im_rank_raw.
*/
static im_function rank_raw_desc = {
"im_rank_raw", /* Name */
"rank filter nth element of xsize/ysize window, no border",
IM_FN_PIO, /* Flags */
rank_raw_vec, /* Dispatch function */
IM_NUMBER( rank_args ), /* Size of arg list */
rank_args /* Arg list */
};
/* Package up all these functions.
*/
static im_function *morph_list[] = {
&cntlines_desc,
&dilate_desc,
&rank_desc,
&rank_image_desc,
&maxvalue_desc,
&zerox_desc,
&rank_raw_desc,
&dilate_raw_desc,
&erode_desc,
&erode_raw_desc,

View File

@ -5,6 +5,9 @@ libresample_la_SOURCES = \
bicubic.cpp \
interpolate.c \
yafrsmooth.cpp \
im_resize_linear.c \
im_shrink.c \
im_stretch3.c \
nohalo1.cpp \
snohalo1.cpp \
nohalo2.cpp \

View File

@ -136,11 +136,107 @@ static im_function affinei_all_desc = {
affinei_all_args /* Arg list */
};
/* Args for im_shrink.
*/
static im_arg_desc shrink_args[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_DOUBLE( "xfac" ),
IM_INPUT_DOUBLE( "yfac" )
};
/* Call im_shrink via arg vector.
*/
static int
shrink_vec( im_object *argv )
{
double xshrink = *((double *) argv[2]);
double yshrink = *((double *) argv[3]);
return( im_shrink( argv[0], argv[1], xshrink, yshrink ) );
}
/* Description of im_shrink.
*/
static im_function shrink_desc = {
"im_shrink", /* Name */
"shrink image by xfac, yfac times",
IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */
shrink_vec, /* Dispatch function */
IM_NUMBER( shrink_args ), /* Size of arg list */
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[] = {
IM_INPUT_IMAGE( "in" ),
IM_OUTPUT_IMAGE( "out" ),
IM_INPUT_DOUBLE( "xdisp" ),
IM_INPUT_DOUBLE( "ydisp" )
};
/* Call im_stretch3 via arg vector.
*/
static int
stretch3_vec( im_object *argv )
{
double xdisp = *((int *) argv[2]);
double ydisp = *((int *) argv[3]);
return( im_stretch3( argv[0], argv[1], xdisp, ydisp ) );
}
/* Description of im_stretch3.
*/
static im_function stretch3_desc = {
"im_stretch3", /* Name */
"stretch 3%, sub-pixel displace by xdisp/ydisp",
IM_FN_PIO, /* Flags */
stretch3_vec, /* Dispatch function */
IM_NUMBER( stretch3_args ), /* Size of arg list */
stretch3_args /* Arg list */
};
/* Package up all these functions.
*/
static im_function *resample_list[] = {
&resize_linear_desc,
&shrink_desc,
&stretch3_desc,
&affinei_desc,
&affinei_all_desc,
&affinei_all_desc
};
/* Package of functions.