1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00
Beef/BeefySysLib/img/ImageData.h

51 lines
993 B
C
Raw Normal View History

2019-08-23 11:56:54 -07:00
#pragma once
#include "../Common.h"
NS_BF_BEGIN;
enum
{
HWBITS_UNKNOWN,
HWBITS_PVRTC_2BPPV1,
HWBITS_PVRTC_4BPPV1,
HWBITS_PVRTC_2X4BPPV1
};
class ImageData
{
public:
int mX;
int mY;
int mWidth;
int mHeight;
void* mHWBits;
int mHWBitsLength;
int mHWBitsType;
uint32* mBits;
uint8* mSrcData;
int mSrcDataLen;
bool mKeepSrcDataValid;
bool mOwnsSrcData;
bool mWantsAlphaPremultiplied;
bool mAlphaPremultiplied;
bool mIsAdditive;
public:
ImageData();
virtual ~ImageData();
void SwapRAndB();
void CreateNew(int x, int y, int width, int height, bool clear = true);
void CreateNew(int width, int height, bool clear = true);
void Fill(uint32 color);
virtual ImageData* Duplicate();
void SetSrcData(uint8* data, int dataLen);
virtual bool LoadFromFile(const StringImpl& path);
virtual bool ReadData() { return false; }
virtual void PremultiplyAlpha();
};
NS_BF_END;