1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
2 | // Classes image heritant de TMatrix<T>
|
---|
3 | // R.Ansari, C.Magneville 07/2000
|
---|
4 | // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA
|
---|
5 |
|
---|
6 | #ifndef CIMAGE_SEEN
|
---|
7 | #define CIMAGE_SEEN
|
---|
8 |
|
---|
9 | #include "tmatrix.h"
|
---|
10 |
|
---|
11 |
|
---|
12 | // **********************************************************
|
---|
13 | // Classe Image
|
---|
14 |
|
---|
15 | namespace SOPHYA {
|
---|
16 |
|
---|
17 | template <class T>
|
---|
18 | class Image : public TMatrix<T> {
|
---|
19 |
|
---|
20 | public:
|
---|
21 | Image();
|
---|
22 | Image(uint_4 sizx, uint_4 sizy, r_8 szpx=1., r_8 szpy=1., r_8 orgx=0., r_8 orgy=0.);
|
---|
23 | Image(const Image<T>& a);
|
---|
24 | Image(const Image<T>& a, bool share);
|
---|
25 |
|
---|
26 | virtual ~Image();
|
---|
27 |
|
---|
28 | // Inline element acces methods
|
---|
29 | inline T const& operator()(uint_4 ix,uint_4 jy) const;
|
---|
30 | inline T& operator()(uint_4 ix,uint_4 jy);
|
---|
31 |
|
---|
32 | inline uint_4 XSize() const {return NCols();}
|
---|
33 | inline uint_4 YSize() const {return NRows();}
|
---|
34 |
|
---|
35 | inline r_8 XOrg() const {return org_x;}
|
---|
36 | inline r_8 YOrg() const {return org_y;}
|
---|
37 |
|
---|
38 | inline r_8 XPixSize() const {return pxsz_x;}
|
---|
39 | inline r_8 YPixSize() const {return pxsz_y;}
|
---|
40 |
|
---|
41 | inline void SetOrg(r_8 orgx=0., r_8 orgy=0.)
|
---|
42 | { org_x = orgx; org_y = orgy; }
|
---|
43 | inline void SetPixelSize(r_8 szx=1., r_8 szy=1.)
|
---|
44 | { pxsz_x = szx; pxsz_y = szy; }
|
---|
45 |
|
---|
46 | protected:
|
---|
47 | r_8 org_x,org_y; // Coordonnees pixel(0,0)
|
---|
48 | r_8 pxsz_x, pxsz_y; // Taille des pixels
|
---|
49 | };
|
---|
50 |
|
---|
51 | template <class T>
|
---|
52 | inline T const& Image<T>::operator()(uint_4 ix, uint_4 jy) const
|
---|
53 | {
|
---|
54 | return (TMatrix<T>::operator() (jy, ix));
|
---|
55 | }
|
---|
56 |
|
---|
57 | template <class T>
|
---|
58 | inline T & Image<T>::operator()(uint_4 ix, uint_4 jy)
|
---|
59 | {
|
---|
60 | return (TMatrix<T>::operator() (jy, ix));
|
---|
61 | }
|
---|
62 |
|
---|
63 |
|
---|
64 | typedef Image<uint_2> ImageU2;
|
---|
65 | typedef Image<int_4> ImageI4;
|
---|
66 | typedef Image<r_4> ImageR4;
|
---|
67 | typedef Image<r_8> ImageR8;
|
---|
68 |
|
---|
69 | class GeneralFit;
|
---|
70 | class RzImage {
|
---|
71 | public:
|
---|
72 | RzImage() { }
|
---|
73 | ~RzImage() { }
|
---|
74 | inline uint_4 XSize() const {return 0;}
|
---|
75 | inline uint_4 YSize() const {return 0;}
|
---|
76 |
|
---|
77 | inline r_8 XOrg() const {return 0;}
|
---|
78 | inline r_8 YOrg() const {return 0;}
|
---|
79 |
|
---|
80 | inline r_8 XPixSize() const {return 1.;}
|
---|
81 | inline r_8 YPixSize() const {return 1.;}
|
---|
82 | inline r_8 DValue(int i, int j) const { return 0.; }
|
---|
83 | // Resultats d'un GeneralFit
|
---|
84 | inline RzImage* FitResidus(GeneralFit& gfit) { return NULL; }
|
---|
85 | inline RzImage* FitFunction(GeneralFit& gfit) { return NULL; }
|
---|
86 |
|
---|
87 | };
|
---|
88 |
|
---|
89 | } // End of namespace SOPHYA
|
---|
90 |
|
---|
91 | #endif
|
---|
92 |
|
---|
93 |
|
---|