gtkdoc fixes
This commit is contained in:
parent
e8e67e51d1
commit
b70319cbec
@ -126,11 +126,11 @@ im_col_Ch2ab( float C, float h, float *a, float *b )
|
||||
/**
|
||||
* im_col_XYZ2Lab:
|
||||
* @X: Input CIE XYZ colour
|
||||
* @Y:
|
||||
* @Z:
|
||||
* @Y: Input CIE XYZ colour
|
||||
* @Z: Input CIE XYZ colour
|
||||
* @L: return CIE Lab value
|
||||
* @a:
|
||||
* @b:
|
||||
* @a: return CIE Lab value
|
||||
* @b: return CIE Lab value
|
||||
*
|
||||
* Calculate Lab from XYZ, D65.
|
||||
*
|
||||
@ -157,11 +157,11 @@ im_col_XYZ2Lab( float X, float Y, float Z, float *L, float *a, float *b )
|
||||
/**
|
||||
* im_col_Lab2XYZ:
|
||||
* @L: Input CIE Lab value
|
||||
* @a:
|
||||
* @b:
|
||||
* @a: Input CIE Lab value
|
||||
* @b: Input CIE Lab value
|
||||
* @X: Return CIE XYZ colour
|
||||
* @Y:
|
||||
* @Z:
|
||||
* @Y: Return CIE XYZ colour
|
||||
* @Z: Return CIE XYZ colour
|
||||
*
|
||||
* Calculate XYZ from Lab, D65.
|
||||
*
|
||||
@ -188,11 +188,11 @@ im_col_Lab2XYZ( float L, float a, float b, float *X, float *Y, float *Z )
|
||||
/**
|
||||
* im_col_pythagoras:
|
||||
* @L1: Input coordinate 1
|
||||
* @a1:
|
||||
* @b1:
|
||||
* @a1: Input coordinate 1
|
||||
* @b1: Input coordinate 1
|
||||
* @L2: Input coordinate 2
|
||||
* @a2:
|
||||
* @b2:
|
||||
* @a2: Input coordinate 2
|
||||
* @b2: Input coordinate 2
|
||||
*
|
||||
* Pythagorean distance between two points in colour space. Lab/XYZ/UCS etc.
|
||||
*/
|
||||
@ -531,11 +531,11 @@ im_col_make_tables_UCS( void )
|
||||
/**
|
||||
* im_col_dECMC:
|
||||
* @L1: Input coordinate 1
|
||||
* @a1:
|
||||
* @b1:
|
||||
* @a1: Input coordinate 1
|
||||
* @b1: Input coordinate 1
|
||||
* @L2: Input coordinate 2
|
||||
* @a2:
|
||||
* @b2:
|
||||
* @a2: Input coordinate 2
|
||||
* @b2: Input coordinate 2
|
||||
*
|
||||
* CMC colour difference from a pair of Lab values.
|
||||
*
|
||||
@ -617,11 +617,11 @@ im_col_ab2h( double a, double b )
|
||||
/**
|
||||
* im_col_dE00:
|
||||
* @L1: Input coordinate 1
|
||||
* @a1:
|
||||
* @b1:
|
||||
* @a1: Input coordinate 1
|
||||
* @b1: Input coordinate 1
|
||||
* @L2: Input coordinate 2
|
||||
* @a2:
|
||||
* @b2:
|
||||
* @a2: Input coordinate 2
|
||||
* @b2: Input coordinate 2
|
||||
*
|
||||
* CIEDE2000, from:
|
||||
*
|
||||
|
@ -49,17 +49,6 @@
|
||||
#include <dmalloc.h>
|
||||
#endif /*WITH_DMALLOC*/
|
||||
|
||||
/**
|
||||
* SECTION: disp
|
||||
* @short_description: convert to and from display RGB
|
||||
* @stability: Stable
|
||||
* @see_also: <link linkend="libvips-colour">colour</link>
|
||||
* @include: vips/vips.h
|
||||
*
|
||||
* Convert to and from display RGB. These functions are still used by nip2,
|
||||
* but most programs will be better off with im_icc_transform() and friends.
|
||||
*/
|
||||
|
||||
/* Tables we've generated, indexed by display name.
|
||||
*/
|
||||
static GHashTable *im__col_display_tables = NULL;
|
||||
@ -570,6 +559,9 @@ im_col_XYZ2rgb( struct im_col_display *d,
|
||||
*
|
||||
* Convert an image from LabQ (Coding == IM_CODING_LABQ) to XYZ.
|
||||
*
|
||||
* Convert to and from display RGB. These functions are still used by nip2,
|
||||
* but most programs will be better off with im_icc_transform() and friends.
|
||||
*
|
||||
* Returns: 0 on success, -1 on error.
|
||||
*/
|
||||
int
|
||||
|
@ -856,10 +856,10 @@ im_icc_ac2rc( IMAGE *in, IMAGE *out, const char *profile_filename )
|
||||
|
||||
/**
|
||||
* VipsIntent:
|
||||
* @IM_INTENT_PERCEPTUAL:
|
||||
* @IM_INTENT_RELATIVE_COLORIMETRIC:
|
||||
* @IM_INTENT_SATURATION:
|
||||
* @IM_INTENT_ABSOLUTE_COLORIMETRIC:
|
||||
* @IM_INTENT_PERCEPTUAL: perceptual rendering intent
|
||||
* @IM_INTENT_RELATIVE_COLORIMETRIC: relative colorimetric rendering intent
|
||||
* @IM_INTENT_SATURATION: saturation rendering intent
|
||||
* @IM_INTENT_ABSOLUTE_COLORIMETRIC: absolute colorimetric rendering intent
|
||||
*
|
||||
* The rendering intent. #IM_INTENT_ABSOLUTE_COLORIMETRIC is best for
|
||||
* scientific work, #IM_INTENT_RELATIVE_COLORIMETRIC is usually best for
|
||||
|
@ -446,7 +446,7 @@ format_for_file_sub( VipsFormatClass *format,
|
||||
|
||||
/**
|
||||
* vips_format_for_file:
|
||||
* @name: file to find a format for
|
||||
* @filename: file to find a format for
|
||||
*
|
||||
* Searches for a format you could use to load a file.
|
||||
*
|
||||
@ -455,28 +455,28 @@ format_for_file_sub( VipsFormatClass *format,
|
||||
* Returns: a format on success, %NULL on error
|
||||
*/
|
||||
VipsFormatClass *
|
||||
vips_format_for_file( const char *name )
|
||||
vips_format_for_file( const char *filename )
|
||||
{
|
||||
char filename[FILENAME_MAX];
|
||||
char name[FILENAME_MAX];
|
||||
char options[FILENAME_MAX];
|
||||
VipsFormatClass *format;
|
||||
|
||||
/* Break any options off the name ... eg. "fred.tif:jpeg,tile"
|
||||
* etc.
|
||||
*/
|
||||
im_filename_split( name, filename, options );
|
||||
im_filename_split( filename, name, options );
|
||||
|
||||
if( !im_existsf( "%s", filename ) ) {
|
||||
if( !im_existsf( "%s", name ) ) {
|
||||
im_error( "format_for_file",
|
||||
_( "file \"%s\" not found" ), filename );
|
||||
_( "file \"%s\" not found" ), name );
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
if( !(format = (VipsFormatClass *) vips_format_map(
|
||||
(VSListMap2Fn) format_for_file_sub,
|
||||
(void *) name, (void *) filename )) ) {
|
||||
(void *) filename, (void *) name )) ) {
|
||||
im_error( "format_for_file",
|
||||
_( "file \"%s\" not a known format" ), filename );
|
||||
_( "file \"%s\" not a known format" ), name );
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
@ -498,7 +498,7 @@ format_for_name_sub( VipsFormatClass *format, const char *name )
|
||||
|
||||
/**
|
||||
* vips_format_for_name:
|
||||
* @name: name to find a format for
|
||||
* @filename: name to find a format for
|
||||
*
|
||||
* Searches for a format you could use to save a file.
|
||||
*
|
||||
@ -507,15 +507,16 @@ format_for_name_sub( VipsFormatClass *format, const char *name )
|
||||
* Returns: a format on success, %NULL on error
|
||||
*/
|
||||
VipsFormatClass *
|
||||
vips_format_for_name( const char *name )
|
||||
vips_format_for_name( const char *filename )
|
||||
{
|
||||
VipsFormatClass *format;
|
||||
|
||||
if( !(format = (VipsFormatClass *) vips_format_map(
|
||||
(VSListMap2Fn) format_for_name_sub, (void *) name, NULL )) ) {
|
||||
(VSListMap2Fn) format_for_name_sub,
|
||||
(void *) filename, NULL )) ) {
|
||||
char suffix[FILENAME_MAX];
|
||||
|
||||
im_filename_suffix( name, suffix );
|
||||
im_filename_suffix( filename, suffix );
|
||||
im_error( "vips_format_for_name",
|
||||
_( "\"%s\" is not a supported image format." ),
|
||||
suffix );
|
||||
@ -528,7 +529,7 @@ vips_format_for_name( const char *name )
|
||||
|
||||
/**
|
||||
* vips_format_read:
|
||||
* @name: file to load
|
||||
* @filename: file to load
|
||||
* @out: write the file to this image
|
||||
*
|
||||
* Searches for a format for this file, then loads the file into @out.
|
||||
@ -538,12 +539,12 @@ vips_format_for_name( const char *name )
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_format_read( const char *name, IMAGE *out )
|
||||
vips_format_read( const char *filename, IMAGE *out )
|
||||
{
|
||||
VipsFormatClass *format;
|
||||
|
||||
if( !(format = vips_format_for_file( name )) ||
|
||||
format->load( name, out ) )
|
||||
if( !(format = vips_format_for_file( filename )) ||
|
||||
format->load( filename, out ) )
|
||||
return( -1 );
|
||||
|
||||
return( 0 );
|
||||
@ -551,8 +552,8 @@ vips_format_read( const char *name, IMAGE *out )
|
||||
|
||||
/**
|
||||
* vips_format_write:
|
||||
* @im: image to write
|
||||
* @name: file to write to
|
||||
* @in: image to write
|
||||
* @filename: file to write to
|
||||
*
|
||||
* Searches for a format for this name, then saves @im to it.
|
||||
*
|
||||
@ -561,12 +562,12 @@ vips_format_read( const char *name, IMAGE *out )
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_format_write( IMAGE *im, const char *name )
|
||||
vips_format_write( IMAGE *in, const char *filename )
|
||||
{
|
||||
VipsFormatClass *format;
|
||||
|
||||
if( !(format = vips_format_for_name( name )) ||
|
||||
format->save( im, name ) )
|
||||
if( !(format = vips_format_for_name( filename )) ||
|
||||
format->save( in, filename ) )
|
||||
return( -1 );
|
||||
|
||||
return( 0 );
|
||||
|
@ -149,17 +149,17 @@ tone_curve( ToneShape *ts, double x )
|
||||
|
||||
/**
|
||||
* im_tone_build_range:
|
||||
* out: output image
|
||||
* in_max: input range
|
||||
* out_max: output range
|
||||
* Lb: black-point [0-100]
|
||||
* Lw: white-point [0-100]
|
||||
* Ps: shadow point (eg. 0.2)
|
||||
* Pm: mid-tone point (eg. 0.5)
|
||||
* Ph: highlight point (eg. 0.8)
|
||||
* S: shadow adjustment (+/- 30)
|
||||
* M: mid-tone adjustment (+/- 30)
|
||||
* H: highlight adjustment (+/- 30)
|
||||
* @out: output image
|
||||
* @in_max: input range
|
||||
* @out_max: output range
|
||||
* @Lb: black-point [0-100]
|
||||
* @Lw: white-point [0-100]
|
||||
* @Ps: shadow point (eg. 0.2)
|
||||
* @Pm: mid-tone point (eg. 0.5)
|
||||
* @Ph: highlight point (eg. 0.8)
|
||||
* @S: shadow adjustment (+/- 30)
|
||||
* @M: mid-tone adjustment (+/- 30)
|
||||
* @H: highlight adjustment (+/- 30)
|
||||
*
|
||||
* im_tone_build_range() generates a tone curve for the adjustment of image
|
||||
* levels. It is mostly designed for adjusting the L* part of a LAB image in
|
||||
@ -281,15 +281,15 @@ im_tone_build_range( IMAGE *out,
|
||||
|
||||
/**
|
||||
* im_tone_build:
|
||||
* out: output image
|
||||
* Lb: black-point [0-100]
|
||||
* Lw: white-point [0-100]
|
||||
* Ps: shadow point (eg. 0.2)
|
||||
* Pm: mid-tone point (eg. 0.5)
|
||||
* Ph: highlight point (eg. 0.8)
|
||||
* S: shadow adjustment (+/- 30)
|
||||
* M: mid-tone adjustment (+/- 30)
|
||||
* H: highlight adjustment (+/- 30)
|
||||
* @out: output image
|
||||
* @Lb: black-point [0-100]
|
||||
* @Lw: white-point [0-100]
|
||||
* @Ps: shadow point (eg. 0.2)
|
||||
* @Pm: mid-tone point (eg. 0.5)
|
||||
* @Ph: highlight point (eg. 0.8)
|
||||
* @S: shadow adjustment (+/- 30)
|
||||
* @M: mid-tone adjustment (+/- 30)
|
||||
* @H: highlight adjustment (+/- 30)
|
||||
*
|
||||
* As im_tone_build_range(), but set 32767 and 32767 as values for @in_max
|
||||
* and @out_max. This makes a curve suitable for correcting LABS
|
||||
@ -429,14 +429,14 @@ im_tone_map( IMAGE *in, IMAGE *out, IMAGE *lut )
|
||||
|
||||
/**
|
||||
* im_tone_analyse:
|
||||
* in: input image
|
||||
* out: output image
|
||||
* Ps: shadow point (eg. 0.2)
|
||||
* Pm: mid-tone point (eg. 0.5)
|
||||
* Ph: highlight point (eg. 0.8)
|
||||
* S: shadow adjustment (+/- 30)
|
||||
* M: mid-tone adjustment (+/- 30)
|
||||
* H: highlight adjustment (+/- 30)
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @Ps: shadow point (eg. 0.2)
|
||||
* @Pm: mid-tone point (eg. 0.5)
|
||||
* @Ph: highlight point (eg. 0.8)
|
||||
* @S: shadow adjustment (+/- 30)
|
||||
* @M: mid-tone adjustment (+/- 30)
|
||||
* @H: highlight adjustment (+/- 30)
|
||||
*
|
||||
* As im_tone_build(), but analyse the histogram of @in and use it to
|
||||
* pick the 0.1% and 99.9% points for @Lb and @Lw.
|
||||
|
@ -55,10 +55,10 @@ typedef struct im__DOUBLEMASK {
|
||||
char *filename;
|
||||
} DOUBLEMASK;
|
||||
|
||||
INTMASK *im_create_imask( const char *name, int width, int height );
|
||||
INTMASK *im_create_imaskv( const char *name, int width, int height, ... );
|
||||
DOUBLEMASK *im_create_dmask( const char *name, int width, int height );
|
||||
DOUBLEMASK *im_create_dmaskv( const char *name, int width, int height, ... );
|
||||
INTMASK *im_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_read_imask( const char *filename );
|
||||
DOUBLEMASK *im_read_dmask( const char *filename );
|
||||
@ -83,8 +83,8 @@ INTMASK *im_gauss_imask_sep( const char *filename,
|
||||
DOUBLEMASK *im_gauss_dmask( const char *filename,
|
||||
double sigma, double min_ampl );
|
||||
|
||||
INTMASK *im_dup_imask( INTMASK *m, const char *name );
|
||||
DOUBLEMASK *im_dup_dmask( DOUBLEMASK *m, const char *name );
|
||||
INTMASK *im_dup_imask( INTMASK *m, const char *filename );
|
||||
DOUBLEMASK *im_dup_dmask( DOUBLEMASK *m, const char *filename );
|
||||
|
||||
INTMASK *im_scale_dmask( DOUBLEMASK *m, const char *filename );
|
||||
void im_norm_dmask( DOUBLEMASK *mask );
|
||||
@ -95,13 +95,13 @@ INTMASK *im_rotate_imask45( INTMASK *m, const char *filename );
|
||||
DOUBLEMASK *im_rotate_dmask90( DOUBLEMASK *m, const char *filename );
|
||||
DOUBLEMASK *im_rotate_dmask45( DOUBLEMASK *m, const char *filename );
|
||||
|
||||
DOUBLEMASK *im_mattrn( DOUBLEMASK *in, const char *name );
|
||||
DOUBLEMASK *im_matcat( DOUBLEMASK *in1, DOUBLEMASK *in2, const char *name );
|
||||
DOUBLEMASK *im_matmul( DOUBLEMASK *in1, DOUBLEMASK *in2, const char *name );
|
||||
DOUBLEMASK *im_mattrn( DOUBLEMASK *in, const char *filename );
|
||||
DOUBLEMASK *im_matcat( DOUBLEMASK *in1, DOUBLEMASK *in2, const char *filename );
|
||||
DOUBLEMASK *im_matmul( DOUBLEMASK *in1, DOUBLEMASK *in2, const char *filename );
|
||||
|
||||
DOUBLEMASK *im_lu_decomp( const DOUBLEMASK *mat, const char *name );
|
||||
DOUBLEMASK *im_lu_decomp( const DOUBLEMASK *mat, const char *filename );
|
||||
int im_lu_solve( const DOUBLEMASK *lu, double *vec );
|
||||
DOUBLEMASK *im_matinv( const DOUBLEMASK *mat, const char *name );
|
||||
DOUBLEMASK *im_matinv( const DOUBLEMASK *mat, const char *filename );
|
||||
int im_matinv_inplace( DOUBLEMASK *mat );
|
||||
|
||||
DOUBLEMASK *im_local_dmask( struct _VipsImage *out, DOUBLEMASK *mask );
|
||||
|
@ -471,11 +471,12 @@ write_free( Write *write )
|
||||
|
||||
/**
|
||||
* VipsRegionWrite:
|
||||
* @region: pixels to write
|
||||
* @region: get pixels from here
|
||||
* @area: area to write
|
||||
* @a: client data
|
||||
*
|
||||
* The function should write the pixels in @region. @a and @b are the values
|
||||
* passed into vips_discsink().
|
||||
* The function should write the pixels in @area from @region. @a is the
|
||||
* value passed into vips_discsink().
|
||||
*
|
||||
* See also: vips_discsink().
|
||||
*
|
||||
|
@ -229,7 +229,7 @@ im_concurrency_get( void )
|
||||
}
|
||||
|
||||
/**
|
||||
* VipsThreadState:
|
||||
* _VipsThreadState:
|
||||
* @reg: a #REGION
|
||||
* @pos: a #Rect
|
||||
* @x: an int
|
||||
@ -729,7 +729,7 @@ vips_threadpool_create_threads( VipsThreadpool *pool )
|
||||
*/
|
||||
|
||||
/**
|
||||
* VipsThreadpoolAllocate:
|
||||
* _VipsThreadpoolAllocate:
|
||||
* @state: per-thread state
|
||||
* @a: client data
|
||||
* @b: client data
|
||||
@ -752,7 +752,7 @@ vips_threadpool_create_threads( VipsThreadpool *pool )
|
||||
*/
|
||||
|
||||
/**
|
||||
* VipsThreadpoolWork:
|
||||
* _VipsThreadpoolWork:
|
||||
* @state: per-thread state
|
||||
* @a: client data
|
||||
* @b: client data
|
||||
@ -771,7 +771,7 @@ vips_threadpool_create_threads( VipsThreadpool *pool )
|
||||
*/
|
||||
|
||||
/**
|
||||
* VipsThreadpoolProgress:
|
||||
* _VipsThreadpoolProgress:
|
||||
* @a: client data
|
||||
* @b: client data
|
||||
* @c: client data
|
||||
@ -792,8 +792,6 @@ vips_threadpool_create_threads( VipsThreadpool *pool )
|
||||
* @work: process a work unit
|
||||
* @progress: give progress feedback about a work unit, or %NULL
|
||||
* @a: client data
|
||||
* @b: client data
|
||||
* @c: client data
|
||||
*
|
||||
* This function runs a set of threads over an image. Each thread first calls
|
||||
* @start to create new per-thread state, then runs
|
||||
|
@ -1,22 +1,7 @@
|
||||
/* @(#) Function which read a mask from a file.
|
||||
* @(#) Result is written in the structure IMASK or DMASK depending on whether
|
||||
* @(#) the input mask is integer or double. The structure of the mask is
|
||||
* @(#) given in mask.h
|
||||
* @(#) The mask coefficients can be either int (INTMASK)
|
||||
* @(#) or double (DOUBLEMASK).
|
||||
* @(#)
|
||||
* @(#) Prints a mask. Used mainly for debugging purposes
|
||||
* @(#)
|
||||
* @(#) Usage
|
||||
* @(#) void im_print_dmask( m )
|
||||
* @(#) DOUBLEMASK *m;
|
||||
* @(#)
|
||||
* @(#) Usage
|
||||
* @(#) void im_print_imask( m )
|
||||
* @(#) INTMASK *m;
|
||||
* @(#)
|
||||
*
|
||||
* Copyright: 1990, N. Dessipris.
|
||||
/* read and write masks
|
||||
*/
|
||||
|
||||
/* Copyright: 1990, N. Dessipris.
|
||||
*
|
||||
* Author: Nicos Dessipris
|
||||
* Written on: 29/04/1991
|
||||
@ -60,6 +45,10 @@
|
||||
* 12/11/09
|
||||
* - reading a float mask with im_read_imask() produced an incorrect
|
||||
* error messagge
|
||||
* 21/10/10
|
||||
* - gtk-doc
|
||||
* - you can use commas to separate eader fields
|
||||
* - small cleanups
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -479,7 +468,6 @@ read_header( FILE *fp, int *xs, int *ys, double *scale, double *offset )
|
||||
*
|
||||
* Returns: the loaded mask on success, or NULL on error.
|
||||
*/
|
||||
|
||||
DOUBLEMASK *
|
||||
im_read_dmask( const char *filename )
|
||||
{
|
||||
@ -583,8 +571,19 @@ im_read_imask( const char *filename )
|
||||
return( imask );
|
||||
}
|
||||
|
||||
/**
|
||||
* im_scale_dmask:
|
||||
* @m: mask to scale
|
||||
* @filename: filename for returned mask
|
||||
*
|
||||
* Scale the dmask to make an imask with a maximum value of 100.
|
||||
*
|
||||
* See also: im_norm_dmask().
|
||||
*
|
||||
* Returns: the converted mask, or NULL on error.
|
||||
*/
|
||||
INTMASK *
|
||||
im_scale_dmask( DOUBLEMASK *m, const char *name )
|
||||
im_scale_dmask( DOUBLEMASK *m, const char *filename )
|
||||
{
|
||||
const int size = m->xsize * m->ysize;
|
||||
|
||||
@ -593,11 +592,11 @@ im_scale_dmask( DOUBLEMASK *m, const char *name )
|
||||
int i;
|
||||
int isum;
|
||||
|
||||
if( !name || m->xsize <= 0 || m->ysize <= 0 ) {
|
||||
if( !filename || m->xsize <= 0 || m->ysize <= 0 ) {
|
||||
im_error( "im_scale_dmask", "%s", _( "bad arguments" ) );
|
||||
return( NULL );
|
||||
}
|
||||
if( !(out = im_create_imask( name, m->xsize, m->ysize )) )
|
||||
if( !(out = im_create_imask( filename, m->xsize, m->ysize )) )
|
||||
return( NULL );
|
||||
|
||||
/* Find mask max.
|
||||
@ -632,6 +631,17 @@ im_scale_dmask( DOUBLEMASK *m, const char *name )
|
||||
return( out );
|
||||
}
|
||||
|
||||
/**
|
||||
* im_norm_dmask:
|
||||
* @m: mask to scale
|
||||
*
|
||||
* Normalise the dmask. Apply the scale and offset to each element and return
|
||||
* a mask with scale 1, offset zero.
|
||||
*
|
||||
* See also: im_scale_dmask().
|
||||
*
|
||||
* Returns: the converted mask, or NULL on error.
|
||||
*/
|
||||
void
|
||||
im_norm_dmask( DOUBLEMASK *mask )
|
||||
{
|
||||
@ -650,53 +660,65 @@ im_norm_dmask( DOUBLEMASK *mask )
|
||||
mask->offset = 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* im_dup_imask:
|
||||
* @m: mask to duplicate
|
||||
* @filename: filename to set for the new mask
|
||||
*
|
||||
* Duplicate an imask.
|
||||
*
|
||||
* See also: im_dup_dmask().
|
||||
*
|
||||
* Returns: the mask copy, or NULL on error.
|
||||
*/
|
||||
INTMASK *
|
||||
im_dup_imask( INTMASK *m, const char *name )
|
||||
{
|
||||
const int xs = m->xsize;
|
||||
const int ys = m->ysize;
|
||||
const int size = xs * ys;
|
||||
|
||||
im_dup_imask( INTMASK *m, const char *filename )
|
||||
{
|
||||
INTMASK *new;
|
||||
int i;
|
||||
|
||||
if( !(new = im_create_imask( name, xs, ys )) )
|
||||
if( !(new = im_create_imask( filename, m->xsize, m->ysize )) )
|
||||
return( NULL );
|
||||
|
||||
new->offset = m->offset;
|
||||
new->scale = m->scale;
|
||||
|
||||
for( i = 0; i < size; i++ )
|
||||
for( i = 0; i < m->xsize * m->ysize; i++ )
|
||||
new->coeff[i] = m->coeff[i];
|
||||
|
||||
return( new );
|
||||
}
|
||||
|
||||
/**
|
||||
* im_dup_dmask:
|
||||
* @m: mask to duplicate
|
||||
* @filename: filename to set for the new mask
|
||||
*
|
||||
* Duplicate a dmask.
|
||||
*
|
||||
* See also: im_dup_imask().
|
||||
*
|
||||
* Returns: the mask copy, or NULL on error.
|
||||
*/
|
||||
DOUBLEMASK *
|
||||
im_dup_dmask( DOUBLEMASK *m, const char *name )
|
||||
{
|
||||
im_dup_dmask( DOUBLEMASK *m, const char *filename )
|
||||
{
|
||||
DOUBLEMASK *new;
|
||||
int xs = m->xsize;
|
||||
int ys = m->ysize;
|
||||
int size = xs * ys;
|
||||
int i;
|
||||
double *pnt1, *pnt2;
|
||||
|
||||
if( !(new = im_create_dmask( name, xs, ys )) )
|
||||
if( !(new = im_create_dmask( filename, m->xsize, m->ysize )) )
|
||||
return( NULL );
|
||||
|
||||
new->offset = m->offset;
|
||||
new->scale = m->scale;
|
||||
|
||||
pnt1 = m->coeff;
|
||||
pnt2 = new->coeff;
|
||||
for( i = 0; i < size; i++ )
|
||||
*pnt2++ = *pnt1++;
|
||||
for( i = 0; i < m->xsize * m->ysize; i++ )
|
||||
new->coeff[i] = m->coeff[i];
|
||||
|
||||
return( new );
|
||||
}
|
||||
|
||||
/* Open for write.
|
||||
/* Open for write. We can't use im__open_write(), we don't want binary mode.
|
||||
*/
|
||||
static FILE *
|
||||
open_write( const char *name )
|
||||
@ -739,29 +761,38 @@ write_double( FILE *fp, double d )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/* Write the INTMASK m into name.
|
||||
/**
|
||||
* im_write_imask_name:
|
||||
* @m: mask to write
|
||||
* @filename: filename to write to
|
||||
*
|
||||
* Write an imask to a file. See im_read_dmask() for a description of the mask
|
||||
* file format.
|
||||
*
|
||||
* See also: im_write_imask().
|
||||
*
|
||||
* Returns: 0 on success, or -1 on error.
|
||||
*/
|
||||
int
|
||||
im_write_imask_name( INTMASK *m, const char *name )
|
||||
im_write_imask_name( INTMASK *m, const char *filename )
|
||||
{
|
||||
FILE *fp;
|
||||
int x, y, i;
|
||||
|
||||
if( !(fp = open_write( name )) )
|
||||
if( !(fp = open_write( filename )) )
|
||||
return( -1 );
|
||||
|
||||
if( write_line( fp, "%d %d %d %d\n",
|
||||
m->xsize, m->ysize, m->scale, m->offset ) ) {
|
||||
if( write_line( fp, "%d %d", m->xsize, m->ysize ) ) {
|
||||
fclose( fp );
|
||||
return( -1 );
|
||||
}
|
||||
if( m->scale != 1 || m->offset != 0 )
|
||||
write_line( fp, " %d %d", m->scale, m->offset );
|
||||
write_line( fp, "\n" );
|
||||
|
||||
for( i = 0, y = 0; y < m->ysize; y++ ) {
|
||||
for( x = 0; x < m->xsize; x++, i++ )
|
||||
if( write_line( fp, "%d ", m->coeff[i] ) ) {
|
||||
fclose( fp );
|
||||
return( -1 );
|
||||
}
|
||||
write_line( fp, "%d ", m->coeff[i] );
|
||||
|
||||
if( write_line( fp, "\n" ) ) {
|
||||
fclose( fp );
|
||||
@ -773,7 +804,15 @@ im_write_imask_name( INTMASK *m, const char *name )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/* Write the INTMASK m into m->filename
|
||||
/**
|
||||
* im_write_imask:
|
||||
* @m: mask to write
|
||||
*
|
||||
* Write an imask to a file.
|
||||
*
|
||||
* See also: im_write_imask_name().
|
||||
*
|
||||
* Returns: 0 on success, or -1 on error.
|
||||
*/
|
||||
int
|
||||
im_write_imask( INTMASK *m )
|
||||
@ -786,33 +825,43 @@ im_write_imask( INTMASK *m )
|
||||
return( im_write_imask_name( m, m->filename ) );
|
||||
}
|
||||
|
||||
/* Write the DOUBLEMASK m into name.
|
||||
/**
|
||||
* im_write_dmask_name:
|
||||
* @m: mask to write
|
||||
* @filename: filename to write to
|
||||
*
|
||||
* Write a dmask to a file. See im_read_dmask() for a description of the mask
|
||||
* file format.
|
||||
*
|
||||
* See also: im_write_dmask().
|
||||
*
|
||||
* Returns: 0 on success, or -1 on error.
|
||||
*/
|
||||
int
|
||||
im_write_dmask_name( DOUBLEMASK *m, const char *name )
|
||||
im_write_dmask_name( DOUBLEMASK *m, const char *filename )
|
||||
{
|
||||
FILE *fp;
|
||||
int x, y, i;
|
||||
|
||||
if( !(fp = open_write( name )) )
|
||||
if( !(fp = open_write( filename )) )
|
||||
return( -1 );
|
||||
|
||||
if( write_line( fp, "%d %d ", m->xsize, m->ysize ) ||
|
||||
write_double( fp, m->scale ) ||
|
||||
write_line( fp, " " ) ||
|
||||
write_double( fp, m->offset ) ||
|
||||
write_line( fp, "\n" ) ) {
|
||||
if( write_line( fp, "%d %d", m->xsize, m->ysize ) ) {
|
||||
fclose( fp );
|
||||
return( -1 );
|
||||
}
|
||||
if( m->scale != 1.0 || m->offset != 0.0 ) {
|
||||
write_line( fp, " " );
|
||||
write_double( fp, m->scale );
|
||||
write_line( fp, " " );
|
||||
write_double( fp, m->offset );
|
||||
}
|
||||
write_line( fp, "\n" );
|
||||
|
||||
for( i = 0, y = 0; y < m->ysize; y++ ) {
|
||||
for( x = 0; x < m->xsize; x++, i++ )
|
||||
if( write_double( fp, m->coeff[i] ) ||
|
||||
write_line( fp, " " ) ) {
|
||||
fclose( fp );
|
||||
return( -1 );
|
||||
}
|
||||
write_double( fp, m->coeff[i] );
|
||||
write_line( fp, " " );
|
||||
|
||||
if( write_line( fp, "\n" ) ) {
|
||||
fclose( fp );
|
||||
@ -824,7 +873,16 @@ im_write_dmask_name( DOUBLEMASK *m, const char *name )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/* Write the DOUBLEMASK m into m->filename
|
||||
/**
|
||||
* im_write_dmask:
|
||||
* @m: mask to write
|
||||
*
|
||||
* Write a dmask to a file. See im_read_dmask() for a description of the mask
|
||||
* file format.
|
||||
*
|
||||
* See also: im_write_dmask_name().
|
||||
*
|
||||
* Returns: 0 on success, or -1 on error.
|
||||
*/
|
||||
int
|
||||
im_write_dmask( DOUBLEMASK *m )
|
||||
@ -891,6 +949,14 @@ im_copy_matrix_dmask( double **matrix, DOUBLEMASK *mask )
|
||||
*p++ = matrix[x][y];
|
||||
}
|
||||
|
||||
/**
|
||||
* im_print_imask:
|
||||
* @m: mask to print
|
||||
*
|
||||
* Print an imask to stdout.
|
||||
*
|
||||
* See also: im_print_dmask().
|
||||
*/
|
||||
void
|
||||
im_print_imask( INTMASK *m )
|
||||
{
|
||||
@ -908,6 +974,14 @@ im_print_imask( INTMASK *m )
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* im_print_dmask:
|
||||
* @m: mask to print
|
||||
*
|
||||
* Print a dmask to stdout.
|
||||
*
|
||||
* See also: im_print_imask().
|
||||
*/
|
||||
void
|
||||
im_print_dmask( DOUBLEMASK *m )
|
||||
{
|
||||
@ -925,7 +999,17 @@ im_print_dmask( DOUBLEMASK *m )
|
||||
}
|
||||
}
|
||||
|
||||
/* Make a DOUBLEMASK local to an image descriptor.
|
||||
/**
|
||||
* im_local_dmask:
|
||||
* @out: image to make the mask local to
|
||||
* @mask: mask to local-ize
|
||||
*
|
||||
* @out takes ownership of @mask: when @out is closed, @mask will be closed
|
||||
* for you. If im_local_dmask() itself fails, the mask is also freed.
|
||||
*
|
||||
* See also: im_local_imask().
|
||||
*
|
||||
* Returns: 0 on success, or -1 on error.
|
||||
*/
|
||||
DOUBLEMASK *
|
||||
im_local_dmask( VipsImage *out, DOUBLEMASK *mask )
|
||||
@ -942,7 +1026,17 @@ im_local_dmask( VipsImage *out, DOUBLEMASK *mask )
|
||||
return( mask );
|
||||
}
|
||||
|
||||
/* Make an INTMASK local to an image descriptor.
|
||||
/**
|
||||
* im_local_imask:
|
||||
* @out: image to make the mask local to
|
||||
* @mask: mask to local-ize
|
||||
*
|
||||
* @out takes ownership of @mask: when @out is closed, @mask will be closed
|
||||
* for you. If im_local_imask() itself fails, the mask is also freed.
|
||||
*
|
||||
* See also: im_local_dmask().
|
||||
*
|
||||
* Returns: 0 on success, or -1 on error.
|
||||
*/
|
||||
INTMASK *
|
||||
im_local_imask( VipsImage *out, INTMASK *mask )
|
||||
|
@ -44,13 +44,13 @@
|
||||
#endif /*WITH_DMALLOC*/
|
||||
|
||||
/**
|
||||
* im_label_regions():
|
||||
* im_label_regions:
|
||||
* @test: image to test
|
||||
* @mask: write labelled regions here
|
||||
* @segments: return number of regions here
|
||||
*
|
||||
* The @test image is repeatedly scanned and regions of 4-connected pixels
|
||||
* with the same pixel value found. Every time a region is discovered, those
|
||||
* im_label_regions() repeatedly scans @test for regions of 4-connected pixels
|
||||
* with the same pixel value. Every time a region is discovered, those
|
||||
* pixels are marked in @mask with a unique serial number. Once all pixels
|
||||
* have been labelled, the operation returns, setting @segments to the number
|
||||
* of discrete regions which were detected.
|
||||
|
Loading…
Reference in New Issue
Block a user