-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dib.h
71 lines (62 loc) · 2.48 KB
/
Dib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Dib.h: interface for the CDib class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DIB_H__955DFDBD_51F6_419C_BE14_06287AE21568__INCLUDED_)
#define AFX_DIB_H__955DFDBD_51F6_419C_BE14_06287AE21568__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Dib Error Codes
#define NODIBMEMORY 1
#define NOPIXELMEMORY 2
// Alpha channel types
#define NOALPHA 0
#define RGBA1 1 // PHD 2020-09-03 changed from RGBA to resolve conflict with WebP library
#define GREYA 2
class CDib
{
public:
CDib();
CDib(const CDib &); // Copy Constructor
virtual ~CDib();
CDib & operator =(const CDib &); // Assignment Operator
unsigned char *InitDib(int Width, int Height);
unsigned char *InitDib(int Width, int Height, WORD bits);
unsigned char *InitDib(int Width, int Height, BYTE *palette, WORD bits);
unsigned char *InitDib(LPBITMAPINFO);
void CloseDibPtrs(void);
void DibTo24(const CDib &);
void DibTo24(LPBITMAPINFO);
void DibTo24(LPBITMAPINFO, BYTE *);
void DibTo24(void);
// void InsertDib(unsigned, unsigned, BYTE *, unsigned, unsigned);
void InsertDib(int, int, BYTE *, unsigned, unsigned);
void Text2Dib(HDC, RECT *, TCHAR *);
void Text2Dib(HDC, RECT *, LOGFONT *, TCHAR *);
void Text2Dib(HDC, RECT *, COLORREF, COLORREF, LOGFONT *, int, TCHAR *);
void ClearDib(int Red, int Green, int Blue);
// void ClearDib(int);
void ClearDib(RGBTRIPLE);
void ClearDib(DWORD);
// void CountColours(void);
DWORD ColourCount(void (*Progress)(int, int, char *));
DWORD ColourCount(void);
DWORD Size() { return DibSize; };
// WORD Width() { return DibWidth; };
// WORD Height() { return DibHeight; };
// WORD Bits() { return BitsPerPixel; };
// DWORD NumColours() { return DibNumColours; };
int DibErrorCode;
LPBITMAPINFO pDibInf; // pointer to the DIB info
BYTE *DibPixels; // the device-independent bitmap pixels
DWORD SizeImage; // Size, in bytes, of the image.
WORD DibWidth; // the size of the image in pixels
WORD DibHeight;
WORD BitsPerPixel;
DWORD WidthBytes; // Width, in bytes, of 1 line.
DWORD DibNumColours;
BYTE AlphaChannel; // RGB+A or Greyscale+A or off
private:
DWORD DibSize; // Size, in bytes, of the DIB
};
#endif // !defined(AFX_DIB_H__955DFDBD_51F6_419C_BE14_06287AE21568__INCLUDED_)