2002-06-01 01:06:46 +02:00
|
|
|
/*
|
2000-07-08 14:50:26 +02:00
|
|
|
* Copyright 2000 Bradley Baetz
|
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
2002-01-29 04:12:19 +01:00
|
|
|
* FIXME: Some flags are ignored
|
2001-01-29 00:09:38 +01:00
|
|
|
*
|
2000-07-08 14:50:26 +02:00
|
|
|
* Handle palettes
|
|
|
|
*/
|
|
|
|
|
2005-11-22 15:56:40 +01:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
2001-01-26 21:43:40 +01:00
|
|
|
#include <string.h>
|
2002-11-20 20:47:08 +01:00
|
|
|
|
2005-11-22 15:56:40 +01:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2000-07-08 14:50:26 +02:00
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
2005-11-22 15:56:40 +01:00
|
|
|
#include "vfw.h"
|
2002-11-20 20:47:08 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msvideo);
|
2001-01-29 00:09:38 +01:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
typedef struct tagWINE_HDD {
|
|
|
|
HDC hdc;
|
|
|
|
INT dxDst;
|
|
|
|
INT dyDst;
|
|
|
|
LPBITMAPINFOHEADER lpbi;
|
|
|
|
INT dxSrc;
|
|
|
|
INT dySrc;
|
|
|
|
HPALETTE hpal; /* Palette to use for the DIB */
|
|
|
|
BOOL begun; /* DrawDibBegin has been called */
|
|
|
|
LPBITMAPINFOHEADER lpbiOut; /* Output format */
|
|
|
|
HIC hic; /* HIC for decompression */
|
|
|
|
HDC hMemDC; /* DC for buffering */
|
|
|
|
HBITMAP hOldDib; /* Original Dib */
|
|
|
|
HBITMAP hDib; /* DibSection */
|
|
|
|
LPVOID lpvbits; /* Buffer for holding decompressed dib */
|
|
|
|
HDRAWDIB hSelf;
|
|
|
|
struct tagWINE_HDD* next;
|
2000-07-08 14:50:26 +02:00
|
|
|
} WINE_HDD;
|
|
|
|
|
2007-03-05 20:03:04 +01:00
|
|
|
static int num_colours(const BITMAPINFOHEADER *lpbi)
|
2002-08-14 23:02:01 +02:00
|
|
|
{
|
|
|
|
if(lpbi->biClrUsed)
|
|
|
|
return lpbi->biClrUsed;
|
|
|
|
if(lpbi->biBitCount<=8)
|
|
|
|
return 1<<lpbi->biBitCount;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
static WINE_HDD* HDD_FirstHdd /* = NULL */;
|
|
|
|
|
|
|
|
static WINE_HDD* MSVIDEO_GetHddPtr(HDRAWDIB hd)
|
|
|
|
{
|
|
|
|
WINE_HDD* hdd;
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2003-01-02 18:56:07 +01:00
|
|
|
for (hdd = HDD_FirstHdd; hdd != NULL && hdd->hSelf != hd; hdd = hdd->next);
|
2002-11-20 20:47:08 +01:00
|
|
|
return hdd;
|
2000-07-08 14:50:26 +02:00
|
|
|
}
|
|
|
|
|
2009-05-28 15:25:09 +02:00
|
|
|
static UINT_PTR HDD_HandleRef = 1;
|
2002-11-20 20:47:08 +01:00
|
|
|
|
2000-07-08 14:50:26 +02:00
|
|
|
/***********************************************************************
|
2002-11-20 20:47:08 +01:00
|
|
|
* DrawDibOpen [MSVFW32.@]
|
2000-07-08 14:50:26 +02:00
|
|
|
*/
|
2002-11-20 20:47:08 +01:00
|
|
|
HDRAWDIB VFWAPI DrawDibOpen(void)
|
|
|
|
{
|
|
|
|
WINE_HDD* whdd;
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
TRACE("(void)\n");
|
|
|
|
|
|
|
|
whdd = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINE_HDD));
|
|
|
|
TRACE("=> %p\n", whdd);
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
while (MSVIDEO_GetHddPtr((HDRAWDIB)HDD_HandleRef) != NULL) HDD_HandleRef++;
|
|
|
|
whdd->hSelf = (HDRAWDIB)HDD_HandleRef++;
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
whdd->next = HDD_FirstHdd;
|
|
|
|
HDD_FirstHdd = whdd;
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
return whdd->hSelf;
|
2000-07-08 14:50:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2002-11-20 20:47:08 +01:00
|
|
|
* DrawDibClose [MSVFW32.@]
|
2000-07-08 14:50:26 +02:00
|
|
|
*/
|
2002-11-20 20:47:08 +01:00
|
|
|
BOOL VFWAPI DrawDibClose(HDRAWDIB hdd)
|
|
|
|
{
|
|
|
|
WINE_HDD* whdd = MSVIDEO_GetHddPtr(hdd);
|
2003-01-02 18:56:07 +01:00
|
|
|
WINE_HDD** p;
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
TRACE("(%p)\n", hdd);
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
if (!whdd) return FALSE;
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
if (whdd->begun) DrawDibEnd(hdd);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2003-01-02 18:56:07 +01:00
|
|
|
for (p = &HDD_FirstHdd; *p != NULL; p = &((*p)->next))
|
|
|
|
{
|
|
|
|
if (*p == whdd)
|
|
|
|
{
|
|
|
|
*p = whdd->next;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
HeapFree(GetProcessHeap(), 0, whdd);
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* DrawDibEnd [MSVFW32.@]
|
|
|
|
*/
|
|
|
|
BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd)
|
|
|
|
{
|
|
|
|
BOOL ret = TRUE;
|
|
|
|
WINE_HDD *whdd = MSVIDEO_GetHddPtr(hdd);
|
|
|
|
|
|
|
|
TRACE("(%p)\n", hdd);
|
|
|
|
|
2008-02-02 14:36:18 +01:00
|
|
|
if (!whdd) return FALSE;
|
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
whdd->hpal = 0; /* Do not free this */
|
|
|
|
whdd->hdc = 0;
|
2004-12-23 18:06:43 +01:00
|
|
|
HeapFree(GetProcessHeap(), 0, whdd->lpbi);
|
|
|
|
whdd->lpbi = NULL;
|
|
|
|
HeapFree(GetProcessHeap(), 0, whdd->lpbiOut);
|
|
|
|
whdd->lpbiOut = NULL;
|
2002-11-20 20:47:08 +01:00
|
|
|
|
|
|
|
whdd->begun = FALSE;
|
|
|
|
|
|
|
|
/*if (whdd->lpvbits)
|
|
|
|
HeapFree(GetProcessHeap(), 0, whdd->lpvbuf);*/
|
|
|
|
|
|
|
|
if (whdd->hMemDC)
|
|
|
|
{
|
|
|
|
SelectObject(whdd->hMemDC, whdd->hOldDib);
|
|
|
|
DeleteDC(whdd->hMemDC);
|
|
|
|
whdd->hMemDC = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (whdd->hDib) DeleteObject(whdd->hDib);
|
|
|
|
whdd->hDib = 0;
|
|
|
|
|
|
|
|
if (whdd->hic)
|
|
|
|
{
|
|
|
|
ICDecompressEnd(whdd->hic);
|
|
|
|
ICClose(whdd->hic);
|
|
|
|
whdd->hic = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
whdd->lpvbits = NULL;
|
|
|
|
|
|
|
|
return ret;
|
2000-07-08 14:50:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* DrawDibBegin [MSVFW32.@]
|
2000-07-08 14:50:26 +02:00
|
|
|
*/
|
|
|
|
BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd,
|
2002-11-20 20:47:08 +01:00
|
|
|
HDC hdc,
|
|
|
|
INT dxDst,
|
|
|
|
INT dyDst,
|
|
|
|
LPBITMAPINFOHEADER lpbi,
|
|
|
|
INT dxSrc,
|
|
|
|
INT dySrc,
|
|
|
|
UINT wFlags)
|
|
|
|
{
|
|
|
|
BOOL ret = TRUE;
|
|
|
|
WINE_HDD *whdd;
|
|
|
|
|
2006-10-12 21:34:41 +02:00
|
|
|
TRACE("(%p,%p,%d,%d,%p,%d,%d,0x%08x)\n",
|
2008-01-12 17:05:25 +01:00
|
|
|
hdd, hdc, dxDst, dyDst, lpbi, dxSrc, dySrc, wFlags);
|
2002-11-20 20:47:08 +01:00
|
|
|
|
2006-10-12 21:34:41 +02:00
|
|
|
TRACE("lpbi: %d,%d/%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
|
2002-11-20 20:47:08 +01:00
|
|
|
lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes,
|
|
|
|
lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage,
|
|
|
|
lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed,
|
|
|
|
lpbi->biClrImportant);
|
|
|
|
|
|
|
|
if (wFlags & ~(DDF_BUFFER))
|
|
|
|
FIXME("wFlags == 0x%08x not handled\n", wFlags & ~(DDF_BUFFER));
|
|
|
|
|
|
|
|
whdd = MSVIDEO_GetHddPtr(hdd);
|
|
|
|
if (!whdd) return FALSE;
|
|
|
|
|
|
|
|
if (whdd->begun) DrawDibEnd(hdd);
|
|
|
|
|
|
|
|
if (lpbi->biCompression)
|
|
|
|
{
|
|
|
|
DWORD size = 0;
|
|
|
|
|
|
|
|
whdd->hic = ICOpen(ICTYPE_VIDEO, lpbi->biCompression, ICMODE_DECOMPRESS);
|
|
|
|
if (!whdd->hic)
|
|
|
|
{
|
2006-10-12 21:34:41 +02:00
|
|
|
WARN("Could not open IC. biCompression == 0x%08x\n", lpbi->biCompression);
|
2002-11-20 20:47:08 +01:00
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
size = ICDecompressGetFormat(whdd->hic, lpbi, NULL);
|
|
|
|
if (size == ICERR_UNSUPPORTED)
|
|
|
|
{
|
|
|
|
WARN("Codec doesn't support GetFormat, giving up.\n");
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
whdd->lpbiOut = HeapAlloc(GetProcessHeap(), 0, size);
|
|
|
|
|
|
|
|
if (ICDecompressGetFormat(whdd->hic, lpbi, whdd->lpbiOut) != ICERR_OK)
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
/* FIXME: Use Ex functions if available? */
|
|
|
|
if (ICDecompressBegin(whdd->hic, lpbi, whdd->lpbiOut) != ICERR_OK)
|
|
|
|
ret = FALSE;
|
|
|
|
|
2006-10-12 21:34:41 +02:00
|
|
|
TRACE("biSizeImage == %d\n", whdd->lpbiOut->biSizeImage);
|
|
|
|
TRACE("biCompression == %d\n", whdd->lpbiOut->biCompression);
|
2002-11-20 20:47:08 +01:00
|
|
|
TRACE("biBitCount == %d\n", whdd->lpbiOut->biBitCount);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DWORD dwSize;
|
|
|
|
/* No compression */
|
|
|
|
TRACE("Not compressed!\n");
|
|
|
|
dwSize = lpbi->biSize + num_colours(lpbi)*sizeof(RGBQUAD);
|
|
|
|
whdd->lpbiOut = HeapAlloc(GetProcessHeap(), 0, dwSize);
|
|
|
|
memcpy(whdd->lpbiOut, lpbi, dwSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
/*whdd->lpvbuf = HeapAlloc(GetProcessHeap(), 0, whdd->lpbiOut->biSizeImage);*/
|
|
|
|
|
|
|
|
whdd->hMemDC = CreateCompatibleDC(hdc);
|
2006-10-12 21:34:41 +02:00
|
|
|
TRACE("Creating: %d, %p\n", whdd->lpbiOut->biSize, whdd->lpvbits);
|
2002-11-20 20:47:08 +01:00
|
|
|
whdd->hDib = CreateDIBSection(whdd->hMemDC, (BITMAPINFO *)whdd->lpbiOut, DIB_RGB_COLORS, &(whdd->lpvbits), 0, 0);
|
2005-06-01 13:02:36 +02:00
|
|
|
if (whdd->hDib)
|
2002-11-20 20:47:08 +01:00
|
|
|
{
|
2005-06-01 13:02:36 +02:00
|
|
|
TRACE("Created: %p,%p\n", whdd->hDib, whdd->lpvbits);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ret = FALSE;
|
2006-10-12 21:34:41 +02:00
|
|
|
TRACE("Error: %d\n", GetLastError());
|
2002-11-20 20:47:08 +01:00
|
|
|
}
|
|
|
|
whdd->hOldDib = SelectObject(whdd->hMemDC, whdd->hDib);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
whdd->hdc = hdc;
|
|
|
|
whdd->dxDst = dxDst;
|
|
|
|
whdd->dyDst = dyDst;
|
|
|
|
whdd->lpbi = HeapAlloc(GetProcessHeap(), 0, lpbi->biSize);
|
|
|
|
memcpy(whdd->lpbi, lpbi, lpbi->biSize);
|
|
|
|
whdd->dxSrc = dxSrc;
|
|
|
|
whdd->dySrc = dySrc;
|
|
|
|
whdd->begun = TRUE;
|
|
|
|
whdd->hpal = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (whdd->hic)
|
|
|
|
ICClose(whdd->hic);
|
2004-12-23 18:06:43 +01:00
|
|
|
HeapFree(GetProcessHeap(), 0, whdd->lpbiOut);
|
|
|
|
whdd->lpbiOut = NULL;
|
2002-11-20 20:47:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
2000-07-08 14:50:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* DrawDibDraw [MSVFW32.@]
|
2000-07-08 14:50:26 +02:00
|
|
|
*/
|
2001-01-03 22:30:03 +01:00
|
|
|
BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc,
|
2002-11-20 20:47:08 +01:00
|
|
|
INT xDst, INT yDst, INT dxDst, INT dyDst,
|
|
|
|
LPBITMAPINFOHEADER lpbi,
|
|
|
|
LPVOID lpBits,
|
|
|
|
INT xSrc, INT ySrc, INT dxSrc, INT dySrc,
|
|
|
|
UINT wFlags)
|
|
|
|
{
|
|
|
|
WINE_HDD *whdd;
|
|
|
|
BOOL ret = TRUE;
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2006-10-12 21:34:41 +02:00
|
|
|
TRACE("(%p,%p,%d,%d,%d,%d,%p,%p,%d,%d,%d,%d,0x%08x)\n",
|
2008-01-12 17:05:25 +01:00
|
|
|
hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits, xSrc, ySrc, dxSrc, dySrc, wFlags);
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
whdd = MSVIDEO_GetHddPtr(hdd);
|
2002-12-15 02:14:21 +01:00
|
|
|
if (!whdd) return FALSE;
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2005-06-01 13:02:36 +02:00
|
|
|
TRACE("whdd=%p\n", whdd);
|
|
|
|
|
2004-10-18 23:20:09 +02:00
|
|
|
if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | DDF_UPDATE | DDF_DONTDRAW | DDF_BACKGROUNDPAL))
|
2008-01-12 17:05:25 +01:00
|
|
|
FIXME("wFlags == 0x%08x not handled\n", wFlags);
|
2001-01-03 22:30:03 +01:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
if (!lpBits)
|
|
|
|
{
|
|
|
|
/* Undocumented? */
|
|
|
|
lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)(num_colours(lpbi)*sizeof(RGBQUAD));
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
#define CHANGED(x) (whdd->x != x)
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
if ((!whdd->begun) ||
|
|
|
|
(!(wFlags & DDF_SAME_HDC) && CHANGED(hdc)) ||
|
|
|
|
(!(wFlags & DDF_SAME_DRAW) && (CHANGED(lpbi) || CHANGED(dxSrc) || CHANGED(dySrc) || CHANGED(dxDst) || CHANGED(dyDst))))
|
|
|
|
{
|
|
|
|
TRACE("Something changed!\n");
|
|
|
|
ret = DrawDibBegin(hdd, hdc, dxDst, dyDst, lpbi, dxSrc, dySrc, 0);
|
|
|
|
}
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
#undef CHANGED
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
if ((dxDst == -1) && (dyDst == -1))
|
|
|
|
{
|
|
|
|
dxDst = dxSrc;
|
|
|
|
dyDst = dySrc;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(wFlags & DDF_UPDATE))
|
|
|
|
{
|
2005-06-01 13:02:36 +02:00
|
|
|
DWORD biSizeImage = lpbi->biSizeImage;
|
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
/* biSizeImage may be set to 0 for BI_RGB (uncompressed) bitmaps */
|
2005-06-01 13:02:36 +02:00
|
|
|
if ((lpbi->biCompression == BI_RGB) && (biSizeImage == 0))
|
|
|
|
biSizeImage = ((lpbi->biWidth * lpbi->biBitCount + 31) / 32) * 4 * lpbi->biHeight;
|
2002-11-20 20:47:08 +01:00
|
|
|
|
|
|
|
if (lpbi->biCompression)
|
|
|
|
{
|
|
|
|
DWORD flags = 0;
|
|
|
|
|
2006-10-12 21:34:41 +02:00
|
|
|
TRACE("Compression == 0x%08x\n", lpbi->biCompression);
|
2002-11-20 20:47:08 +01:00
|
|
|
|
|
|
|
if (wFlags & DDF_NOTKEYFRAME)
|
|
|
|
flags |= ICDECOMPRESS_NOTKEYFRAME;
|
|
|
|
|
|
|
|
ICDecompress(whdd->hic, flags, lpbi, lpBits, whdd->lpbiOut, whdd->lpvbits);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-06-01 13:02:36 +02:00
|
|
|
memcpy(whdd->lpvbits, lpBits, biSizeImage);
|
2002-11-20 20:47:08 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!(wFlags & DDF_DONTDRAW) && whdd->hpal)
|
2004-10-18 23:20:09 +02:00
|
|
|
{
|
|
|
|
if ((wFlags & DDF_BACKGROUNDPAL) && ! (wFlags & DDF_SAME_HDC))
|
|
|
|
SelectPalette(hdc, whdd->hpal, TRUE);
|
|
|
|
else
|
|
|
|
SelectPalette(hdc, whdd->hpal, FALSE);
|
|
|
|
}
|
2002-11-20 20:47:08 +01:00
|
|
|
|
|
|
|
if (!(StretchBlt(whdd->hdc, xDst, yDst, dxDst, dyDst, whdd->hMemDC, xSrc, ySrc, dxSrc, dySrc, SRCCOPY)))
|
|
|
|
ret = FALSE;
|
|
|
|
|
|
|
|
return ret;
|
2000-07-08 14:50:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* DrawDibStart [MSVFW32.@]
|
2000-07-08 14:50:26 +02:00
|
|
|
*/
|
|
|
|
BOOL VFWAPI DrawDibStart(HDRAWDIB hdd, DWORD rate) {
|
2006-10-12 21:34:41 +02:00
|
|
|
FIXME("(%p, %d), stub\n", hdd, rate);
|
2000-07-08 14:50:26 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* DrawDibStop [MSVFW32.@]
|
2000-07-08 14:50:26 +02:00
|
|
|
*/
|
|
|
|
BOOL VFWAPI DrawDibStop(HDRAWDIB hdd) {
|
2002-11-20 20:47:08 +01:00
|
|
|
FIXME("(%p), stub\n", hdd);
|
2000-07-08 14:50:26 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2005-01-17 16:33:43 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* DrawDibChangePalette [MSVFW32.@]
|
|
|
|
*/
|
|
|
|
BOOL VFWAPI DrawDibChangePalette(HDRAWDIB hdd, int iStart, int iLen, LPPALETTEENTRY lppe)
|
|
|
|
{
|
|
|
|
FIXME("(%p, 0x%08x, 0x%08x, %p), stub\n", hdd, iStart, iLen, lppe);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-07-08 14:50:26 +02:00
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* DrawDibSetPalette [MSVFW32.@]
|
2000-07-08 14:50:26 +02:00
|
|
|
*/
|
2002-11-20 20:47:08 +01:00
|
|
|
BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal)
|
|
|
|
{
|
|
|
|
WINE_HDD *whdd;
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
TRACE("(%p, %p)\n", hdd, hpal);
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
whdd = MSVIDEO_GetHddPtr(hdd);
|
|
|
|
if (!whdd) return FALSE;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
whdd->hpal = hpal;
|
|
|
|
|
|
|
|
if (whdd->begun)
|
|
|
|
{
|
|
|
|
SelectPalette(whdd->hdc, hpal, 0);
|
|
|
|
RealizePalette(whdd->hdc);
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2000-07-08 14:50:26 +02:00
|
|
|
}
|
|
|
|
|
2005-01-17 16:33:43 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* DrawDibGetBuffer [MSVFW32.@]
|
|
|
|
*/
|
|
|
|
LPVOID VFWAPI DrawDibGetBuffer(HDRAWDIB hdd, LPBITMAPINFOHEADER lpbi, DWORD dwSize, DWORD dwFlags)
|
|
|
|
{
|
2006-10-12 21:34:41 +02:00
|
|
|
FIXME("(%p, %p, 0x%08x, 0x%08x), stub\n", hdd, lpbi, dwSize, dwFlags);
|
2005-01-17 16:33:43 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2000-07-08 14:50:26 +02:00
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* DrawDibGetPalette [MSVFW32.@]
|
2000-07-08 14:50:26 +02:00
|
|
|
*/
|
2002-11-20 20:47:08 +01:00
|
|
|
HPALETTE VFWAPI DrawDibGetPalette(HDRAWDIB hdd)
|
|
|
|
{
|
|
|
|
WINE_HDD *whdd;
|
|
|
|
|
|
|
|
TRACE("(%p)\n", hdd);
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
whdd = MSVIDEO_GetHddPtr(hdd);
|
|
|
|
if (!whdd) return FALSE;
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
return whdd->hpal;
|
2000-07-08 14:50:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* DrawDibRealize [MSVFW32.@]
|
2000-07-08 14:50:26 +02:00
|
|
|
*/
|
2002-11-20 20:47:08 +01:00
|
|
|
UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground)
|
|
|
|
{
|
|
|
|
WINE_HDD *whdd;
|
|
|
|
UINT ret = 0;
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
FIXME("(%p, %p, %d), stub\n", hdd, hdc, fBackground);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
whdd = MSVIDEO_GetHddPtr(hdd);
|
|
|
|
if (!whdd) return FALSE;
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
if (!whdd || !(whdd->begun))
|
|
|
|
{
|
|
|
|
ret = 0;
|
|
|
|
goto out;
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-11-20 20:47:08 +01:00
|
|
|
if (!whdd->hpal)
|
|
|
|
whdd->hpal = CreateHalftonePalette(hdc);
|
2000-07-08 14:50:26 +02:00
|
|
|
|
2008-04-22 23:04:49 +02:00
|
|
|
SelectPalette(hdc, whdd->hpal, fBackground);
|
2002-11-20 20:47:08 +01:00
|
|
|
ret = RealizePalette(hdc);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-07-08 14:50:26 +02:00
|
|
|
out:
|
2002-11-20 20:47:08 +01:00
|
|
|
TRACE("=> %u\n", ret);
|
|
|
|
return ret;
|
2000-07-08 14:50:26 +02:00
|
|
|
}
|
2004-06-04 01:19:51 +02:00
|
|
|
|
2005-01-17 16:33:43 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* DrawDibTime [MSVFW32.@]
|
|
|
|
*/
|
|
|
|
BOOL VFWAPI DrawDibTime(HDRAWDIB hdd, LPDRAWDIBTIME lpddtime)
|
|
|
|
{
|
|
|
|
FIXME("(%p, %p) stub\n", hdd, lpddtime);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DrawDibProfileDisplay [MSVFW32.@]
|
|
|
|
*/
|
2004-06-04 01:19:51 +02:00
|
|
|
DWORD VFWAPI DrawDibProfileDisplay(LPBITMAPINFOHEADER lpbi)
|
|
|
|
{
|
|
|
|
FIXME("(%p) stub\n", lpbi);
|
|
|
|
|
|
|
|
return PD_CAN_DRAW_DIB;
|
|
|
|
}
|