ReactOS  0.4.15-dev-1068-g467feb9
drawdib.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "vfw.h"
#include "wine/debug.h"
Include dependency graph for drawdib.c:

Go to the source code of this file.

Classes

struct  tagWINE_HDD
 

Macros

#define CHANGED(x)   (whdd->x != x)
 

Typedefs

typedef struct tagWINE_HDD WINE_HDD
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msvideo)
 
static int num_colours (const BITMAPINFOHEADER *lpbi)
 
static WINE_HDDMSVIDEO_GetHddPtr (HDRAWDIB hd)
 
HDRAWDIB VFWAPI DrawDibOpen (void)
 
BOOL VFWAPI DrawDibClose (HDRAWDIB hdd)
 
BOOL VFWAPI DrawDibEnd (HDRAWDIB hdd)
 
BOOL VFWAPI DrawDibBegin (HDRAWDIB hdd, HDC hdc, INT dxDst, INT dyDst, LPBITMAPINFOHEADER lpbi, INT dxSrc, INT dySrc, UINT wFlags)
 
BOOL VFWAPI DrawDibDraw (HDRAWDIB hdd, HDC hdc, INT xDst, INT yDst, INT dxDst, INT dyDst, LPBITMAPINFOHEADER lpbi, LPVOID lpBits, INT xSrc, INT ySrc, INT dxSrc, INT dySrc, UINT wFlags)
 
BOOL VFWAPI DrawDibStart (HDRAWDIB hdd, DWORD rate)
 
BOOL VFWAPI DrawDibStop (HDRAWDIB hdd)
 
BOOL VFWAPI DrawDibChangePalette (HDRAWDIB hdd, int iStart, int iLen, LPPALETTEENTRY lppe)
 
BOOL VFWAPI DrawDibSetPalette (HDRAWDIB hdd, HPALETTE hpal)
 
LPVOID VFWAPI DrawDibGetBuffer (HDRAWDIB hdd, LPBITMAPINFOHEADER lpbi, DWORD dwSize, DWORD dwFlags)
 
HPALETTE VFWAPI DrawDibGetPalette (HDRAWDIB hdd)
 
UINT VFWAPI DrawDibRealize (HDRAWDIB hdd, HDC hdc, BOOL fBackground)
 
BOOL VFWAPI DrawDibTime (HDRAWDIB hdd, LPDRAWDIBTIME lpddtime)
 
DWORD VFWAPI DrawDibProfileDisplay (LPBITMAPINFOHEADER lpbi)
 

Variables

static WINE_HDDHDD_FirstHdd
 
static UINT_PTR HDD_HandleRef = 1
 

Macro Definition Documentation

◆ CHANGED

#define CHANGED (   x)    (whdd->x != x)

Typedef Documentation

◆ WINE_HDD

Function Documentation

◆ DrawDibBegin()

BOOL VFWAPI DrawDibBegin ( HDRAWDIB  hdd,
HDC  hdc,
INT  dxDst,
INT  dyDst,
LPBITMAPINFOHEADER  lpbi,
INT  dxSrc,
INT  dySrc,
UINT  wFlags 
)

Definition at line 175 of file drawdib.c.

