doc cleanups

This commit is contained in:
John Cupitt 2009-10-22 13:43:09 +00:00
parent 1082e5b0f1
commit 7249f2cb8c
16 changed files with 81 additions and 74 deletions

View File

@ -118,6 +118,8 @@ add_callback( IMAGE *im, GSList **cblist, im_callback_fn fn, void *a, void *b )
* See also: im_malloc() (implemented with im_add_close_callback()),
* im_add_preclose_callback() (called earlier in the image close process),
* im_free().
*
* Returns: 0 on success, or -1 on error.
*/
int
im_add_close_callback( IMAGE *im, im_callback_fn fn, void *a, void *b )
@ -140,6 +142,8 @@ im_add_close_callback( IMAGE *im, im_callback_fn fn, void *a, void *b )
*
* Pre-close callbacks are a good place for languae bindings to break as
* association between the language object and the VIPS image.
*
* Returns: 0 on success, or -1 on error.
*/
int
im_add_preclose_callback( IMAGE *im, im_callback_fn fn, void *a, void *b )
@ -171,6 +175,8 @@ im_add_preclose_callback( IMAGE *im, im_callback_fn fn, void *a, void *b )
* and that image will recieve notification instead.
*
* See also: im_add_evalend_callback(), im_add_evalstart_callback().
*
* Returns: 0 on success, or -1 on error.
*/
int
im_add_eval_callback( IMAGE *im, im_callback_fn fn, void *a, void *b )
@ -208,6 +214,8 @@ im_add_eval_callback( IMAGE *im, im_callback_fn fn, void *a, void *b )
* and that image will recieve notification instead.
*
* See also: im_add_eval_callback(), im_add_evalstart_callback().
*
* Returns: 0 on success, or -1 on error.
*/
int
im_add_evalend_callback( IMAGE *im, im_callback_fn fn, void *a, void *b )
@ -240,6 +248,8 @@ im_add_evalend_callback( IMAGE *im, im_callback_fn fn, void *a, void *b )
* and that image will recieve notification instead.
*
* See also: im_add_eval_callback(), im_add_evalend_callback().
*
* Returns: 0 on success, or -1 on error.
*/
int
im_add_evalstart_callback( IMAGE *im, im_callback_fn fn, void *a, void *b )
@ -261,6 +271,8 @@ im_add_evalstart_callback( IMAGE *im, im_callback_fn fn, void *a, void *b )
* removing images from other, higher-level caches.
*
* See also: im_invalidate().
*
* Returns: 0 on success, or -1 on error.
*/
int
im_add_invalidate_callback( IMAGE *im, im_callback_fn fn, void *a, void *b )

View File

@ -543,9 +543,9 @@ im_piocheck( IMAGE *in, IMAGE *out )
* If not, set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 on OK, or -1 on error.
*/
int
im_check_uncoded( const char *domain, IMAGE *im )
@ -567,9 +567,9 @@ im_check_uncoded( const char *domain, IMAGE *im )
* If not, set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 on OK, or -1 on error.
*/
int
im_check_known_coded( const char *domain, IMAGE *im )
@ -597,9 +597,9 @@ im_check_known_coded( const char *domain, IMAGE *im )
* If not, set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 on OK, or -1 on error.
*/
int
im_check_bands_1orn( const char *domain, IMAGE *im1, IMAGE *im2 )
@ -624,9 +624,9 @@ im_check_bands_1orn( const char *domain, IMAGE *im1, IMAGE *im2 )
* Otherwise set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 if OK, -1 otherwise.
*/
int
im_check_noncomplex( const char *domain, IMAGE *im )
@ -648,9 +648,9 @@ im_check_noncomplex( const char *domain, IMAGE *im )
* Otherwise set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 if OK, -1 otherwise.
*/
int
im_check_complex( const char *domain, IMAGE *im )
@ -673,9 +673,9 @@ im_check_complex( const char *domain, IMAGE *im )
* Otherwise set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 if OK, -1 otherwise.
*/
int
im_check_format( const char *domain, IMAGE *im, VipsBandFmt fmt )
@ -698,9 +698,9 @@ im_check_format( const char *domain, IMAGE *im, VipsBandFmt fmt )
* Otherwise set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 if OK, -1 otherwise.
*/
int
im_check_mono( const char *domain, IMAGE *im )
@ -722,9 +722,9 @@ im_check_mono( const char *domain, IMAGE *im )
* Otherwise set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 if OK, -1 otherwise.
*/
int
im_check_int( const char *domain, IMAGE *im )
@ -746,9 +746,9 @@ im_check_int( const char *domain, IMAGE *im )
* Otherwise set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 if OK, -1 otherwise.
*/
int
im_check_u8or16( const char *domain, IMAGE *im )
@ -773,9 +773,9 @@ im_check_u8or16( const char *domain, IMAGE *im )
* If not, set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 if OK, -1 otherwise.
*/
int
im_check_same_size( const char *domain, IMAGE *im1, IMAGE *im2 )
@ -798,9 +798,9 @@ im_check_same_size( const char *domain, IMAGE *im1, IMAGE *im2 )
* If not, set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 if OK, -1 otherwise.
*/
int
im_check_same_bands( const char *domain, IMAGE *im1, IMAGE *im2 )
@ -824,9 +824,9 @@ im_check_same_bands( const char *domain, IMAGE *im1, IMAGE *im2 )
* If not, set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 if OK, -1 otherwise.
*/
int
im_check_same_format( const char *domain, IMAGE *im1, IMAGE *im2 )
@ -850,9 +850,9 @@ im_check_same_format( const char *domain, IMAGE *im1, IMAGE *im2 )
* If not, set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 if OK, -1 otherwise.
*/
int
im_check_same_coding( const char *domain, IMAGE *im1, IMAGE *im2 )
@ -876,9 +876,9 @@ im_check_same_coding( const char *domain, IMAGE *im1, IMAGE *im2 )
* If not, set an error message
* and return non-zero.
*
* Returns: 0 if OK, -1 otherwise.
*
* See also: im_error().
*
* Returns: 0 if OK, -1 otherwise.
*/
int
im_check_vector( const char *domain, int n, IMAGE *im )

