leocad/common/image.h

44 lines
768 B
C
Raw Normal View History

#pragma once
2011-09-07 23:06:51 +02:00
2013-08-09 06:57:18 +02:00
// Image Options
#define LC_IMAGE_TRANSPARENT 0x2000
//#define LC_IMAGE_MASK 0x7000
2013-08-09 06:57:18 +02:00
enum lcPixelFormat
{
LC_PIXEL_FORMAT_INVALID,
LC_PIXEL_FORMAT_A8,
LC_PIXEL_FORMAT_L8A8,
LC_PIXEL_FORMAT_R8G8B8,
LC_PIXEL_FORMAT_R8G8B8A8
};
2011-09-07 23:06:51 +02:00
class Image
{
public:
2012-03-23 00:44:56 +01:00
Image();
Image(Image&& Other);
2012-03-23 00:44:56 +01:00
virtual ~Image();
2020-05-04 00:39:39 +02:00
Image(const Image&) = delete;
Image& operator=(const Image&) = delete;
Image& operator=(Image&&) = delete;
int GetBPP() const;
bool HasAlpha() const;
2013-08-09 06:57:18 +02:00
bool FileLoad(lcMemFile& File);
bool FileLoad(const QString& FileName);
2012-03-23 00:44:56 +01:00
2013-08-09 06:57:18 +02:00
void Resize(int Width, int Height);
2012-03-23 00:44:56 +01:00
void ResizePow2();
void Allocate(int Width, int Height, lcPixelFormat Format);
2012-03-23 00:44:56 +01:00
void FreeData();
2013-08-09 06:57:18 +02:00
int mWidth;
int mHeight;
lcPixelFormat mFormat;
2013-08-09 06:57:18 +02:00
unsigned char* mData;
2011-09-07 23:06:51 +02:00
};