183 {
184  BOOL ret = TRUE;
185  WINE_HDD *whdd;
186 
187  TRACE("(%p,%p,%d,%d,%p,%d,%d,0x%08x)\n",
188  hdd, hdc, dxDst, dyDst, lpbi, dxSrc, dySrc, wFlags);
189 
190  TRACE("lpbi: %d,%d/%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
191  lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes,
192  lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage,
193  lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed,
194  lpbi->biClrImportant);
195 
196  if (wFlags & ~(DDF_BUFFER))
197  FIXME("wFlags == 0x%08x not handled\n", wFlags & ~(DDF_BUFFER));
198 
199  whdd = MSVIDEO_GetHddPtr(hdd);
200  if (!whdd) return FALSE;
201 
202  if (whdd->begun) DrawDibEnd(hdd);
203 
204  if (lpbi->biCompression)
205  {
206  DWORD size = 0;
207 
209  if (!whdd->hic)
210  {
211  WARN("Could not open IC. biCompression == 0x%08x\n", lpbi->biCompression);
212  ret = FALSE;
213  }
214 
215  if (ret)
216  {
217  size = ICDecompressGetFormat(whdd->hic, lpbi, NULL);
218  if (size == ICERR_UNSUPPORTED)
219  {
220  WARN("Codec doesn't support GetFormat, giving up.\n");
221  ret = FALSE;
222  }
223  }
224 
225  if (ret)
226  {
227  whdd->lpbiOut = HeapAlloc(GetProcessHeap(), 0, size);
228 
229  if (ICDecompressGetFormat(whdd->hic, lpbi, whdd->lpbiOut) != ICERR_OK)
230  ret = FALSE;
231  }
232 
233  if (ret)
234  {
235  /* FIXME: Use Ex functions if available? */
236  if (ICDecompressBegin(whdd->hic, lpbi, whdd->lpbiOut) != ICERR_OK)
237  ret = FALSE;
238 
239  TRACE("biSizeImage == %d\n", whdd->lpbiOut->biSizeImage);
240  TRACE("biCompression == %d\n", whdd->lpbiOut->biCompression);
241  TRACE("biBitCount == %d\n", whdd->lpbiOut->biBitCount);
242  }
243  }
244  else
245  {
246  DWORD dwSize;
247  /* No compression */
248  TRACE("Not compressed!\n");
249  if (lpbi->biHeight <= 0)
250  {
251  /* we don't draw inverted DIBs */
252  TRACE("detected inverted DIB\n");
253  ret = FALSE;
254  }
255  else
256  {
257  dwSize = lpbi->biSize + num_colours(lpbi)*sizeof(RGBQUAD);
258  whdd->lpbiOut = HeapAlloc(GetProcessHeap(), 0, dwSize);
259  memcpy(whdd->lpbiOut, lpbi, dwSize);
260  }
261  }
262 
263  if (ret)
264  {
265  /*whdd->lpvbuf = HeapAlloc(GetProcessHeap(), 0, whdd->lpbiOut->biSizeImage);*/
266 
267  whdd->hMemDC = CreateCompatibleDC(hdc);
268  TRACE("Creating: %d, %p\n", whdd->lpbiOut->biSize, whdd->lpvbits);
269  whdd->hDib = CreateDIBSection(whdd->hMemDC, (BITMAPINFO *)whdd->lpbiOut, DIB_RGB_COLORS, &(whdd->lpvbits), 0, 0);
270  if (whdd->hDib)
271  {
272  TRACE("Created: %p,%p\n", whdd->hDib, whdd->lpvbits);
273  }
274  else
275  {
276  ret = FALSE;
277  TRACE("Error: %d\n", GetLastError());
278  }
279  whdd->hOldDib = SelectObject(whdd->hMemDC, whdd->hDib);
280  }
281 
282  if (ret)
283  {
284  whdd->hdc = hdc;
285  whdd->dxDst = dxDst;
286  whdd->dyDst = dyDst;
287  whdd->lpbi = HeapAlloc(GetProcessHeap(), 0, lpbi->biSize);
288  memcpy(whdd->lpbi, lpbi, lpbi->biSize);
289  whdd->dxSrc = dxSrc;
290  whdd->dySrc = dySrc;
291  whdd->begun = TRUE;
292  whdd->hpal = 0;
293  }
294  else
295  {
296  if (whdd->hic)
297  ICClose(whdd->hic);
298  HeapFree(GetProcessHeap(), 0, whdd->lpbiOut);
299  whdd->lpbiOut = NULL;
300  }
301 
302  return ret;
303 }
HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
Definition: msvideo_main.c:441
LPBITMAPINFOHEADER lpbiOut
Definition: drawdib.c:46
DWORD biClrImportant
Definition: amvideo.idl:40
#define TRUE
Definition: types.h:120
#define DDF_BUFFER
Definition: vfw.h:2062
LONG biXPelsPerMeter
Definition: amvideo.idl:37
#define WARN(fmt,...)
Definition: debug.h:112
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
static WINE_HDD * MSVIDEO_GetHddPtr(HDRAWDIB hd)
Definition: drawdib.c:67
HBITMAP hDib
Definition: drawdib.c:50
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define ICERR_OK
Definition: vfw.h:50
#define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput)
Definition: vfw.h:383
LONG biYPelsPerMeter
Definition: amvideo.idl:38
HPALETTE hpal
Definition: drawdib.c:44
#define FALSE
Definition: types.h:117
INT dyDst
Definition: drawdib.c:40
unsigned int BOOL
Definition: ntddk_ex.h:94
LRESULT WINAPI ICClose(HIC hic)
#define FIXME(fmt,...)
Definition: debug.h:111
DWORD biCompression
Definition: amvideo.idl:35
smooth NULL
Definition: ftsmooth.c:416
HDC hMemDC
Definition: drawdib.c:48
INT dxDst
Definition: drawdib.c:39
HDC hdc
Definition: drawdib.c:38
HBITMAP hOldDib
Definition: drawdib.c:49
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
ULONG RGBQUAD
Definition: precomp.h:50
#define ICMODE_DECOMPRESS
Definition: vfw.h:269
#define ICTYPE_VIDEO
Definition: mmreg.h:531
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD biSizeImage
Definition: amvideo.idl:36
INT dxSrc
Definition: drawdib.c:42
int ret
BOOL begun
Definition: drawdib.c:45
#define ICERR_UNSUPPORTED
Definition: vfw.h:56
HDC hdc
Definition: main.c:9
HIC hic
Definition: drawdib.c:47
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
INT dySrc
Definition: drawdib.c:43
#define ICDecompressBegin(hic, lpbiInput, lpbiOutput)
Definition: vfw.h:371
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534
LPBITMAPINFOHEADER lpbi
Definition: drawdib.c:41
BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd)
Definition: drawdib.c:129
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:197
#define DIB_RGB_COLORS
Definition: wingdi.h:366
#define HeapFree(x, y, z)
Definition: compat.h:483
LPVOID lpvbits
Definition: drawdib.c:51
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
static int num_colours(const BITMAPINFOHEADER *lpbi)
Definition: drawdib.c:56

