1 /* 2 * Misleadingly named convenience functions for accessing WIC. 3 * 4 * Copyright 2012 Vincent Povirk for CodeWeavers 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2.1 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 */ 20 21 #include "config.h" 22 23 #include <stdarg.h> 24 25 #define COBJMACROS 26 27 #include "windef.h" 28 #include "winbase.h" 29 #include "objbase.h" 30 31 #include "wincodecs_private.h" 32 33 #include "wine/debug.h" 34 35 WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); 36 37 HRESULT WINAPI IPropertyBag2_Write_Proxy(IPropertyBag2 *iface, 38 ULONG cProperties, PROPBAG2 *ppropbag, VARIANT *pvarValue) 39 { 40 return IPropertyBag2_Write(iface, cProperties, ppropbag, pvarValue); 41 } 42 43 HRESULT WINAPI IWICBitmapClipper_Initialize_Proxy_W(IWICBitmapClipper *iface, 44 IWICBitmapSource *pISource, const WICRect *prc) 45 { 46 return IWICBitmapClipper_Initialize(iface, pISource, prc); 47 } 48 49 HRESULT WINAPI IWICBitmapCodecInfo_GetContainerFormat_Proxy_W(IWICBitmapCodecInfo *iface, 50 GUID *pguidContainerFormat) 51 { 52 return IWICBitmapCodecInfo_GetContainerFormat(iface, pguidContainerFormat); 53 } 54 55 HRESULT WINAPI IWICBitmapCodecInfo_GetDeviceManufacturer_Proxy_W(IWICBitmapCodecInfo *iface, 56 UINT cchDeviceManufacturer, WCHAR *wzDeviceManufacturer, UINT *pcchActual) 57 { 58 return IWICBitmapCodecInfo_GetDeviceManufacturer(iface, cchDeviceManufacturer, wzDeviceManufacturer, pcchActual); 59 } 60 61 HRESULT WINAPI IWICBitmapCodecInfo_GetDeviceModels_Proxy_W(IWICBitmapCodecInfo *iface, 62 UINT cchDeviceModels, WCHAR *wzDeviceModels, UINT *pcchActual) 63 { 64 return IWICBitmapCodecInfo_GetDeviceModels(iface, cchDeviceModels, wzDeviceModels, pcchActual); 65 } 66 67 HRESULT WINAPI IWICBitmapCodecInfo_GetMimeTypes_Proxy_W(IWICBitmapCodecInfo *iface, 68 UINT cchMimeTypes, WCHAR *wzMimeTypes, UINT *pcchActual) 69 { 70 return IWICBitmapCodecInfo_GetMimeTypes(iface, cchMimeTypes, wzMimeTypes, pcchActual); 71 } 72 73 HRESULT WINAPI IWICBitmapCodecInfo_GetFileExtensions_Proxy_W(IWICBitmapCodecInfo *iface, 74 UINT cchFileExtensions, WCHAR *wzFileExtensions, UINT *pcchActual) 75 { 76 return IWICBitmapCodecInfo_GetFileExtensions(iface, cchFileExtensions, wzFileExtensions, pcchActual); 77 } 78 79 HRESULT WINAPI IWICBitmapCodecInfo_DoesSupportAnimation_Proxy_W(IWICBitmapCodecInfo *iface, 80 BOOL *pfSupportAnimation) 81 { 82 return IWICBitmapCodecInfo_DoesSupportAnimation(iface, pfSupportAnimation); 83 } 84 85 HRESULT WINAPI IWICBitmapCodecInfo_DoesSupportLossless_Proxy_W(IWICBitmapCodecInfo *iface, 86 BOOL *pfSupportLossless) 87 { 88 return IWICBitmapCodecInfo_DoesSupportLossless(iface, pfSupportLossless); 89 } 90 91 HRESULT WINAPI IWICBitmapCodecInfo_DoesSupportMultiframe_Proxy_W(IWICBitmapCodecInfo *iface, 92 BOOL *pfSupportMultiframe) 93 { 94 return IWICBitmapCodecInfo_DoesSupportMultiframe(iface, pfSupportMultiframe); 95 } 96 97 HRESULT WINAPI IWICBitmapDecoder_GetDecoderInfo_Proxy_W(IWICBitmapDecoder *iface, 98 IWICBitmapDecoderInfo **ppIDecoderInfo) 99 { 100 return IWICBitmapDecoder_GetDecoderInfo(iface, ppIDecoderInfo); 101 } 102 103 HRESULT WINAPI IWICBitmapDecoder_CopyPalette_Proxy_W(IWICBitmapDecoder *iface, 104 IWICPalette *pIPalette) 105 { 106 return IWICBitmapDecoder_CopyPalette(iface, pIPalette); 107 } 108 109 HRESULT WINAPI IWICBitmapDecoder_GetMetadataQueryReader_Proxy_W(IWICBitmapDecoder *iface, 110 IWICMetadataQueryReader **ppIMetadataQueryReader) 111 { 112 return IWICBitmapDecoder_GetMetadataQueryReader(iface, ppIMetadataQueryReader); 113 } 114 115 HRESULT WINAPI IWICBitmapDecoder_GetPreview_Proxy_W(IWICBitmapDecoder *iface, 116 IWICBitmapSource **ppIBitmapSource) 117 { 118 return IWICBitmapDecoder_GetPreview(iface, ppIBitmapSource); 119 } 120 121 HRESULT WINAPI IWICBitmapDecoder_GetColorContexts_Proxy_W(IWICBitmapDecoder *iface, 122 UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount) 123 { 124 return IWICBitmapDecoder_GetColorContexts(iface, cCount, ppIColorContexts, pcActualCount); 125 } 126 127 HRESULT WINAPI IWICBitmapDecoder_GetThumbnail_Proxy_W(IWICBitmapDecoder *iface, 128 IWICBitmapSource **ppIThumbnail) 129 { 130 return IWICBitmapDecoder_GetThumbnail(iface, ppIThumbnail); 131 } 132 133 HRESULT WINAPI IWICBitmapDecoder_GetFrameCount_Proxy_W(IWICBitmapDecoder *iface, 134 UINT *pCount) 135 { 136 return IWICBitmapDecoder_GetFrameCount(iface, pCount); 137 } 138 139 HRESULT WINAPI IWICBitmapDecoder_GetFrame_Proxy_W(IWICBitmapDecoder *iface, 140 UINT index, IWICBitmapFrameDecode **ppIBitmapFrame) 141 { 142 return IWICBitmapDecoder_GetFrame(iface, index, ppIBitmapFrame); 143 } 144 145 HRESULT WINAPI IWICBitmapEncoder_Initialize_Proxy_W(IWICBitmapEncoder *iface, 146 IStream *pIStream, WICBitmapEncoderCacheOption cacheOption) 147 { 148 return IWICBitmapEncoder_Initialize(iface, pIStream, cacheOption); 149 } 150 151 HRESULT WINAPI IWICBitmapEncoder_GetEncoderInfo_Proxy_W(IWICBitmapEncoder *iface, 152 IWICBitmapEncoderInfo **ppIEncoderInfo) 153 { 154 return IWICBitmapEncoder_GetEncoderInfo(iface, ppIEncoderInfo); 155 } 156 157 HRESULT WINAPI IWICBitmapEncoder_SetPalette_Proxy_W(IWICBitmapEncoder *iface, 158 IWICPalette *pIPalette) 159 { 160 return IWICBitmapEncoder_SetPalette(iface, pIPalette); 161 } 162 163 HRESULT WINAPI IWICBitmapEncoder_SetThumbnail_Proxy_W(IWICBitmapEncoder *iface, 164 IWICBitmapSource *pIThumbnail) 165 { 166 return IWICBitmapEncoder_SetThumbnail(iface, pIThumbnail); 167 } 168 169 HRESULT WINAPI IWICBitmapEncoder_CreateNewFrame_Proxy_W(IWICBitmapEncoder *iface, 170 IWICBitmapFrameEncode **ppIFrameEncode, IPropertyBag2 **ppIEncoderOptions) 171 { 172 return IWICBitmapEncoder_CreateNewFrame(iface, ppIFrameEncode, ppIEncoderOptions); 173 } 174 175 HRESULT WINAPI IWICBitmapEncoder_Commit_Proxy_W(IWICBitmapEncoder *iface) 176 { 177 return IWICBitmapEncoder_Commit(iface); 178 } 179 180 HRESULT WINAPI IWICBitmapEncoder_GetMetadataQueryWriter_Proxy_W(IWICBitmapEncoder *iface, 181 IWICMetadataQueryWriter **ppIMetadataQueryWriter) 182 { 183 return IWICBitmapEncoder_GetMetadataQueryWriter(iface, ppIMetadataQueryWriter); 184 } 185 186 HRESULT WINAPI IWICBitmapFlipRotator_Initialize_Proxy_W(IWICBitmapFlipRotator *iface, 187 IWICBitmapSource *pISource, WICBitmapTransformOptions options) 188 { 189 return IWICBitmapFlipRotator_Initialize(iface, pISource, options); 190 } 191 192 HRESULT WINAPI IWICBitmapFrameEncode_Initialize_Proxy_W(IWICBitmapFrameEncode *iface, 193 IPropertyBag2 *pIEncoderOptions) 194 { 195 return IWICBitmapFrameEncode_Initialize(iface, pIEncoderOptions); 196 } 197 198 HRESULT WINAPI IWICBitmapFrameEncode_SetSize_Proxy_W(IWICBitmapFrameEncode *iface, 199 UINT uiWidth, UINT uiHeight) 200 { 201 return IWICBitmapFrameEncode_SetSize(iface, uiWidth, uiHeight); 202 } 203 204 HRESULT WINAPI IWICBitmapFrameEncode_SetResolution_Proxy_W(IWICBitmapFrameEncode *iface, 205 double dpiX, double dpiY) 206 { 207 return IWICBitmapFrameEncode_SetResolution(iface, dpiX, dpiY); 208 } 209 210 HRESULT WINAPI IWICBitmapFrameEncode_SetColorContexts_Proxy_W(IWICBitmapFrameEncode *iface, 211 UINT cCount, IWICColorContext **ppIColorContext) 212 { 213 return IWICBitmapFrameEncode_SetColorContexts(iface, cCount, ppIColorContext); 214 } 215 216 HRESULT WINAPI IWICBitmapFrameEncode_SetThumbnail_Proxy_W(IWICBitmapFrameEncode *iface, 217 IWICBitmapSource *pIThumbnail) 218 { 219 return IWICBitmapFrameEncode_SetThumbnail(iface, pIThumbnail); 220 } 221 222 HRESULT WINAPI IWICBitmapFrameEncode_WriteSource_Proxy_W(IWICBitmapFrameEncode *iface, 223 IWICBitmapSource *pIBitmapSource, WICRect *prc) 224 { 225 if (prc && (prc->Width <= 0 || prc->Height <= 0)) 226 prc = NULL; 227 228 return IWICBitmapFrameEncode_WriteSource(iface, pIBitmapSource, prc); 229 } 230 231 HRESULT WINAPI IWICBitmapFrameEncode_Commit_Proxy_W(IWICBitmapFrameEncode *iface) 232 { 233 return IWICBitmapFrameEncode_Commit(iface); 234 } 235 236 HRESULT WINAPI IWICBitmapFrameEncode_GetMetadataQueryWriter_Proxy_W(IWICBitmapFrameEncode *iface, 237 IWICMetadataQueryWriter **ppIMetadataQueryWriter) 238 { 239 return IWICBitmapFrameEncode_GetMetadataQueryWriter(iface, ppIMetadataQueryWriter); 240 } 241 242 HRESULT WINAPI IWICBitmapLock_GetDataPointer_Proxy_W(IWICBitmapLock *iface, 243 UINT *pcbBufferSize, BYTE **ppbData) 244 { 245 return IWICBitmapLock_GetDataPointer(iface, pcbBufferSize, ppbData); 246 } 247 248 HRESULT WINAPI IWICBitmapLock_GetStride_Proxy_W(IWICBitmapLock *iface, 249 UINT *pcbStride) 250 { 251 return IWICBitmapLock_GetStride(iface, pcbStride); 252 } 253 254 HRESULT WINAPI IWICBitmapScaler_Initialize_Proxy_W(IWICBitmapScaler *iface, 255 IWICBitmapSource *pISource, UINT uiWidth, UINT uiHeight, WICBitmapInterpolationMode mode) 256 { 257 return IWICBitmapScaler_Initialize(iface, pISource, uiWidth, uiHeight, mode); 258 } 259 260 HRESULT WINAPI IWICBitmapSource_GetSize_Proxy_W(IWICBitmapSource *iface, 261 UINT *puiWidth, UINT *puiHeight) 262 { 263 return IWICBitmapSource_GetSize(iface, puiWidth, puiHeight); 264 } 265 266 HRESULT WINAPI IWICBitmapSource_GetPixelFormat_Proxy_W(IWICBitmapSource *iface, 267 WICPixelFormatGUID *pPixelFormat) 268 { 269 return IWICBitmapSource_GetPixelFormat(iface, pPixelFormat); 270 } 271 272 HRESULT WINAPI IWICBitmapSource_GetResolution_Proxy_W(IWICBitmapSource *iface, 273 double *pDpiX, double *pDpiY) 274 { 275 return IWICBitmapSource_GetResolution(iface, pDpiX, pDpiY); 276 } 277 278 HRESULT WINAPI IWICBitmapSource_CopyPalette_Proxy_W(IWICBitmapSource *iface, 279 IWICPalette *pIPalette) 280 { 281 return IWICBitmapSource_CopyPalette(iface, pIPalette); 282 } 283 284 HRESULT WINAPI IWICBitmapSource_CopyPixels_Proxy_W(IWICBitmapSource *iface, 285 const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) 286 { 287 return IWICBitmapSource_CopyPixels(iface, prc, cbStride, cbBufferSize, pbBuffer); 288 } 289 290 HRESULT WINAPI IWICBitmap_Lock_Proxy_W(IWICBitmap *iface, 291 const WICRect *prcLock, DWORD flags, IWICBitmapLock **ppILock) 292 { 293 return IWICBitmap_Lock(iface, prcLock, flags, ppILock); 294 } 295 296 HRESULT WINAPI IWICBitmap_SetPalette_Proxy_W(IWICBitmap *iface, 297 IWICPalette *pIPalette) 298 { 299 return IWICBitmap_SetPalette(iface, pIPalette); 300 } 301 302 HRESULT WINAPI IWICBitmap_SetResolution_Proxy_W(IWICBitmap *iface, 303 double dpiX, double dpiY) 304 { 305 return IWICBitmap_SetResolution(iface, dpiX, dpiY); 306 } 307 308 HRESULT WINAPI IWICColorContext_InitializeFromMemory_Proxy_W(IWICColorContext *iface, 309 const BYTE *pbBuffer, UINT cbBufferSize) 310 { 311 return IWICColorContext_InitializeFromMemory(iface, pbBuffer, cbBufferSize); 312 } 313 314 HRESULT WINAPI IWICComponentFactory_CreateMetadataWriterFromReader_Proxy_W(IWICComponentFactory *iface, 315 IWICMetadataReader *pIReader, const GUID *pguidVendor, IWICMetadataWriter **ppIWriter) 316 { 317 return IWICComponentFactory_CreateMetadataWriterFromReader(iface, pIReader, pguidVendor, ppIWriter); 318 } 319 320 HRESULT WINAPI IWICComponentFactory_CreateQueryWriterFromBlockWriter_Proxy_W(IWICComponentFactory *iface, 321 IWICMetadataBlockWriter *pIBlockWriter, IWICMetadataQueryWriter **ppIQueryWriter) 322 { 323 return IWICComponentFactory_CreateQueryWriterFromBlockWriter(iface, pIBlockWriter, ppIQueryWriter); 324 } 325 326 HRESULT WINAPI IWICComponentInfo_GetCLSID_Proxy_W(IWICComponentInfo *iface, 327 CLSID *pclsid) 328 { 329 return IWICComponentInfo_GetCLSID(iface, pclsid); 330 } 331 332 HRESULT WINAPI IWICComponentInfo_GetAuthor_Proxy_W(IWICComponentInfo *iface, 333 UINT cchAuthor, WCHAR *wzAuthor, UINT *pcchActual) 334 { 335 return IWICComponentInfo_GetAuthor(iface, cchAuthor, wzAuthor, pcchActual); 336 } 337 338 HRESULT WINAPI IWICComponentInfo_GetVersion_Proxy_W(IWICComponentInfo *iface, 339 UINT cchVersion, WCHAR *wzVersion, UINT *pcchActual) 340 { 341 return IWICComponentInfo_GetVersion(iface, cchVersion, wzVersion, pcchActual); 342 } 343 344 HRESULT WINAPI IWICComponentInfo_GetSpecVersion_Proxy_W(IWICComponentInfo *iface, 345 UINT cchSpecVersion, WCHAR *wzSpecVersion, UINT *pcchActual) 346 { 347 return IWICComponentInfo_GetSpecVersion(iface, cchSpecVersion, wzSpecVersion, pcchActual); 348 } 349 350 HRESULT WINAPI IWICComponentInfo_GetFriendlyName_Proxy_W(IWICComponentInfo *iface, 351 UINT cchFriendlyName, WCHAR *wzFriendlyName, UINT *pcchActual) 352 { 353 return IWICComponentInfo_GetFriendlyName(iface, cchFriendlyName, wzFriendlyName, pcchActual); 354 } 355 356 HRESULT WINAPI IWICFastMetadataEncoder_Commit_Proxy_W(IWICFastMetadataEncoder *iface) 357 { 358 return IWICFastMetadataEncoder_Commit(iface); 359 } 360 361 HRESULT WINAPI IWICFastMetadataEncoder_GetMetadataQueryWriter_Proxy_W(IWICFastMetadataEncoder *iface, 362 IWICMetadataQueryWriter **ppIMetadataQueryWriter) 363 { 364 return IWICFastMetadataEncoder_GetMetadataQueryWriter(iface, ppIMetadataQueryWriter); 365 } 366 367 HRESULT WINAPI IWICBitmapFrameDecode_GetMetadataQueryReader_Proxy_W(IWICBitmapFrameDecode *iface, 368 IWICMetadataQueryReader **ppIMetadataQueryReader) 369 { 370 return IWICBitmapFrameDecode_GetMetadataQueryReader(iface, ppIMetadataQueryReader); 371 } 372 373 HRESULT WINAPI IWICBitmapFrameDecode_GetColorContexts_Proxy_W(IWICBitmapFrameDecode *iface, 374 UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount) 375 { 376 return IWICBitmapFrameDecode_GetColorContexts(iface, cCount, ppIColorContexts, pcActualCount); 377 } 378 379 HRESULT WINAPI IWICBitmapFrameDecode_GetThumbnail_Proxy_W(IWICBitmapFrameDecode *iface, 380 IWICBitmapSource **ppIThumbnail) 381 { 382 return IWICBitmapFrameDecode_GetThumbnail(iface, ppIThumbnail); 383 } 384 385 HRESULT WINAPI IWICFormatConverter_Initialize_Proxy_W(IWICFormatConverter *iface, 386 IWICBitmapSource *pISource, REFWICPixelFormatGUID dstFormat, WICBitmapDitherType dither, 387 IWICPalette *pIPalette, double alphaThresholdPercent, WICBitmapPaletteType paletteTranslate) 388 { 389 return IWICFormatConverter_Initialize(iface, pISource, dstFormat, dither, 390 pIPalette, alphaThresholdPercent, paletteTranslate); 391 } 392 393 HRESULT WINAPI IWICImagingFactory_CreateBitmapClipper_Proxy_W(IWICImagingFactory *pFactory, 394 IWICBitmapClipper **ppIBitmapClipper) 395 { 396 return IWICImagingFactory_CreateBitmapClipper(pFactory, ppIBitmapClipper); 397 } 398 399 HRESULT WINAPI IWICImagingFactory_CreateBitmapFlipRotator_Proxy_W(IWICImagingFactory *pFactory, 400 IWICBitmapFlipRotator **ppIBitmapFlipRotator) 401 { 402 return IWICImagingFactory_CreateBitmapFlipRotator(pFactory, ppIBitmapFlipRotator); 403 } 404 405 HRESULT WINAPI IWICImagingFactory_CreateBitmapFromHBITMAP_Proxy_W(IWICImagingFactory *pFactory, 406 HBITMAP hBitmap, HPALETTE hPalette, WICBitmapAlphaChannelOption options, IWICBitmap **ppIBitmap) 407 { 408 return IWICImagingFactory_CreateBitmapFromHBITMAP(pFactory, hBitmap, hPalette, options, ppIBitmap); 409 } 410 411 HRESULT WINAPI IWICImagingFactory_CreateBitmapFromHICON_Proxy_W(IWICImagingFactory *pFactory, 412 HICON hIcon, IWICBitmap **ppIBitmap) 413 { 414 return IWICImagingFactory_CreateBitmapFromHICON(pFactory, hIcon, ppIBitmap); 415 } 416 417 HRESULT WINAPI IWICImagingFactory_CreateBitmapFromMemory_Proxy_W(IWICImagingFactory *pFactory, 418 UINT uiWidth, UINT uiHeight, REFWICPixelFormatGUID pixelFormat, UINT cbStride, 419 UINT cbBufferSize, BYTE *pbBuffer, IWICBitmap **ppIBitmap) 420 { 421 return IWICImagingFactory_CreateBitmapFromMemory(pFactory, uiWidth, uiHeight, 422 pixelFormat, cbStride, cbBufferSize, pbBuffer, ppIBitmap); 423 } 424 425 HRESULT WINAPI IWICImagingFactory_CreateBitmapFromSource_Proxy_W(IWICImagingFactory *pFactory, 426 IWICBitmapSource *piBitmapSource, WICBitmapCreateCacheOption option, IWICBitmap **ppIBitmap) 427 { 428 return IWICImagingFactory_CreateBitmapFromSource(pFactory, piBitmapSource, option, ppIBitmap); 429 } 430 431 HRESULT WINAPI IWICImagingFactory_CreateBitmapScaler_Proxy_W(IWICImagingFactory *pFactory, 432 IWICBitmapScaler **ppIBitmapScaler) 433 { 434 return IWICImagingFactory_CreateBitmapScaler(pFactory, ppIBitmapScaler); 435 } 436 437 HRESULT WINAPI IWICImagingFactory_CreateBitmap_Proxy_W(IWICImagingFactory *pFactory, 438 UINT uiWidth, UINT uiHeight, REFWICPixelFormatGUID pixelFormat, 439 WICBitmapCreateCacheOption option, IWICBitmap **ppIBitmap) 440 { 441 return IWICImagingFactory_CreateBitmap(pFactory, uiWidth, uiHeight, 442 pixelFormat, option, ppIBitmap); 443 } 444 445 HRESULT WINAPI IWICImagingFactory_CreateComponentInfo_Proxy_W(IWICImagingFactory *pFactory, 446 REFCLSID clsidComponent, IWICComponentInfo **ppIInfo) 447 { 448 return IWICImagingFactory_CreateComponentInfo(pFactory, clsidComponent, ppIInfo); 449 } 450 451 HRESULT WINAPI IWICImagingFactory_CreateDecoderFromFileHandle_Proxy_W(IWICImagingFactory *pFactory, 452 ULONG_PTR hFile, const GUID *pguidVendor, WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder) 453 { 454 return IWICImagingFactory_CreateDecoderFromFileHandle(pFactory, hFile, pguidVendor, metadataOptions, ppIDecoder); 455 } 456 457 HRESULT WINAPI IWICImagingFactory_CreateDecoderFromFilename_Proxy_W(IWICImagingFactory *pFactory, 458 LPCWSTR wzFilename, const GUID *pguidVendor, DWORD dwDesiredAccess, 459 WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder) 460 { 461 return IWICImagingFactory_CreateDecoderFromFilename(pFactory, wzFilename, 462 pguidVendor, dwDesiredAccess, metadataOptions, ppIDecoder); 463 } 464 465 HRESULT WINAPI IWICImagingFactory_CreateDecoderFromStream_Proxy_W(IWICImagingFactory *pFactory, 466 IStream *pIStream, const GUID *pguidVendor, 467 WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder) 468 { 469 return IWICImagingFactory_CreateDecoderFromStream(pFactory, pIStream, pguidVendor, metadataOptions, ppIDecoder); 470 } 471 472 HRESULT WINAPI IWICImagingFactory_CreateEncoder_Proxy_W(IWICImagingFactory *pFactory, 473 REFGUID guidContainerFormat, const GUID *pguidVendor, IWICBitmapEncoder **ppIEncoder) 474 { 475 return IWICImagingFactory_CreateEncoder(pFactory, guidContainerFormat, pguidVendor, ppIEncoder); 476 } 477 478 HRESULT WINAPI IWICImagingFactory_CreateFastMetadataEncoderFromDecoder_Proxy_W(IWICImagingFactory *pFactory, 479 IWICBitmapDecoder *pIDecoder, IWICFastMetadataEncoder **ppIFastEncoder) 480 { 481 return IWICImagingFactory_CreateFastMetadataEncoderFromDecoder(pFactory, pIDecoder, ppIFastEncoder); 482 } 483 484 HRESULT WINAPI IWICImagingFactory_CreateFastMetadataEncoderFromFrameDecode_Proxy_W(IWICImagingFactory *pFactory, 485 IWICBitmapFrameDecode *pIFrameDecoder, IWICFastMetadataEncoder **ppIFastEncoder) 486 { 487 return IWICImagingFactory_CreateFastMetadataEncoderFromFrameDecode(pFactory, pIFrameDecoder, ppIFastEncoder); 488 } 489 490 HRESULT WINAPI IWICImagingFactory_CreateFormatConverter_Proxy_W(IWICImagingFactory *pFactory, 491 IWICFormatConverter **ppIFormatConverter) 492 { 493 return IWICImagingFactory_CreateFormatConverter(pFactory, ppIFormatConverter); 494 } 495 496 HRESULT WINAPI IWICImagingFactory_CreatePalette_Proxy_W(IWICImagingFactory *pFactory, 497 IWICPalette **ppIPalette) 498 { 499 return IWICImagingFactory_CreatePalette(pFactory, ppIPalette); 500 } 501 502 HRESULT WINAPI IWICImagingFactory_CreateQueryWriterFromReader_Proxy_W(IWICImagingFactory *pFactory, 503 IWICMetadataQueryReader *pIQueryReader, const GUID *pguidVendor, 504 IWICMetadataQueryWriter **ppIQueryWriter) 505 { 506 return IWICImagingFactory_CreateQueryWriterFromReader(pFactory, pIQueryReader, pguidVendor, ppIQueryWriter); 507 } 508 509 HRESULT WINAPI IWICImagingFactory_CreateQueryWriter_Proxy_W(IWICImagingFactory *pFactory, 510 REFGUID guidMetadataFormat, const GUID *pguidVendor, IWICMetadataQueryWriter **ppIQueryWriter) 511 { 512 return IWICImagingFactory_CreateQueryWriter(pFactory, guidMetadataFormat, pguidVendor, ppIQueryWriter); 513 } 514 515 HRESULT WINAPI IWICImagingFactory_CreateStream_Proxy_W(IWICImagingFactory *pFactory, 516 IWICStream **ppIWICStream) 517 { 518 return IWICImagingFactory_CreateStream(pFactory, ppIWICStream); 519 } 520 521 HRESULT WINAPI IWICMetadataBlockReader_GetCount_Proxy_W(IWICMetadataBlockReader *iface, 522 UINT *pcCount) 523 { 524 return IWICMetadataBlockReader_GetCount(iface, pcCount); 525 } 526 527 HRESULT WINAPI IWICMetadataBlockReader_GetReaderByIndex_Proxy_W(IWICMetadataBlockReader *iface, 528 UINT nIndex, IWICMetadataReader **ppIMetadataReader) 529 { 530 return IWICMetadataBlockReader_GetReaderByIndex(iface, nIndex, ppIMetadataReader); 531 } 532 533 HRESULT WINAPI IWICMetadataQueryReader_GetContainerFormat_Proxy_W(IWICMetadataQueryReader *iface, 534 GUID *pguidContainerFormat) 535 { 536 return IWICMetadataQueryReader_GetContainerFormat(iface, pguidContainerFormat); 537 } 538 539 HRESULT WINAPI IWICMetadataQueryReader_GetLocation_Proxy_W(IWICMetadataQueryReader *iface, 540 UINT cchMaxLength, WCHAR *wzNamespace, UINT *pcchActualLength) 541 { 542 return IWICMetadataQueryReader_GetLocation(iface, cchMaxLength, wzNamespace, pcchActualLength); 543 } 544 545 HRESULT WINAPI IWICMetadataQueryReader_GetMetadataByName_Proxy_W(IWICMetadataQueryReader *iface, 546 LPCWSTR wzName, PROPVARIANT *pvarValue) 547 { 548 return IWICMetadataQueryReader_GetMetadataByName(iface, wzName, pvarValue); 549 } 550 551 HRESULT WINAPI IWICMetadataQueryReader_GetEnumerator_Proxy_W(IWICMetadataQueryReader *iface, 552 IEnumString **ppIEnumString) 553 { 554 return IWICMetadataQueryReader_GetEnumerator(iface, ppIEnumString); 555 } 556 557 HRESULT WINAPI IWICMetadataQueryWriter_SetMetadataByName_Proxy_W(IWICMetadataQueryWriter *iface, 558 LPCWSTR wzName, const PROPVARIANT *pvarValue) 559 { 560 return IWICMetadataQueryWriter_SetMetadataByName(iface, wzName, pvarValue); 561 } 562 563 HRESULT WINAPI IWICMetadataQueryWriter_RemoveMetadataByName_Proxy_W(IWICMetadataQueryWriter *iface, 564 LPCWSTR wzName) 565 { 566 return IWICMetadataQueryWriter_RemoveMetadataByName(iface, wzName); 567 } 568 569 HRESULT WINAPI IWICPalette_InitializePredefined_Proxy_W(IWICPalette *iface, 570 WICBitmapPaletteType ePaletteType, BOOL fAddTransparentColor) 571 { 572 return IWICPalette_InitializePredefined(iface, ePaletteType, fAddTransparentColor); 573 } 574 575 HRESULT WINAPI IWICPalette_InitializeCustom_Proxy_W(IWICPalette *iface, 576 WICColor *pColors, UINT colorCount) 577 { 578 return IWICPalette_InitializeCustom(iface, pColors, colorCount); 579 } 580 581 HRESULT WINAPI IWICPalette_InitializeFromBitmap_Proxy_W(IWICPalette *iface, 582 IWICBitmapSource *pISurface, UINT colorCount, BOOL fAddTransparentColor) 583 { 584 return IWICPalette_InitializeFromBitmap(iface, pISurface, colorCount, fAddTransparentColor); 585 } 586 587 HRESULT WINAPI IWICPalette_InitializeFromPalette_Proxy_W(IWICPalette *iface, 588 IWICPalette *pIPalette) 589 { 590 return IWICPalette_InitializeFromPalette(iface, pIPalette); 591 } 592 593 HRESULT WINAPI IWICPalette_GetType_Proxy_W(IWICPalette *iface, 594 WICBitmapPaletteType *pePaletteType) 595 { 596 return IWICPalette_GetType(iface, pePaletteType); 597 } 598 599 HRESULT WINAPI IWICPalette_GetColorCount_Proxy_W(IWICPalette *iface, 600 UINT *pcCount) 601 { 602 return IWICPalette_GetColorCount(iface, pcCount); 603 } 604 605 HRESULT WINAPI IWICPalette_GetColors_Proxy_W(IWICPalette *iface, 606 UINT colorCount, WICColor *pColors, UINT *pcActualColors) 607 { 608 return IWICPalette_GetColors(iface, colorCount, pColors, pcActualColors); 609 } 610 611 HRESULT WINAPI IWICPalette_HasAlpha_Proxy_W(IWICPalette *iface, 612 BOOL *pfHasAlpha) 613 { 614 return IWICPalette_HasAlpha(iface, pfHasAlpha); 615 } 616 617 HRESULT WINAPI IWICStream_InitializeFromIStream_Proxy_W(IWICStream *iface, 618 IStream *pIStream) 619 { 620 return IWICStream_InitializeFromIStream(iface, pIStream); 621 } 622 623 HRESULT WINAPI IWICStream_InitializeFromMemory_Proxy_W(IWICStream *iface, 624 BYTE *pbBuffer, DWORD cbBufferSize) 625 { 626 return IWICStream_InitializeFromMemory(iface, pbBuffer, cbBufferSize); 627 } 628 629 HRESULT WINAPI WICCreateColorContext_Proxy(IWICImagingFactory *iface, IWICColorContext **ppIWICColorContext) 630 { 631 TRACE("%p, %p\n", iface, ppIWICColorContext); 632 633 return IWICImagingFactory_CreateColorContext(iface, ppIWICColorContext); 634 } 635 636 HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT SDKVersion, IWICImagingFactory **ppIImagingFactory) 637 { 638 TRACE("%x, %p\n", SDKVersion, ppIImagingFactory); 639 640 return ComponentFactory_CreateInstance(&IID_IWICImagingFactory, (void**)ppIImagingFactory); 641 } 642 643 HRESULT WINAPI WICSetEncoderFormat_Proxy(IWICBitmapSource *pSourceIn, 644 IWICPalette *pIPalette, IWICBitmapFrameEncode *pIFrameEncode, 645 IWICBitmapSource **ppSourceOut) 646 { 647 HRESULT hr; 648 WICPixelFormatGUID pixelformat, framepixelformat; 649 650 TRACE("%p,%p,%p,%p\n", pSourceIn, pIPalette, pIFrameEncode, ppSourceOut); 651 652 if (pIPalette) FIXME("ignoring palette\n"); 653 654 if (!pSourceIn || !pIFrameEncode || !ppSourceOut) 655 return E_INVALIDARG; 656 657 *ppSourceOut = NULL; 658 659 hr = IWICBitmapSource_GetPixelFormat(pSourceIn, &pixelformat); 660 661 if (SUCCEEDED(hr)) 662 { 663 framepixelformat = pixelformat; 664 hr = IWICBitmapFrameEncode_SetPixelFormat(pIFrameEncode, &framepixelformat); 665 } 666 667 if (SUCCEEDED(hr)) 668 { 669 if (IsEqualGUID(&pixelformat, &framepixelformat)) 670 { 671 *ppSourceOut = pSourceIn; 672 IWICBitmapSource_AddRef(pSourceIn); 673 } 674 else 675 { 676 hr = WICConvertBitmapSource(&framepixelformat, pSourceIn, ppSourceOut); 677 } 678 } 679 680 return hr; 681 } 682