Last change
on this file since 3596 was
2831,
checked in by ldelgass, 13 years ago
|
Refactor texture classes, misc. cleanups, cut down on header pollution -- still
need to fix header deps in Makefile.in
|
-
Property svn:eol-style set to
native
|
File size:
1.1 KB
|
Line | |
---|
1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | #ifndef IMAGE_H |
---|
3 | #define IMAGE_H |
---|
4 | |
---|
5 | class Image |
---|
6 | { |
---|
7 | public: |
---|
8 | enum DataType { |
---|
9 | IMG_UNSIGNED_BYTE, |
---|
10 | IMG_FLOAT |
---|
11 | }; |
---|
12 | |
---|
13 | enum ImageFormat { |
---|
14 | IMG_RGB = 3, |
---|
15 | IMG_RGBA = 4 |
---|
16 | }; |
---|
17 | |
---|
18 | Image(const unsigned int width, const unsigned int height, |
---|
19 | const ImageFormat format, const DataType dataType, void *data = NULL); |
---|
20 | |
---|
21 | ~Image(); |
---|
22 | |
---|
23 | unsigned int getWidth() const |
---|
24 | { |
---|
25 | return _width; |
---|
26 | } |
---|
27 | |
---|
28 | unsigned int getHeight() const |
---|
29 | { |
---|
30 | return _height; |
---|
31 | } |
---|
32 | |
---|
33 | unsigned int getComponentCount() const |
---|
34 | { |
---|
35 | return (unsigned int)_format; |
---|
36 | } |
---|
37 | |
---|
38 | unsigned int getDataTypeByteSize() const |
---|
39 | { |
---|
40 | return _dataTypeByteSize; |
---|
41 | } |
---|
42 | |
---|
43 | DataType getDataType() const |
---|
44 | { |
---|
45 | return _dataType; |
---|
46 | } |
---|
47 | |
---|
48 | void *getImageBuffer() |
---|
49 | { |
---|
50 | return _dataBuffer; |
---|
51 | } |
---|
52 | |
---|
53 | private: |
---|
54 | const unsigned int _width; |
---|
55 | const unsigned int _height; |
---|
56 | ImageFormat _format; |
---|
57 | DataType _dataType; |
---|
58 | unsigned int _dataTypeByteSize; |
---|
59 | void *_dataBuffer; |
---|
60 | }; |
---|
61 | |
---|
62 | #endif |
---|
63 | |
---|
Note: See
TracBrowser
for help on using the repository browser.