Code_TYMPAN  4.4.0
Industrial site acoustic simulation
OImage.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
16 /*
17  *
18  *
19  *
20  *
21  */
22 
23 #ifndef __O_IMAGE__
24 #define __O_IMAGE__
25 
26 #include <string>
27 
28 class TYImageManager;
29 
33 class OImage
34 {
35  // TYImageManager a besoin d'acceder au donnee privee.
36  friend class TYImageManager;
37 
38 public:
39  OImage();
40  virtual ~OImage();
41 
45  unsigned char* getData() const
46  {
47  return _data;
48  }
49 
53  unsigned int getSizeX() const
54  {
55  return _sizeX;
56  }
57 
61  unsigned int getSizeY() const
62  {
63  return _sizeY;
64  }
65 
69  unsigned int getDepth() const
70  {
71  return _depth;
72  }
73 
77  unsigned int getPixelSize() const;
78 
82  virtual bool load(const std::string& filename) = 0;
83 
84 protected:
85  // Donnee de l'image.
86  unsigned char* _data;
87 
88  // Bits par pixel.
89  unsigned int _depth;
90 
91  // Taille de l'image.
92  unsigned int _sizeX;
93  unsigned int _sizeY;
94 };
95 
96 #endif //__O_IMAGE__
Definition: OImage.h:34
virtual ~OImage()
Definition: OImage.cpp:24
unsigned char * getData() const
Definition: OImage.h:45
unsigned int _sizeX
Definition: OImage.h:92
unsigned int _depth
Definition: OImage.h:89
unsigned int _sizeY
Definition: OImage.h:93
unsigned int getPixelSize() const
virtual bool load(const std::string &filename)=0
unsigned int getDepth() const
Definition: OImage.h:69
unsigned char * _data
Definition: OImage.h:86
OImage()
Definition: OImage.cpp:22
unsigned int getSizeX() const
Definition: OImage.h:53
unsigned int getSizeY() const
Definition: OImage.h:61