2 * Copyright 2009 Vincent Povirk for CodeWeavers
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.
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.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include "wincodecs_private.h"
31 #include "wine/debug.h"
33 extern BOOL WINAPI
WIC_DllMain(HINSTANCE
, DWORD
, LPVOID
);
35 HMODULE windowscodecs_module
= 0;
37 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
42 case DLL_PROCESS_ATTACH
:
43 DisableThreadLibraryCalls(hinstDLL
);
44 windowscodecs_module
= hinstDLL
;
46 case DLL_PROCESS_DETACH
:
47 ReleaseComponentInfos();
51 return WIC_DllMain(hinstDLL
, fdwReason
, lpvReserved
);
54 HRESULT
get_pixelformat_bpp(const GUID
*pixelformat
, UINT
*bpp
)
57 IWICComponentInfo
*info
;
58 IWICPixelFormatInfo
*formatinfo
;
60 hr
= CreateComponentInfo(pixelformat
, &info
);
63 hr
= IWICComponentInfo_QueryInterface(info
, &IID_IWICPixelFormatInfo
, (void**)&formatinfo
);
67 hr
= IWICPixelFormatInfo_GetBitsPerPixel(formatinfo
, bpp
);
69 IWICPixelFormatInfo_Release(formatinfo
);
72 IWICComponentInfo_Release(info
);
78 HRESULT
TiffDecoder_CreateInstance(REFIID iid
, void** ppv
)
81 struct decoder
*decoder
;
82 struct decoder_info decoder_info
;
84 hr
= tiff_decoder_create(&decoder_info
, &decoder
);
87 hr
= CommonDecoder_CreateInstance(decoder
, &decoder_info
, iid
, ppv
);
92 HRESULT
TiffEncoder_CreateInstance(REFIID iid
, void** ppv
)
95 struct encoder
*encoder
;
96 struct encoder_info encoder_info
;
98 hr
= tiff_encoder_create(&encoder_info
, &encoder
);
101 hr
= CommonEncoder_CreateInstance(encoder
, &encoder_info
, iid
, ppv
);
106 HRESULT
JpegDecoder_CreateInstance(REFIID iid
, void** ppv
)
109 struct decoder
*decoder
;
110 struct decoder_info decoder_info
;
112 hr
= jpeg_decoder_create(&decoder_info
, &decoder
);
115 hr
= CommonDecoder_CreateInstance(decoder
, &decoder_info
, iid
, ppv
);
120 HRESULT
JpegEncoder_CreateInstance(REFIID iid
, void** ppv
)
123 struct encoder
*encoder
;
124 struct encoder_info encoder_info
;
126 hr
= jpeg_encoder_create(&encoder_info
, &encoder
);
129 hr
= CommonEncoder_CreateInstance(encoder
, &encoder_info
, iid
, ppv
);