source: trunk/src/gdi32/dibsect.h@ 1954

Last change on this file since 1954 was 1937, checked in by achimha, 26 years ago

changes from Markus

File size: 2.7 KB
Line 
1/* $Id: dibsect.h,v 1.7 1999-12-02 13:26:05 achimha Exp $ */
2
3/*
4 * GDI32 DIB sections
5 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
6 * Project Odin Software License can be found in LICENSE.TXT
7 */
8#ifndef __DIBSECT_H__
9#define __DIBSECT_H__
10
11#ifdef OS2_ONLY
12typedef struct {
13 BYTE rgbBlue;
14 BYTE rgbGreen;
15 BYTE rgbRed;
16 BYTE rgbReserved;
17} RGBQUAD, *LPRGBQUAD;
18#else
19#define BITMAPINFO2 DWORD
20#endif
21
22#define FLIP_VERT 1
23#define FLIP_HOR 2
24
25typedef struct {
26 DWORD biSize;
27 LONG biWidth;
28 LONG biHeight;
29 WORD biPlanes;
30 WORD biBitCount;
31 DWORD biCompression;
32 DWORD biSizeImage;
33 LONG biXPelsPerMeter;
34 LONG biYPelsPerMeter;
35 DWORD biClrUsed;
36 DWORD biClrImportant;
37} WINBITMAPINFOHEADER;
38
39typedef struct
40{
41 INT bmType;
42 INT bmWidth;
43 INT bmHeight;
44 INT bmWidthBytes;
45 WORD bmPlanes;
46 WORD bmBitsPixel;
47 LPVOID bmBits;
48} WINBITMAP, *LPWINBITMAP;
49
50#ifdef OS2_ONLY
51typedef struct
52{
53 WINBITMAP dsBm;
54 WINBITMAPINFOHEADER dsBmih;
55 DWORD dsBitfields[3];
56 HANDLE dshSection;
57 DWORD dsOffset;
58} DIBSECTION,*LPDIBSECTION;
59#endif
60
61class DIBSection
62{
63public:
64 DIBSection(WINBITMAPINFOHEADER *pbmi, DWORD handle, int fFlip);
65 ~DIBSection();
66
67 char *GetDIBObject() { return bmpBits; };
68 void SelectDIBObject(HDC hdc);
69
70 void UnSelectDIBObject() { this->hdc = 0; };
71
72 BOOL BitBlt(HDC hdcDest, int nXdest, int nYDest,
73 int nDestWidth, int nDestHeight,
74 int nXsrc, int nYSrc,
75 int nSrcWidth, int nSrcHeight,
76 DWORD Rop);
77
78 int SetDIBColorTable(int startIdx, int cEntries, RGBQUAD *rgb);
79
80 int SetDIBits(HDC hdc, HBITMAP hbitmap, UINT startscan, UINT
81 lines, const VOID *bits, WINBITMAPINFOHEADER *pbmi,
82 UINT coloruse);
83
84 int GetDIBSection(int iSize , DIBSECTION *pDIBSection);
85
86 static DIBSection *getSection() { return section; } ;
87 static DIBSection *find(DWORD handle);
88 static DIBSection *findHDC(HDC hdc);
89 static void deleteSection(DWORD handle);
90protected:
91
92private:
93 DWORD handle;
94 HWND hwndParent;
95 HDC hdc;
96 char *bmpBits;
97 BOOL fFlip;
98 int bmpsize;
99 BITMAPINFO2 *pOS2bmp;
100 // Linked list management
101 DIBSection* next; // Next DIB section
102 static DIBSection* section; // List of DIB sections
103};
104
105#endif
106
107
Note: See TracBrowser for help on using the repository browser.