[220] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
[1104] | 2 | // Classes image heritant de TMatrix<T>
|
---|
| 3 | // R.Ansari, C.Magneville 07/2000
|
---|
[220] | 4 | // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA
|
---|
| 5 |
|
---|
| 6 | #ifndef CIMAGE_SEEN
|
---|
| 7 | #define CIMAGE_SEEN
|
---|
| 8 |
|
---|
[1104] | 9 | #include "tmatrix.h"
|
---|
[220] | 10 |
|
---|
| 11 |
|
---|
| 12 | // **********************************************************
|
---|
| 13 | // Classe Image
|
---|
| 14 |
|
---|
[1104] | 15 | namespace SOPHYA {
|
---|
[220] | 16 |
|
---|
| 17 | template <class T>
|
---|
[1104] | 18 | class Image : public TMatrix<T> {
|
---|
[220] | 19 |
|
---|
| 20 | public:
|
---|
| 21 | Image();
|
---|
[1104] | 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 |
|
---|
[220] | 26 | virtual ~Image();
|
---|
| 27 |
|
---|
[1104] | 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);
|
---|
[220] | 31 |
|
---|
[1104] | 32 | inline uint_4 XSize() const {return NCols();}
|
---|
| 33 | inline uint_4 YSize() const {return NRows();}
|
---|
[220] | 34 |
|
---|
[1104] | 35 | inline r_8 XOrg() const {return org_x;}
|
---|
| 36 | inline r_8 YOrg() const {return org_y;}
|
---|
[220] | 37 |
|
---|
[1104] | 38 | inline r_8 XPixSize() const {return pxsz_x;}
|
---|
| 39 | inline r_8 YPixSize() const {return pxsz_y;}
|
---|
[220] | 40 |
|
---|
[1104] | 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; }
|
---|
[220] | 45 |
|
---|
| 46 | protected:
|
---|
[1104] | 47 | r_8 org_x,org_y; // Coordonnees pixel(0,0)
|
---|
| 48 | r_8 pxsz_x, pxsz_y; // Taille des pixels
|
---|
[220] | 49 | };
|
---|
| 50 |
|
---|
| 51 | template <class T>
|
---|
[1104] | 52 | inline T const& Image<T>::operator()(uint_4 ix, uint_4 jy) const
|
---|
[220] | 53 | {
|
---|
[1104] | 54 | return (TMatrix<T>::operator() (jy, ix));
|
---|
[220] | 55 | }
|
---|
| 56 |
|
---|
| 57 | template <class T>
|
---|
[1104] | 58 | inline T & Image<T>::operator()(uint_4 ix, uint_4 jy)
|
---|
[220] | 59 | {
|
---|
[1104] | 60 | return (TMatrix<T>::operator() (jy, ix));
|
---|
[220] | 61 | }
|
---|
| 62 |
|
---|
| 63 |
|
---|
| 64 | typedef Image<uint_2> ImageU2;
|
---|
| 65 | typedef Image<int_4> ImageI4;
|
---|
| 66 | typedef Image<r_4> ImageR4;
|
---|
[1104] | 67 | typedef Image<r_8> ImageR8;
|
---|
[220] | 68 |
|
---|
[1104] | 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;}
|
---|
[220] | 76 |
|
---|
[1104] | 77 | inline r_8 XOrg() const {return 0;}
|
---|
| 78 | inline r_8 YOrg() const {return 0;}
|
---|
[220] | 79 |
|
---|
[1104] | 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; }
|
---|
[896] | 86 |
|
---|
[1104] | 87 | };
|
---|
| 88 |
|
---|
| 89 | } // End of namespace SOPHYA
|
---|
| 90 |
|
---|
[220] | 91 | #endif
|
---|
| 92 |
|
---|
| 93 |
|
---|