ReactOS 0.4.16-dev-1007-g2e85425
bitmap.c
Go to the documentation of this file.
1/*
2 * Copyright 2012 Vincent Povirk for CodeWeavers
3 * Copyright 2016 Dmitry Timoshkov
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#include <stdarg.h>
21
22#define COBJMACROS
23
24#include "windef.h"
25#include "winbase.h"
26#include "objbase.h"
27
28#include "wincodecs_private.h"
29
30#include "wine/asm.h"
31#include "wine/debug.h"
32
33#include "initguid.h"
34DEFINE_GUID(IID_CMetaBitmapRenderTarget, 0x0ccd7824,0xdc16,0x4d09,0xbc,0xa8,0x6b,0x09,0xc4,0xef,0x55,0x35);
35
37
38/* WARNING: .NET Media Integration Layer (MIL) directly dereferences
39 * BitmapImpl members and depends on its exact layout.
40 */
41typedef struct BitmapImpl {
44 IMILBitmap IMILBitmap_iface;
46 IMILUnknown2 IMILUnknown2_iface;
49 LONG lock; /* 0 if not locked, -1 if locked for writing, count if locked for reading */
51 void *view; /* used if data is a section created by an application */
52 UINT offset; /* offset into view */
57 double dpix, dpiy;
60
61typedef struct BitmapLockImpl {
68
70{
71 return CONTAINING_RECORD(iface, BitmapImpl, IWICBitmap_iface);
72}
73
74static inline BitmapImpl *impl_from_IMILBitmap(IMILBitmap *iface)
75{
76 return CONTAINING_RECORD(iface, BitmapImpl, IMILBitmap_iface);
77}
78
80{
81 return CONTAINING_RECORD(iface, BitmapImpl, IMILUnknown1_iface);
82}
83
85{
86 return CONTAINING_RECORD(iface, BitmapLockImpl, IWICBitmapLock_iface);
87}
88
90{
91 if (write)
92 {
93 return 0 == InterlockedCompareExchange(&This->lock, -1, 0);
94 }
95 else
96 {
97 while (1)
98 {
99 LONG prev_val = This->lock;
100 if (prev_val == -1)
101 return FALSE;
102 if (prev_val == InterlockedCompareExchange(&This->lock, prev_val+1, prev_val))
103 return TRUE;
104 }
105 }
106}
107
109{
110 while (1)
111 {
112 LONG prev_val = This->lock, new_val;
113 if (prev_val == -1)
114 new_val = 0;
115 else
116 new_val = prev_val - 1;
117 if (prev_val == InterlockedCompareExchange(&This->lock, new_val, prev_val))
118 break;
119 }
120}
121
122
124 void **ppv)
125{
127 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
128
129 if (!ppv) return E_INVALIDARG;
130
131 if (IsEqualIID(&IID_IUnknown, iid) ||
132 IsEqualIID(&IID_IWICBitmapLock, iid))
133 {
134 *ppv = &This->IWICBitmapLock_iface;
135 }
136 else
137 {
138 FIXME("unknown interface %s\n", debugstr_guid(iid));
139 *ppv = NULL;
140 return E_NOINTERFACE;
141 }
142
143 IUnknown_AddRef((IUnknown*)*ppv);
144 return S_OK;
145}
146
148{
151
152 TRACE("(%p) refcount=%lu\n", iface, ref);
153
154 return ref;
155}
156
158{
161
162 TRACE("(%p) refcount=%lu\n", iface, ref);
163
164 if (ref == 0)
165 {
167 IWICBitmap_Release(&This->parent->IWICBitmap_iface);
168 free(This);
169 }
170
171 return ref;
172}
173
175 UINT *puiWidth, UINT *puiHeight)
176{
178 TRACE("(%p,%p,%p)\n", iface, puiWidth, puiHeight);
179
180 if (!puiWidth || !puiHeight)
181 return E_INVALIDARG;
182
183 *puiWidth = This->width;
184 *puiHeight = This->height;
185
186 return S_OK;
187}
188
190 UINT *pcbStride)
191{
193 TRACE("(%p,%p)\n", iface, pcbStride);
194
195 if (!pcbStride)
196 return E_INVALIDARG;
197
198 *pcbStride = This->parent->stride;
199
200 return S_OK;
201}
202
204 UINT *pcbBufferSize, BYTE **ppbData)
205{
207 TRACE("(%p,%p,%p)\n", iface, pcbBufferSize, ppbData);
208
209 if (!pcbBufferSize || !ppbData)
210 return E_INVALIDARG;
211
212 *pcbBufferSize = This->parent->stride * (This->height - 1) +
213 ((This->parent->bpp * This->width) + 7)/8;
214 *ppbData = This->data;
215
216 return S_OK;
217}
218
220 WICPixelFormatGUID *pPixelFormat)
221{
223 TRACE("(%p,%p)\n", iface, pPixelFormat);
224
225 return IWICBitmap_GetPixelFormat(&This->parent->IWICBitmap_iface, pPixelFormat);
226}
227
228static const IWICBitmapLockVtbl BitmapLockImpl_Vtbl = {
236};
237
239 void **ppv)
240{
242 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
243
244 if (!ppv) return E_INVALIDARG;
245
246 if (IsEqualIID(&IID_IUnknown, iid) ||
247 IsEqualIID(&IID_IWICBitmapSource, iid) ||
248 IsEqualIID(&IID_IWICBitmap, iid))
249 {
250 *ppv = &This->IWICBitmap_iface;
251 }
252 else if (IsEqualIID(&IID_IMILBitmap, iid) ||
254 {
255 *ppv = &This->IMILBitmap_iface;
256 }
257 else
258 {
259 if (IsEqualIID(&IID_CMetaBitmapRenderTarget, iid))
260 WARN("Ignoring interface %s\n", debugstr_guid(iid));
261 else
262 FIXME("unknown interface %s\n", debugstr_guid(iid));
263 *ppv = NULL;
264 return E_NOINTERFACE;
265 }
266
267 IUnknown_AddRef((IUnknown*)*ppv);
268 return S_OK;
269}
270
272{
275
276 TRACE("(%p) refcount=%lu\n", iface, ref);
277
278 return ref;
279}
280
282{
285
286 TRACE("(%p) refcount=%lu\n", iface, ref);
287
288 if (ref == 0)
289 {
290 if (This->palette) IWICPalette_Release(This->palette);
291 This->cs.DebugInfo->Spare[0] = 0;
293 if (This->view)
294 UnmapViewOfFile(This->view);
295 else
296 free(This->data);
297 free(This);
298 }
299
300 return ref;
301}
302
304 UINT *puiWidth, UINT *puiHeight)
305{
307 TRACE("(%p,%p,%p)\n", iface, puiWidth, puiHeight);
308
309 if (!puiWidth || !puiHeight)
310 return E_INVALIDARG;
311
312 *puiWidth = This->width;
313 *puiHeight = This->height;
314
315 return S_OK;
316}
317
319 WICPixelFormatGUID *pPixelFormat)
320{
322 TRACE("(%p,%p)\n", iface, pPixelFormat);
323
324 if (!pPixelFormat)
325 return E_INVALIDARG;
326
327 memcpy(pPixelFormat, &This->pixelformat, sizeof(GUID));
328
329 return S_OK;
330}
331
333 double *pDpiX, double *pDpiY)
334{
336 TRACE("(%p,%p,%p)\n", iface, pDpiX, pDpiY);
337
338 if (!pDpiX || !pDpiY)
339 return E_INVALIDARG;
340
342 *pDpiX = This->dpix;
343 *pDpiY = This->dpiy;
345
346 return S_OK;
347}
348
350 IWICPalette *pIPalette)
351{
353 TRACE("(%p,%p)\n", iface, pIPalette);
354
355 if (!This->palette_set)
357
358 return IWICPalette_InitializeFromPalette(pIPalette, This->palette);
359}
360
362 const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
363{
365 TRACE("(%p,%s,%u,%u,%p)\n", iface, debug_wic_rect(prc), cbStride, cbBufferSize, pbBuffer);
366
367 return copy_pixels(This->bpp, This->data, This->width, This->height,
368 This->stride, prc, cbStride, cbBufferSize, pbBuffer);
369}
370
371static HRESULT WINAPI BitmapImpl_Lock(IWICBitmap *iface, const WICRect *prcLock,
372 DWORD flags, IWICBitmapLock **ppILock)
373{
376 WICRect rc;
377
378 TRACE("(%p,%s,%lx,%p)\n", iface, debug_wic_rect(prcLock), flags, ppILock);
379
380 if (!(flags & (WICBitmapLockRead|WICBitmapLockWrite)) || !ppILock)
381 return E_INVALIDARG;
382
383 if (!prcLock)
384 {
385 rc.X = rc.Y = 0;
386 rc.Width = This->width;
387 rc.Height = This->height;
388 prcLock = &rc;
389 }
390 else if (prcLock->X >= This->width || prcLock->Y >= This->height ||
391 prcLock->X + prcLock->Width > This->width ||
392 prcLock->Y + prcLock->Height > This->height ||
393 prcLock->Width <= 0 || prcLock->Height <= 0)
394 return E_INVALIDARG;
395 else if (((prcLock->X * This->bpp) % 8) != 0)
396 {
397 FIXME("Cannot lock at an X coordinate not at a full byte\n");
398 return E_FAIL;
399 }
400
401 result = malloc(sizeof(BitmapLockImpl));
402 if (!result)
403 return E_OUTOFMEMORY;
404
406 {
407 free(result);
409 }
410
411 result->IWICBitmapLock_iface.lpVtbl = &BitmapLockImpl_Vtbl;
412 result->ref = 1;
413 result->parent = This;
414 result->width = prcLock->Width;
415 result->height = prcLock->Height;
416 result->data = This->data + This->stride * prcLock->Y +
417 (This->bpp * prcLock->X)/8;
418
419 IWICBitmap_AddRef(&This->IWICBitmap_iface);
420 *ppILock = &result->IWICBitmapLock_iface;
421
422 return S_OK;
423}
424
426{
428 HRESULT hr;
429
430 TRACE("(%p,%p)\n", iface, pIPalette);
431
432 if (!This->palette)
433 {
434 IWICPalette *new_palette;
435 hr = PaletteImpl_Create(&new_palette);
436
437 if (FAILED(hr)) return hr;
438
439 if (InterlockedCompareExchangePointer((void**)&This->palette, new_palette, NULL))
440 {
441 /* someone beat us to it */
442 IWICPalette_Release(new_palette);
443 }
444 }
445
446 hr = IWICPalette_InitializeFromPalette(This->palette, pIPalette);
447
448 if (SUCCEEDED(hr))
449 This->palette_set = 1;
450
451 return S_OK;
452}
453
455 double dpiX, double dpiY)
456{
458 TRACE("(%p,%f,%f)\n", iface, dpiX, dpiY);
459
461 This->dpix = dpiX;
462 This->dpiy = dpiY;
464
465 return S_OK;
466}
467
468static const IWICBitmapVtbl BitmapImpl_Vtbl = {
480};
481
483 void **ppv)
484{
486 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
487 return IWICBitmap_QueryInterface(&This->IWICBitmap_iface, iid, ppv);
488}
489
490static ULONG WINAPI IMILBitmapImpl_AddRef(IMILBitmap *iface)
491{
493 return IWICBitmap_AddRef(&This->IWICBitmap_iface);
494}
495
496static ULONG WINAPI IMILBitmapImpl_Release(IMILBitmap *iface)
497{
499 return IWICBitmap_Release(&This->IWICBitmap_iface);
500}
501
502static HRESULT WINAPI IMILBitmapImpl_GetSize(IMILBitmap *iface,
504{
506 TRACE("(%p,%p,%p)\n", iface, width, height);
507 return IWICBitmap_GetSize(&This->IWICBitmap_iface, width, height);
508}
509
510static const struct
511{
514} pixel_fmt_map[] =
515{
516 { &GUID_WICPixelFormatDontCare, 0 },
517 { &GUID_WICPixelFormat1bppIndexed, 1 },
518 { &GUID_WICPixelFormat2bppIndexed, 2 },
519 { &GUID_WICPixelFormat4bppIndexed, 3 },
520 { &GUID_WICPixelFormat8bppIndexed, 4 },
521 { &GUID_WICPixelFormatBlackWhite, 5 },
522 { &GUID_WICPixelFormat2bppGray, 6 },
523 { &GUID_WICPixelFormat4bppGray, 7 },
524 { &GUID_WICPixelFormat8bppGray, 8 },
525 { &GUID_WICPixelFormat16bppBGR555, 9 },
526 { &GUID_WICPixelFormat16bppBGR565, 0x0a },
527 { &GUID_WICPixelFormat16bppGray, 0x0b },
528 { &GUID_WICPixelFormat24bppBGR, 0x0c },
529 { &GUID_WICPixelFormat24bppRGB, 0x0d },
530 { &GUID_WICPixelFormat32bppBGR, 0x0e },
531 { &GUID_WICPixelFormat32bppBGRA, 0x0f },
532 { &GUID_WICPixelFormat32bppPBGRA, 0x10 },
533 { &GUID_WICPixelFormat48bppRGB, 0x15 },
534 { &GUID_WICPixelFormat64bppRGBA, 0x16 },
535 { &GUID_WICPixelFormat64bppPRGBA, 0x17 },
536 { &GUID_WICPixelFormat32bppCMYK, 0x1c }
538
540 int *format)
541{
543 int i;
544
545 TRACE("(%p,%p)\n", iface, format);
546
547 if (!format) return E_INVALIDARG;
548
549 *format = 0;
550
551 for (i = 0; i < ARRAY_SIZE(pixel_fmt_map); i++)
552 {
553 if (IsEqualGUID(pixel_fmt_map[i].WIC_format, &This->pixelformat))
554 {
555 *format = pixel_fmt_map[i].enum_format;
556 break;
557 }
558 }
559
560 TRACE("=> %u\n", *format);
561 return S_OK;
562}
563
565 double *dpix, double *dpiy)
566{
568 TRACE("(%p,%p,%p)\n", iface, dpix, dpiy);
569 return IWICBitmap_GetResolution(&This->IWICBitmap_iface, dpix, dpiy);
570}
571
574{
576 TRACE("(%p,%p)\n", iface, palette);
577 return IWICBitmap_CopyPalette(&This->IWICBitmap_iface, palette);
578}
579
580static HRESULT WINAPI IMILBitmapImpl_CopyPixels(IMILBitmap *iface,
581 const WICRect *rc, UINT stride, UINT size, BYTE *buffer)
582{
584 TRACE("(%p,%p,%u,%u,%p)\n", iface, rc, stride, size, buffer);
585 return IWICBitmap_CopyPixels(&This->IWICBitmap_iface, rc, stride, size, buffer);
586}
587
588static HRESULT WINAPI IMILBitmapImpl_unknown1(IMILBitmap *iface, void **ppv)
589{
591
592 TRACE("(%p,%p)\n", iface, ppv);
593
594 if (!ppv) return E_INVALIDARG;
595
596 /* reference count is not incremented here */
597 *ppv = &This->IMILUnknown1_iface;
598
599 return S_OK;
600}
601
602static HRESULT WINAPI IMILBitmapImpl_Lock(IMILBitmap *iface, const WICRect *rc, DWORD flags, IWICBitmapLock **lock)
603{
605 TRACE("(%p,%p,%08lx,%p)\n", iface, rc, flags, lock);
606 return IWICBitmap_Lock(&This->IWICBitmap_iface, rc, flags, lock);
607}
608
610{
611 TRACE("(%p,%p)\n", iface, lock);
612 IWICBitmapLock_Release(lock);
613 return S_OK;
614}
615
617{
619 TRACE("(%p,%p)\n", iface, palette);
620 return IWICBitmap_SetPalette(&This->IWICBitmap_iface, palette);
621}
622
623static HRESULT WINAPI IMILBitmapImpl_SetResolution(IMILBitmap *iface, double dpix, double dpiy)
624{
626 TRACE("(%p,%f,%f)\n", iface, dpix, dpiy);
627 return IWICBitmap_SetResolution(&This->IWICBitmap_iface, dpix, dpiy);
628}
629
630static HRESULT WINAPI IMILBitmapImpl_AddDirtyRect(IMILBitmap *iface, const WICRect *rc)
631{
632 FIXME("(%p,%p): stub\n", iface, rc);
633 return E_NOTIMPL;
634}
635
636static const IMILBitmapVtbl IMILBitmapImpl_Vtbl =
637{
652};
653
655 void **ppv)
656{
657 /* It's not clear what interface should be returned here */
658 FIXME("(%p,%s,%p): stub\n", iface, debugstr_guid(iid), ppv);
659 *ppv = NULL;
660 return E_NOINTERFACE;
661}
662
664{
666 return IWICBitmap_AddRef(&This->IWICBitmap_iface);
667}
668
670{
672 return IWICBitmap_Release(&This->IWICBitmap_iface);
673}
674
676{
677 FIXME("(%p,%p): stub\n", iface, arg);
678}
679
681{
682 FIXME("(%p,%p,%p): stub\n", iface, arg1, arg2);
683 return E_NOTIMPL;
684}
685
687{
688 FIXME("(%p,%p): stub\n", iface, arg);
689 return E_NOTIMPL;
690}
691
693{
694 FIXME("(%p,%p): stub\n", iface, arg);
695 return E_NOTIMPL;
696}
697
699{
700 FIXME("(%p,%p): stub\n", iface, arg);
701 return E_NOTIMPL;
702}
703
705{
706 FIXME("(%p,%s): stub\n", iface, wine_dbgstr_longlong(arg));
707 return E_NOTIMPL;
708}
709
711{
712 FIXME("(%p,%p): stub\n", iface, arg);
713 return E_NOTIMPL;
714}
715
717{
718 FIXME("(%p): stub\n", iface);
719 return E_NOTIMPL;
720}
721
725
726static const IMILUnknown1Vtbl IMILUnknown1Impl_Vtbl =
727{
739};
740
741static HRESULT WINAPI IMILUnknown2Impl_QueryInterface(IMILUnknown2 *iface, REFIID iid,
742 void **ppv)
743{
744 FIXME("(%p,%s,%p): stub\n", iface, debugstr_guid(iid), ppv);
745 *ppv = NULL;
746 return E_NOINTERFACE;
747}
748
749static ULONG WINAPI IMILUnknown2Impl_AddRef(IMILUnknown2 *iface)
750{
751 FIXME("(%p): stub\n", iface);
752 return 0;
753}
754
755static ULONG WINAPI IMILUnknown2Impl_Release(IMILUnknown2 *iface)
756{
757 FIXME("(%p): stub\n", iface);
758 return 0;
759}
760
761static HRESULT WINAPI IMILUnknown2Impl_unknown1(IMILUnknown2 *iface, void *arg1, void **arg2)
762{
763 FIXME("(%p,%p,%p): stub\n", iface, arg1, arg2);
764 if (arg2) *arg2 = NULL;
765 return E_NOTIMPL;
766}
767
768static HRESULT WINAPI IMILUnknown2Impl_unknown2(IMILUnknown2 *iface, void *arg1, void *arg2)
769{
770 FIXME("(%p,%p,%p): stub\n", iface, arg1, arg2);
771 return E_NOTIMPL;
772}
773
774static HRESULT WINAPI IMILUnknown2Impl_unknown3(IMILUnknown2 *iface, void *arg1)
775{
776 FIXME("(%p,%p): stub\n", iface, arg1);
777 return E_NOTIMPL;
778}
779
780static const IMILUnknown2Vtbl IMILUnknown2Impl_Vtbl =
781{
788};
789
792 IWICBitmap **ppIBitmap)
793{
794 HRESULT hr;
796 BYTE *data;
797 UINT bpp;
798
799 hr = get_pixelformat_bpp(pixelFormat, &bpp);
800 if (FAILED(hr)) return hr;
801
802 if (!stride) stride = (((bpp*uiWidth)+31)/32)*4;
803 if (!datasize) datasize = stride * uiHeight;
804
805 if (datasize < stride * uiHeight) return WINCODEC_ERR_INSUFFICIENTBUFFER;
806 if (stride < ((bpp*uiWidth)+7)/8) return E_INVALIDARG;
807
808 This = malloc(sizeof(BitmapImpl));
809 if (!This) return E_OUTOFMEMORY;
810
811 if (view) data = (BYTE *)view + offset;
812 else if (!(data = calloc(1, datasize)))
813 {
814 free(This);
815 return E_OUTOFMEMORY;
816 }
817
818 This->IWICBitmap_iface.lpVtbl = &BitmapImpl_Vtbl;
819 This->IMILBitmap_iface.lpVtbl = &IMILBitmapImpl_Vtbl;
820 This->IMILUnknown1_iface.lpVtbl = &IMILUnknown1Impl_Vtbl;
821 This->IMILUnknown2_iface.lpVtbl = &IMILUnknown2Impl_Vtbl;
822 This->ref = 1;
823 This->palette = NULL;
824 This->palette_set = 0;
825 This->lock = 0;
826 This->data = data;
827 This->view = view;
828 This->offset = offset;
829 This->width = uiWidth;
830 This->height = uiHeight;
831 This->stride = stride;
832 This->bpp = bpp;
833 memcpy(&This->pixelformat, pixelFormat, sizeof(GUID));
834 This->dpix = This->dpiy = 0.0;
835#ifdef __REACTOS__
837#else
839#endif
840 This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BitmapImpl.lock");
841
842 *ppIBitmap = &This->IWICBitmap_iface;
843
844 return S_OK;
845}
#define write
Definition: acwin.h:97
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
static SIZE_T datasize
Definition: asm.c:30
void copy_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *size, const struct pixel_format_desc *format) DECLSPEC_HIDDEN
Definition: surface.c:1700
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
DWORD bpp
Definition: surface.c:185
#define UnmapViewOfFile
Definition: compat.h:746
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
static HRESULT WINAPI BitmapLockImpl_QueryInterface(IWICBitmapLock *iface, REFIID iid, void **ppv)
Definition: bitmap.c:123
static void BitmapImpl_ReleaseLock(BitmapImpl *This)
Definition: bitmap.c:108
static HRESULT WINAPI IMILUnknown2Impl_QueryInterface(IMILUnknown2 *iface, REFIID iid, void **ppv)
Definition: bitmap.c:741
static const struct @623 pixel_fmt_map[]
static HRESULT WINAPI IMILBitmapImpl_QueryInterface(IMILBitmap *iface, REFIID iid, void **ppv)
Definition: bitmap.c:482
static HRESULT WINAPI BitmapLockImpl_GetDataPointer(IWICBitmapLock *iface, UINT *pcbBufferSize, BYTE **ppbData)
Definition: bitmap.c:203
static ULONG WINAPI IMILUnknown1Impl_AddRef(IMILUnknown1 *iface)
Definition: bitmap.c:663
HRESULT WINAPI IMILUnknown1Impl_unknown8(IMILUnknown1 *iface)
Definition: bitmap.c:716
int enum_format
Definition: bitmap.c:513
static HRESULT WINAPI IMILBitmapImpl_unknown1(IMILBitmap *iface, void **ppv)
Definition: bitmap.c:588
static BitmapImpl * impl_from_IMILBitmap(IMILBitmap *iface)
Definition: bitmap.c:74
static const IMILBitmapVtbl IMILBitmapImpl_Vtbl
Definition: bitmap.c:636
static HRESULT WINAPI BitmapImpl_CopyPalette(IWICBitmap *iface, IWICPalette *pIPalette)
Definition: bitmap.c:349
static HRESULT WINAPI IMILUnknown2Impl_unknown1(IMILUnknown2 *iface, void *arg1, void **arg2)
Definition: bitmap.c:761
static HRESULT WINAPI IMILBitmapImpl_CopyPalette(IMILBitmap *iface, IWICPalette *palette)
Definition: bitmap.c:572
static BOOL BitmapImpl_AcquireLock(BitmapImpl *This, int write)
Definition: bitmap.c:89
static HRESULT WINAPI IMILBitmapImpl_CopyPixels(IMILBitmap *iface, const WICRect *rc, UINT stride, UINT size, BYTE *buffer)
Definition: bitmap.c:580
static ULONG WINAPI BitmapLockImpl_Release(IWICBitmapLock *iface)
Definition: bitmap.c:157
static HRESULT WINAPI BitmapLockImpl_GetStride(IWICBitmapLock *iface, UINT *pcbStride)
Definition: bitmap.c:189
static BitmapImpl * impl_from_IMILUnknown1(IMILUnknown1 *iface)
Definition: bitmap.c:79
static HRESULT WINAPI IMILBitmapImpl_SetPalette(IMILBitmap *iface, IWICPalette *palette)
Definition: bitmap.c:616
static HRESULT WINAPI IMILUnknown1Impl_unknown6(IMILUnknown1 *iface, DWORD64 arg)
Definition: bitmap.c:704
static HRESULT WINAPI IMILBitmapImpl_AddDirtyRect(IMILBitmap *iface, const WICRect *rc)
Definition: bitmap.c:630
static HRESULT WINAPI IMILBitmapImpl_GetPixelFormat(IMILBitmap *iface, int *format)
Definition: bitmap.c:539
static HRESULT WINAPI IMILUnknown1Impl_unknown7(IMILUnknown1 *iface, void *arg)
Definition: bitmap.c:710
static ULONG WINAPI BitmapImpl_AddRef(IWICBitmap *iface)
Definition: bitmap.c:271
static BitmapLockImpl * impl_from_IWICBitmapLock(IWICBitmapLock *iface)
Definition: bitmap.c:84
static HRESULT WINAPI BitmapLockImpl_GetSize(IWICBitmapLock *iface, UINT *puiWidth, UINT *puiHeight)
Definition: bitmap.c:174
static HRESULT WINAPI BitmapImpl_GetPixelFormat(IWICBitmap *iface, WICPixelFormatGUID *pPixelFormat)
Definition: bitmap.c:318
static ULONG WINAPI IMILUnknown2Impl_AddRef(IMILUnknown2 *iface)
Definition: bitmap.c:749
static HRESULT WINAPI BitmapImpl_QueryInterface(IWICBitmap *iface, REFIID iid, void **ppv)
Definition: bitmap.c:238
static HRESULT WINAPI IMILUnknown1Impl_unknown2(IMILUnknown1 *iface, void *arg1, void *arg2)
Definition: bitmap.c:680
HRESULT BitmapImpl_Create(UINT uiWidth, UINT uiHeight, UINT stride, UINT datasize, void *view, UINT offset, REFWICPixelFormatGUID pixelFormat, WICBitmapCreateCacheOption option, IWICBitmap **ppIBitmap)
Definition: bitmap.c:790
static HRESULT WINAPI BitmapLockImpl_GetPixelFormat(IWICBitmapLock *iface, WICPixelFormatGUID *pPixelFormat)
Definition: bitmap.c:219
static ULONG WINAPI IMILUnknown1Impl_Release(IMILUnknown1 *iface)
Definition: bitmap.c:669
static HRESULT WINAPI IMILUnknown1Impl_QueryInterface(IMILUnknown1 *iface, REFIID iid, void **ppv)
Definition: bitmap.c:654
static HRESULT WINAPI IMILBitmapImpl_GetResolution(IMILBitmap *iface, double *dpix, double *dpiy)
Definition: bitmap.c:564
static ULONG WINAPI IMILUnknown2Impl_Release(IMILUnknown2 *iface)
Definition: bitmap.c:755
static HRESULT WINAPI BitmapImpl_Lock(IWICBitmap *iface, const WICRect *prcLock, DWORD flags, IWICBitmapLock **ppILock)
Definition: bitmap.c:371
static BitmapImpl * impl_from_IWICBitmap(IWICBitmap *iface)
Definition: bitmap.c:69
static HRESULT WINAPI IMILUnknown2Impl_unknown2(IMILUnknown2 *iface, void *arg1, void *arg2)
Definition: bitmap.c:768
static HRESULT WINAPI IMILBitmapImpl_GetSize(IMILBitmap *iface, UINT *width, UINT *height)
Definition: bitmap.c:502
const GUID * WIC_format
Definition: bitmap.c:512
static HRESULT WINAPI IMILUnknown1Impl_unknown5(IMILUnknown1 *iface, void *arg)
Definition: bitmap.c:698
static HRESULT WINAPI BitmapImpl_GetResolution(IWICBitmap *iface, double *pDpiX, double *pDpiY)
Definition: bitmap.c:332
static const IMILUnknown2Vtbl IMILUnknown2Impl_Vtbl
Definition: bitmap.c:780
static HRESULT WINAPI IMILUnknown2Impl_unknown3(IMILUnknown2 *iface, void *arg1)
Definition: bitmap.c:774
static HRESULT WINAPI BitmapImpl_SetResolution(IWICBitmap *iface, double dpiX, double dpiY)
Definition: bitmap.c:454
static const IWICBitmapLockVtbl BitmapLockImpl_Vtbl
Definition: bitmap.c:228
static HRESULT WINAPI IMILBitmapImpl_Lock(IMILBitmap *iface, const WICRect *rc, DWORD flags, IWICBitmapLock **lock)
Definition: bitmap.c:602
static HRESULT WINAPI BitmapImpl_CopyPixels(IWICBitmap *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
Definition: bitmap.c:361
static ULONG WINAPI IMILBitmapImpl_AddRef(IMILBitmap *iface)
Definition: bitmap.c:490
static HRESULT WINAPI IMILBitmapImpl_Unlock(IMILBitmap *iface, IWICBitmapLock *lock)
Definition: bitmap.c:609
static ULONG WINAPI BitmapLockImpl_AddRef(IWICBitmapLock *iface)
Definition: bitmap.c:147
static ULONG WINAPI IMILBitmapImpl_Release(IMILBitmap *iface)
Definition: bitmap.c:496
HRESULT WINAPI IMILUnknown1Impl_unknown3(IMILUnknown1 *iface, void *arg)
Definition: bitmap.c:686
static HRESULT WINAPI IMILBitmapImpl_SetResolution(IMILBitmap *iface, double dpix, double dpiy)
Definition: bitmap.c:623
static const IMILUnknown1Vtbl IMILUnknown1Impl_Vtbl
Definition: bitmap.c:726
static const IWICBitmapVtbl BitmapImpl_Vtbl
Definition: bitmap.c:468
static ULONG WINAPI BitmapImpl_Release(IWICBitmap *iface)
Definition: bitmap.c:281
static HRESULT WINAPI BitmapImpl_GetSize(IWICBitmap *iface, UINT *puiWidth, UINT *puiHeight)
Definition: bitmap.c:303
static HRESULT WINAPI BitmapImpl_SetPalette(IWICBitmap *iface, IWICPalette *pIPalette)
Definition: bitmap.c:425
static HRESULT WINAPI IMILUnknown1Impl_unknown4(IMILUnknown1 *iface, void *arg)
Definition: bitmap.c:692
void WINAPI IMILUnknown1Impl_unknown1(IMILUnknown1 *iface, void *arg)
Definition: bitmap.c:675
HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp)
Definition: main.c:62
HRESULT PaletteImpl_Create(IWICPalette **palette)
Definition: palette.c:897
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizei stride
Definition: glext.h:5848
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
GLbitfield flags
Definition: glext.h:7161
GLuint64EXT * result
Definition: glext.h:11304
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
#define InterlockedCompareExchange
Definition: interlocked.h:104
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static HPALETTE palette
Definition: clipboard.c:1345
unsigned int UINT
Definition: ndis.h:50
_Out_ LPRECT prc
Definition: ntgdi.h:1658
#define DEFINE_THISCALL_WRAPPER(func, args)
Definition: msvc-thiscall.c:2
long LONG
Definition: pedump.c:60
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define THISCALL(func)
Definition: asm.h:153
#define calloc
Definition: rosglue.h:14
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
double dpiy
Definition: bitmap.c:57
LONG ref
Definition: bitmap.c:43
LONG lock
Definition: bitmap.c:49
UINT stride
Definition: bitmap.c:54
UINT offset
Definition: bitmap.c:52
IMILUnknown1 IMILUnknown1_iface
Definition: bitmap.c:42
IMILUnknown2 IMILUnknown2_iface
Definition: bitmap.c:46
UINT height
Definition: bitmap.c:53
int palette_set
Definition: bitmap.c:48
IWICPalette * palette
Definition: bitmap.c:47
CRITICAL_SECTION cs
Definition: bitmap.c:58
IWICBitmap IWICBitmap_iface
Definition: bitmap.c:45
IMILBitmap IMILBitmap_iface
Definition: bitmap.c:44
UINT bpp
Definition: bitmap.c:55
BYTE * data
Definition: bitmap.c:50
double dpix
Definition: bitmap.c:57
UINT width
Definition: bitmap.c:53
void * view
Definition: bitmap.c:51
WICPixelFormatGUID pixelformat
Definition: bitmap.c:56
BYTE * data
Definition: bitmap.c:66
UINT width
Definition: bitmap.c:65
LONG ref
Definition: bitmap.c:63
UINT height
Definition: bitmap.c:65
BitmapImpl * parent
Definition: bitmap.c:64
IWICBitmapLock IWICBitmapLock_iface
Definition: bitmap.c:62
INT Height
Definition: wincodec.idl:335
INT Width
Definition: wincodec.idl:334
Definition: scsiwmi.h:51
Definition: format.c:58
Definition: getopt.h:109
Definition: send.c:48
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
rwlock_t lock
Definition: tcpcore.h:0
#define DWORD_PTR
Definition: treelist.c:76
uint64_t DWORD64
Definition: typedefs.h:67
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
@ WICBitmapLockWrite
Definition: wincodec.idl:87
@ WICBitmapLockRead
Definition: wincodec.idl:86
WICBitmapCreateCacheOption
Definition: wincodec.idl:34
static const char * debug_wic_rect(const WICRect *rect)
IID IID_IMILBitmapSource
IID IID_IMILBitmap
#define WINAPI
Definition: msvc.h:6
#define IMILUnknown1
Definition: msvc.h:8
#define WINCODEC_ERR_ALREADYLOCKED
Definition: winerror.h:3286
#define E_NOINTERFACE
Definition: winerror.h:2364
#define WINCODEC_ERR_PALETTEUNAVAILABLE
Definition: winerror.h:3292
#define WINCODEC_ERR_INSUFFICIENTBUFFER
Definition: winerror.h:3311
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1116
unsigned char BYTE
Definition: xxhash.c:193
#define const
Definition: zconf.h:233