Final project!
[opengl.git] / image.hpp
1 #ifndef IMAGE_HPP
2 #define IMAGE_HPP
3
4 #include <iostream>
5 #include <fstream>
6 #ifdef __APPLE__
7 #include <CoreGraphics/CoreGraphics.h>
8 #include <GL/glew.h>
9 #endif
10
11 class Image {
12         public:
13                 Image(const std::string &path);
14                 ~Image();
15                 unsigned char *data() const;
16                 GLfloat width() const;
17                 GLfloat height() const;
18                 GLenum format() const;
19                 GLint internalFormat() const;
20                 GLenum type() const;
21         private:
22                 #ifdef __APPLE__
23                 CFDataRef dataRef;
24                 CGBitmapInfo info;
25                 CGImageAlphaInfo alphaInfo;
26                 CGColorSpaceRef colorSpace;
27                 GLfloat _width, _height;
28                 size_t bitsPerComponent;
29                 #endif
30 };
31
32 #endif