Referenced by DrawDibDraw().

◆ DrawDibChangePalette()

BOOL VFWAPI DrawDibChangePalette ( HDRAWDIB  hdd,
int  iStart,
int  iLen,
LPPALETTEENTRY  lppe 
)

Definition at line 432 of file drawdib.c.

433 {
434  FIXME("(%p, 0x%08x, 0x%08x, %p), stub\n", hdd, iStart, iLen, lppe);
435  return TRUE;
436 }
#define TRUE
Definition: types.h:120
_In_ UINT iStart
Definition: wingdi.h:3619
#define FIXME(fmt,...)
Definition: debug.h:111

◆ DrawDibClose()

BOOL VFWAPI DrawDibClose ( HDRAWDIB  hdd)

Definition at line 101 of file drawdib.c.

102 {
103  WINE_HDD* whdd = MSVIDEO_GetHddPtr(hdd);
104  WINE_HDD** p;
105 
106  TRACE("(%p)\n", hdd);
107 
108  if (!whdd) return FALSE;
109 
110  if (whdd->begun) DrawDibEnd(hdd);
111 
112  for (p = &HDD_FirstHdd; *p != NULL; p = &((*p)->next))
113  {
114  if (*p == whdd)
115  {
116  *p = whdd->next;
117  break;
118  }
119  }
120 
121  HeapFree(GetProcessHeap(), 0, whdd);
122 
123  return TRUE;
124 }
#define TRUE
Definition: types.h:120
struct tagWINE_HDD * next
Definition: drawdib.c:53
static WINE_HDD * MSVIDEO_GetHddPtr(HDRAWDIB hd)
Definition: drawdib.c:67
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:484
static WINE_HDD * HDD_FirstHdd
Definition: drawdib.c:65
BOOL begun
Definition: drawdib.c:45
BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd)
Definition: drawdib.c:129
GLfloat GLfloat p
Definition: glext.h:8902
#define HeapFree(x, y, z)
Definition: compat.h:483

Referenced by test_DrawDib_sizeimage().

◆ DrawDibDraw()

BOOL VFWAPI DrawDibDraw ( HDRAWDIB  hdd,
HDC  hdc,
INT  xDst,
INT  yDst,
INT  dxDst,
INT  dyDst,
LPBITMAPINFOHEADER  lpbi,
LPVOID  lpBits,
INT  xSrc,
INT  ySrc,
INT  dxSrc,
INT  dySrc,
UINT  wFlags 
)

