ColorContrast
Image.h
1 /* Image.h */
2 
3 #ifndef IMAGEN_H
4 #define IMAGEN_H
5 
6 #include <fftw3.h>
7 #include <math.h>
8 
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <iostream>
12 #include <string.h>
13 
14 #include "io_tiff.h"
15 using namespace std;
16 #define MINDOUBLE 1.0e-2
17 
18 inline double max(double a, double b)
19 {
20  if(a<=b)
21  return(b);
22  else
23  return(a);
24 };
25 
26 
27 inline double min(double a, double b)
28 {
29  if(a>=b)
30  return(b);
31  else
32  return(a);
33 };
34 
35 
36 class Image
37 {
38  public:
39  int dim[2];
40  double * data;
41  Image();
42  Image(int row, int col);
43  Image(int row, int col, double val);
44  Image(Image & im2);
45  ~Image();
46  void initialize(int rows, int col);
47  void operator*=(double dt);
48  void operator*=(Image & im2);
49  void operator=(Image & im2);
50  void operator+=(Image & im2);
51  void operator+=(double dt);
52  int rows(){return dim[0];}
53  int cols(){return dim[1];}
54  inline double & operator()(int i, int j)
55  {
56  return(data[i*dim[1]+j]);
57  };
58 
59  double maxval();
60  double maxabsval();
61  double minval();
62  double meanvalue();
63 
64  void threshold(double m,double M);
65  void rescale(double minv, double maxv);
66 
67  void fftshift();
68  double Dist(Image & Im2);
69 
70  void gaussian_kernel(int row, int col, double sigma);
71  void linear_kernel(double alpha);
72 };
73 
74 
75 #endif
76 
Definition: Image.h:36