Remove cmake
[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(const unsigned char *data, size_t length, const char *formatHint);
15                 ~Image();
16                 unsigned char *data() const;
17                 GLfloat width() const;
18                 GLfloat height() const;
19                 GLenum format() const;
20                 GLint internalFormat() const;
21                 GLenum type() const;
22         private:
23                 #ifdef __APPLE__
24                 void initWithImageRef(CGImageRef ref);
25                 CFDataRef dataRef;
26                 CGBitmapInfo info;
27                 CGImageAlphaInfo alphaInfo;
28                 CGColorSpaceRef colorSpace;
29                 GLfloat _width, _height;
30                 size_t bitsPerComponent;
31                 bool usesFloat() const;
32                 #endif
33 };
34
35 #endif