Definition at line 308 of file drawdib.c.

314 {
315  WINE_HDD *whdd;
316  BOOL ret;
317  int reopen = 0;
318 
319  TRACE("(%p,%p,%d,%d,%d,%d,%p,%p,%d,%d,%d,%d,0x%08x)\n",
320  hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits, xSrc, ySrc, dxSrc, dySrc, wFlags);
321 
322  whdd = MSVIDEO_GetHddPtr(hdd);
323  if (!whdd) return FALSE;
324 
325  TRACE("whdd=%p\n", whdd);
326 
328  FIXME("wFlags == 0x%08x not handled\n", wFlags);
329 
330  if (!lpBits)
331  {
332  /* Undocumented? */
333  lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)(num_colours(lpbi)*sizeof(RGBQUAD));
334  }
335 
336 
337 #define CHANGED(x) (whdd->x != x)
338 
339  /* Check if anything changed from the parameters passed and our struct.
340  * If anything changed we need to run DrawDibBegin again to ensure we
341  * can support the changes.
342  */
343  if (!whdd->begun)
344  reopen = 1;
345  else if (!(wFlags & DDF_SAME_HDC) && CHANGED(hdc))
346  reopen = 2;
347  else if (!(wFlags & DDF_SAME_DRAW))
348  {
349  if (CHANGED(lpbi) && memcmp(lpbi, whdd->lpbi, sizeof(*lpbi))) reopen = 3;
350  else if (CHANGED(dxSrc)) reopen = 4;
351  else if (CHANGED(dySrc)) reopen = 5;
352  else if (CHANGED(dxDst)) reopen = 6;
353  else if (CHANGED(dyDst)) reopen = 7;
354  }
355  if (reopen)
356  {
357  TRACE("Something changed (reason %d)!\n", reopen);
358  ret = DrawDibBegin(hdd, hdc, dxDst, dyDst, lpbi, dxSrc, dySrc, 0);
359  if (!ret)
360  return ret;
361  }
362 
363 #undef CHANGED
364 
365  /* If source dimensions are not specified derive them from bitmap header */
366  if (dxSrc == -1 && dySrc == -1)
367  {
368  dxSrc = lpbi->biWidth;
369  dySrc = lpbi->biHeight;
370  }
371  /* If destination dimensions are not specified derive them from source */
372  if (dxDst == -1 && dyDst == -1)
373  {
374  dxDst = dxSrc;
375  dyDst = dySrc;
376  }
377 
378  if (!(wFlags & DDF_UPDATE))
379  {
380  if (lpbi->biCompression)
381  {
382  DWORD flags = 0;
383 
384  TRACE("Compression == 0x%08x\n", lpbi->biCompression);
385 
386  if (wFlags & DDF_NOTKEYFRAME)
388 
389  ICDecompress(whdd->hic, flags, lpbi, lpBits, whdd->lpbiOut, whdd->lpvbits);
390  }
391  else
392  {
393  /* BI_RGB: lpbi->biSizeImage isn't reliable */
394  DWORD biSizeImage = ((lpbi->biWidth * lpbi->biBitCount + 31) / 32) * 4 * lpbi->biHeight;
395  memcpy(whdd->lpvbits, lpBits, biSizeImage);
396  }
397  }
398  if (!(wFlags & DDF_DONTDRAW) && whdd->hpal)
399  {
400  if ((wFlags & DDF_BACKGROUNDPAL) && ! (wFlags & DDF_SAME_HDC))
401  SelectPalette(hdc, whdd->hpal, TRUE);
402  else
403  SelectPalette(hdc, whdd->hpal, FALSE);
404  }
405 
406  ret = StretchBlt(whdd->hdc, xDst, yDst, dxDst, dyDst, whdd->hMemDC, xSrc, ySrc, dxSrc, dySrc, SRCCOPY);
407  TRACE("Painting %dx%d at %d,%d from %dx%d at %d,%d -> %d\n",
408  dxDst, dyDst, xDst, yDst, dxSrc, dySrc, xSrc, ySrc, ret);
409 
410  return ret;
411 }
#define DDF_SAME_DRAW
Definition: vfw.h:2059
LPBITMAPINFOHEADER lpbiOut
Definition: drawdib.c:46
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define TRUE
Definition: types.h:120
static WINE_HDD * MSVIDEO_GetHddPtr(HDRAWDIB hd)
Definition: drawdib.c:67
char * LPSTR
Definition: xmlstorage.h:182
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HPALETTE hpal
Definition: drawdib.c:44
#define DDF_DONTDRAW
Definition: vfw.h:2060
#define FALSE
Definition: types.h:117
DWORD VFWAPIV ICDecompress(HIC hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFormat, LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits)
Definition: msvideo_main.c:827
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:111
DWORD biCompression
Definition: amvideo.idl:35
BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, HDC hdc, INT dxDst, INT dyDst, LPBITMAPINFOHEADER lpbi, INT dxSrc, INT dySrc, UINT wFlags)
Definition: drawdib.c:175
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
HDC hMemDC
Definition: drawdib.c:48
HDC hdc
Definition: drawdib.c:38
#define DDF_NOTKEYFRAME
Definition: vfw.h:2066
#define TRACE(s)
Definition: solgame.cpp:4
ULONG RGBQUAD
Definition: precomp.h:50
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ICDECOMPRESS_NOTKEYFRAME
Definition: vfw.h:331
GLbitfield flags
Definition: glext.h:7161
int ret
BOOL begun
Definition: drawdib.c:45
#define CHANGED(x)
#define DDF_UPDATE
Definition: vfw.h:2057
HDC hdc
Definition: main.c:9
HIC hic
Definition: drawdib.c:47
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define DDF_SAME_HDC
Definition: vfw.h:2058
#define DDF_BACKGROUNDPAL
Definition: vfw.h:2065
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534
LPBITMAPINFOHEADER lpbi
Definition: drawdib.c:41
LPVOID lpvbits
Definition: drawdib.c:51
#define SRCCOPY
Definition: wingdi.h:332
static int num_colours(const BITMAPINFOHEADER *lpbi)
Definition: drawdib.c:56

