Changeset 9140 for trunk/src/msvfw32/drawdib.c
- Timestamp:
- Aug 27, 2002, 10:31:48 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/msvfw32/drawdib.c
r7511 r9140 1 /* 1 /* 2 2 * Copyright 2000 Bradley Baetz 3 3 * 4 * Fixme: Some flags are ignored 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * 18 * FIXME: Some flags are ignored 5 19 * 6 20 * Handle palettes … … 13 27 #include "winuser.h" 14 28 #include "wine/winbase16.h" 15 #include " debugtools.h"29 #include "wine/debug.h" 16 30 #include "vfw.h" 17 31 #include "vfw16.h" 18 32 #include "windef.h" 19 33 20 DEFAULT_DEBUG_CHANNEL(msvideo);34 WINE_DEFAULT_DEBUG_CHANNEL(msvideo); 21 35 22 36 typedef struct { … … 37 51 } WINE_HDD; 38 52 39 #ifdef __WIN32OS2__ 40 #include <heapstring.h> 41 42 #define GlobalAlloc16 GlobalAlloc 43 #define GlobalLock16 GlobalLock 44 #define GlobalUnlock16 GlobalUnlock 45 #define GlobalFree16 GlobalFree 46 47 #endif 53 int num_colours(LPBITMAPINFOHEADER lpbi) 54 { 55 if(lpbi->biClrUsed) 56 return lpbi->biClrUsed; 57 if(lpbi->biBitCount<=8) 58 return 1<<lpbi->biBitCount; 59 return 0; 60 } 48 61 49 62 /*********************************************************************** … … 60 73 61 74 /*********************************************************************** 62 * DrawDibOpen [MSVIDEO.102]63 */64 HDRAWDIB16 VFWAPI DrawDibOpen16(void) {65 return (HDRAWDIB16)DrawDibOpen();66 }67 68 /***********************************************************************69 75 * DrawDibClose [MSVFW32.@] 70 76 */ … … 83 89 GlobalFree16(hdd); 84 90 return TRUE; 85 }86 87 /***********************************************************************88 * DrawDibClose [MSVIDEO.103]89 */90 BOOL16 VFWAPI DrawDibClose16(HDRAWDIB16 hdd) {91 return DrawDibClose(hdd);92 91 } 93 92 … … 98 97 BOOL ret = TRUE; 99 98 WINE_HDD *whdd = GlobalLock16(hdd); 100 99 101 100 TRACE("(0x%08lx)\n",(DWORD)hdd); 102 101 … … 124 123 if (whdd->hDib) 125 124 DeleteObject(whdd->hDib); 126 125 127 126 if (whdd->hic) { 128 127 ICDecompressEnd(whdd->hic); … … 134 133 GlobalUnlock16(hdd); 135 134 return ret; 136 }137 138 /***********************************************************************139 * DrawDibEnd [MSVIDEO.105]140 */141 BOOL16 VFWAPI DrawDibEnd16(HDRAWDIB16 hdd) {142 return DrawDibEnd(hdd);143 135 } 144 136 … … 161 153 ); 162 154 TRACE("lpbi: %ld,%ld/%ld,%d,%d,%ld,%ld,%ld,%ld,%ld,%ld\n", 163 lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes, 164 lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage, 165 lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed, 155 lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes, 156 lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage, 157 lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed, 166 158 lpbi->biClrImportant); 167 159 … … 212 204 /* No compression */ 213 205 TRACE("Not compressed!\n"); 214 dwSize = lpbi->biSize + lpbi->biClrUsed*sizeof(RGBQUAD);206 dwSize = lpbi->biSize + num_colours(lpbi)*sizeof(RGBQUAD); 215 207 whdd->lpbiOut = HeapAlloc(GetProcessHeap(),0,dwSize); 216 208 memcpy(whdd->lpbiOut,lpbi,dwSize); … … 219 211 if (ret) { 220 212 /*whdd->lpvbuf = HeapAlloc(GetProcessHeap(),0,whdd->lpbiOut->biSizeImage);*/ 221 213 222 214 whdd->hMemDC = CreateCompatibleDC(hdc); 223 215 TRACE("Creating: %ld,%p\n",whdd->lpbiOut->biSize,whdd->lpvbits); … … 254 246 } 255 247 256 /************************************************************************257 * DrawDibBegin [MSVIDEO.104]258 */259 BOOL16 VFWAPI DrawDibBegin16(HDRAWDIB16 hdd,260 HDC16 hdc,261 INT16 dxDst,262 INT16 dyDst,263 LPBITMAPINFOHEADER lpbi,264 INT16 dxSrc,265 INT16 dySrc,266 UINT16 wFlags) {267 return DrawDibBegin(hdd,hdc,dxDst,dyDst,lpbi,dxSrc,dySrc,wFlags);268 }269 270 248 /********************************************************************** 271 249 * DrawDibDraw [MSVFW32.@] … … 285 263 ); 286 264 287 if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | 265 if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | 288 266 DDF_UPDATE | DDF_DONTDRAW)) 289 267 FIXME("wFlags == 0x%08lx not handled\n",(DWORD)wFlags); … … 291 269 if (!lpBits) { 292 270 /* Undocumented? */ 293 lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)( lpbi->biClrUsed*sizeof(RGBQUAD));271 lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)(num_colours(lpbi)*sizeof(RGBQUAD)); 294 272 } 295 273 … … 318 296 if (lpbi->biCompression) { 319 297 DWORD flags = 0; 320 298 321 299 TRACE("Compression == 0x%08lx\n",lpbi->biCompression); 322 300 323 301 if (wFlags & DDF_NOTKEYFRAME) 324 302 flags |= ICDECOMPRESS_NOTKEYFRAME; 325 303 326 304 ICDecompress(whdd->hic,flags,lpbi,lpBits,whdd->lpbiOut,whdd->lpvbits); 327 305 } else { 328 306 memcpy(whdd->lpvbits,lpBits,lpbi->biSizeImage); 329 } 307 } 330 308 } 331 309 if (!(wFlags & DDF_DONTDRAW) && whdd->hpal) … … 337 315 GlobalUnlock16(hdd); 338 316 return ret; 339 }340 341 /**********************************************************************342 * DrawDibDraw [MSVIDEO.106]343 */344 BOOL16 VFWAPI DrawDibDraw16(HDRAWDIB16 hdd,345 HDC16 hdc,346 INT16 xDst,347 INT16 yDst,348 INT16 dxDst,349 INT16 dyDst,350 LPBITMAPINFOHEADER lpbi,351 LPVOID lpBits,352 INT16 xSrc,353 INT16 ySrc,354 INT16 dxSrc,355 INT16 dySrc,356 UINT16 wFlags) {357 return DrawDibDraw(hdd,hdc,xDst,yDst,dxDst,dyDst,lpbi,lpBits,xSrc,ySrc,dxSrc,dySrc,wFlags);358 317 } 359 318 … … 367 326 368 327 /************************************************************************* 369 * DrawDibStart [MSVIDEO.118]370 */371 BOOL16 VFWAPI DrawDibStart16(HDRAWDIB16 hdd, DWORD rate) {372 return DrawDibStart(hdd,rate);373 }374 375 /*************************************************************************376 328 * DrawDibStop [MSVFW32.@] 377 329 */ … … 381 333 } 382 334 383 /*************************************************************************384 * DrawDibStop [MSVIDEO.119]385 */386 BOOL16 DrawDibStop16(HDRAWDIB16 hdd) {387 return DrawDibStop(hdd);388 }389 390 335 /*********************************************************************** 391 336 * DrawDibSetPalette [MSVFW32.@] … … 398 343 whdd = GlobalLock16(hdd); 399 344 whdd->hpal = hpal; 400 345 401 346 if (whdd->begun) { 402 347 SelectPalette(whdd->hdc,hpal,0); … … 408 353 409 354 /*********************************************************************** 410 * DrawDibSetPalette [MSVIDEO.110]411 */412 BOOL16 VFWAPI DrawDibSetPalette16(HDRAWDIB16 hdd, HPALETTE16 hpal) {413 return DrawDibSetPalette(hdd,hpal);414 }415 416 /***********************************************************************417 355 * DrawDibGetPalette [MSVFW32.@] 418 356 */ … … 430 368 431 369 /*********************************************************************** 432 * DrawDibGetPalette [MSVIDEO.108]433 */434 HPALETTE16 VFWAPI DrawDibGetPalette16(HDRAWDIB16 hdd) {435 return (HPALETTE16)DrawDibGetPalette(hdd);436 }437 438 /***********************************************************************439 370 * DrawDibRealize [MSVFW32.@] 440 371 */ … … 445 376 446 377 FIXME("(%d,0x%08lx,%d), stub\n",hdd,(DWORD)hdc,fBackground); 447 378 448 379 whdd = GlobalLock16(hdd); 449 380 … … 452 383 goto out; 453 384 } 454 385 455 386 if (!whdd->hpal) 456 387 whdd->hpal = CreateHalftonePalette(hdc); … … 458 389 oldPal = SelectPalette(hdc,whdd->hpal,fBackground); 459 390 ret = RealizePalette(hdc); 460 391 461 392 out: 462 393 GlobalUnlock16(hdd); … … 465 396 return ret; 466 397 } 467 468 /***********************************************************************469 * DrawDibRealize [MSVIDEO.112]470 */471 UINT16 VFWAPI DrawDibRealize16(HDRAWDIB16 hdd, HDC16 hdc, BOOL16 fBackground) {472 return (UINT16)DrawDibRealize(hdd,hdc,fBackground);473 }
Note:
See TracChangeset
for help on using the changeset viewer.