2020-02-25 21:19:39 +01:00
|
|
|
/*
|
|
|
|
This class will replace EG_IMAGE structure and methods
|
|
|
|
*/
|
|
|
|
|
2020-02-25 14:55:39 +01:00
|
|
|
#if !defined(__XSTRINGW_H__)
|
|
|
|
#define __XSTRINGW_H__
|
|
|
|
|
|
|
|
#include "XToolsCommon.h"
|
|
|
|
#include <Platform.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
typedef struct {
|
|
|
|
UINT8 Blue;
|
|
|
|
UINT8 Green;
|
|
|
|
UINT8 Red;
|
|
|
|
UINT8 Reserved; //this is Alpha. 0 means full transparent, 0xFF means opaque
|
|
|
|
} EFI_GRAPHICS_OUTPUT_BLT_PIXEL;
|
|
|
|
|
|
|
|
typedef union {
|
|
|
|
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;
|
|
|
|
UINT32 Raw;
|
|
|
|
} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct {
|
2020-02-25 21:19:39 +01:00
|
|
|
UINTN Xpos;
|
|
|
|
UINTN Ypos;
|
|
|
|
UINTN Width;
|
|
|
|
UINTN Height;
|
2020-02-25 14:55:39 +01:00
|
|
|
} EgRect;
|
2020-02-25 21:19:39 +01:00
|
|
|
|
|
|
|
class XImage
|
|
|
|
{
|
|
|
|
protected:
|
2020-02-25 14:55:39 +01:00
|
|
|
UINTN Width;
|
|
|
|
UINTN Height;
|
|
|
|
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *PixelData;
|
2020-02-25 21:19:39 +01:00
|
|
|
bool HasAlpha;
|
|
|
|
public:
|
|
|
|
XImage();
|
|
|
|
XImage(UINTN W, UINTN H, bool HasAlpha);
|
|
|
|
// XImage(UINTN W, UINTN H, bool HasAlpha, UINT32 Color); //egCreateFilledImage
|
|
|
|
// XImage(VOID *Data);
|
|
|
|
~XImage();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
UINTN GetSize(); //in bytes
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
EFI_GRAPHICS_OUTPUT_BLT_PIXEL* GetData();
|
2020-02-25 14:55:39 +01:00
|
|
|
UINTN GetWidth();
|
|
|
|
UINTN GetHeight();
|
2020-02-25 21:19:39 +01:00
|
|
|
|
|
|
|
void Fill(EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color = { 0, 0, 0, 0 });
|
|
|
|
void FillArea(EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color, const EgRect& Rect);
|
|
|
|
void Compose(int PosX, int PosY, XImage& TopImage, bool Lowest);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__XSTRINGW_H__
|