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
) DECLSPEC_HIDDEN
;
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 WINAPI
DllCanUnloadNow(void)
59 HRESULT
get_pixelformat_bpp(const GUID
*pixelformat
, UINT
*bpp
)
62 IWICComponentInfo
*info
;
63 IWICPixelFormatInfo
*formatinfo
;
65 hr
= CreateComponentInfo(pixelformat
, &info
);
68 hr
= IWICComponentInfo_QueryInterface(info
, &IID_IWICPixelFormatInfo
, (void**)&formatinfo
);
72 hr
= IWICPixelFormatInfo_GetBitsPerPixel(formatinfo
, bpp
);
74 IWICPixelFormatInfo_Release(formatinfo
);
77 IWICComponentInfo_Release(info
);
83 HRESULT
TiffDecoder_CreateInstance(REFIID iid
, void** ppv
)
86 struct decoder
*decoder
;
87 struct decoder_info decoder_info
;
89 hr
= get_unix_decoder(&CLSID_WICTiffDecoder
, &decoder_info
, &decoder
);
92 hr
= CommonDecoder_CreateInstance(decoder
, &decoder_info
, iid
, ppv
);
97 HRESULT
TiffEncoder_CreateInstance(REFIID iid
, void** ppv
)
100 struct encoder
*encoder
;
101 struct encoder_info encoder_info
;
103 hr
= get_unix_encoder(&CLSID_WICTiffEncoder
, &encoder_info
, &encoder
);
106 hr
= CommonEncoder_CreateInstance(encoder
, &encoder_info
, iid
, ppv
);
111 HRESULT
JpegDecoder_CreateInstance(REFIID iid
, void** ppv
)
114 struct decoder
*decoder
;
115 struct decoder_info decoder_info
;
117 hr
= get_unix_decoder(&CLSID_WICJpegDecoder
, &decoder_info
, &decoder
);
120 hr
= CommonDecoder_CreateInstance(decoder
, &decoder_info
, iid
, ppv
);
125 HRESULT
JpegEncoder_CreateInstance(REFIID iid
, void** ppv
)
128 struct encoder
*encoder
;
129 struct encoder_info encoder_info
;
131 hr
= get_unix_encoder(&CLSID_WICJpegEncoder
, &encoder_info
, &encoder
);
134 hr
= CommonEncoder_CreateInstance(encoder
, &encoder_info
, iid
, ppv
);
139 HRESULT
IcnsEncoder_CreateInstance(REFIID iid
, void** ppv
)
142 struct encoder
*encoder
;
143 struct encoder_info encoder_info
;
145 hr
= get_unix_encoder(&CLSID_WICIcnsEncoder
, &encoder_info
, &encoder
);
148 hr
= CommonEncoder_CreateInstance(encoder
, &encoder_info
, iid
, ppv
);