start revising new docs
This commit is contained in:
parent
4256563332
commit
01a64422b2
1733
doc/reference/libvips-decl-list.txt.bak
Normal file
1733
doc/reference/libvips-decl-list.txt.bak
Normal file
File diff suppressed because it is too large
Load Diff
8234
doc/reference/libvips-decl.txt.bak
Normal file
8234
doc/reference/libvips-decl.txt.bak
Normal file
File diff suppressed because it is too large
Load Diff
@ -69,22 +69,6 @@
|
||||
|
||||
#include "unary.h"
|
||||
|
||||
/**
|
||||
* VipsAbs:
|
||||
* @in: input #VipsImage
|
||||
* @out: output #VipsImage
|
||||
*
|
||||
* This operation finds the absolute value of an image. It does a copy for
|
||||
* unsigned integer types, negate for negative values in
|
||||
* signed integer types, <function>fabs(3)</function> for
|
||||
* float types, and calculate modulus for complex
|
||||
* types.
|
||||
*
|
||||
* See also: im_sign().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
|
||||
typedef VipsUnary VipsAbs;
|
||||
typedef VipsUnaryClass VipsAbsClass;
|
||||
|
||||
@ -249,6 +233,22 @@ vips_abs_init( VipsAbs *abs )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_abs:
|
||||
* @in: input #VipsImage
|
||||
* @out: output #VipsImage
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* This operation finds the absolute value of an image. It does a copy for
|
||||
* unsigned integer types, negate for negative values in
|
||||
* signed integer types, <function>fabs(3)</function> for
|
||||
* float types, and calculate modulus for complex
|
||||
* types.
|
||||
*
|
||||
* See also: vips_sign().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_abs( VipsImage *in, VipsImage **out, ... )
|
||||
{
|
||||
|
@ -314,6 +314,8 @@ vips_add_init( VipsAdd *add )
|
||||
* if possible. Disable this with --vips-novector or IM_NOVECTOR.
|
||||
*
|
||||
* See also: vips_subtract(), vips_linear().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_add( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
|
@ -74,18 +74,6 @@
|
||||
|
||||
#include "statistic.h"
|
||||
|
||||
/**
|
||||
* VipsAvg:
|
||||
* @in: input #VipsImage
|
||||
* @out: output pixel average
|
||||
*
|
||||
* This operation finds the average value in an image. It operates on all
|
||||
* bands of the input image: use im_stats() if you need to calculate an
|
||||
* average for each band. For complex images, return the average modulus.
|
||||
*
|
||||
* See also: im_stats(), im_bandmean(), im_deviate(), im_rank()
|
||||
*/
|
||||
|
||||
typedef struct _VipsAvg {
|
||||
VipsStatistic parent_instance;
|
||||
|
||||
@ -239,6 +227,21 @@ vips_avg_init( VipsAvg *avg )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* vips_avg:
|
||||
* @in: input #VipsImage
|
||||
* @out: output pixel average
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* This operation finds the average value in an image. It operates on all
|
||||
* bands of the input image: use vips_stats() if you need to calculate an
|
||||
* average for each band. For complex images, return the average modulus.
|
||||
*
|
||||
* See also: vips_stats(), vips_bandmean(), vips_deviate(), vips_rank()
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_avg( VipsImage *in, double *out, ... )
|
||||
{
|
||||
|
@ -76,34 +76,6 @@
|
||||
#include "binary.h"
|
||||
#include "unaryconst.h"
|
||||
|
||||
/**
|
||||
* VipsBoolean:
|
||||
* @left: left-hand input #VipsImage
|
||||
* @right: right-hand input #VipsImage
|
||||
* @out: output #VipsImage
|
||||
* @boolean: boolean operation to perform
|
||||
*
|
||||
* Perform various boolean operations on pairs of images.
|
||||
*
|
||||
* The output image is the same format as the upcast input images for integer
|
||||
* types. Float types are cast to int before processing. Complex types are not
|
||||
* supported.
|
||||
*
|
||||
* If the images differ in size, the smaller image is enlarged to match the
|
||||
* larger by adding zero pixels along the bottom and right.
|
||||
*
|
||||
* 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
|
||||
* one-band image by joining n copies of the one-band image together, and then
|
||||
* the two n-band images are operated upon.
|
||||
*
|
||||
* The two input images are cast up to the smallest common type (see table
|
||||
* Smallest common format in
|
||||
* <link linkend="VIPS-arithmetic">arithmetic</link>).
|
||||
*
|
||||
* See also: #VipsBoolean, #VipsBooleanConst.
|
||||
*/
|
||||
|
||||
typedef struct _VipsBoolean {
|
||||
VipsBinary parent_instance;
|
||||
|
||||
@ -256,6 +228,44 @@ vips_boolean_init( VipsBoolean *boolean )
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
vips_booleanv( VipsImage *left, VipsImage *right, VipsImage **out,
|
||||
VipsOperationBoolean boolean, va_list ap )
|
||||
{
|
||||
return( vips_call_split( "boolean", ap, left, right, out,
|
||||
boolean ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_boolean:
|
||||
* @left: left-hand input #VipsImage
|
||||
* @right: right-hand input #VipsImage
|
||||
* @out: output #VipsImage
|
||||
* @boolean: boolean operation to perform
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform various boolean operations on pairs of images.
|
||||
*
|
||||
* The output image is the same format as the upcast input images for integer
|
||||
* types. Float types are cast to int before processing. Complex types are not
|
||||
* supported.
|
||||
*
|
||||
* If the images differ in size, the smaller image is enlarged to match the
|
||||
* larger by adding zero pixels along the bottom and right.
|
||||
*
|
||||
* 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
|
||||
* one-band image by joining n copies of the one-band image together, and then
|
||||
* the two n-band images are operated upon.
|
||||
*
|
||||
* The two input images are cast up to the smallest common type (see table
|
||||
* Smallest common format in
|
||||
* <link linkend="VIPS-arithmetic">arithmetic</link>).
|
||||
*
|
||||
* See also: vips_boolean_const().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_boolean( VipsImage *left, VipsImage *right, VipsImage **out,
|
||||
VipsOperationBoolean boolean, ... )
|
||||
@ -264,33 +274,141 @@ vips_boolean( VipsImage *left, VipsImage *right, VipsImage **out,
|
||||
int result;
|
||||
|
||||
va_start( ap, boolean );
|
||||
result = vips_call_split( "boolean", ap, left, right, out,
|
||||
boolean );
|
||||
result = vips_booleanv( left, right, out, boolean, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* VipsBooleanConst:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @a: array of constants
|
||||
* @boolean: boolean operation to perform
|
||||
* vips_andimage:
|
||||
* @left: left-hand input #VipsImage
|
||||
* @right: right-hand input #VipsImage
|
||||
* @out: output #VipsImage
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform various boolean operations on an image against a constant.
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_AND on a pair of images. See
|
||||
* vips_boolean().
|
||||
*
|
||||
* The output type is always uchar, with 0 for FALSE and 255 for TRUE.
|
||||
*
|
||||
* If the array of constants has just one element, that constant is used for
|
||||
* all image bands. If the array has more than one element and they have
|
||||
* the same number of elements as there are bands in the image, then
|
||||
* one array element is used for each band. If the arrays have more than one
|
||||
* element and the image only has a single band, the result is a many-band
|
||||
* image where each band corresponds to one array element.
|
||||
*
|
||||
* See also: #VipsBoolean, #VipsBoolean.
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_andimage( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, out );
|
||||
result = vips_booleanv( left, right, out,
|
||||
VIPS_OPERATION_BOOLEAN_AND, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_orimage:
|
||||
* @left: left-hand input #VipsImage
|
||||
* @right: right-hand input #VipsImage
|
||||
* @out: output #VipsImage
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_OR on a pair of images. See
|
||||
* vips_boolean().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_orimage( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, out );
|
||||
result = vips_booleanv( left, right, out,
|
||||
VIPS_OPERATION_BOOLEAN_OR, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_eorimage:
|
||||
* @left: left-hand input #VipsImage
|
||||
* @right: right-hand input #VipsImage
|
||||
* @out: output #VipsImage
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_EOR on a pair of images. See
|
||||
* vips_boolean().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_eorimage( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, out );
|
||||
result = vips_booleanv( left, right, out,
|
||||
VIPS_OPERATION_BOOLEAN_EOR, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_lshift:
|
||||
* @left: left-hand input #VipsImage
|
||||
* @right: right-hand input #VipsImage
|
||||
* @out: output #VipsImage
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_LSHIFT on a pair of images. See
|
||||
* vips_boolean().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_lshift( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, out );
|
||||
result = vips_booleanv( left, right, out,
|
||||
VIPS_OPERATION_BOOLEAN_LSHIFT, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_rshift:
|
||||
* @left: left-hand input #VipsImage
|
||||
* @right: right-hand input #VipsImage
|
||||
* @out: output #VipsImage
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_RSHIFT on a pair of images. See
|
||||
* vips_boolean().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_rshift( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, out );
|
||||
result = vips_booleanv( left, right, out,
|
||||
VIPS_OPERATION_BOOLEAN_RSHIFT, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
typedef struct _VipsBooleanConst {
|
||||
VipsUnaryConst parent_instance;
|
||||
@ -434,6 +552,31 @@ vips_boolean_constv( VipsImage *in, VipsImage **out,
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_boolean_const:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @boolean: boolean operation to perform
|
||||
* @c: array of constants
|
||||
* @n: number of constants in @c
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform various boolean operations on an image against an array of
|
||||
* constants.
|
||||
*
|
||||
* The output type is always uchar, with 0 for FALSE and 255 for TRUE.
|
||||
*
|
||||
* If the array of constants has just one element, that constant is used for
|
||||
* all image bands. If the array has more than one element and they have
|
||||
* the same number of elements as there are bands in the image, then
|
||||
* one array element is used for each band. If the arrays have more than one
|
||||
* element and the image only has a single band, the result is a many-band
|
||||
* image where each band corresponds to one array element.
|
||||
*
|
||||
* See also: vips_boolean(), vips_boolean_const1().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_boolean_const( VipsImage *in, VipsImage **out,
|
||||
VipsOperationBoolean boolean, double *c, int n, ... )
|
||||
@ -448,6 +591,166 @@ vips_boolean_const( VipsImage *in, VipsImage **out,
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_andimage_const:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @c: array of constants
|
||||
* @n: number of constants in @c
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_AND on an image and an array of constants.
|
||||
* See vips_boolean_const().
|
||||
*
|
||||
* See also: vips_boolean(), vips_boolean_const1().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_andimage_const( VipsImage *in, VipsImage **out, double *c, int n, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, n );
|
||||
result = vips_boolean_constv( in, out,
|
||||
VIPS_OPERATION_BOOLEAN_AND, c, n, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_orimage_const:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @c: array of constants
|
||||
* @n: number of constants in @c
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_OR on an image and an array of constants.
|
||||
* See vips_boolean_const().
|
||||
*
|
||||
* See also: vips_boolean(), vips_boolean_const1().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_orimage_const( VipsImage *in, VipsImage **out, double *c, int n, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, n );
|
||||
result = vips_boolean_constv( in, out,
|
||||
VIPS_OPERATION_BOOLEAN_OR, c, n, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_eorimage_const:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @c: array of constants
|
||||
* @n: number of constants in @c
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_EOR on an image and an array of constants.
|
||||
* See vips_boolean_const().
|
||||
*
|
||||
* See also: vips_boolean(), vips_boolean_const1().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_eorimage_const( VipsImage *in, VipsImage **out, double *c, int n, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, n );
|
||||
result = vips_boolean_constv( in, out,
|
||||
VIPS_OPERATION_BOOLEAN_EOR, c, n, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_lshift_const:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @c: array of constants
|
||||
* @n: number of constants in @c
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_LSHIFT on an image and an array of constants.
|
||||
* See vips_boolean_const().
|
||||
*
|
||||
* See also: vips_boolean(), vips_boolean_const1().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_lshift_const( VipsImage *in, VipsImage **out, double *c, int n, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, n );
|
||||
result = vips_boolean_constv( in, out,
|
||||
VIPS_OPERATION_BOOLEAN_LSHIFT, c, n, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_rshift_const:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @c: array of constants
|
||||
* @n: number of constants in @c
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_LSHIFT on an image and an array of constants.
|
||||
* See vips_boolean_const().
|
||||
*
|
||||
* See also: vips_boolean(), vips_boolean_const1().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_rshift_const( VipsImage *in, VipsImage **out, double *c, int n, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, n );
|
||||
result = vips_boolean_constv( in, out,
|
||||
VIPS_OPERATION_BOOLEAN_RSHIFT, c, n, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_boolean_const1:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @boolean: boolean operation to perform
|
||||
* @c: constant
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform various boolean operations on an image with a single constant. See
|
||||
* vips_boolean_const().
|
||||
*
|
||||
* See also: vips_boolean(), vips_boolean_const().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_boolean_const1( VipsImage *in, VipsImage **out,
|
||||
VipsOperationBoolean boolean, double c, ... )
|
||||
@ -461,3 +764,143 @@ vips_boolean_const1( VipsImage *in, VipsImage **out,
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_andimage_const1:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @c: constant
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_AND on an image and a constant.
|
||||
* See vips_boolean_const1().
|
||||
*
|
||||
* See also: vips_boolean(), vips_boolean_const().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_andimage_const1( VipsImage *in, VipsImage **out, double c, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, c );
|
||||
result = vips_boolean_constv( in, out,
|
||||
VIPS_OPERATION_BOOLEAN_AND, &c, 1, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_orimage_const1:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @c: constant
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_OR on an image and a constant.
|
||||
* See vips_boolean_const1().
|
||||
*
|
||||
* See also: vips_boolean(), vips_boolean_const().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_orimage_const1( VipsImage *in, VipsImage **out, double c, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, c );
|
||||
result = vips_boolean_constv( in, out,
|
||||
VIPS_OPERATION_BOOLEAN_OR, &c, 1, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_eorimage_const1:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @c: constant
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_EOR on an image and a constant.
|
||||
* See vips_boolean_const1().
|
||||
*
|
||||
* See also: vips_boolean(), vips_boolean_const().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_eorimage_const1( VipsImage *in, VipsImage **out, double c, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, c );
|
||||
result = vips_boolean_constv( in, out,
|
||||
VIPS_OPERATION_BOOLEAN_EOR, &c, 1, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_lshift_const1:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @c: constant
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_LSHIFT on an image and a constant.
|
||||
* See vips_boolean_const1().
|
||||
*
|
||||
* See also: vips_boolean(), vips_boolean_const().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_lshift_const1( VipsImage *in, VipsImage **out, double c, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, c );
|
||||
result = vips_boolean_constv( in, out,
|
||||
VIPS_OPERATION_BOOLEAN_LSHIFT, &c, 1, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_rshift_const1:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @c: constant
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* Perform #VIPS_OPERATION_BOOLEAN_RSHIFT on an image and a constant.
|
||||
* See vips_boolean_const1().
|
||||
*
|
||||
* See also: vips_boolean(), vips_boolean_const().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_rshift_const1( VipsImage *in, VipsImage **out, double c, ... )
|
||||
{
|
||||
va_list ap;
|
||||
int result;
|
||||
|
||||
va_start( ap, c );
|
||||
result = vips_boolean_constv( in, out,
|
||||
VIPS_OPERATION_BOOLEAN_RSHIFT, &c, 1, ap );
|
||||
va_end( ap );
|
||||
|
||||
return( result );
|
||||
}
|
||||
|
@ -73,20 +73,6 @@
|
||||
|
||||
#include "statistic.h"
|
||||
|
||||
/**
|
||||
* VipsDeviate:
|
||||
* @in: input #IMAGE
|
||||
* @out: output pixel standard deviation
|
||||
*
|
||||
* This operation finds the standard deviation of all pixels in @in. It
|
||||
* operates on all bands of the input image: use im_stats() if you need
|
||||
* to calculate an average for each band.
|
||||
*
|
||||
* Non-complex images only.
|
||||
*
|
||||
* See also: VipsDeviate.
|
||||
*/
|
||||
|
||||
typedef struct _VipsDeviate {
|
||||
VipsStatistic parent_instance;
|
||||
|
||||
@ -242,6 +228,22 @@ vips_deviate_init( VipsDeviate *deviate )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_deviate():
|
||||
* @in: input #VipsImage
|
||||
* @out: output pixel standard deviation
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* This operation finds the standard deviation of all pixels in @in. It
|
||||
* operates on all bands of the input image: use vips_stats() if you need
|
||||
* to calculate an average for each band.
|
||||
*
|
||||
* Non-complex images only.
|
||||
*
|
||||
* See also: vips_avg(), vips_stats()..
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_deviate( VipsImage *in, double *out, ... )
|
||||
{
|
||||
|
@ -73,88 +73,6 @@
|
||||
|
||||
#include "binary.h"
|
||||
|
||||
/**
|
||||
* VipsDivide::
|
||||
* @in1: input #IMAGE 1
|
||||
* @in2: input #IMAGE 2
|
||||
* @out: output #IMAGE
|
||||
*
|
||||
* This operation calculates @in1 / @in2 and writes the result to @out. If any
|
||||
* pixels in @in2 are zero, the corresponding pixel in @out is also zero.
|
||||
*
|
||||
* If the images differ in size, the smaller image is enlarged to match the
|
||||
* larger by adding zero pixels along the bottom and right.
|
||||
*
|
||||
* 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
|
||||
* one-band image by joining n copies of the one-band image together, and then
|
||||
* the two n-band images are operated upon.
|
||||
*
|
||||
* The two input images are cast up to the smallest common type (see table
|
||||
* Smallest common format in
|
||||
* <link linkend="VIPS-arithmetic">arithmetic</link>), then the
|
||||
* following table is used to determine the output type:
|
||||
*
|
||||
* <table>
|
||||
* <title>im_divide() type promotion</title>
|
||||
* <tgroup cols='2' align='left' colsep='1' rowsep='1'>
|
||||
* <thead>
|
||||
* <row>
|
||||
* <entry>input type</entry>
|
||||
* <entry>output type</entry>
|
||||
* </row>
|
||||
* </thead>
|
||||
* <tbody>
|
||||
* <row>
|
||||
* <entry>uchar</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>char</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>ushort</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>short</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>uint</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>int</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>float</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>double</entry>
|
||||
* <entry>double</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>complex</entry>
|
||||
* <entry>complex</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>double complex</entry>
|
||||
* <entry>double complex</entry>
|
||||
* </row>
|
||||
* </tbody>
|
||||
* </tgroup>
|
||||
* </table>
|
||||
*
|
||||
* In other words, the output type is just large enough to hold the whole
|
||||
* range of possible values.
|
||||
*
|
||||
* See also: #VipsAdd, #VipsSubtract.
|
||||
*/
|
||||
|
||||
typedef VipsBinary VipsDivide;
|
||||
typedef VipsBinaryClass VipsDivideClass;
|
||||
|
||||
@ -302,6 +220,90 @@ vips_divide_init( VipsDivide *divide )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_divide::
|
||||
* @in1: input image 1
|
||||
* @in2: input image 2
|
||||
* @out: output image
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* This operation calculates @in1 / @in2 and writes the result to @out. If any
|
||||
* pixels in @in2 are zero, the corresponding pixel in @out is also zero.
|
||||
*
|
||||
* If the images differ in size, the smaller image is enlarged to match the
|
||||
* larger by adding zero pixels along the bottom and right.
|
||||
*
|
||||
* 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
|
||||
* one-band image by joining n copies of the one-band image together, and then
|
||||
* the two n-band images are operated upon.
|
||||
*
|
||||
* The two input images are cast up to the smallest common type (see table
|
||||
* Smallest common format in
|
||||
* <link linkend="VIPS-arithmetic">arithmetic</link>), then the
|
||||
* following table is used to determine the output type:
|
||||
*
|
||||
* <table>
|
||||
* <title>im_divide() type promotion</title>
|
||||
* <tgroup cols='2' align='left' colsep='1' rowsep='1'>
|
||||
* <thead>
|
||||
* <row>
|
||||
* <entry>input type</entry>
|
||||
* <entry>output type</entry>
|
||||
* </row>
|
||||
* </thead>
|
||||
* <tbody>
|
||||
* <row>
|
||||
* <entry>uchar</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>char</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>ushort</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>short</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>uint</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>int</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>float</entry>
|
||||
* <entry>float</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>double</entry>
|
||||
* <entry>double</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>complex</entry>
|
||||
* <entry>complex</entry>
|
||||
* </row>
|
||||
* <row>
|
||||
* <entry>double complex</entry>
|
||||
* <entry>double complex</entry>
|
||||
* </row>
|
||||
* </tbody>
|
||||
* </tgroup>
|
||||
* </table>
|
||||
*
|
||||
* In other words, the output type is just large enough to hold the whole
|
||||
* range of possible values.
|
||||
*
|
||||
* See also: vips_multiply(), vips_linear(), vips_power().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_divide( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
{
|
||||
|
@ -60,20 +60,6 @@
|
||||
|
||||
#include "unary.h"
|
||||
|
||||
/**
|
||||
* VipsInvert:
|
||||
* @in: input #VipsImage
|
||||
* @out: output #VipsImage
|
||||
*
|
||||
* For unsigned formats, this operation calculates (max - @in), eg. (255 -
|
||||
* @in) for uchar. For signed and float formats, this operation calculates (-1
|
||||
* * @in).
|
||||
*
|
||||
* See also: im_lintra().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
|
||||
typedef VipsUnary VipsInvert;
|
||||
typedef VipsUnaryClass VipsInvertClass;
|
||||
|
||||
@ -174,6 +160,20 @@ vips_invert_init( VipsInvert *invert )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_invert:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @...: %NULL-terminated list of optional named arguments
|
||||
*
|
||||
* For unsigned formats, this operation calculates (max - @in), eg. (255 -
|
||||
* @in) for uchar. For signed and float formats, this operation calculates (-1
|
||||
* * @in).
|
||||
*
|
||||
* See also: vips_linear().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_invert( VipsImage *in, VipsImage **out, ... )
|
||||
{
|
||||
|
@ -83,29 +83,6 @@
|
||||
|
||||
#include "unary.h"
|
||||
|
||||
/**
|
||||
* VipsLinear:
|
||||
* @in: image to transform
|
||||
* @out: output image
|
||||
* @a: array of constants for multiplication
|
||||
* @b: array of constants for addition
|
||||
*
|
||||
* Pass an image through a linear transform, ie. (@out = @in * @a + @b). Output
|
||||
* is always float for integer input, double for double input, complex for
|
||||
* complex input and double complex for double complex input.
|
||||
*
|
||||
* If the arrays of constants have just one element, that constant is used for
|
||||
* all image bands. If the arrays have more than one element and they have
|
||||
* the same number of elements as there are bands in the image, then
|
||||
* one array element is used for each band. If the arrays have more than one
|
||||
* element and the image only has a single band, the result is a many-band
|
||||
* image where each band corresponds to one array element.
|
||||
*
|
||||
* See also: #VipsAdd.
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
|
||||
typedef struct _VipsLinear {
|
||||
VipsUnary parent_instance;
|
||||
|
||||
@ -323,6 +300,29 @@ vips_linearv( VipsImage *in, VipsImage **out,
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_linear:
|
||||
* @in: image to transform
|
||||
* @out: output image
|
||||
* @a: array of constants for multiplication
|
||||
* @b: array of constants for addition
|
||||
* @n: length of constant arrays
|
||||
*
|
||||
* Pass an image through a linear transform, ie. (@out = @in * @a + @b). Output
|
||||
* is always float for integer input, double for double input, complex for
|
||||
* complex input and double complex for double complex input.
|
||||
*
|
||||
* If the arrays of constants have just one element, that constant is used for
|
||||
* all image bands. If the arrays have more than one element and they have
|
||||
* the same number of elements as there are bands in the image, then
|
||||
* one array element is used for each band. If the arrays have more than one
|
||||
* element and the image only has a single band, the result is a many-band
|
||||
* image where each band corresponds to one array element.
|
||||
*
|
||||
* See also: vips_linear1(), vips_add().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_linear( VipsImage *in, VipsImage **out, double *a, double *b, int n, ... )
|
||||
{
|
||||
@ -336,6 +336,19 @@ vips_linear( VipsImage *in, VipsImage **out, double *a, double *b, int n, ... )
|
||||
return( result );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_linear1:
|
||||
* @in: image to transform
|
||||
* @out: output image
|
||||
* @a: constant for multiplication
|
||||
* @b: constant for addition
|
||||
*
|
||||
* Run vips_linear() with a single constant.
|
||||
*
|
||||
* See also: vips_linear().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_linear1( VipsImage *in, VipsImage **out, double a, double b, ... )
|
||||
{
|
||||
|
@ -68,46 +68,6 @@
|
||||
|
||||
#include "conversion.h"
|
||||
|
||||
/**
|
||||
* VipsJoin:
|
||||
* @in1: first input image
|
||||
* @in2: second input image
|
||||
* @out: output image
|
||||
* @direction: join horizontally or vertically
|
||||
* @expand: %TRUE to expand the output image to hold all of the input pixels
|
||||
* @shim: space between images, in pixels
|
||||
* @background: background ink colour
|
||||
* @align: low, centre or high alignment
|
||||
*
|
||||
* Join @in1 and @in2 together, left-right or up-down depending on the value
|
||||
* of @direction.
|
||||
*
|
||||
* If one is taller or wider than the
|
||||
* other, @out will be has high as the smaller. If @expand is %TRUE, then
|
||||
* the output will be expanded to contain all of the input pixels.
|
||||
*
|
||||
* Use @align to set the edge that the images align on. By default, they align
|
||||
* on the edge with the lower value coordinate.
|
||||
*
|
||||
* Use @background to set the colour of any pixels in @out which are not
|
||||
* present in either @in1 or @in2.
|
||||
*
|
||||
* Use @shim to set the spacing between the images. By default this is 0.
|
||||
*
|
||||
* 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
|
||||
* one-band image by joining n copies of the one-band image together, and then
|
||||
* the two n-band images are operated upon.
|
||||
*
|
||||
* The two input images are cast up to the smallest common type (see table
|
||||
* Smallest common format in
|
||||
* <link linkend="VIPS-arithmetic">arithmetic</link>).
|
||||
*
|
||||
* See also: vips_insert().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
|
||||
typedef struct _VipsJoin {
|
||||
VipsConversion parent_instance;
|
||||
|
||||
@ -309,6 +269,45 @@ vips_join_init( VipsJoin *join )
|
||||
((double *) (join->background->data))[0] = 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_join:
|
||||
* @in1: first input image
|
||||
* @in2: second input image
|
||||
* @out: output image
|
||||
* @direction: join horizontally or vertically
|
||||
* @expand: %TRUE to expand the output image to hold all of the input pixels
|
||||
* @shim: space between images, in pixels
|
||||
* @background: background ink colour
|
||||
* @align: low, centre or high alignment
|
||||
*
|
||||
* Join @in1 and @in2 together, left-right or up-down depending on the value
|
||||
* of @direction.
|
||||
*
|
||||
* If one is taller or wider than the
|
||||
* other, @out will be has high as the smaller. If @expand is %TRUE, then
|
||||
* the output will be expanded to contain all of the input pixels.
|
||||
*
|
||||
* Use @align to set the edge that the images align on. By default, they align
|
||||
* on the edge with the lower value coordinate.
|
||||
*
|
||||
* Use @background to set the colour of any pixels in @out which are not
|
||||
* present in either @in1 or @in2.
|
||||
*
|
||||
* Use @shim to set the spacing between the images. By default this is 0.
|
||||
*
|
||||
* 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
|
||||
* one-band image by joining n copies of the one-band image together, and then
|
||||
* the two n-band images are operated upon.
|
||||
*
|
||||
* The two input images are cast up to the smallest common type (see table
|
||||
* Smallest common format in
|
||||
* <link linkend="VIPS-arithmetic">arithmetic</link>).
|
||||
*
|
||||
* See also: vips_insert().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
vips_join( VipsImage *in1, VipsImage *in2, VipsImage **out,
|
||||
VipsDirection direction, ... )
|
||||
|
@ -140,21 +140,13 @@ int vips_multiply( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_divide( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_avg( VipsImage *in, double *out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_deviate( VipsImage *in, double *out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_min( VipsImage *in, double *out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_max( VipsImage *in, double *out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_invert( VipsImage *in, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_linear( VipsImage *in, VipsImage **out,
|
||||
double *a, double *b, int n, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_linear1( VipsImage *in, VipsImage **out, double a, double b, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_invert( VipsImage *in, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_math( VipsImage *in, VipsImage **out,
|
||||
VipsOperationMath math, ... )
|
||||
__attribute__((sentinel));
|
||||
@ -162,12 +154,6 @@ int vips_abs( VipsImage *in, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_sign( VipsImage *in, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_stats( VipsImage *in, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_measure( VipsImage *in, VipsImage **out, int h, int v, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_recomb( VipsImage *in, VipsImage **out, VipsImage *m, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_round( VipsImage *in, VipsImage **out, VipsOperationRound round, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_relational( VipsImage *left, VipsImage *right, VipsImage **out,
|
||||
@ -187,12 +173,45 @@ int vips_remainder_const( VipsImage *in, VipsImage **out,
|
||||
int vips_remainder_const1( VipsImage *in, VipsImage **out,
|
||||
double c, ... )
|
||||
__attribute__((sentinel));
|
||||
|
||||
int vips_boolean( VipsImage *left, VipsImage *right, VipsImage **out,
|
||||
VipsOperationBoolean boolean, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_andimage( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_orimage( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_eorimage( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_lshift( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_rshift( VipsImage *left, VipsImage *right, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
|
||||
int vips_boolean_const( VipsImage *in, VipsImage **out,
|
||||
VipsOperationBoolean boolean, double *c, int n, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_andimage_const( VipsImage *in, VipsImage **out, double *c, int n, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_orimage_const( VipsImage *in, VipsImage **out, double *c, int n, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_eorimage_const( VipsImage *in, VipsImage **out, double *c, int n, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_lshift_const( VipsImage *in, VipsImage **out, double *c, int n, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_rshift_const( VipsImage *in, VipsImage **out, double *c, int n, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_andimage_const1( VipsImage *in, VipsImage **out, double c, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_orimage_const1( VipsImage *in, VipsImage **out, double c, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_eorimage_const1( VipsImage *in, VipsImage **out, double c, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_lshift_const1( VipsImage *in, VipsImage **out, double c, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_rshift_const1( VipsImage *in, VipsImage **out, double c, ... )
|
||||
__attribute__((sentinel));
|
||||
|
||||
int vips_math2( VipsImage *left, VipsImage *right, VipsImage **out,
|
||||
VipsOperationMath2 math2, ... )
|
||||
__attribute__((sentinel));
|
||||
@ -203,6 +222,22 @@ int vips_math2_const1( VipsImage *in, VipsImage **out,
|
||||
VipsOperationMath2 math2, double c, ... )
|
||||
__attribute__((sentinel));
|
||||
|
||||
int vips_recomb( VipsImage *in, VipsImage **out, VipsImage *m, ... )
|
||||
__attribute__((sentinel));
|
||||
|
||||
int vips_avg( VipsImage *in, double *out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_deviate( VipsImage *in, double *out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_min( VipsImage *in, double *out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_max( VipsImage *in, double *out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_stats( VipsImage *in, VipsImage **out, ... )
|
||||
__attribute__((sentinel));
|
||||
int vips_measure( VipsImage *in, VipsImage **out, int h, int v, ... )
|
||||
__attribute__((sentinel));
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user