mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-13 10:04:04 +01:00
Added const in XImage
This commit is contained in:
parent
a0b40c06dc
commit
9ac41a3c9d
@ -21,22 +21,22 @@ XImage::~XImage()
|
||||
Xfree(PixelData);
|
||||
}
|
||||
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL* XImage::GetData()
|
||||
const EFI_GRAPHICS_OUTPUT_BLT_PIXEL* XImage::GetData() const
|
||||
{
|
||||
return PixelData;
|
||||
}
|
||||
|
||||
UINTN XImage::GetWidth()
|
||||
UINTN XImage::GetWidth() const
|
||||
{
|
||||
return Width;
|
||||
}
|
||||
|
||||
UINTN XImage::GetHeight()
|
||||
UINTN XImage::GetHeight() const
|
||||
{
|
||||
return Height;
|
||||
}
|
||||
|
||||
UINTN XImage::GetSize()
|
||||
UINTN XImage::GetSize() const
|
||||
{
|
||||
return Width * Height * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
|
||||
}
|
||||
@ -59,13 +59,14 @@ void XImage::FillArea(EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color, const EgRect& Rect)
|
||||
|
||||
|
||||
|
||||
void XImage::Compose(int PosX, int PosY, XImage& TopImage, bool Lowest) //lowest image is opaque
|
||||
void XImage::Compose(int PosX, int PosY, const XImage& TopImage, bool Lowest) //lowest image is opaque
|
||||
{
|
||||
UINT32 TopAlpha;
|
||||
UINT32 RevAlpha;
|
||||
UINT32 FinalAlpha;
|
||||
UINT32 Temp;
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *TopPtr, *CompPtr;
|
||||
const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *TopPtr;
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *CompPtr;
|
||||
|
||||
for (UINTN y = PosY; y < Height && (y - PosY) < TopImage.GetHeight(); y++) {
|
||||
TopPtr = TopImage.GetData();
|
||||
|
@ -5,7 +5,7 @@ This class will replace EG_IMAGE structure and methods
|
||||
#if !defined(__XSTRINGW_H__)
|
||||
#define __XSTRINGW_H__
|
||||
|
||||
#include "XToolsCommon.h"
|
||||
#include "../cpp_foundation/XToolsCommon.h"
|
||||
#include <Platform.h>
|
||||
|
||||
/*
|
||||
@ -44,17 +44,17 @@ public:
|
||||
~XImage();
|
||||
|
||||
protected:
|
||||
UINTN GetSize(); //in bytes
|
||||
UINTN GetSize() const; //in bytes
|
||||
|
||||
public:
|
||||
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL* GetData();
|
||||
UINTN GetWidth();
|
||||
UINTN GetHeight();
|
||||
const EFI_GRAPHICS_OUTPUT_BLT_PIXEL* GetData() const;
|
||||
UINTN GetWidth() const;
|
||||
UINTN GetHeight() const;
|
||||
|
||||
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);
|
||||
void Compose(int PosX, int PosY, const XImage& TopImage, bool Lowest);
|
||||
};
|
||||
|
||||
#endif //__XSTRINGW_H__
|
||||
|
Loading…
Reference in New Issue
Block a user