View File

@ -116,9 +116,9 @@ static VipsBuf im_error_buf = VIPS_BUF_STATIC( im_error_text );
* Get a pointer to the start of the error buffer as a C string.
* The string is owned by the error system and must not be freed.
*
* Returns: the error buffer as a C string which must not be freed
*
* See also: im_error_clear().
*
* Returns: the error buffer as a C string which must not be freed
*/
const char *
im_error_buffer( void )

View File

@ -88,9 +88,9 @@ find_least( im_demand_type a, im_demand_type b )
* for the cache invalidation system. You have to call this function, or its
* varargs friend im_demand_hint().
*
* Returns: 0 on success, or -1 on error.
*
* See also: im_demand_hint(), im_generate().
*
* Returns: 0 on success, or -1 on error.
*/
int
im_demand_hint_array( IMAGE *im, VipsDemandStyle hint, IMAGE **in )
@ -149,9 +149,9 @@ im_demand_hint_array( IMAGE *im, VipsDemandStyle hint, IMAGE **in )
*
* Build an array and call im_demand_hint_array().
*
* Returns: 0 on success, or -1 on error.
*
* See also: im_demand_hint(), im_generate().
*
* Returns: 0 on success, or -1 on error.
*/
int
im_demand_hint( IMAGE *im, VipsDemandStyle hint, ... )

View File

@ -642,9 +642,9 @@ im_generate( IMAGE *im,
* Use im_prepare() to calculate an area of pixels in-line.
* Use im_render() to calculate an area of pixels in the background.
*
* Returns: 0 on success, or -1 on error
*
* See also: im_prepare(), im_render(), im_prepare_to().
*
* Returns: 0 on success, or -1 on error
*/
int
im_prepare_thread( im_threadgroup_t *tg, REGION *or, Rect *r )

View File

@ -362,9 +362,9 @@ guess_prefix( const char *argv0, const char *name )
*
* Don't free the return string!
*
* Returns: the install prefix as a static string, do not free
*
* See also: im_guess_libdir().
*
* Returns: the install prefix as a static string, do not free.
*/
const char *
im_guess_prefix( const char *argv0, const char *env_name )
@ -425,9 +425,9 @@ im_guess_prefix( const char *argv0, const char *env_name )
*
* Don't free the return string!
*
* Returns: the libdir as a static string, do not free
*
* See also: im_guess_prefix().
*
* Returns: the libdir as a static string, do not free.
*/
const char *
im_guess_libdir( const char *argv0, const char *env_name )

View File

@ -117,10 +117,10 @@ GMutex *im__global_lock = NULL;
* }
* ]|
*
* Returns: 0 on success, -1 otherwise
*
* See also: im_get_option_group(), im_version(), im_guess_prefix(),
* im_guess_libdir().
*
* Returns: 0 on success, -1 otherwise
*/
int
im_init_world( const char *argv0 )
@ -278,10 +278,10 @@ static GOptionEntry option_entries[] = {
* command-line options. It can be used with GOption to help
* parse argc/argv.
*
* Returns: a GOptionGroup for VIPS, see GOption
*
* See also: im_version(), im_guess_prefix(),
* im_guess_libdir(), im_init_world().
*
* Returns: a GOptionGroup for VIPS, see GOption
*/
GOptionGroup *
im_get_option_group( void )

View File

@ -398,9 +398,9 @@ evalend_cb( Progress *progress )
* </listitem>
* </itemizedlist>
*
* Returns: the image descriptor on success and NULL on error.
*
* See also: im_close(), #VipsFormat
*
* Returns: the image descriptor on success and NULL on error.
*/
IMAGE *
im_open( const char *filename, const char *mode )

View File

@ -299,9 +299,9 @@
* return( -1 );
* ]|
*
* Returns: 0 on sucess, or -1 on error
*
* See also: im_open(), im_open_local(), im_local_array().
*
* Returns: 0 on sucess, or -1 on error
*/
/**
@ -313,9 +313,9 @@
* Just like im_open(), but the #IMAGE will be closed for you automatically
* when @IM is closed.
*
* Returns: a new #IMAGE, or NULL on error
*
* See also: im_open(), im_close(), im_local().
*
* Returns: a new #IMAGE, or NULL on error
*/
/* Try to make an O_BINARY ... sometimes need the leading '_'.

View File

@ -106,7 +106,8 @@ im__test_kill( IMAGE *im )
return( 0 );
}
/** im_prepare:
/**
* im_prepare:
* @reg: region to prepare
* @r: #Rect of pixels you need to be able to address
*
@ -118,11 +119,12 @@ im__test_kill( IMAGE *im )
* pixels are ready.
*
* Use im_prepare_thread() to calculate an area of pixels with many
* threads. Use im_render() to calculate an area of pixels in the background.
* threads. Use im_render_priority() to calculate an area of pixels in the
* background.
*
* Returns: 0 on success, or -1 on error
* See also: im_prepare_thread(), im_render_priority(), im_prepare_to().
*
* See also: im_prepare_thread(), im_render(), im_prepare_to().
* Returns: 0 on success, or -1 on error.
*/
int
im_prepare( REGION *reg, Rect *r )
@ -283,9 +285,9 @@ im_prepare_to_generate( REGION *reg, REGION *dest, Rect *r, int x, int y )
* result, we guarantee that we will fill the pixels in @dest at offset @x, @y.
* In other words, we generate an extra copy operation if necessary.
*
* Returns: 0 on success, or -1 on error
*
* See also: im_prepare().
*
* Returns: 0 on success, or -1 on error
*/
int
im_prepare_to( REGION *reg, REGION *dest, Rect *r, int x, int y )

