Neo  0.5.0
Developer Documentation
Image.h
Go to the documentation of this file.
1 //========================================================================
2 // Copyright (c) 2003-2011 Anael Seghezzi <www.maratis3d.com>
3 // Copyright (c) 2014-2015 Yannick Pflanzer <www.neo-engine.de>
4 //
5 // This software is provided 'as-is', without any express or implied
6 // warranty. In no event will the authors be held liable for any damages
7 // arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it
11 // freely, subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented; you must not
14 // claim that you wrote the original software. If you use this software
15 // in a product, an acknowledgment in the product documentation would
16 // be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such, and must not
19 // be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source
22 // distribution.
23 //
24 //========================================================================
25 
26 
27 #ifndef __IMAGE_H
28 #define __IMAGE_H
29 
30 namespace Neo
31 {
32 class NEO_CORE_EXPORT Image
33 {
34 public:
35 
36  Image(void);
37  ~Image(void);
38 
39 private:
40 
41  void * m_data;
42  VAR_TYPES m_dataType;
43 
44  unsigned int m_components;
45  unsigned int m_width;
46  unsigned int m_height;
47  unsigned int m_size;
48 
49 public:
50 
51  void create(VAR_TYPES dataType, unsigned int width, unsigned int height, unsigned int components);
52  void clear(void * color);
53  void readPixel(unsigned int x, unsigned int y, void * color);
54  void writePixel(unsigned int x, unsigned int y, void * color);
55 
56  inline void * getData(void){ return m_data; }
57  VAR_TYPES getDataType(void){ return m_dataType; }
58 
59  inline unsigned int getComponents(void){ return m_components; }
60  inline unsigned int getWidth(void){ return m_width; }
61  inline unsigned int getHeight(void){ return m_height; }
62  inline unsigned int getSize(void){ return m_size; }
63 };
64 }
65 
66 #endif
void * getData(void)
Definition: Image.h:56
VAR_TYPES getDataType(void)
Definition: Image.h:57
unsigned int getComponents(void)
Definition: Image.h:59
unsigned int getSize(void)
Definition: Image.h:62
unsigned int getWidth(void)
Definition: Image.h:60
Definition: Image.h:32
unsigned int getHeight(void)
Definition: Image.h:61
Definition: Color.h:29
VAR_TYPES
Definition: RenderingContext.h:140