Last change
on this file since 2096 was
2096,
checked in by ldelgass, 13 years ago
|
Normalize line endings, set eol-style to native on *.cpp, *.h files
|
-
Property svn:eol-style set to
native
|
File size:
1.2 KB
|
Line | |
---|
1 | #ifndef __IMAGE_H__ |
---|
2 | #define __IMAGE_H__ |
---|
3 | |
---|
4 | class Image { |
---|
5 | public : |
---|
6 | enum DataType { |
---|
7 | IMG_UNSIGNED_BYTE, |
---|
8 | IMG_FLOAT |
---|
9 | }; |
---|
10 | |
---|
11 | enum ImageFormat { |
---|
12 | IMG_RGB = 3, |
---|
13 | IMG_RGBA = 4 |
---|
14 | }; |
---|
15 | |
---|
16 | private : |
---|
17 | const unsigned int _width; |
---|
18 | const unsigned int _height; |
---|
19 | ImageFormat _format; |
---|
20 | DataType _dataType; |
---|
21 | unsigned int _dataTypeByteSize; |
---|
22 | void* _dataBuffer; |
---|
23 | public : |
---|
24 | |
---|
25 | Image(const unsigned int width, const unsigned int height, const ImageFormat format, const DataType dataType, void* data = 0); |
---|
26 | ~Image(); |
---|
27 | |
---|
28 | unsigned int getWidth() const; |
---|
29 | unsigned int getHeight() const; |
---|
30 | unsigned int getComponentCount() const; |
---|
31 | unsigned int getDataTypeByteSize() const; |
---|
32 | DataType getDataType() const; |
---|
33 | void* getImageBuffer(); |
---|
34 | }; |
---|
35 | |
---|
36 | inline void* Image::getImageBuffer() |
---|
37 | { |
---|
38 | return _dataBuffer; |
---|
39 | } |
---|
40 | |
---|
41 | inline unsigned int Image::getWidth() const |
---|
42 | { |
---|
43 | return _width; |
---|
44 | } |
---|
45 | |
---|
46 | inline unsigned int Image::getHeight() const |
---|
47 | { |
---|
48 | return _height; |
---|
49 | } |
---|
50 | |
---|
51 | inline unsigned int Image::getComponentCount() const |
---|
52 | { |
---|
53 | return (unsigned int) _format; |
---|
54 | } |
---|
55 | |
---|
56 | inline Image::DataType Image::getDataType() const |
---|
57 | { |
---|
58 | return _dataType; |
---|
59 | } |
---|
60 | |
---|
61 | inline unsigned int Image::getDataTypeByteSize() const |
---|
62 | { |
---|
63 | return _dataTypeByteSize; |
---|
64 | } |
---|
65 | |
---|
66 | #endif // |
---|
67 | |
---|
Note: See
TracBrowser
for help on using the repository browser.