Referenced by test_DrawDib_sizeimage().

◆ DrawDibEnd()

BOOL VFWAPI DrawDibEnd ( HDRAWDIB  hdd)

Definition at line 129 of file drawdib.c.

130 {
131  BOOL ret = TRUE;
132  WINE_HDD *whdd = MSVIDEO_GetHddPtr(hdd);
133 
134  TRACE("(%p)\n", hdd);
135 
136  if (!whdd) return FALSE;
137 
138  whdd->hpal = 0; /* Do not free this */
139  whdd->hdc = 0;
140  HeapFree(GetProcessHeap(), 0, whdd->lpbi);
141  whdd->lpbi = NULL;
142  HeapFree(GetProcessHeap(), 0, whdd->lpbiOut);
143  whdd->lpbiOut = NULL;
144 
145  whdd->begun = FALSE;
146 
147  /*if (whdd->lpvbits)
148  HeapFree(GetProcessHeap(), 0, whdd->lpvbuf);*/
149 
150  if (whdd->hMemDC)
151  {
152  SelectObject(whdd->hMemDC, whdd->hOldDib);
153  DeleteDC(whdd->hMemDC);
154  whdd->hMemDC = 0;
155  }
156 
157  if (whdd->hDib) DeleteObject(whdd->hDib);
158  whdd->hDib = 0;
159 
160  if (whdd->hic)
161  {
162  ICDecompressEnd(whdd->hic);
163  ICClose(whdd->hic);
164  whdd->hic = 0;
165  }
166 
167  whdd->lpvbits = NULL;
168 
169  return ret;
170 }
#define ICDecompressEnd(hic)
Definition: vfw.h:404
LPBITMAPINFOHEADER lpbiOut
Definition: drawdib.c:46
#define TRUE
Definition: types.h:120
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
static WINE_HDD * MSVIDEO_GetHddPtr(HDRAWDIB hd)
Definition: drawdib.c:67
HBITMAP hDib
Definition: drawdib.c:50
HPALETTE hpal
Definition: drawdib.c:44
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
LRESULT WINAPI ICClose(HIC hic)
smooth NULL
Definition: ftsmooth.c:416
HDC hMemDC
Definition: drawdib.c:48
HDC hdc
Definition: drawdib.c:38
HBITMAP hOldDib
Definition: drawdib.c:49
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:484
int ret
BOOL begun
Definition: drawdib.c:45
HIC hic
Definition: drawdib.c:47
LPBITMAPINFOHEADER lpbi
Definition: drawdib.c:41
BOOL WINAPI DeleteDC(_In_ HDC)
#define HeapFree(x, y, z)
Definition: compat.h:483
LPVOID lpvbits
Definition: drawdib.c:51

