"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libvips/create/gaussnoise.c" between
vips-8.10.6.tar.gz and vips-8.11.0.tar.gz

About: VIPS is a free image processing system (see also the GUI nip2).

gaussnoise.c  (vips-8.10.6):gaussnoise.c  (vips-8.11.0)
skipping to change at line 78 skipping to change at line 78
#include "pcreate.h" #include "pcreate.h"
typedef struct _VipsGaussnoise { typedef struct _VipsGaussnoise {
VipsCreate parent_instance; VipsCreate parent_instance;
int width; int width;
int height; int height;
double mean; double mean;
double sigma; double sigma;
/* Per-image seed. /* Per-image seed. Each pixel is seeded by this plus the (x,
* y) coordinate.
*/ */
guint32 seed; guint32 seed;
} VipsGaussnoise; } VipsGaussnoise;
typedef VipsCreateClass VipsGaussnoiseClass; typedef VipsCreateClass VipsGaussnoiseClass;
G_DEFINE_TYPE( VipsGaussnoise, vips_gaussnoise, VIPS_TYPE_CREATE ); G_DEFINE_TYPE( VipsGaussnoise, vips_gaussnoise, VIPS_TYPE_CREATE );
static int static int
vips_gaussnoise_gen( VipsRegion *or, void *seq, void *a, void *b, vips_gaussnoise_gen( VipsRegion *or, void *seq, void *a, void *b,
skipping to change at line 141 skipping to change at line 142
if( VIPS_OBJECT_CLASS( vips_gaussnoise_parent_class )->build( object ) ) if( VIPS_OBJECT_CLASS( vips_gaussnoise_parent_class )->build( object ) )
return( -1 ); return( -1 );
vips_image_init_fields( create->out, vips_image_init_fields( create->out,
gaussnoise->width, gaussnoise->height, 1, gaussnoise->width, gaussnoise->height, 1,
VIPS_FORMAT_FLOAT, VIPS_CODING_NONE, VIPS_FORMAT_FLOAT, VIPS_CODING_NONE,
VIPS_INTERPRETATION_MULTIBAND, 1.0, 1.0 ); VIPS_INTERPRETATION_MULTIBAND, 1.0, 1.0 );
vips_image_pipelinev( create->out, vips_image_pipelinev( create->out,
VIPS_DEMAND_STYLE_ANY, NULL ); VIPS_DEMAND_STYLE_ANY, NULL );
/* The seed for this image. Each pixel is seeded by this plus the (x,
* y) coordinate.
*/
gaussnoise->seed = UINT_MAX * g_random_double();
if( vips_image_generate( create->out, if( vips_image_generate( create->out,
NULL, vips_gaussnoise_gen, NULL, gaussnoise, NULL ) ) NULL, vips_gaussnoise_gen, NULL, gaussnoise, NULL ) )
return( -1 ); return( -1 );
return( 0 ); return( 0 );
} }
static void static void
vips_gaussnoise_class_init( VipsGaussnoiseClass *class ) vips_gaussnoise_class_init( VipsGaussnoiseClass *class )
{ {
skipping to change at line 199 skipping to change at line 195
G_STRUCT_OFFSET( VipsGaussnoise, mean ), G_STRUCT_OFFSET( VipsGaussnoise, mean ),
-10000000, 1000000, 128 ); -10000000, 1000000, 128 );
VIPS_ARG_DOUBLE( class, "sigma", 6, VIPS_ARG_DOUBLE( class, "sigma", 6,
_( "Sigma" ), _( "Sigma" ),
_( "Standard deviation of pixels in generated image" ), _( "Standard deviation of pixels in generated image" ),
VIPS_ARGUMENT_OPTIONAL_INPUT, VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsGaussnoise, sigma ), G_STRUCT_OFFSET( VipsGaussnoise, sigma ),
0, 100000, 30 ); 0, 100000, 30 );
VIPS_ARG_INT( class, "seed", 7,
_( "Seed" ),
_( "Random number seed" ),
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsGaussnoise, seed ),
INT_MIN, INT_MAX, 0 );
} }
static void static void
vips_gaussnoise_init( VipsGaussnoise *gaussnoise ) vips_gaussnoise_init( VipsGaussnoise *gaussnoise )
{ {
gaussnoise->mean = 128.0; gaussnoise->mean = 128.0;
gaussnoise->sigma = 30.0; gaussnoise->sigma = 30.0;
gaussnoise->seed = UINT_MAX * g_random_double();
} }
/** /**
* vips_gaussnoise: * vips_gaussnoise:
* @out: (out): output image * @out: (out): output image
* @width: output width * @width: output width
* @height: output height * @height: output height
* @...: %NULL-terminated list of optional named arguments * @...: %NULL-terminated list of optional named arguments
* *
* Optional arguments: * Optional arguments:
 End of changes. 4 change blocks. 
6 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)