00001 #ifndef __GAPFILL_H 00002 #define __GAPFILL_H 00003 00004 #include <omp.h> 00005 00006 struct fill_hash_struct { 00007 int nbad; // Number of bad points for this entry 00008 int hash0; // Hash value before modulus operation 00009 int nhit; // Number of times used 00010 int *wbad; // List of bad pixels for this entry 00011 double *coeff; // Saved coefficients 00012 float cnorm; 00013 float ierror; 00014 struct fill_hash_struct *next; // Next item in list 00015 }; 00016 00017 struct fill_struct { 00018 int order; // Interpolation order 00019 double *a0,*a00,*rh0,*a0t,*rh0t,acort00; 00020 //double *a,*rh,*a1b,*a1r; 00021 //int *wgood; 00022 //int *wbad; 00023 int hashmod; // Modules for hash calculation 00024 int *hashcount; // How many of this hash value 00025 int ndiff; // Number of different masks seen 00026 struct fill_hash_struct **hashtable; 00027 omp_lock_t *locks; // To prevent reading while updating 00028 omp_lock_t *complocks; // To prevent redundant computations 00029 int method; // Value of input method 00030 char *filename; // File acor was read from 00031 }; 00032 00033 int init_fill( 00034 int method, // Interpolation method 00035 double pnoise, // Level of photon noise for trade-off 00036 int order, // Interpolation order. Generally odd. 00037 int targetx, // Target point in x (normally (order-1)/2) 00038 int targety, // Target point in y (normally (order-1)/2) 00039 struct fill_struct *pars, // Structure to save setup information etc. 00040 char **filenamep, // Pointer to name of file to read covariance from. 00041 // Set to actual file used if method > 0. 00042 const char *path // to data files read by this function. 00043 00044 ); 00045 00046 int free_fill( 00047 struct fill_struct *pars 00048 ); 00049 00050 int fgap_fill( 00051 struct fill_struct *pars, // Parameters from call of init_fill 00052 float *im, // Input image 00053 int nx, // Size of array in dimension adjacent in memory 00054 int ny, // Size of array in dimension not adjacent in memory 00055 int nlead, // Leading dimension of array nlead>=nx 00056 unsigned char *mask, // Mask is 0 data point is there 00057 // Mask is 1 if data point is not there and should be filled 00058 // Mask is 2 if data point is not there and should not be filled 00059 float *cnorm, // White noise magnification 00060 float *ierror // Estimated interpolation error 00061 ); 00062 00063 char *gapfill_version(); // Returns CVS version of gapfill.c 00064 00065 #endif