Referenced by DrawDibBegin(), and DrawDibClose().

◆ DrawDibGetBuffer()

LPVOID VFWAPI DrawDibGetBuffer ( HDRAWDIB  hdd,
LPBITMAPINFOHEADER  lpbi,
DWORD  dwSize,
DWORD  dwFlags 
)

Definition at line 464 of file drawdib.c.

465 {
466  FIXME("(%p, %p, 0x%08x, 0x%08x), stub\n", hdd, lpbi, dwSize, dwFlags);
467  return NULL;
468 }
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

◆ DrawDibGetPalette()

HPALETTE VFWAPI DrawDibGetPalette ( HDRAWDIB  hdd)

Definition at line 473 of file drawdib.c.

474 {
475  WINE_HDD *whdd;
476 
477  TRACE("(%p)\n", hdd);
478 
479  whdd = MSVIDEO_GetHddPtr(hdd);
480  if (!whdd) return FALSE;
481 
482  return whdd->hpal;
483 }
static WINE_HDD * MSVIDEO_GetHddPtr(HDRAWDIB hd)
Definition: drawdib.c:67
HPALETTE hpal
Definition: drawdib.c:44
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4

◆ DrawDibOpen()

HDRAWDIB VFWAPI DrawDibOpen ( void  )

Definition at line 80 of file drawdib.c.

81 {
82  WINE_HDD* whdd;
83 
84  TRACE("(void)\n");
85 
87  TRACE("=> %p\n", whdd);
88 
90  whdd->hSelf = (HDRAWDIB)HDD_HandleRef++;
91 
92  whdd->next = HDD_FirstHdd;
93  HDD_FirstHdd = whdd;
94 
95  return whdd->hSelf;
96 }
struct tagWINE_HDD * next
Definition: drawdib.c:53
static WINE_HDD * MSVIDEO_GetHddPtr(HDRAWDIB hd)
Definition: drawdib.c:67
smooth NULL
Definition: ftsmooth.c:416
HANDLE HDRAWDIB
Definition: vfw.h:33
static UINT_PTR HDD_HandleRef
Definition: drawdib.c:75
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static WINE_HDD * HDD_FirstHdd
Definition: drawdib.c:65
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
HDRAWDIB hSelf
Definition: drawdib.c:52

Referenced by test_DrawDib_sizeimage().

◆ DrawDibProfileDisplay()

DWORD VFWAPI DrawDibProfileDisplay ( LPBITMAPINFOHEADER  lpbi)

Definition at line 527 of file drawdib.c.

