static int gbandjoin_vec( im_object *argv ) { im_imagevec_object *iv = (im_imagevec_object *) argv[0]; return( im_gbandjoin( iv->vec, argv[1], iv->n ) ); }
int im_addgnoise( IMAGE *in, IMAGE *out, double sigma ){ #define FUNCTION_NAME "im_addgnoise" if( im_piocheck( in, out )) return -1; { int i; IMAGE **temps= IM_ARRAY( out, in-> Bands, IMAGE* ); IMAGE *joined_temps= im_open_local( out, FUNCTION_NAME ": joined_temps", "p" ); if( ! temps || ! joined_temps || im_open_local_array( out, temps, in-> Bands, FUNCTION_NAME ": temps", "p" )) return -1; for( i= 0; i < in-> Bands; ++i ) if( im_gaussnoise( temps[i], in-> Xsize, in-> Ysize, 0.0, sigma )) return -1; return im_gbandjoin( temps, joined_temps, in-> Bands ) || im_add( in, joined_temps, out ); } #undef FUNCTION_NAME }