-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathImage.hpp
68 lines (53 loc) · 1.05 KB
/
Image.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* Image.hpp
*
* Created on: 2014/10/18
* Author: Dimitri Kourkoulis
* http://dimitros.be
* License: BSD 3-Clause License (see LICENSE file)
*/
#pragma once
#include <string>
#include <memory>
#include "Logger.hpp"
#include <glenn/png/png.h>
using namespace std;
namespace small3d {
/**
* @class Image
*
* @brief Image loading class. Only handles RGB encoded data in PNG files for now.
*
*/
class Image {
private:
int width, height;
float* imageData;
void loadFromFile(const string &fileLocation);
public:
/**
* Constructor
* @param fileLocation Location of image file
*/
Image(const string &fileLocation);
/**
* Destructor
*/
~Image();
/**
* Get the image width
* @return The image width
*/
int getWidth() const;
/**
* Get the image height
* @return The image height
*/
int getHeight() const;
/**
* Get the image data
* @return The image data
*/
float* getData() const;
};
}