00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
#ifndef OPENCAL_UTILS_IMAGE_H
00012
#define OPENCAL_UTILS_IMAGE_H
00013
00014
00015
#include <OpenCAL/global.h>
00016
00017
00018
namespace OpenCAL
00019 {
00020
namespace Utils
00021 {
00027 class OPENCAL_API Image
00028 {
00029
protected:
00030
00031
unsigned int m_width, m_height, m_depth;
00032
unsigned char *m_data;
00033
00034
public:
00035
00036 Image(
unsigned int width,
unsigned int height,
unsigned int depth = 3);
00037 Image(
const string &filename);
00038
virtual ~Image();
00039
00040
00041
unsigned int getWidth()
const {
return m_width; }
00042
unsigned int getHeight()
const {
return m_height; }
00043
unsigned int getDepth()
const {
return m_depth; }
00044
const unsigned char *getData()
const {
return m_data; }
00045
unsigned char *getData() {
return m_data; }
00046
00047
00048
void resize(
unsigned int width,
unsigned int height,
unsigned int depth);
00049
void clear();
00050
00051
friend class ImageLoader;
00052 };
00053 }
00054 }
00055
00056
#endif // OPENCAL_UTILS_IMAGE_H