59 for (
int cy=iY; cy<=iY2; cy++)
HLine(iX,iX2,cy,iCol);
75 for (
int cx=iX; cx<=iX2; cx++)
SetPix(cx,iY,iCol);
82 if (!iWdt || !iHgt)
return false;
87 if (!
pPal)
return false;
91 if (!
Bits)
return false;
104 if (!hGroup.
Read(&BitmapInfo,
sizeof(
C4BMPInfo)))
return false;
109 if (!hGroup.
Advance(BitmapInfo.FileBitsOffset()))
return false;
115 if (!hGroup.
Advance(((
C4BMPInfo) BitmapInfo).FileBitsOffset()))
return false;
124 for (cnt=0; cnt<256; cnt++)
136 for (lcnt=
Hgt-1; lcnt>=0; lcnt--)
138 if (!hGroup.
Read(pBuf, iBufSize))
139 {
Clear();
delete [] pBuf;
return false; }
166 if ( !hFile.
Create(szFilename)
167 || !hFile.
Write(&BitmapInfo,
sizeof(BitmapInfo)) )
171 char bpEmpty[4];
ZeroMem(bpEmpty, 4);
173 for (
int cnt=
Hgt-1; cnt>=0; cnt--)
178 if (!hFile.
Write(bpEmpty,iEmpty))
205 for (
int y=iY; y<iY+iHgt; ++y)
206 for (
int x=iX; x<iX+iWdt; ++x)
214 for (
int ycnt=-r; ycnt<r; ycnt++)
216 int lwdt = (int) sqrt(
float(r*r-ycnt*ycnt));
217 for (
int xcnt = 2 * lwdt - 1; xcnt >= 0; xcnt--)
218 SetPix(x - lwdt + xcnt, y + ycnt, col);
226 if (iRngHi<iRngLo)
return;
227 for (ycnt=0; ycnt<
Hgt; ycnt++)
229 for (xcnt=0; xcnt<
Wdt; xcnt++)
232 if (px || !fAllowZero)
233 if ((px<iRngLo) || (px>iRngHi))
234 SetPix(xcnt, ycnt, iRngLo + px % (iRngHi-iRngLo+1));
247 this->
Bits = pbyToBuf;
253 this->
Bits =
nullptr;
int DWordAligned(int val)
std::enable_if< std::is_pod< T >::value >::type ZeroMem(T *lpMem, size_t dwSize)
T Clamp(T bval, T lbound, T rbound)
void Set(int iWdt, int iHgt, CStdPalette *)
bool Close(StdBuf **ppMemory=nullptr)
bool Create(const char *szFileName, bool fCompressed=false, bool fExecutable=false, bool fMemory=false)
bool Write(const void *pBuffer, int iSize)
virtual bool Read(void *pBuffer, size_t iSize)=0
virtual bool Advance(int iOffset)=0
void ClearBox8Only(int iX, int iY, int iWdt, int iHgt)
void Clip(int iX, int iY, int iX2, int iY2)
bool Save(const char *szFilename, CStdPalette *=nullptr)
BYTE GetPix(int iX, int iY) const
void HLine(int iX, int iX2, int iY, int iCol)
bool Create(int iWdt, int iHgt)
void AllowColor(BYTE iRngLo, BYTE iRngHi, bool fAllowZero=false)
void Circle(int x, int y, int r, BYTE col)
void GetSurfaceSize(int &irX, int &irY) const
void Box(int iX, int iY, int iX2, int iY2, int iCol)
void MapBytes(BYTE *bpMap)
void SetPix(int iX, int iY, BYTE byCol)
bool Read(class CStdStream &hGroup)
void SetBuffer(BYTE *pbyToBuf, int Wdt, int Hgt, int Pitch)