src/functions.h

00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #ifndef __IMAGER_FUNCTIONS_H__
00009 #define __IMAGER_FUNCTIONS_H__
00010 
00011 int spl_cache_z;
00012 int spl_cache_uid;
00013 int spl_cache_deg;
00014 long rndreg;
00015 
00016 void dp (int pri, char *format,...);
00017 void fatal_memerr ();
00018 char isempty (char* s);
00019 
00020 char slice_is_zero (image_type* img, int slice);
00021 
00022 int isqrt (long x);
00023 
00024 void combsort_f (float *array, int *links, int size);
00025 void combsort_i (int *array, int *links, int size);
00026 
00027 
00028 fitresult loglogfit (double* x, double* y, int st, int en);
00029 fitresult lsqfit (double* xdata, double* ydata, int st, int en);
00030 
00031 float nr_rand2 ();                      /* Random numbers from 0 to 1, box distribution */
00032 float gauss_rnd ();                     /* Gaussian-distribution random numbers, zero mean, SD=1 */
00033 float eran1 ();                         /* Exponentially-distributed, positive random numbers of unit mean */
00034 float pnoise (int x, int y, int level); /* 2D deterministic noise generator for Perlin noise */
00035 float perlin_noise (float x, float y, float H, int octaves);            
00036                                                         /* Perlin noise synthesizer, H is the persistence, 0<H<1 */
00037 
00038 void create_fbm (float* timeseries, float sd, float h, int numpoints, char make_fbm);
00039                                                         /* FBM random noise by successive random additions */
00040 void create_fbm_spectral (float *timeseries, float sd, float beta, int numpoints, char make_fbm);
00041                                                         /* FBM or FBN time series by spectral synthesis */
00042 void create_2d_fbm_spectral (image_type *img, float beta, int numpoints);
00043                                                         /* FBM 2D data by spectral synthesis */
00044 
00045 
00046 hsvtriplet rgb_to_hsv (rgbtriplet rgb);
00047 rgbtriplet hsv_to_rgb (hsvtriplet hsv);
00048 
00049 void imgminmax (image_type* img, float* mmin, float* mmax);
00050 
00051 
00052 /* Matrix operations */
00053 
00054 MFLOAT det2x2 (MFLOAT *A);
00055 
00056 MFLOAT pythag (MFLOAT a, MFLOAT b);
00057 
00058 int matsolv (MFLOAT *A, MFLOAT *B, int n);
00059 void mat_transpose (MFLOAT *A, int n);
00060 void matmult (MFLOAT* A, MFLOAT* V, int n);
00061 void householder_reduction (MFLOAT* A, int n, MFLOAT* D, MFLOAT* E);
00062 void eigen_ql (MFLOAT* A, int n, MFLOAT* D, MFLOAT* E);
00063 
00064 void testmatrix ();
00065 
00066 /* Interploation functions */
00067 
00068 double spline_interpol (image_type* img, float xf, float yf, int z, int SplDeg);
00069 
00070 
00071 
00072 #endif

Generated on Sat Nov 15 23:24:49 2008 for Crystal Image by  doxygen 1.5.3