leocad/common/image.h

44 lines
686 B
C
Raw Normal View History

#pragma once
2011-09-07 21:06:51 +00:00
2013-08-09 04:57:18 +00:00
// Image Options
#define LC_IMAGE_TRANSPARENT 0x2000
//#define LC_IMAGE_MASK 0x7000
2013-08-09 04:57:18 +00:00
2021-11-14 19:10:16 -08:00
enum class lcPixelFormat
{
2021-11-14 19:10:16 -08:00
Invalid,
A8,
L8A8,
R8G8B8,
R8G8B8A8
};
2011-09-07 21:06:51 +00:00
class Image
{
public:
2012-03-22 23:44:56 +00:00
Image();
Image(Image&& Other);
2021-11-21 12:16:19 -08:00
~Image();
2012-03-22 23:44:56 +00:00
2020-05-03 15:39:39 -07:00
Image(const Image&) = delete;
Image& operator=(const Image&) = delete;
Image& operator=(Image&&) = delete;
int GetBPP() const;
bool HasAlpha() const;
2013-08-09 04:57:18 +00:00
bool FileLoad(lcMemFile& File);
bool FileLoad(const QString& FileName);
2012-03-22 23:44:56 +00:00
2013-08-09 04:57:18 +00:00
void Resize(int Width, int Height);
2012-03-22 23:44:56 +00:00
void ResizePow2();
void Allocate(int Width, int Height, lcPixelFormat Format);
2012-03-22 23:44:56 +00:00
void FreeData();
2013-08-09 04:57:18 +00:00
int mWidth;
int mHeight;
lcPixelFormat mFormat;
2013-08-09 04:57:18 +00:00
unsigned char* mData;
2011-09-07 21:06:51 +00:00
};