ReactOS 0.4.15-dev-8096-ga0eec98
scaler.c
Go to the documentation of this file.
1/*
2 * Copyright 2010 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 "config.h"
21
22#include <stdarg.h>
23
24#define COBJMACROS
25
26#include "windef.h"
27#include "winbase.h"
28#include "objbase.h"
29
30#include "wincodecs_private.h"
31
32#include "wine/debug.h"
33
35
36typedef struct BitmapScaler {
39 IMILBitmapScaler IMILBitmapScaler_iface;
47 CRITICAL_SECTION lock; /* must be held when initialized */
49
51{
53}
54
55static inline BitmapScaler *impl_from_IMILBitmapScaler(IMILBitmapScaler *iface)
56{
58}
59
61 void **ppv)
62{
64 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
65
66 if (!ppv) return E_INVALIDARG;
67
68 if (IsEqualIID(&IID_IUnknown, iid) ||
69 IsEqualIID(&IID_IWICBitmapSource, iid) ||
70 IsEqualIID(&IID_IWICBitmapScaler, iid))
71 {
72 *ppv = &This->IWICBitmapScaler_iface;
73 }
74 else if (IsEqualIID(&IID_IMILBitmapScaler, iid))
75 {
76 *ppv = &This->IMILBitmapScaler_iface;
77 }
78 else
79 {
80 FIXME("unknown interface %s\n", debugstr_guid(iid));
81 *ppv = NULL;
82 return E_NOINTERFACE;
83 }
84
85 IUnknown_AddRef((IUnknown*)*ppv);
86 return S_OK;
87}
88
90{
93
94 TRACE("(%p) refcount=%u\n", iface, ref);
95
96 return ref;
97}
98
100{
103
104 TRACE("(%p) refcount=%u\n", iface, ref);
105
106 if (ref == 0)
107 {
108 This->lock.DebugInfo->Spare[0] = 0;
110 if (This->source) IWICBitmapSource_Release(This->source);
112 }
113
114 return ref;
115}
116
118 UINT *puiWidth, UINT *puiHeight)
119{
121 TRACE("(%p,%p,%p)\n", iface, puiWidth, puiHeight);
122
123 if (!This->source)
125
126 if (!puiWidth || !puiHeight)
127 return E_INVALIDARG;
128
129 *puiWidth = This->width;
130 *puiHeight = This->height;
131
132 return S_OK;
133}
134
136 WICPixelFormatGUID *pPixelFormat)
137{
139 TRACE("(%p,%p)\n", iface, pPixelFormat);
140
141 if (!pPixelFormat)
142 return E_INVALIDARG;
143
144 if (!This->source)
145 {
146 memcpy(pPixelFormat, &GUID_WICPixelFormatDontCare, sizeof(*pPixelFormat));
147 return S_OK;
148 }
149
150 return IWICBitmapSource_GetPixelFormat(This->source, pPixelFormat);
151}
152
154 double *pDpiX, double *pDpiY)
155{
157 TRACE("(%p,%p,%p)\n", iface, pDpiX, pDpiY);
158
159 if (!This->source)
161
162 if (!pDpiX || !pDpiY)
163 return E_INVALIDARG;
164
165 return IWICBitmapSource_GetResolution(This->source, pDpiX, pDpiY);
166}
167
169 IWICPalette *pIPalette)
170{
172 TRACE("(%p,%p)\n", iface, pIPalette);
173
174 if (!pIPalette)
175 return E_INVALIDARG;
176
177 if (!This->source)
179
180 return IWICBitmapSource_CopyPalette(This->source, pIPalette);
181}
182
184 UINT x, UINT y, WICRect *src_rect)
185{
186 src_rect->X = x * This->src_width / This->width;
187 src_rect->Y = y * This->src_height / This->height;
188 src_rect->Width = src_rect->Height = 1;
189}
190
192 UINT dst_x, UINT dst_y, UINT dst_width,
193 BYTE **src_data, UINT src_data_x, UINT src_data_y, BYTE *pbBuffer)
194{
195 UINT i;
196 UINT bytesperpixel = This->bpp/8;
197 UINT src_x, src_y;
198
199 src_y = dst_y * This->src_height / This->height - src_data_y;
200
201 for (i=0; i<dst_width; i++)
202 {
203 src_x = (dst_x + i) * This->src_width / This->width - src_data_x;
204 memcpy(pbBuffer + bytesperpixel * i, src_data[src_y] + bytesperpixel * src_x, bytesperpixel);
205 }
206}
207
209 const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
210{
212 HRESULT hr;
213 WICRect dest_rect;
214 WICRect src_rect_ul, src_rect_br, src_rect;
215 BYTE **src_rows;
216 BYTE *src_bits;
217 ULONG bytesperrow;
218 ULONG src_bytesperrow;
220 UINT y;
221
222 TRACE("(%p,%s,%u,%u,%p)\n", iface, debug_wic_rect(prc), cbStride, cbBufferSize, pbBuffer);
223
225
226 if (!This->source)
227 {
229 goto end;
230 }
231
232 if (prc)
233 dest_rect = *prc;
234 else
235 {
236 dest_rect.X = dest_rect.Y = 0;
237 dest_rect.Width = This->width;
238 dest_rect.Height = This->height;
239 }
240
241 if (dest_rect.X < 0 || dest_rect.Y < 0 ||
242 dest_rect.X+dest_rect.Width > This->width|| dest_rect.Y+dest_rect.Height > This->height)
243 {
245 goto end;
246 }
247
248 bytesperrow = ((This->bpp * dest_rect.Width)+7)/8;
249
250 if (cbStride < bytesperrow)
251 {
253 goto end;
254 }
255
256 if ((cbStride * dest_rect.Height) > cbBufferSize)
257 {
259 goto end;
260 }
261
262 /* MSDN recommends calling CopyPixels once for each scanline from top to
263 * bottom, and claims codecs optimize for this. Ideally, when called in this
264 * way, we should avoid requesting a scanline from the source more than
265 * once, by saving the data that will be useful for the next scanline after
266 * the call returns. The GetRequiredSourceRect/CopyScanline functions are
267 * designed to make it possible to do this in a generic way, but for now we
268 * just grab all the data we need in each call. */
269
270 This->fn_get_required_source_rect(This, dest_rect.X, dest_rect.Y, &src_rect_ul);
271 This->fn_get_required_source_rect(This, dest_rect.X+dest_rect.Width-1,
272 dest_rect.Y+dest_rect.Height-1, &src_rect_br);
273
274 src_rect.X = src_rect_ul.X;
275 src_rect.Y = src_rect_ul.Y;
276 src_rect.Width = src_rect_br.Width + src_rect_br.X - src_rect_ul.X;
277 src_rect.Height = src_rect_br.Height + src_rect_br.Y - src_rect_ul.Y;
278
279 src_bytesperrow = (src_rect.Width * This->bpp + 7)/8;
280 buffer_size = src_bytesperrow * src_rect.Height;
281
282 src_rows = HeapAlloc(GetProcessHeap(), 0, sizeof(BYTE*) * src_rect.Height);
283 src_bits = HeapAlloc(GetProcessHeap(), 0, buffer_size);
284
285 if (!src_rows || !src_bits)
286 {
287 HeapFree(GetProcessHeap(), 0, src_rows);
288 HeapFree(GetProcessHeap(), 0, src_bits);
290 goto end;
291 }
292
293 for (y=0; y<src_rect.Height; y++)
294 src_rows[y] = src_bits + y * src_bytesperrow;
295
296 hr = IWICBitmapSource_CopyPixels(This->source, &src_rect, src_bytesperrow,
297 buffer_size, src_bits);
298
299 if (SUCCEEDED(hr))
300 {
301 for (y=0; y < dest_rect.Height; y++)
302 {
303 This->fn_copy_scanline(This, dest_rect.X, dest_rect.Y+y, dest_rect.Width,
304 src_rows, src_rect.X, src_rect.Y, pbBuffer + cbStride * y);
305 }
306 }
307
308 HeapFree(GetProcessHeap(), 0, src_rows);
309 HeapFree(GetProcessHeap(), 0, src_bits);
310
311end:
313
314 return hr;
315}
316
318 IWICBitmapSource *pISource, UINT uiWidth, UINT uiHeight,
320{
322 HRESULT hr;
323 GUID src_pixelformat;
324
325 TRACE("(%p,%p,%u,%u,%u)\n", iface, pISource, uiWidth, uiHeight, mode);
326
327 if (!pISource || !uiWidth || !uiHeight)
328 return E_INVALIDARG;
329
331
332 if (This->source)
333 {
335 goto end;
336 }
337
338 This->width = uiWidth;
339 This->height = uiHeight;
340 This->mode = mode;
341
342 hr = IWICBitmapSource_GetSize(pISource, &This->src_width, &This->src_height);
343
344 if (SUCCEEDED(hr))
345 hr = IWICBitmapSource_GetPixelFormat(pISource, &src_pixelformat);
346
347 if (SUCCEEDED(hr))
348 {
349 hr = get_pixelformat_bpp(&src_pixelformat, &This->bpp);
350 }
351
352 if (SUCCEEDED(hr))
353 {
354 switch (mode)
355 {
356 default:
357 FIXME("unsupported mode %i\n", mode);
358 /* fall-through */
360 if ((This->bpp % 8) == 0)
361 {
362 IWICBitmapSource_AddRef(pISource);
363 This->source = pISource;
364 }
365 else
366 {
367 hr = WICConvertBitmapSource(&GUID_WICPixelFormat32bppBGRA,
368 pISource, &This->source);
369 This->bpp = 32;
370 }
371 This->fn_get_required_source_rect = NearestNeighbor_GetRequiredSourceRect;
372 This->fn_copy_scanline = NearestNeighbor_CopyScanline;
373 break;
374 }
375 }
376
377end:
379
380 return hr;
381}
382
383static const IWICBitmapScalerVtbl BitmapScaler_Vtbl = {
393};
394
395static HRESULT WINAPI IMILBitmapScaler_QueryInterface(IMILBitmapScaler *iface, REFIID iid,
396 void **ppv)
397{
399 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
400 return IWICBitmapScaler_QueryInterface(&This->IWICBitmapScaler_iface, iid, ppv);
401}
402
403static ULONG WINAPI IMILBitmapScaler_AddRef(IMILBitmapScaler *iface)
404{
406 return IWICBitmapScaler_AddRef(&This->IWICBitmapScaler_iface);
407}
408
409static ULONG WINAPI IMILBitmapScaler_Release(IMILBitmapScaler *iface)
410{
412 return IWICBitmapScaler_Release(&This->IWICBitmapScaler_iface);
413}
414
415static HRESULT WINAPI IMILBitmapScaler_GetSize(IMILBitmapScaler *iface,
417{
419 TRACE("(%p,%p,%p)\n", iface, width, height);
420 return IWICBitmapScaler_GetSize(&This->IWICBitmapScaler_iface, width, height);
421}
422
423static HRESULT WINAPI IMILBitmapScaler_GetPixelFormat(IMILBitmapScaler *iface,
424 int *format)
425{
427 IMILBitmapSource *source;
428 HRESULT hr;
429
430 TRACE("(%p,%p)\n", iface, format);
431
432 if (!format) return E_INVALIDARG;
433
434 if (!This->source)
436
437 hr = IWICBitmapSource_QueryInterface(This->source, &IID_IMILBitmapSource, (void **)&source);
438 if (hr == S_OK)
439 {
440 hr = source->lpVtbl->GetPixelFormat(source, format);
441 source->lpVtbl->Release(source);
442 }
443 return hr;
444}
445
446static HRESULT WINAPI IMILBitmapScaler_GetResolution(IMILBitmapScaler *iface,
447 double *dpix, double *dpiy)
448{
450 TRACE("(%p,%p,%p)\n", iface, dpix, dpiy);
451 return IWICBitmapScaler_GetResolution(&This->IWICBitmapScaler_iface, dpix, dpiy);
452}
453
454static HRESULT WINAPI IMILBitmapScaler_CopyPalette(IMILBitmapScaler *iface,
456{
458
459 TRACE("(%p,%p)\n", iface, palette);
460
461 if (!This->source)
463
464 return IWICBitmapScaler_CopyPalette(&This->IWICBitmapScaler_iface, palette);
465}
466
467static HRESULT WINAPI IMILBitmapScaler_CopyPixels(IMILBitmapScaler *iface,
468 const WICRect *rc, UINT stride, UINT size, BYTE *buffer)
469{
471 TRACE("(%p,%p,%u,%u,%p)\n", iface, rc, stride, size, buffer);
472 return IWICBitmapScaler_CopyPixels(&This->IWICBitmapScaler_iface, rc, stride, size, buffer);
473}
474
475static HRESULT WINAPI IMILBitmapScaler_unknown1(IMILBitmapScaler *iface, void **ppv)
476{
477 TRACE("(%p,%p)\n", iface, ppv);
478 return E_NOINTERFACE;
479}
480
481static HRESULT WINAPI IMILBitmapScaler_Initialize(IMILBitmapScaler *iface,
482 IMILBitmapSource *mil_source, UINT width, UINT height,
484{
486 IWICBitmapSource *wic_source;
487 HRESULT hr;
488
489 TRACE("(%p,%p,%u,%u,%u)\n", iface, mil_source, width, height, mode);
490
491 if (!mil_source) return E_INVALIDARG;
492
493 hr = mil_source->lpVtbl->QueryInterface(mil_source, &IID_IWICBitmapSource, (void **)&wic_source);
494 if (hr == S_OK)
495 {
496 hr = IWICBitmapScaler_Initialize(&This->IWICBitmapScaler_iface, wic_source, width, height, mode);
497 IWICBitmapSource_Release(wic_source);
498 }
499 return hr;
500}
501
502static const IMILBitmapScalerVtbl IMILBitmapScaler_Vtbl = {
513};
514
516{
518
519 This = HeapAlloc(GetProcessHeap(), 0, sizeof(BitmapScaler));
520 if (!This) return E_OUTOFMEMORY;
521
522 This->IWICBitmapScaler_iface.lpVtbl = &BitmapScaler_Vtbl;
523 This->IMILBitmapScaler_iface.lpVtbl = &IMILBitmapScaler_Vtbl;
524 This->ref = 1;
525 This->source = NULL;
526 This->width = 0;
527 This->height = 0;
528 This->src_width = 0;
529 This->src_height = 0;
530 This->mode = 0;
531 This->bpp = 0;
533 This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BitmapScaler.lock");
534
535 *scaler = &This->IWICBitmapScaler_iface;
536
537 return S_OK;
538}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
const GUID IID_IUnknown
#define FIXME(fmt,...)
Definition: debug.h:114
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
Definition: info.c:2474
HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp)
Definition: main.c:252
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint GLuint end
Definition: gl.h:1545
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLsizei stride
Definition: glext.h:5848
GLuint buffer
Definition: glext.h:5915
GLenum mode
Definition: glext.h:6217
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
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#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
long LONG
Definition: pedump.c:60
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
static ULONG WINAPI IMILBitmapScaler_AddRef(IMILBitmapScaler *iface)
Definition: scaler.c:403
static const IWICBitmapScalerVtbl BitmapScaler_Vtbl
Definition: scaler.c:383
static HRESULT WINAPI BitmapScaler_GetPixelFormat(IWICBitmapScaler *iface, WICPixelFormatGUID *pPixelFormat)
Definition: scaler.c:135
HRESULT BitmapScaler_Create(IWICBitmapScaler **scaler)
Definition: scaler.c:515
static ULONG WINAPI BitmapScaler_Release(IWICBitmapScaler *iface)
Definition: scaler.c:99
static void NearestNeighbor_CopyScanline(BitmapScaler *This, UINT dst_x, UINT dst_y, UINT dst_width, BYTE **src_data, UINT src_data_x, UINT src_data_y, BYTE *pbBuffer)
Definition: scaler.c:191
static HRESULT WINAPI BitmapScaler_QueryInterface(IWICBitmapScaler *iface, REFIID iid, void **ppv)
Definition: scaler.c:60
static HRESULT WINAPI IMILBitmapScaler_GetPixelFormat(IMILBitmapScaler *iface, int *format)
Definition: scaler.c:423
static ULONG WINAPI IMILBitmapScaler_Release(IMILBitmapScaler *iface)
Definition: scaler.c:409
static BitmapScaler * impl_from_IMILBitmapScaler(IMILBitmapScaler *iface)
Definition: scaler.c:55
static HRESULT WINAPI BitmapScaler_CopyPalette(IWICBitmapScaler *iface, IWICPalette *pIPalette)
Definition: scaler.c:168
static HRESULT WINAPI IMILBitmapScaler_CopyPixels(IMILBitmapScaler *iface, const WICRect *rc, UINT stride, UINT size, BYTE *buffer)
Definition: scaler.c:467
static HRESULT WINAPI IMILBitmapScaler_unknown1(IMILBitmapScaler *iface, void **ppv)
Definition: scaler.c:475
static ULONG WINAPI BitmapScaler_AddRef(IWICBitmapScaler *iface)
Definition: scaler.c:89
static HRESULT WINAPI BitmapScaler_CopyPixels(IWICBitmapScaler *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
Definition: scaler.c:208
static BitmapScaler * impl_from_IWICBitmapScaler(IWICBitmapScaler *iface)
Definition: scaler.c:50
static HRESULT WINAPI BitmapScaler_Initialize(IWICBitmapScaler *iface, IWICBitmapSource *pISource, UINT uiWidth, UINT uiHeight, WICBitmapInterpolationMode mode)
Definition: scaler.c:317
static const IMILBitmapScalerVtbl IMILBitmapScaler_Vtbl
Definition: scaler.c:502
static HRESULT WINAPI IMILBitmapScaler_CopyPalette(IMILBitmapScaler *iface, IWICPalette *palette)
Definition: scaler.c:454
static HRESULT WINAPI BitmapScaler_GetSize(IWICBitmapScaler *iface, UINT *puiWidth, UINT *puiHeight)
Definition: scaler.c:117
static void NearestNeighbor_GetRequiredSourceRect(BitmapScaler *This, UINT x, UINT y, WICRect *src_rect)
Definition: scaler.c:183
static HRESULT WINAPI IMILBitmapScaler_QueryInterface(IMILBitmapScaler *iface, REFIID iid, void **ppv)
Definition: scaler.c:395
static HRESULT WINAPI IMILBitmapScaler_Initialize(IMILBitmapScaler *iface, IMILBitmapSource *mil_source, UINT width, UINT height, WICBitmapInterpolationMode mode)
Definition: scaler.c:481
static HRESULT WINAPI BitmapScaler_GetResolution(IWICBitmapScaler *iface, double *pDpiX, double *pDpiY)
Definition: scaler.c:153
static HRESULT WINAPI IMILBitmapScaler_GetResolution(IMILBitmapScaler *iface, double *dpix, double *dpiy)
Definition: scaler.c:446
static HRESULT WINAPI IMILBitmapScaler_GetSize(IMILBitmapScaler *iface, UINT *width, UINT *height)
Definition: scaler.c:415
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
IMILBitmapScaler IMILBitmapScaler_iface
Definition: scaler.c:39
UINT bpp
Definition: scaler.c:44
void(* fn_copy_scanline)(struct BitmapScaler *, UINT, UINT, UINT, BYTE **, UINT, UINT, BYTE *)
Definition: scaler.c:46
UINT src_width
Definition: scaler.c:42
WICBitmapInterpolationMode mode
Definition: scaler.c:43
CRITICAL_SECTION lock
Definition: scaler.c:47
UINT src_height
Definition: scaler.c:42
LONG ref
Definition: scaler.c:38
UINT width
Definition: scaler.c:41
IWICBitmapScaler IWICBitmapScaler_iface
Definition: scaler.c:37
UINT height
Definition: scaler.c:41
void(* fn_get_required_source_rect)(struct BitmapScaler *, UINT, UINT, WICRect *)
Definition: scaler.c:45
IWICBitmapSource * source
Definition: scaler.c:40
INT Height
Definition: wincodec.idl:301
INT Width
Definition: wincodec.idl:300
Definition: send.c:48
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
Definition: swimpl.c:888
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#define DWORD_PTR
Definition: treelist.c:76
#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)
WICBitmapInterpolationMode
Definition: wincodec.idl:76
@ WICBitmapInterpolationModeNearestNeighbor
Definition: wincodec.idl:77
static const char * debug_wic_rect(const WICRect *rect)
#define WINAPI
Definition: msvc.h:6
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3281
#define WINCODEC_ERR_NOTINITIALIZED
Definition: winerror.h:3285
#define E_NOINTERFACE
Definition: winerror.h:2364
#define WINCODEC_ERR_PALETTEUNAVAILABLE
Definition: winerror.h:3292
unsigned char BYTE
Definition: xxhash.c:193