FasTC/IO/include/ImageFile.h

31 lines
754 B
C
Raw Normal View History

#ifndef _IMAGE_FILE_H_
2012-08-26 20:46:47 +02:00
#define _IMAGE_FILE_H_
#include "ImageFileFormat.h"
2012-08-26 20:46:47 +02:00
class ImageFile {
public:
ImageFile(const char *filename);
ImageFile(const char *filename, EImageFileFormat format);
2012-08-26 20:46:47 +02:00
~ImageFile();
unsigned int GetWidth() const { return m_Width; }
unsigned int GetHeight() const { return m_Height; }
const unsigned char *GetPixels() const { return m_PixelData; }
2012-08-26 20:46:47 +02:00
private:
unsigned int m_Handle;
unsigned int m_Width;
unsigned int m_Height;
unsigned char *m_PixelData;
const EImageFileFormat m_FileFormat;
static unsigned char *ReadFileData(const char *filename);
static EImageFileFormat DetectFileFormat(const char *filename);
bool LoadImage(const unsigned char *rawImageData);
2012-08-26 20:46:47 +02:00
};
#endif // _IMAGE_FILE_H_