gtk-doc fixes
This commit is contained in:
parent
b70319cbec
commit
0d2bdac332
|
@ -34,6 +34,8 @@
|
|||
- im_blend() can have any format condition image and it's converted to uchar
|
||||
- security fix for vips-7.23 wrapper script (thanks Jay)
|
||||
- im_affine() has a larger safety margin
|
||||
- fix gtk-doc warnings
|
||||
- small mask load/save improvements
|
||||
|
||||
12/5/10 started 7.22.2
|
||||
- the conditional image of ifthenelse can be any format, a (!=0) is added if
|
||||
|
|
|
@ -95,7 +95,7 @@ static int minpos_vec_stop( void *seq, void *, void * );
|
|||
* @maxima: array to return values
|
||||
* @n: number of maxima to search for
|
||||
*
|
||||
* Find the coordinates and values of the n maxima of an image.
|
||||
* Find the coordinates and values of the @n @maxima of an image.
|
||||
*
|
||||
* For 8 and 16-bit images, it's much faster to find the histogram and then
|
||||
* calculate a threshold from that. See im_mpercent().
|
||||
|
@ -157,10 +157,10 @@ int im_maxpos_vec( IMAGE *im, int *xpos, int *ypos, double *maxima, int n ){
|
|||
* @im: image to scan
|
||||
* @xpos: array to return x positions
|
||||
* @ypos: array to return y positions
|
||||
* @maxima: array to return values
|
||||
* @minima: array to return values
|
||||
* @n: number of minima to search for
|
||||
*
|
||||
* Find the coordinates and values of the n minima of an image.
|
||||
* Find the coordinates and values of the @n @minima of an image.
|
||||
*
|
||||
* For 8 and 16-bit images, it's much faster to find the histogram and then
|
||||
* calculate a threshold from that. See im_mpercent().
|
||||
|
|
|
@ -262,7 +262,7 @@ make_LI( void )
|
|||
|
||||
/**
|
||||
* im_col_Lucs2L:
|
||||
* @L: L ucs
|
||||
* @Lucs: L ucs
|
||||
*
|
||||
* Calculate L from Lucs using a table. Call im_col_make_tables_UCS() at
|
||||
* least once before using this function.
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
/* Struct we carry stuff around in.
|
||||
*/
|
||||
typedef struct joins {
|
||||
int nim; /* Number of input images */
|
||||
int n; /* Number of input images */
|
||||
IMAGE **in; /* Array of input images, NULL-terminated */
|
||||
int *is; /* An int for SIZEOF_PEL() for each image */
|
||||
} Join;
|
||||
|
@ -74,31 +74,31 @@ typedef struct joins {
|
|||
/* Make a Join struct.
|
||||
*/
|
||||
static Join *
|
||||
join_new( IMAGE *out, IMAGE **in, int nim )
|
||||
join_new( IMAGE *out, IMAGE **in, int n )
|
||||
{
|
||||
Join *join;
|
||||
int i;
|
||||
|
||||
if( !(join = IM_NEW( out, Join )) )
|
||||
return( NULL );
|
||||
join->nim = nim;
|
||||
if( !(join->in = IM_ARRAY( out, nim + 1, IMAGE * )) ||
|
||||
!(join->is = IM_ARRAY( out, nim, int )) )
|
||||
join->n = n;
|
||||
if( !(join->in = IM_ARRAY( out, n + 1, IMAGE * )) ||
|
||||
!(join->is = IM_ARRAY( out, n, int )) )
|
||||
return( NULL );
|
||||
|
||||
/* Cast inputs up to a common format.
|
||||
*/
|
||||
if( im_open_local_array( out, join->in, nim, "im_gbandjoin", "p" ) ||
|
||||
im__formatalike_vec( in, join->in, nim ) )
|
||||
if( im_open_local_array( out, join->in, n, "im_gbandjoin", "p" ) ||
|
||||
im__formatalike_vec( in, join->in, n ) )
|
||||
return( NULL );
|
||||
|
||||
for( i = 0; i < nim; i++ )
|
||||
for( i = 0; i < n; i++ )
|
||||
join->is[i] = IM_IMAGE_SIZEOF_PEL( join->in[i] );
|
||||
|
||||
/* Remember to NULL-terminate. We pass ->in[] to
|
||||
* im_demand_hint_array() and friends later.
|
||||
*/
|
||||
join->in[nim] = NULL;
|
||||
join->in[n] = NULL;
|
||||
|
||||
return( join );
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ join_bands( REGION *or, void *seq, void *a, void *b )
|
|||
|
||||
int x, y, z, i;
|
||||
|
||||
for( i = 0; i < join->nim; i++ )
|
||||
for( i = 0; i < join->n; i++ )
|
||||
if( im_prepare( ir[i], r ) )
|
||||
return( -1 );
|
||||
|
||||
|
@ -129,7 +129,7 @@ join_bands( REGION *or, void *seq, void *a, void *b )
|
|||
/* Loop for each input image. Scattered write is faster than
|
||||
* scattered read.
|
||||
*/
|
||||
for( i = 0; i < join->nim; i++ ) {
|
||||
for( i = 0; i < join->n; i++ ) {
|
||||
int k = join->is[i];
|
||||
|
||||
PEL *p;
|
||||
|
@ -158,7 +158,7 @@ join_bands( REGION *or, void *seq, void *a, void *b )
|
|||
* im_gbandjoin:
|
||||
* @in: vector of input images
|
||||
* @out: output image
|
||||
* @nim: number of input images
|
||||
* @n: number of input images
|
||||
*
|
||||
* Join a set of images together, bandwise.
|
||||
* If the images
|
||||
|
@ -176,18 +176,18 @@ join_bands( REGION *or, void *seq, void *a, void *b )
|
|||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
im_gbandjoin( IMAGE **in, IMAGE *out, int nim )
|
||||
im_gbandjoin( IMAGE **in, IMAGE *out, int n )
|
||||
{
|
||||
int i;
|
||||
Join *join;
|
||||
|
||||
/* Check it out!
|
||||
*/
|
||||
if( nim < 1 ) {
|
||||
if( n < 1 ) {
|
||||
im_error( "im_gbandjoin", "%s", _( "zero input images!" ) );
|
||||
return( -1 );
|
||||
}
|
||||
else if( nim == 1 )
|
||||
else if( n == 1 )
|
||||
return( im_copy( in[0], out ) );
|
||||
|
||||
/* Check our args.
|
||||
|
@ -195,7 +195,7 @@ im_gbandjoin( IMAGE **in, IMAGE *out, int nim )
|
|||
if( im_poutcheck( out ) ||
|
||||
im_check_coding_known( "im_gbandjoin", in[0] ) )
|
||||
return( -1 );
|
||||
for( i = 0; i < nim; i++ )
|
||||
for( i = 0; i < n; i++ )
|
||||
if( im_pincheck( in[i] ) ||
|
||||
im_check_size_same( "im_gbandjoin", in[i], in[0] ) ||
|
||||
im_check_coding_same( "im_gbandjoin", in[i], in[0] ) )
|
||||
|
@ -203,7 +203,7 @@ im_gbandjoin( IMAGE **in, IMAGE *out, int nim )
|
|||
|
||||
/* Build a data area.
|
||||
*/
|
||||
if( !(join = join_new( out, in, nim )) )
|
||||
if( !(join = join_new( out, in, n )) )
|
||||
return( -1 );
|
||||
|
||||
/* Prepare the output header.
|
||||
|
@ -211,7 +211,7 @@ im_gbandjoin( IMAGE **in, IMAGE *out, int nim )
|
|||
if( im_cp_desc_array( out, join->in ) )
|
||||
return( -1 );
|
||||
out->Bands = 0;
|
||||
for( i = 0; i < nim; i++ )
|
||||
for( i = 0; i < n; i++ )
|
||||
out->Bands += join->in[i]->Bands;
|
||||
if( im_demand_hint_array( out, IM_THINSTRIP, join->in ) )
|
||||
return( -1 );
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
/**
|
||||
* im_mask2vips:
|
||||
* @in: input mask
|
||||
* @out output image
|
||||
* @out: output image
|
||||
*
|
||||
* Write a one-band, %IM_BANDFMT_DOUBLE image to @out based on mask @in.
|
||||
*
|
||||
|
|
|
@ -97,7 +97,8 @@ join_buffer( PEL **p, PEL *q, int n, IMAGE *im )
|
|||
*
|
||||
* Compose two real images to make a complex image. If either @in1 or @in2 are
|
||||
* %IM_BANDFMT_DOUBLE, @out is %IM_BANDFMT_DPCOMPLEX. Otherwise @out is
|
||||
* %IM_BANDFMT_COMPLEX.
|
||||
* %IM_BANDFMT_COMPLEX. @in1 becomes the real component fo @out and @in2 the
|
||||
* imaginary.
|
||||
*
|
||||
* If the number of bands differs, one of the images
|
||||
* must have one band. In this case, an n-band image is formed from the
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
/**
|
||||
* im_vips2mask:
|
||||
* @in: input image
|
||||
* @outname: name for output mask
|
||||
* @filename: name for output mask
|
||||
*
|
||||
* Make a mask from an image. All images are cast to %IM_BANDFMT_DOUBLE
|
||||
* before processing. There are two cases for handling bands:
|
||||
|
@ -71,7 +71,7 @@
|
|||
* Returns: a #DOUBLEMASK with @outname set as the name, or NULL on error
|
||||
*/
|
||||
DOUBLEMASK *
|
||||
im_vips2mask( IMAGE *in, const char *outname )
|
||||
im_vips2mask( IMAGE *in, const char *filename )
|
||||
{
|
||||
int width, height;
|
||||
DOUBLEMASK *out;
|
||||
|
@ -84,7 +84,7 @@ im_vips2mask( IMAGE *in, const char *outname )
|
|||
if( !(t = im_open( "im_vips2mask", "p" )) )
|
||||
return( NULL );
|
||||
if( im_clip2fmt( in, t, IM_BANDFMT_DOUBLE ) ||
|
||||
!(out = im_vips2mask( t, outname )) ) {
|
||||
!(out = im_vips2mask( t, filename )) ) {
|
||||
im_close( t );
|
||||
return( NULL );
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ im_vips2mask( IMAGE *in, const char *outname )
|
|||
return( NULL );
|
||||
}
|
||||
|
||||
if( !(out = im_create_dmask( outname, width, height )) )
|
||||
if( !(out = im_create_dmask( filename, width, height )) )
|
||||
return( NULL );
|
||||
if( in->Bands > 1 && in->Ysize == 1 ) {
|
||||
double *data = (double *) in->data;
|
||||
|
|
|
@ -64,6 +64,17 @@
|
|||
* Matlab, Radiance, RAW, VIPS and one that wraps libMagick.
|
||||
*/
|
||||
|
||||
/**
|
||||
* VipsFormatFlags:
|
||||
* @VIPS_FORMAT_NONE: no flags set
|
||||
* @VIPS_FORMAT_PARTIAL: the image may be read lazilly
|
||||
*
|
||||
* Some hints about the image loader.
|
||||
*
|
||||
* @VIPS_FORMAT_PARTIAL means that the image can be read directly from the
|
||||
* file without needing to be unpacked to a temporary image first.
|
||||
*/
|
||||
|
||||
/**
|
||||
* VipsFormat:
|
||||
*
|
||||
|
|
|
@ -310,7 +310,7 @@ plot( IMAGE *in, IMAGE *out )
|
|||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
im_histplot( IMAGE *hist, IMAGE *histplot )
|
||||
im_histplot( IMAGE *in, IMAGE *out )
|
||||
{
|
||||
IMAGE *t1;
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ im_lhisteq_raw( IMAGE *in, IMAGE *out, int xwin, int ywin )
|
|||
* @in: input image
|
||||
* @out: output image
|
||||
* @xwin: width of region
|
||||
* @hwin: height of region
|
||||
* @ywin: height of region
|
||||
*
|
||||
* Performs local histogram equalisation on @in using a
|
||||
* window of size @xwin by @ywin centered on the input pixel. Works only on
|
||||
|
|
|
@ -245,7 +245,7 @@ im_stdif_raw( IMAGE *in, IMAGE *out,
|
|||
* @b: weight of new deviation
|
||||
* @s0:target deviation
|
||||
* @xwin: width of region
|
||||
* @hwin: height of region
|
||||
* @ywin: height of region
|
||||
*
|
||||
* im_stdif() preforms statistical differencing according to the formula
|
||||
* given in page 45 of the book "An Introduction to Digital Image
|
||||
|
|
|
@ -70,7 +70,7 @@ gboolean vips_buf_appendc( VipsBuf *buf, char ch );
|
|||
gboolean vips_buf_appendsc( VipsBuf *buf, gboolean quote, const char *str );
|
||||
gboolean vips_buf_appendgv( VipsBuf *buf, GValue *value );
|
||||
gboolean vips_buf_removec( VipsBuf *buf, char ch );
|
||||
gboolean vips_buf_change( VipsBuf *buf, const char *old, const char * );
|
||||
gboolean vips_buf_change( VipsBuf *buf, const char *o, const char *n );
|
||||
gboolean vips_buf_is_empty( VipsBuf *buf );
|
||||
gboolean vips_buf_is_full( VipsBuf *buf );
|
||||
const char *vips_buf_all( VipsBuf *buf );
|
||||
|
|
|
@ -37,13 +37,13 @@
|
|||
extern "C" {
|
||||
#endif /*__cplusplus*/
|
||||
|
||||
DOUBLEMASK *im_vips2mask( IMAGE *in, const char *out );
|
||||
DOUBLEMASK *im_vips2mask( IMAGE *in, const char *filename );
|
||||
int im_mask2vips( DOUBLEMASK *in, IMAGE *out );
|
||||
|
||||
int im_copy( IMAGE *in, IMAGE *out );
|
||||
int im_copy_set( IMAGE *in, IMAGE *out,
|
||||
VipsType type, float xres, float yres, int xoffset, int yoffset );
|
||||
int im_copy_set_meta( IMAGE *in, IMAGE *out, const char *field, GValue *meta );
|
||||
int im_copy_set_meta( IMAGE *in, IMAGE *out, const char *field, GValue *value );
|
||||
int im_copy_morph( IMAGE *in, IMAGE *out,
|
||||
int bands, VipsBandFmt bandfmt, VipsCoding coding );
|
||||
int im_copy_swap( IMAGE *in, IMAGE *out );
|
||||
|
@ -57,7 +57,7 @@ int im_msb_band( IMAGE *in, IMAGE *out, int band );
|
|||
|
||||
int im_c2amph( IMAGE *in, IMAGE *out );
|
||||
int im_c2rect( IMAGE *in, IMAGE *out );
|
||||
int im_ri2c( IMAGE *real_in, IMAGE *imag_in, IMAGE *out );
|
||||
int im_ri2c( IMAGE *in1, IMAGE *in2, IMAGE *out );
|
||||
int im_c2imag( IMAGE *in, IMAGE *out );
|
||||
int im_c2real( IMAGE *in, IMAGE *out );
|
||||
int im_scaleps( IMAGE *in, IMAGE *out );
|
||||
|
@ -65,7 +65,7 @@ int im_scaleps( IMAGE *in, IMAGE *out );
|
|||
int im_falsecolour( IMAGE *in, IMAGE *out );
|
||||
int im_gaussnoise( IMAGE *out, int x, int y, double mean, double sigma );
|
||||
|
||||
int im_black( IMAGE *out, int width, int height, int bands );
|
||||
int im_black( IMAGE *out, int x, int y, int bands );
|
||||
int im_text( IMAGE *out, const char *text, const char *font,
|
||||
int width, int alignment, int dpi );
|
||||
|
||||
|
@ -82,8 +82,8 @@ int im_gbandjoin( IMAGE **in, IMAGE *out, int n );
|
|||
int im_insert( IMAGE *main, IMAGE *sub, IMAGE *out, int x, int y );
|
||||
int im_insert_noexpand( IMAGE *main, IMAGE *sub, IMAGE *out, int x, int y );
|
||||
int im_insertset( IMAGE *main, IMAGE *sub, IMAGE *out, int n, int *x, int *y );
|
||||
int im_lrjoin( IMAGE *in1, IMAGE *in2, IMAGE *out );
|
||||
int im_tbjoin( IMAGE *in1, IMAGE *in2, IMAGE *out );
|
||||
int im_lrjoin( IMAGE *left, IMAGE *right, IMAGE *out );
|
||||
int im_tbjoin( IMAGE *top, IMAGE *bottom, IMAGE *out );
|
||||
int im_replicate( IMAGE *in, IMAGE *out, int across, int down );
|
||||
int im_grid( IMAGE *in, IMAGE *out, int tile_height, int across, int down );
|
||||
int im_wrap( IMAGE *in, IMAGE *out, int x, int y );
|
||||
|
@ -94,8 +94,8 @@ int im_rot90( IMAGE *in, IMAGE *out );
|
|||
int im_rot180( IMAGE *in, IMAGE *out );
|
||||
int im_rot270( IMAGE *in, IMAGE *out );
|
||||
|
||||
int im_subsample( IMAGE *in, IMAGE *out, int x, int y );
|
||||
int im_zoom( IMAGE *in, IMAGE *out, int x, int y );
|
||||
int im_subsample( IMAGE *in, IMAGE *out, int xshrink, int yshrink );
|
||||
int im_zoom( IMAGE *in, IMAGE *out, int xfac, int yfac );
|
||||
|
||||
int im_system( IMAGE *im, const char *cmd, char **out );
|
||||
IMAGE *im_system_image( IMAGE *im,
|
||||
|
|
|
@ -62,12 +62,14 @@ typedef enum {
|
|||
|
||||
typedef struct _VipsFormat {
|
||||
VipsObject parent_object;
|
||||
/*< public >*/
|
||||
|
||||
} VipsFormat;
|
||||
|
||||
typedef struct _VipsFormatClass {
|
||||
VipsObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* Is a file in this format.
|
||||
*/
|
||||
gboolean (*is_a)( const char * );
|
||||
|
|
|
@ -45,10 +45,10 @@ typedef void *(*im_start_fn)( IMAGE *out, void *a, void *b );
|
|||
typedef int (*im_generate_fn)( REGION *out, void *seq, void *a, void *b );
|
||||
typedef int (*im_stop_fn)( void *seq, void *a, void *b );
|
||||
|
||||
void *im_start_one( IMAGE *out, void *in, void *dummy );
|
||||
int im_stop_one( void *seq, void *dummy1, void *dummy2 );
|
||||
void *im_start_many( IMAGE *out, void *in, void *dummy );
|
||||
int im_stop_many( void *seq, void *dummy1, void *dummy2 );
|
||||
void *im_start_one( IMAGE *out, void *a, void *b );
|
||||
int im_stop_one( void *seq, void *a, void *b );
|
||||
void *im_start_many( IMAGE *out, void *a, void *b );
|
||||
int im_stop_many( void *seq, void *a, void *b );
|
||||
IMAGE **im_allocate_input_array( IMAGE *out, ... )
|
||||
__attribute__((sentinel));
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ int im_header_get( IMAGE *im, const char *field, GValue *value_copy );
|
|||
typedef void *(*im_header_map_fn)( IMAGE *, const char *, GValue *, void * );
|
||||
void *im_header_map( IMAGE *im, im_header_map_fn fn, void *a );
|
||||
|
||||
int im_histlin( IMAGE *image, const char *fmt, ... )
|
||||
int im_histlin( IMAGE *im, const char *fmt, ... )
|
||||
__attribute__((format(printf, 2, 3)));
|
||||
int im_updatehist( IMAGE *out, const char *name, int argc, char *argv[] );
|
||||
const char *im_history_get( IMAGE *im );
|
||||
|
|
|
@ -50,9 +50,9 @@ int im_project( IMAGE *in, IMAGE *hout, IMAGE *vout );
|
|||
int im_histnorm( IMAGE *in, IMAGE *out );
|
||||
int im_histcum( IMAGE *in, IMAGE *out );
|
||||
int im_histeq( IMAGE *in, IMAGE *out );
|
||||
int im_histspec( IMAGE *hin, IMAGE *href, IMAGE *lut );
|
||||
int im_histspec( IMAGE *in, IMAGE *ref, IMAGE *out );
|
||||
int im_ismonotonic( IMAGE *lut, int *out );
|
||||
int im_histplot( IMAGE *hist, IMAGE *histplot );
|
||||
int im_histplot( IMAGE *in, IMAGE *out );
|
||||
|
||||
int im_maplut( IMAGE *in, IMAGE *out, IMAGE *lut );
|
||||
|
||||
|
@ -74,7 +74,7 @@ int im_tone_build_range( IMAGE *out,
|
|||
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,
|
||||
int im_tone_analyse( IMAGE *in, IMAGE *out,
|
||||
double Ps, double Pm, double Ph, double S, double M, double H );
|
||||
int im_tone_map( IMAGE *in, IMAGE *out, IMAGE *lut );
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@ int im_cp_desc_array( VipsImage *out, VipsImage *in[] );
|
|||
VipsImage *im_binfile( const char *name,
|
||||
int xsize, int ysize, int bands, int offset );
|
||||
VipsImage *im_image( void *buffer,
|
||||
int width, int height, int bands, VipsBandFmt bandfmt );
|
||||
int xsize, int ysize, int bands, VipsBandFmt bandfmt );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -55,10 +55,10 @@ typedef struct im__DOUBLEMASK {
|
|||
char *filename;
|
||||
} DOUBLEMASK;
|
||||
|
||||
INTMASK *im_create_imask( const char *filename, int width, int height );
|
||||
INTMASK *im_create_imaskv( const char *filename, int width, int height, ... );
|
||||
DOUBLEMASK *im_create_dmask( const char *filename, int width, int height );
|
||||
DOUBLEMASK *im_create_dmaskv( const char *filename, int width, int height, ... );
|
||||
INTMASK *im_create_imask( const char *filename, int xsize, int ysize );
|
||||
INTMASK *im_create_imaskv( const char *filename, int xsize, int ysize, ... );
|
||||
DOUBLEMASK *im_create_dmask( const char *filename, int xsize, int ysize );
|
||||
DOUBLEMASK *im_create_dmaskv( const char *filename, int xsize, int ysize, ... );
|
||||
|
||||
INTMASK *im_read_imask( const char *filename );
|
||||
DOUBLEMASK *im_read_dmask( const char *filename );
|
||||
|
|
|
@ -39,8 +39,8 @@ extern "C" {
|
|||
#define IM_NEW( IM, T ) ((T *) im_malloc( (IM), sizeof( T )))
|
||||
#define IM_ARRAY( IM, N, T ) ((T *) im_malloc( (IM), (N) * sizeof( T )))
|
||||
|
||||
void *im_malloc( VipsImage *im, size_t sz );
|
||||
int im_free( void * );
|
||||
void *im_malloc( VipsImage *im, size_t size );
|
||||
int im_free( void *s );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -102,27 +102,28 @@ size_t im_ref_string_get_length( const GValue *value );
|
|||
*/
|
||||
#define IM_TYPE_BLOB (im_blob_get_type())
|
||||
GType im_blob_get_type( void );
|
||||
void *im_blob_get( const GValue *value, size_t *data_length );
|
||||
void *im_blob_get( const GValue *value, size_t *length );
|
||||
int im_blob_set( GValue *value, im_callback_fn free_fn,
|
||||
void *data, size_t length );
|
||||
|
||||
int im_meta_set( IMAGE *, const char *field, GValue * );
|
||||
int im_meta_set( IMAGE *im, const char *field, GValue *value );
|
||||
gboolean im_meta_remove( IMAGE *im, const char *field );
|
||||
int im_meta_get( IMAGE *, const char *field, GValue * );
|
||||
int im_meta_get( IMAGE *im, const char *field, GValue *value_copy );
|
||||
GType im_meta_get_typeof( IMAGE *im, const char *field );
|
||||
|
||||
int im_meta_set_int( IMAGE *, const char *field, int i );
|
||||
int im_meta_get_int( IMAGE *, const char *field, int *i );
|
||||
int im_meta_set_double( IMAGE *, const char *field, double d );
|
||||
int im_meta_get_double( IMAGE *, const char *field, double *d );
|
||||
int im_meta_set_area( IMAGE *, const char *field, im_callback_fn, void * );
|
||||
int im_meta_get_area( IMAGE *, const char *field, void **data );
|
||||
int im_meta_set_string( IMAGE *, const char *field, const char *str );
|
||||
int im_meta_get_string( IMAGE *, const char *field, char **str );
|
||||
int im_meta_set_int( IMAGE *im, const char *field, int i );
|
||||
int im_meta_get_int( IMAGE *im, const char *field, int *i );
|
||||
int im_meta_set_double( IMAGE *im, const char *field, double d );
|
||||
int im_meta_get_double( IMAGE *im, const char *field, double *d );
|
||||
int im_meta_set_area( IMAGE *im,
|
||||
const char *field, im_callback_fn free_fn, void *data );
|
||||
int im_meta_get_area( IMAGE *im, const char *field, void **data );
|
||||
int im_meta_set_string( IMAGE *im, const char *field, const char *str );
|
||||
int im_meta_get_string( IMAGE *im, const char *field, char **str );
|
||||
int im_meta_set_blob( IMAGE *im, const char *field,
|
||||
im_callback_fn free_fn, void *blob, size_t blob_length );
|
||||
im_callback_fn free_fn, void *data, size_t length );
|
||||
int im_meta_get_blob( IMAGE *im, const char *field,
|
||||
void **blob, size_t *blob_length );
|
||||
void **data, size_t *length );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -36,8 +36,11 @@ extern "C" {
|
|||
|
||||
/* A rectangle.
|
||||
*/
|
||||
typedef struct im_rect_struct {
|
||||
int left, top, width, height;
|
||||
typedef struct _Rect {
|
||||
int left;
|
||||
int top;
|
||||
int width;
|
||||
int height;
|
||||
} Rect;
|
||||
|
||||
#define IM_RECT_RIGHT(R) ((R)->left + (R)->width)
|
||||
|
|
|
@ -77,9 +77,9 @@ void im_region_free( REGION *reg );
|
|||
|
||||
int im_region_buffer( REGION *reg, Rect *r );
|
||||
int im_region_image( REGION *reg, Rect *r );
|
||||
int im_region_region( REGION *reg, REGION *to, Rect *r, int x, int y );
|
||||
int im_region_region( REGION *reg, REGION *dest, Rect *r, int x, int y );
|
||||
int im_region_equalsregion( REGION *reg1, REGION *reg2 );
|
||||
int im_region_position( REGION *reg1, int x, int y );
|
||||
int im_region_position( REGION *reg, int x, int y );
|
||||
|
||||
void im_region_paint( REGION *reg, Rect *r, int value );
|
||||
void im_region_black( REGION *reg );
|
||||
|
@ -101,10 +101,10 @@ void im_region_copy( REGION *reg, REGION *dest, Rect *r, int x, int y );
|
|||
/* If DEBUG is defined, add bounds checking.
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
#define IM_REGION_ADDR(B,X,Y) \
|
||||
( (im_rect_includespoint( &(B)->valid, (X), (Y) ))? \
|
||||
((B)->data + ((Y) - (B)->valid.top) * IM_REGION_LSKIP(B) + \
|
||||
((X) - (B)->valid.left) * IM_IMAGE_SIZEOF_PEL((B)->im)): \
|
||||
#define IM_REGION_ADDR(R,X,Y) \
|
||||
( (im_rect_includespoint( &(R)->valid, (X), (Y) ))? \
|
||||
((R)->data + ((Y) - (R)->valid.top) * IM_REGION_LSKIP(R) + \
|
||||
((X) - (R)->valid.left) * IM_IMAGE_SIZEOF_PEL((R)->im)): \
|
||||
(fprintf( stderr, \
|
||||
"IM_REGION_ADDR: point out of bounds, " \
|
||||
"file \"%s\", line %d\n" \
|
||||
|
@ -113,19 +113,19 @@ void im_region_copy( REGION *reg, REGION *dest, Rect *r, int x, int y );
|
|||
"width=%d, height=%d)\n", \
|
||||
__FILE__, __LINE__, \
|
||||
(X), (Y), \
|
||||
(B)->valid.left, \
|
||||
(B)->valid.top, \
|
||||
(B)->valid.width, \
|
||||
(B)->valid.height ), abort(), (char *) NULL) \
|
||||
(R)->valid.left, \
|
||||
(R)->valid.top, \
|
||||
(R)->valid.width, \
|
||||
(R)->valid.height ), abort(), (char *) NULL) \
|
||||
)
|
||||
#else /*DEBUG*/
|
||||
#define IM_REGION_ADDR(B,X,Y) \
|
||||
((B)->data + \
|
||||
((Y)-(B)->valid.top) * IM_REGION_LSKIP(B) + \
|
||||
((X)-(B)->valid.left) * IM_IMAGE_SIZEOF_PEL((B)->im))
|
||||
#define IM_REGION_ADDR(R,X,Y) \
|
||||
((R)->data + \
|
||||
((Y)-(R)->valid.top) * IM_REGION_LSKIP(R) + \
|
||||
((X)-(R)->valid.left) * IM_IMAGE_SIZEOF_PEL((R)->im))
|
||||
#endif /*DEBUG*/
|
||||
|
||||
#define IM_REGION_ADDR_TOPLEFT(B) ( (B)->data )
|
||||
#define IM_REGION_ADDR_TOPLEFT(R) ( (R)->data )
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@ extern "C" {
|
|||
typedef struct _VipsThreadState {
|
||||
VipsObject parent_object;
|
||||
|
||||
/*< public >*/
|
||||
/* Image we run on.
|
||||
*/
|
||||
VipsImage *im;
|
||||
|
@ -86,6 +87,7 @@ typedef struct _VipsThreadState {
|
|||
|
||||
typedef struct _VipsThreadStateClass {
|
||||
VipsObjectClass parent_class;
|
||||
/*< public >*/
|
||||
|
||||
} VipsThreadStateClass;
|
||||
|
||||
|
|
|
@ -269,13 +269,19 @@ line_draw( Line *line )
|
|||
|
||||
/**
|
||||
* VipsPlotFn:
|
||||
* @image: image to draw on
|
||||
* @x: position to draw at
|
||||
* @y: position to draw at
|
||||
* @a: user data
|
||||
* @b: user data
|
||||
* @c: user data
|
||||
*
|
||||
* A plot function, as used by im_draw_line_user() to draw on an image.
|
||||
*/
|
||||
|
||||
/**
|
||||
* im_draw_line_user:
|
||||
* @im: image to draw on
|
||||
* @image: image to draw on
|
||||
* @x1: start point
|
||||
* @y1: start point
|
||||
* @x2: end point
|
||||
|
@ -294,14 +300,14 @@ line_draw( Line *line )
|
|||
* Returns: 0 on success, or -1 on error.
|
||||
*/
|
||||
int
|
||||
im_draw_line_user( VipsImage *im,
|
||||
im_draw_line_user( VipsImage *image,
|
||||
int x1, int y1, int x2, int y2,
|
||||
VipsPlotFn plot, void *a, void *b, void *c )
|
||||
{
|
||||
Line *line;
|
||||
|
||||
if( im_check_coding_known( "im_draw_line_user", im ) ||
|
||||
!(line = line_new( im, x1, y1, x2, y2, NULL )) )
|
||||
if( im_check_coding_known( "im_draw_line_user", image ) ||
|
||||
!(line = line_new( image, x1, y1, x2, y2, NULL )) )
|
||||
return( -1 );
|
||||
|
||||
line->plot = plot;
|
||||
|
@ -334,7 +340,7 @@ line_plot_point( VipsImage *im, int x, int y,
|
|||
|
||||
/**
|
||||
* im_draw_line:
|
||||
* @im: image to draw on
|
||||
* @image: image to draw on
|
||||
* @x1: start point
|
||||
* @y1: start point
|
||||
* @x2: end point
|
||||
|
@ -345,19 +351,19 @@ line_plot_point( VipsImage *im, int x, int y,
|
|||
*
|
||||
* @ink is an array of bytes
|
||||
* containing a valid pixel for the image's format.
|
||||
* It must have at least IM_IMAGE_SIZEOF_PEL( @im ) bytes.
|
||||
* It must have at least IM_IMAGE_SIZEOF_PEL( @image ) bytes.
|
||||
*
|
||||
* See also: im_draw_circle().
|
||||
*
|
||||
* Returns: 0 on success, or -1 on error.
|
||||
*/
|
||||
int
|
||||
im_draw_line( VipsImage *im, int x1, int y1, int x2, int y2, PEL *ink )
|
||||
im_draw_line( VipsImage *image, int x1, int y1, int x2, int y2, PEL *ink )
|
||||
{
|
||||
Line *line;
|
||||
|
||||
if( im_check_coding_known( "im_draw_line", im ) ||
|
||||
!(line = line_new( im, x1, y1, x2, y2, ink )) )
|
||||
if( im_check_coding_known( "im_draw_line", image ) ||
|
||||
!(line = line_new( image, x1, y1, x2, y2, ink )) )
|
||||
return( -1 );
|
||||
|
||||
line->plot = line_plot_point;
|
||||
|
|
|
@ -266,7 +266,7 @@ mask_draw( Mask *mask )
|
|||
|
||||
/**
|
||||
* im_draw_mask:
|
||||
* @im: image to draw on
|
||||
* @image: image to draw on
|
||||
* @x: draw mask here
|
||||
* @y: draw mask here
|
||||
* @ink: value to draw
|
||||
|
@ -278,18 +278,18 @@ mask_draw( Mask *mask )
|
|||
*
|
||||
* @ink is an array of bytes
|
||||
* containing a valid pixel for the image's format.
|
||||
* It must have at least IM_IMAGE_SIZEOF_PEL( @im ) bytes.
|
||||
* It must have at least IM_IMAGE_SIZEOF_PEL( @image ) bytes.
|
||||
*
|
||||
* See also: im_draw_circle(), im_text(), im_draw_line_user().
|
||||
*
|
||||
* Returns: 0 on success, or -1 on error.
|
||||
*/
|
||||
int
|
||||
im_draw_mask( VipsImage *im, VipsImage *mask_im, int x, int y, PEL *ink )
|
||||
im_draw_mask( VipsImage *image, VipsImage *mask_im, int x, int y, PEL *ink )
|
||||
{
|
||||
Mask *mask;
|
||||
|
||||
if( !(mask = mask_new( im, x, y, ink, mask_im )) )
|
||||
if( !(mask = mask_new( image, x, y, ink, mask_im )) )
|
||||
return( -1 );
|
||||
|
||||
/* Any points to plot?
|
||||
|
@ -301,7 +301,7 @@ im_draw_mask( VipsImage *im, VipsImage *mask_im, int x, int y, PEL *ink )
|
|||
|
||||
/* Loop through image plotting where required.
|
||||
*/
|
||||
switch( im->Coding ) {
|
||||
switch( image->Coding ) {
|
||||
case IM_CODING_LABQ:
|
||||
if( mask_draw_labq( mask ) ) {
|
||||
mask_free( mask );
|
||||
|
|
|
@ -84,7 +84,6 @@
|
|||
/**
|
||||
* VIPS_BUF_STATIC:
|
||||
* @TEXT: the storage area to use
|
||||
* @MAX: the size of the storage area
|
||||
*
|
||||
* Initialize a heap buffer. For example:
|
||||
*
|
||||
|
@ -340,10 +339,10 @@ vips_buf_appendc( VipsBuf *buf, char ch )
|
|||
/**
|
||||
* vips_buf_change:
|
||||
* @buf: the buffer
|
||||
* @old: the string to search for
|
||||
* @new: the string to substitute
|
||||
* @o: the string to search for
|
||||
* @n: the string to substitute
|
||||
*
|
||||
* Swap the rightmost occurence of @old for @new.
|
||||
* Swap the rightmost occurence of @o for @n.
|
||||
*
|
||||
* Returns: %FALSE on overflow, %TRUE otherwise.
|
||||
*/
|
||||
|
|
|
@ -774,7 +774,7 @@ im_check_bands_1orn( const char *domain, IMAGE *im1, IMAGE *im2 )
|
|||
/**
|
||||
* im_check_bands_1orn_unary:
|
||||
* @domain: the originating domain for the error message
|
||||
* @im1: image to check
|
||||
* @im: image to check
|
||||
* @n: number of bands, or 1
|
||||
*
|
||||
* Check that an image has 1 or @n bands. Handy for unary operations, cf.
|
||||
|
@ -1361,7 +1361,7 @@ vips_bandfmt_isfloat( VipsBandFmt fmt )
|
|||
|
||||
/**
|
||||
* vips_bandfmt_iscomplex:
|
||||
* @im: image to test
|
||||
* @fmt: format to test
|
||||
*
|
||||
* Return %TRUE if @fmt is one of the complex types.
|
||||
*/
|
||||
|
|
|
@ -118,28 +118,34 @@
|
|||
|
||||
/**
|
||||
* im_start_one:
|
||||
* @out: image to generate
|
||||
* @a: user data
|
||||
* @b: user data
|
||||
*
|
||||
* Start function for one image in. Input image is first user data.
|
||||
*
|
||||
* See also: im_generate().
|
||||
*/
|
||||
void *
|
||||
im_start_one( IMAGE *out, void *client, void *dummy )
|
||||
im_start_one( IMAGE *out, void *a, void *b )
|
||||
{
|
||||
IMAGE *in = (IMAGE *) client;
|
||||
IMAGE *in = (IMAGE *) a;
|
||||
|
||||
return( im_region_create( in ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* im_stop_one:
|
||||
* @seq: sequence value
|
||||
* @a: user data
|
||||
* @b: user data
|
||||
*
|
||||
* Stop function for one image in. Input image is first user data.
|
||||
* Stop function for one image in. Input image is @a.
|
||||
*
|
||||
* See also: im_generate().
|
||||
*/
|
||||
int
|
||||
im_stop_one( void *seq, void *dummy1, void *dummy2 )
|
||||
im_stop_one( void *seq, void *a, void *b )
|
||||
{
|
||||
REGION *reg = (REGION *) seq;
|
||||
|
||||
|
@ -150,14 +156,17 @@ im_stop_one( void *seq, void *dummy1, void *dummy2 )
|
|||
|
||||
/**
|
||||
* im_stop_many:
|
||||
* @seq: sequence value
|
||||
* @a: user data
|
||||
* @b: user data
|
||||
*
|
||||
* Stop function for many images in. First client is a pointer to
|
||||
* Stop function for many images in. First user data is a pointer to
|
||||
* a %NULL-terminated array of input images.
|
||||
*
|
||||
* See also: im_generate().
|
||||
*/
|
||||
int
|
||||
im_stop_many( void *seq, void *dummy1, void *dummy2 )
|
||||
im_stop_many( void *seq, void *a, void *b )
|
||||
{
|
||||
REGION **ar = (REGION **) seq;
|
||||
|
||||
|
@ -174,16 +183,19 @@ im_stop_many( void *seq, void *dummy1, void *dummy2 )
|
|||
|
||||
/**
|
||||
* im_start_many:
|
||||
* @out: image to generate
|
||||
* @a: user data
|
||||
* @b: user data
|
||||
*
|
||||
* Start function for many images in. First client is a pointer to
|
||||
* Start function for many images in. @a is a pointer to
|
||||
* a %NULL-terminated array of input images.
|
||||
*
|
||||
* See also: im_generate(), im_allocate_input_array()
|
||||
*/
|
||||
void *
|
||||
im_start_many( IMAGE *out, void *client, void *dummy )
|
||||
im_start_many( IMAGE *out, void *a, void *b )
|
||||
{
|
||||
IMAGE **in = (IMAGE **) client;
|
||||
IMAGE **in = (IMAGE **) a;
|
||||
|
||||
int i, n;
|
||||
REGION **ar;
|
||||
|
|
|
@ -64,11 +64,11 @@
|
|||
* Returns: the new #IMAGE, or %NULL on error.
|
||||
*/
|
||||
IMAGE *
|
||||
im_image( void *buffer, int width, int height, int bands, VipsBandFmt bandfmt )
|
||||
im_image( void *buffer, int xsize, int ysize, int bands, VipsBandFmt bandfmt )
|
||||
{
|
||||
IMAGE *im;
|
||||
|
||||
if( width <= 0 || height <= 0 || bands <= 0 ||
|
||||
if( xsize <= 0 || ysize <= 0 || bands <= 0 ||
|
||||
bandfmt < 0 || bandfmt > IM_BANDFMT_DPCOMPLEX ) {
|
||||
im_error( "im_image", "%s", _( "bad parameters" ) );
|
||||
return( NULL );
|
||||
|
@ -81,8 +81,8 @@ im_image( void *buffer, int width, int height, int bands, VipsBandFmt bandfmt )
|
|||
|
||||
/* Set header fields.
|
||||
*/
|
||||
im->Xsize = width;
|
||||
im->Ysize = height;
|
||||
im->Xsize = xsize;
|
||||
im->Ysize = ysize;
|
||||
im->Bands = bands;
|
||||
im->BandFmt = bandfmt;
|
||||
im->Bbits = im_bits_of_fmt( bandfmt );
|
||||
|
|
|
@ -170,6 +170,7 @@
|
|||
|
||||
/**
|
||||
* VipsBandFmt:
|
||||
* @IM_BANDFMT_NOTSET: invalid setting
|
||||
* @IM_BANDFMT_UCHAR: unsigned char format
|
||||
* @IM_BANDFMT_CHAR: char format
|
||||
* @IM_BANDFMT_USHORT: unsigned short format
|
||||
|
|
|
@ -1088,17 +1088,17 @@ im_meta_get_string( IMAGE *im, const char *field, char **str )
|
|||
/**
|
||||
* im_blob_get:
|
||||
* @value: GValue to get from
|
||||
* @blob_length: return the blob length here, optionally
|
||||
* @length: return the blob length here, optionally
|
||||
*
|
||||
* Get the address of the blob (binary large object) being held in @value and
|
||||
* optionally return its length in @blob_length.
|
||||
* optionally return its length in @length.
|
||||
*
|
||||
* See also: im_blob_set()
|
||||
* See also: im_blob_set().
|
||||
*
|
||||
* Returns: The blob address.
|
||||
*/
|
||||
void *
|
||||
im_blob_get( const GValue *value, size_t *blob_length )
|
||||
im_blob_get( const GValue *value, size_t *length )
|
||||
{
|
||||
Area *area;
|
||||
|
||||
|
@ -1107,8 +1107,8 @@ im_blob_get( const GValue *value, size_t *blob_length )
|
|||
*/
|
||||
|
||||
area = g_value_get_boxed( value );
|
||||
if( blob_length )
|
||||
*blob_length = area->length;
|
||||
if( length )
|
||||
*length = area->length;
|
||||
|
||||
return( area->data );
|
||||
}
|
||||
|
@ -1181,8 +1181,8 @@ im_blob_get_type( void )
|
|||
* im_blob_set:
|
||||
* @value: GValue to set
|
||||
* @free_fn: free function for @data
|
||||
* @blob: pointer to area of memory
|
||||
* @blob_length: length of memory area
|
||||
* @data: pointer to area of memory
|
||||
* @length: length of memory area
|
||||
*
|
||||
* Sets @value to hold a pointer to @blob. When @value is freed, @blob will be
|
||||
* freed with @free_fn. @value also holds a note of the length of the memory
|
||||
|
@ -1198,13 +1198,13 @@ im_blob_get_type( void )
|
|||
*/
|
||||
int
|
||||
im_blob_set( GValue *value,
|
||||
im_callback_fn free_fn, void *blob, size_t blob_length )
|
||||
im_callback_fn free_fn, void *data, size_t length )
|
||||
{
|
||||
Area *area;
|
||||
|
||||
g_assert( G_VALUE_TYPE( value ) == IM_TYPE_BLOB );
|
||||
|
||||
if( !(area = area_new_blob( free_fn, blob, blob_length )) )
|
||||
if( !(area = area_new_blob( free_fn, blob, length )) )
|
||||
return( -1 );
|
||||
|
||||
g_value_set_boxed( value, area );
|
||||
|
@ -1218,8 +1218,8 @@ im_blob_set( GValue *value,
|
|||
* @im: image to attach the metadata to
|
||||
* @field: metadata name
|
||||
* @free_fn: free function for @data
|
||||
* @blob: pointer to area of memory
|
||||
* @blob_length: length of memory area
|
||||
* @data: pointer to area of memory
|
||||
* @length: length of memory area
|
||||
*
|
||||
* Attaches @blob as a metadata item on @im under the name @field. A convenience
|
||||
* function over im_meta_set() using an im_blob.
|
||||
|
@ -1230,12 +1230,12 @@ im_blob_set( GValue *value,
|
|||
*/
|
||||
int
|
||||
im_meta_set_blob( IMAGE *im, const char *field,
|
||||
im_callback_fn free_fn, void *blob, size_t blob_length )
|
||||
im_callback_fn free_fn, void *data, size_t length )
|
||||
{
|
||||
GValue value = { 0 };
|
||||
|
||||
g_value_init( &value, IM_TYPE_BLOB );
|
||||
im_blob_set( &value, free_fn, blob, blob_length );
|
||||
im_blob_set( &value, free_fn, blob, length );
|
||||
|
||||
return( meta_set_value( im, field, &value ) );
|
||||
}
|
||||
|
@ -1244,28 +1244,28 @@ im_meta_set_blob( IMAGE *im, const char *field,
|
|||
* im_meta_get_blob:
|
||||
* @im: image to get the metadata from
|
||||
* @field: metadata name
|
||||
* @blob: pointer to area of memory
|
||||
* @blob_length: return the blob length here, optionally
|
||||
* @data: pointer to area of memory
|
||||
* @length: return the blob length here, optionally
|
||||
*
|
||||
* Gets @blob from @im under the name @field, optionally return its length in
|
||||
* @blob_length. A convenience
|
||||
* @length. A convenience
|
||||
* function over im_meta_get(). Use im_meta_get_typeof() to test for the
|
||||
* existance
|
||||
* of a piece of metadata.
|
||||
*
|
||||
* See also: im_meta_get(), im_meta_get_typeof(), im_blob_get(), im_blob
|
||||
* See also: im_meta_get(), im_meta_get_typeof(), im_blob_get(),
|
||||
*
|
||||
* Returns: 0 on success, -1 otherwise.
|
||||
*/
|
||||
int
|
||||
im_meta_get_blob( IMAGE *im, const char *field,
|
||||
void **blob, size_t *blob_length )
|
||||
void **data, size_t *length )
|
||||
{
|
||||
GValue value_copy = { 0 };
|
||||
|
||||
if( meta_get_value( im, field, IM_TYPE_BLOB, &value_copy ) )
|
||||
return( -1 );
|
||||
*blob = im_blob_get( &value_copy, blob_length );
|
||||
*blob = im_blob_get( &value_copy, length );
|
||||
g_value_unset( &value_copy );
|
||||
|
||||
return( 0 );
|
||||
|
|
|
@ -43,6 +43,16 @@
|
|||
#include <dmalloc.h>
|
||||
#endif /*WITH_DMALLOC*/
|
||||
|
||||
/**
|
||||
* Rect:
|
||||
* @left: left edge of rectangle
|
||||
* @top: top edge of rectangle
|
||||
* @width: width of rectangle
|
||||
* @height: height of rectangle
|
||||
*
|
||||
* A #Rect is a rectangular area of pixels.
|
||||
*/
|
||||
|
||||
/* Move the margins of a rect. +1 means out one pixel.
|
||||
*/
|
||||
void
|
||||
|
|
|
@ -229,7 +229,8 @@ im_concurrency_get( void )
|
|||
}
|
||||
|
||||
/**
|
||||
* _VipsThreadState:
|
||||
* VipsThreadState:
|
||||
* @im: the #VipsImage being operated upon
|
||||
* @reg: a #REGION
|
||||
* @pos: a #Rect
|
||||
* @x: an int
|
||||
|
|
|
@ -209,8 +209,8 @@ im_free_dmask( DOUBLEMASK *m )
|
|||
/**
|
||||
* im_create_imask:
|
||||
* @filename: set mask filename to this
|
||||
* @xs: mask width
|
||||
* @ys: mask height
|
||||
* @xsize: mask width
|
||||
* @ysize: mask height
|
||||
*
|
||||
* Create an empty imask. You need to loop over @coeff to set the values.
|
||||
*
|
||||
|
@ -219,14 +219,14 @@ im_free_dmask( DOUBLEMASK *m )
|
|||
* Returns: The newly-allocated mask.
|
||||
*/
|
||||
INTMASK *
|
||||
im_create_imask( const char *filename, int xs, int ys )
|
||||
im_create_imask( const char *filename, int xsize, int ysize )
|
||||
{
|
||||
INTMASK *m;
|
||||
int size = xs * ys;
|
||||
int size = xsize * ysize;
|
||||
|
||||
/* Check args.
|
||||
*/
|
||||
if( xs <= 0 || ys <= 0 || filename == NULL ) {
|
||||
if( xsize <= 0 || ysize <= 0 || filename == NULL ) {
|
||||
im_error( "im_create_imask", "%s", _( "bad arguments" ) );
|
||||
return( NULL );
|
||||
}
|
||||
|
@ -251,7 +251,8 @@ im_create_imask( const char *filename, int xs, int ys )
|
|||
im_free_imask( m );
|
||||
return( NULL );
|
||||
}
|
||||
m->xsize = xs; m->ysize = ys;
|
||||
m->xsize = xsize;
|
||||
m->ysize = ysize;
|
||||
|
||||
return( m );
|
||||
}
|
||||
|
@ -259,8 +260,8 @@ im_create_imask( const char *filename, int xs, int ys )
|
|||
/**
|
||||
* im_create_imaskv:
|
||||
* @filename: set mask filename to this
|
||||
* @xs: mask width
|
||||
* @ys: mask height
|
||||
* @xsize: mask width
|
||||
* @ysize: mask height
|
||||
* @Varargs: values to set for the mask
|
||||
*
|
||||
* Create an imask and initialise it from the funtion parameter list.
|
||||
|
@ -270,18 +271,18 @@ im_create_imask( const char *filename, int xs, int ys )
|
|||
* Returns: The newly-allocated mask.
|
||||
*/
|
||||
INTMASK *
|
||||
im_create_imaskv( const char *filename, int xs, int ys, ... )
|
||||
im_create_imaskv( const char *filename, int xsize, int ysize, ... )
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
INTMASK *m;
|
||||
int i;
|
||||
|
||||
if( !(m = im_create_imask( filename, xs, ys )) )
|
||||
if( !(m = im_create_imask( filename, xsize, ysize )) )
|
||||
return( NULL );
|
||||
|
||||
va_start( ap, ys );
|
||||
for( i = 0; i < xs * ys; i++ )
|
||||
va_start( ap, ysize );
|
||||
for( i = 0; i < xsize * ysize; i++ )
|
||||
m->coeff[i] = va_arg( ap, int );
|
||||
va_end( ap );
|
||||
|
||||
|
@ -291,24 +292,24 @@ im_create_imaskv( const char *filename, int xs, int ys, ... )
|
|||
/**
|
||||
* im_create_dmask:
|
||||
* @filename: set mask filename to this
|
||||
* @xs: mask width
|
||||
* @ys: mask height
|
||||
* @xsize: mask width
|
||||
* @ysize: mask height
|
||||
*
|
||||
* Create an empty dmask. You need to loop over @coeff to set the values.
|
||||
*
|
||||
* See also: im_create_dmaskv().
|
||||
* See also: im_create_dmaskv(), im_vips2mask().
|
||||
*
|
||||
* Returns: The newly-allocated mask.
|
||||
*/
|
||||
DOUBLEMASK *
|
||||
im_create_dmask( const char *filename, int xs, int ys )
|
||||
im_create_dmask( const char *filename, int xsize, int ysize )
|
||||
{
|
||||
DOUBLEMASK *m;
|
||||
int size = xs * ys;
|
||||
int size = xsize * ysize;
|
||||
|
||||
/* Check args.
|
||||
*/
|
||||
if( xs <= 0 || ys <= 0 || filename == NULL ) {
|
||||
if( xsize <= 0 || ysize <= 0 || filename == NULL ) {
|
||||
im_error( "im_create_dmask", "%s", _( "bad arguments" ) );
|
||||
return( NULL );
|
||||
}
|
||||
|
@ -333,7 +334,8 @@ im_create_dmask( const char *filename, int xs, int ys )
|
|||
im_free_dmask( m );
|
||||
return( NULL );
|
||||
}
|
||||
m->xsize = xs; m->ysize = ys;
|
||||
m->xsize = xsize;
|
||||
m->ysize = ysize;
|
||||
|
||||
return( m );
|
||||
}
|
||||
|
@ -341,8 +343,8 @@ im_create_dmask( const char *filename, int xs, int ys )
|
|||
/**
|
||||
* im_create_dmaskv:
|
||||
* @filename: set mask filename to this
|
||||
* @xs: mask width
|
||||
* @ys: mask height
|
||||
* @xsize: mask width
|
||||
* @ysize: mask height
|
||||
* @Varargs: values to set for the mask
|
||||
*
|
||||
* Create a dmask and initialise it from the funtion parameter list.
|
||||
|
@ -352,18 +354,18 @@ im_create_dmask( const char *filename, int xs, int ys )
|
|||
* Returns: The newly-allocated mask.
|
||||
*/
|
||||
DOUBLEMASK *
|
||||
im_create_dmaskv( const char *filename, int xs, int ys, ... )
|
||||
im_create_dmaskv( const char *filename, int xsize, int ysize, ... )
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
DOUBLEMASK *m;
|
||||
int i;
|
||||
|
||||
if( !(m = im_create_dmask( filename, xs, ys )) )
|
||||
if( !(m = im_create_dmask( filename, xsize, ysize )) )
|
||||
return( NULL );
|
||||
|
||||
va_start( ap, ys );
|
||||
for( i = 0; i < xs * ys; i++ )
|
||||
va_start( ap, ysize );
|
||||
for( i = 0; i < xsize * ysize; i++ )
|
||||
m->coeff[i] = va_arg( ap, double );
|
||||
va_end( ap );
|
||||
|
||||
|
@ -633,7 +635,7 @@ im_scale_dmask( DOUBLEMASK *m, const char *filename )
|
|||
|
||||
/**
|
||||
* im_norm_dmask:
|
||||
* @m: mask to scale
|
||||
* @mask: mask to scale
|
||||
*
|
||||
* Normalise the dmask. Apply the scale and offset to each element and return
|
||||
* a mask with scale 1, offset zero.
|
||||
|
|
Loading…
Reference in New Issue