leocad/common/image.h

44 lines
686 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
2021-11-15 04:10:16 +01:00
enum class lcPixelFormat
{
2021-11-15 04:10:16 +01:00
Invalid,
A8,
L8A8,
R8G8B8,
R8G8B8A8
};
2011-09-07 23:06:51 +02:00
class Image
{
public:
2012-03-23 00:44:56 +01:00
Image();
Image(Image&& Other);
2021-11-21 21:16:19 +01:00
~Image();
2012-03-23 00:44:56 +01:00
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
};