528 {
529  FIXME("(%p) stub\n", lpbi);
530 
531  return PD_CAN_DRAW_DIB;
532 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define PD_CAN_DRAW_DIB
Definition: vfw.h:2104

◆ DrawDibRealize()

UINT VFWAPI DrawDibRealize ( HDRAWDIB  hdd,
HDC  hdc,
BOOL  fBackground 
)

Definition at line 488 of file drawdib.c.

489 {
490  WINE_HDD *whdd;
491  UINT ret = 0;
492 
493  FIXME("(%p, %p, %d), stub\n", hdd, hdc, fBackground);
494 
495  whdd = MSVIDEO_GetHddPtr(hdd);
496  if (!whdd) return FALSE;
497 
498  if (!whdd->begun)
499  {
500  ret = 0;
501  goto out;
502  }
503 
504  if (!whdd->hpal)
505  whdd->hpal = CreateHalftonePalette(hdc);
506 
507  SelectPalette(hdc, whdd->hpal, fBackground);
509 
510  out:
511  TRACE("=> %u\n", ret);
512  return ret;
513 }
static WINE_HDD * MSVIDEO_GetHddPtr(HDRAWDIB hd)
Definition: drawdib.c:67
HPALETTE hpal
Definition: drawdib.c:44
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
int ret
BOOL begun
Definition: drawdib.c:45
HDC hdc
Definition: main.c:9
unsigned int UINT
Definition: ndis.h:50
UINT WINAPI RealizePalette(_In_ HDC)
Definition: palette.c:138
HPALETTE WINAPI CreateHalftonePalette(_In_opt_ HDC)

◆ DrawDibSetPalette()

BOOL VFWAPI DrawDibSetPalette ( HDRAWDIB  hdd,
HPALETTE  hpal 
)

Definition at line 441 of file drawdib.c.

442 {
443  WINE_HDD *whdd;
444 
445  TRACE("(%p, %p)\n", hdd, hpal);
446 
447  whdd = MSVIDEO_GetHddPtr(hdd);
448  if (!whdd) return FALSE;
449 
450  whdd->hpal = hpal;
451 
452  if (whdd->begun)
453  {
454  SelectPalette(whdd->hdc, hpal, 0);
455  RealizePalette(whdd->hdc);
456  }
457 
458  return TRUE;
459 }
#define TRUE
Definition: types.h:120
static WINE_HDD * MSVIDEO_GetHddPtr(HDRAWDIB hd)
Definition: drawdib.c:67
HPALETTE hpal
Definition: drawdib.c:44
#define FALSE
Definition: types.h:117
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
HDC hdc
Definition: drawdib.c:38
#define TRACE(s)
Definition: solgame.cpp:4
BOOL begun
Definition: drawdib.c:45
UINT WINAPI RealizePalette(_In_ HDC)
Definition: palette.c:138

◆ DrawDibStart()

BOOL VFWAPI DrawDibStart ( HDRAWDIB  hdd,
DWORD  rate 
)

Definition at line 416 of file drawdib.c.

416  {
417  FIXME("(%p, %d), stub\n", hdd, rate);
418  return TRUE;
419 }
#define TRUE
Definition: types.h:120
int rate
Definition: pcmconverter.c:97
#define FIXME(fmt,...)
Definition: debug.h:111

◆ DrawDibStop()

BOOL VFWAPI DrawDibStop ( HDRAWDIB  hdd)

Definition at line 424 of file drawdib.c.

424  {
425  FIXME("(%p), stub\n", hdd);
426  return TRUE;
427 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:111

◆ DrawDibTime()

BOOL VFWAPI DrawDibTime ( HDRAWDIB  hdd,
LPDRAWDIBTIME  lpddtime 
)

Definition at line 518 of file drawdib.c.

519 {
520  FIXME("(%p, %p) stub\n", hdd, lpddtime);
521  return FALSE;
522 }
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111

◆ MSVIDEO_GetHddPtr()

static WINE_HDD* MSVIDEO_GetHddPtr ( HDRAWDIB  hd)
static

Definition at line 67 of file drawdib.c.

68 {
69  WINE_HDD* hdd;
70 
71  for (hdd = HDD_FirstHdd; hdd != NULL && hdd->hSelf != hd; hdd = hdd->next);
72  return hdd;
73 }
struct tagWINE_HDD * next
Definition: drawdib.c:53
smooth NULL
Definition: ftsmooth.c:416
static WINE_HDD * HDD_FirstHdd
Definition: drawdib.c:65
HDRAWDIB hSelf
Definition: drawdib.c:52

Referenced by DrawDibBegin(), DrawDibClose(), DrawDibDraw(), DrawDibEnd(), DrawDibGetPalette(), DrawDibOpen(), DrawDibRealize(), and DrawDibSetPalette().

◆ num_colours()

static int num_colours ( const BITMAPINFOHEADER lpbi)
static

Definition at line 56 of file drawdib.c.

57 {
58  if(lpbi->biClrUsed)
59  return lpbi->biClrUsed;
60  if(lpbi->biBitCount<=8)
61  return 1<<lpbi->biBitCount;
62  return 0;
63 }

Referenced by DrawDibBegin(), and DrawDibDraw().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msvideo  )

Variable Documentation

◆ HDD_FirstHdd

WINE_HDD* HDD_FirstHdd
static

Definition at line 65 of file drawdib.c.

Referenced by DrawDibClose(), DrawDibOpen(), and MSVIDEO_GetHddPtr().

◆ HDD_HandleRef

UINT_PTR HDD_HandleRef = 1
static

Definition at line 75 of file drawdib.c.

Referenced by DrawDibOpen().