72 *
ppv = &
This->IWICBitmapScaler_iface;
74 else if (
IsEqualIID(&IID_IMILBitmapScaler, iid))
76 *
ppv = &
This->IMILBitmapScaler_iface;
94 TRACE(
"(%p) refcount=%u\n", iface,
ref);
104 TRACE(
"(%p) refcount=%u\n", iface,
ref);
108 This->lock.DebugInfo->Spare[0] = 0;
110 if (
This->source) IWICBitmapSource_Release(
This->source);
121 TRACE(
"(%p,%p,%p)\n", iface, puiWidth, puiHeight);
126 if (!puiWidth || !puiHeight)
129 *puiWidth =
This->width;
130 *puiHeight =
This->height;
139 TRACE(
"(%p,%p)\n", iface, pPixelFormat);
146 memcpy(pPixelFormat, &GUID_WICPixelFormatDontCare,
sizeof(*pPixelFormat));
150 return IWICBitmapSource_GetPixelFormat(
This->source, pPixelFormat);
154 double *pDpiX,
double *pDpiY)
157 TRACE(
"(%p,%p,%p)\n", iface, pDpiX, pDpiY);
162 if (!pDpiX || !pDpiY)
165 return IWICBitmapSource_GetResolution(
This->source, pDpiX, pDpiY);
172 TRACE(
"(%p,%p)\n", iface, pIPalette);
180 return IWICBitmapSource_CopyPalette(
This->source, pIPalette);
186 src_rect->
X =
x *
This->src_width /
This->width;
187 src_rect->
Y =
y *
This->src_height /
This->height;
199 src_y = dst_y *
This->src_height /
This->height - src_data_y;
201 for (
i=0;
i<dst_width;
i++)
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);
214 WICRect src_rect_ul, src_rect_br, src_rect;
218 ULONG src_bytesperrow;
236 dest_rect.
X = dest_rect.
Y = 0;
241 if (dest_rect.
X < 0 || dest_rect.
Y < 0 ||
248 bytesperrow = ((
This->bpp * dest_rect.
Width)+7)/8;
250 if (cbStride < bytesperrow)
256 if ((cbStride * dest_rect.
Height) > cbBufferSize)
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);
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;
279 src_bytesperrow = (src_rect.
Width *
This->bpp + 7)/8;
285 if (!src_rows || !src_bits)
294 src_rows[
y] = src_bits +
y * src_bytesperrow;
296 hr = IWICBitmapSource_CopyPixels(
This->source, &src_rect, src_bytesperrow,
304 src_rows, src_rect.
X, src_rect.
Y, pbBuffer + cbStride *
y);
323 GUID src_pixelformat;
325 TRACE(
"(%p,%p,%u,%u,%u)\n", iface, pISource, uiWidth, uiHeight,
mode);
327 if (!pISource || !uiWidth || !uiHeight)
338 This->width = uiWidth;
339 This->height = uiHeight;
342 hr = IWICBitmapSource_GetSize(pISource, &
This->src_width, &
This->src_height);
345 hr = IWICBitmapSource_GetPixelFormat(pISource, &src_pixelformat);
360 if ((
This->bpp % 8) == 0)
362 IWICBitmapSource_AddRef(pISource);
363 This->source = pISource;
368 pISource, &
This->source);
400 return IWICBitmapScaler_QueryInterface(&
This->IWICBitmapScaler_iface, iid,
ppv);
406 return IWICBitmapScaler_AddRef(&
This->IWICBitmapScaler_iface);
412 return IWICBitmapScaler_Release(&
This->IWICBitmapScaler_iface);
420 return IWICBitmapScaler_GetSize(&
This->IWICBitmapScaler_iface,
width,
height);
437 hr = IWICBitmapSource_QueryInterface(
This->source, &IID_IMILBitmapSource, (
void **)&
source);
447 double *dpix,
double *dpiy)
450 TRACE(
"(%p,%p,%p)\n", iface, dpix, dpiy);
451 return IWICBitmapScaler_GetResolution(&
This->IWICBitmapScaler_iface, dpix, dpiy);
464 return IWICBitmapScaler_CopyPalette(&
This->IWICBitmapScaler_iface,
palette);
493 hr = mil_source->lpVtbl->
QueryInterface(mil_source, &IID_IWICBitmapSource, (
void **)&wic_source);
497 IWICBitmapSource_Release(wic_source);
529 This->src_height = 0;
533 This->lock.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": BitmapScaler.lock");
535 *scaler = &
This->IWICBitmapScaler_iface;
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define HeapFree(x, y, z)
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
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
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define memcpy(s1, s2, n)
#define IsEqualIID(riid1, riid2)
static ULONG WINAPI IMILBitmapScaler_AddRef(IMILBitmapScaler *iface)
static const IWICBitmapScalerVtbl BitmapScaler_Vtbl
static HRESULT WINAPI BitmapScaler_GetPixelFormat(IWICBitmapScaler *iface, WICPixelFormatGUID *pPixelFormat)
HRESULT BitmapScaler_Create(IWICBitmapScaler **scaler)
static ULONG WINAPI BitmapScaler_Release(IWICBitmapScaler *iface)
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)
static HRESULT WINAPI BitmapScaler_QueryInterface(IWICBitmapScaler *iface, REFIID iid, void **ppv)
static HRESULT WINAPI IMILBitmapScaler_GetPixelFormat(IMILBitmapScaler *iface, int *format)
static ULONG WINAPI IMILBitmapScaler_Release(IMILBitmapScaler *iface)
static BitmapScaler * impl_from_IMILBitmapScaler(IMILBitmapScaler *iface)
static HRESULT WINAPI BitmapScaler_CopyPalette(IWICBitmapScaler *iface, IWICPalette *pIPalette)
static HRESULT WINAPI IMILBitmapScaler_CopyPixels(IMILBitmapScaler *iface, const WICRect *rc, UINT stride, UINT size, BYTE *buffer)
static HRESULT WINAPI IMILBitmapScaler_unknown1(IMILBitmapScaler *iface, void **ppv)
static ULONG WINAPI BitmapScaler_AddRef(IWICBitmapScaler *iface)
static HRESULT WINAPI BitmapScaler_CopyPixels(IWICBitmapScaler *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
static BitmapScaler * impl_from_IWICBitmapScaler(IWICBitmapScaler *iface)
static HRESULT WINAPI BitmapScaler_Initialize(IWICBitmapScaler *iface, IWICBitmapSource *pISource, UINT uiWidth, UINT uiHeight, WICBitmapInterpolationMode mode)
static const IMILBitmapScalerVtbl IMILBitmapScaler_Vtbl
static HRESULT WINAPI IMILBitmapScaler_CopyPalette(IMILBitmapScaler *iface, IWICPalette *palette)
static HRESULT WINAPI BitmapScaler_GetSize(IWICBitmapScaler *iface, UINT *puiWidth, UINT *puiHeight)
static void NearestNeighbor_GetRequiredSourceRect(BitmapScaler *This, UINT x, UINT y, WICRect *src_rect)
static HRESULT WINAPI IMILBitmapScaler_QueryInterface(IMILBitmapScaler *iface, REFIID iid, void **ppv)
static HRESULT WINAPI IMILBitmapScaler_Initialize(IMILBitmapScaler *iface, IMILBitmapSource *mil_source, UINT width, UINT height, WICBitmapInterpolationMode mode)
static HRESULT WINAPI BitmapScaler_GetResolution(IWICBitmapScaler *iface, double *pDpiX, double *pDpiY)
static HRESULT WINAPI IMILBitmapScaler_GetResolution(IMILBitmapScaler *iface, double *dpix, double *dpiy)
static HRESULT WINAPI IMILBitmapScaler_GetSize(IMILBitmapScaler *iface, UINT *width, UINT *height)
IMILBitmapScaler IMILBitmapScaler_iface
void(* fn_copy_scanline)(struct BitmapScaler *, UINT, UINT, UINT, BYTE **, UINT, UINT, BYTE *)
WICBitmapInterpolationMode mode
IWICBitmapScaler IWICBitmapScaler_iface
void(* fn_get_required_source_rect)(struct BitmapScaler *, UINT, UINT, WICRect *)
IWICBitmapSource * source
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
#define CONTAINING_RECORD(address, type, field)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
WICBitmapInterpolationMode
@ WICBitmapInterpolationModeNearestNeighbor
static const char * debug_wic_rect(const WICRect *rect)
#define WINCODEC_ERR_WRONGSTATE
#define WINCODEC_ERR_NOTINITIALIZED
#define WINCODEC_ERR_PALETTEUNAVAILABLE