View File

@ -1062,9 +1062,9 @@ mask_fill( REGION *out, void *seq, void *a, void *b )
* im_prepare() on @out will always block until the pixels have been
* calculated by the background #im_threadgroup_t.
*
* Returns: 0 on sucess, -1 on error.
*
* See also: im_cache(), im_prepare().
*
* Returns: 0 on sucess, -1 on error.
*/
int
im_render_priority( IMAGE *in, IMAGE *out, IMAGE *mask,

View File

@ -81,9 +81,9 @@
* im_writeline(). You need to have set all the image fields, such as @Xsize
* and @BandFmt, before calling this.
*
* Returns: 0 on success, or -1 on error.
*
* See also: im_writeline(), im_generate(), im_initdesc(), im_cp_desc().
*
* Returns: 0 on success, or -1 on error.
*/
int
im_setupout( IMAGE *im )

View File

@ -179,7 +179,7 @@ VImage::VImage( void *buffer, int width, int height,
_ref = new refblock;
if( !(_ref->im = im_image( buffer, width, height,
bands, int( format ) )) )
bands, VipsBandFmt( format ) )) )
verror();
_ref->close_on_delete = 1;
@ -432,19 +432,9 @@ void VImage::initdesc( int x, int y, int b,
TBandFmt f, TCoding c, TType t, float xr, float yr, int xo, int yo )
throw( VError )
{
static int fmt[] = {
0, // NOTSET
IM_BBITS_BYTE, IM_BBITS_BYTE, // uchar/char
IM_BBITS_SHORT, IM_BBITS_SHORT, // ushort/short
IM_BBITS_INT, IM_BBITS_INT, // uint/int
IM_BBITS_FLOAT, // float types ...
IM_BBITS_COMPLEX,
IM_BBITS_DOUBLE,
IM_BBITS_DPCOMPLEX
};
im_initdesc( _ref->im, x, y, b,
fmt[(int)f + 1], f, c, t, xr, yr, xo, yo );
im_initdesc( _ref->im, x, y, b, 0,
VipsBandFmt( f ), VipsCoding( c ), VipsType( t ),
xr, yr, xo, yo );
if( im_setupout( _ref->im ) )
verror();
}

View File

@ -43,6 +43,7 @@
#include <stdlib.h>
#include <vips/vips.h>
#include <vips/internal.h>
int
main( int argc, char **argv )

View File

@ -43,6 +43,7 @@
#include <stdlib.h>
#include <vips/vips.h>
#include <vips/internal.h>
int
main( int argc, char **argv )

View File

@ -43,6 +43,7 @@
#include <stdlib.h>
#include <vips/vips.h>
#include <vips/internal.h>
int
main( int argc, char **argv )