Changeset 257
Author: alax
(2011/04/25 21:56) About 1 year ago
added /o switch for ICOpen/ICGetInfo data, /c to show compressor choice UI
Author: alax
(2011/04/25 21:56) About 1 year ago
added /o switch for ICOpen/ICGetInfo data, /c to show compressor choice UI
{{sText.Append(_T(" |"));sText.Append(_T(" | "));sText.AppendFormat(_T("0x%x"), nValue & ~nNamedValue);sText.AppendFormat(_T("0x%x"), nValue & ~nNamedValue);VOID Print(const ICINFO& Information, LPCTSTR pszName, LPCTSTR pszPrefix = _T("")){_T("%s") _T("%s: szName %ls\n")_T("%s") _T(" fccType %s, fccHandler %s\n")_T("%s") _T(" dwFlags %s\n")_T("%s") _T(" dwVersion 0x%x, dwVersionICM 0x%x\n")_T("%s") _T(" szDescription \"%ls\"\n")_T("%s") _T(" szDriver \"%ls\"\n"){{{{{if(_tcschr(_T("-/"), sArgument[0])){if(sArgument.CompareNoCase(_T("o")) == 0){if(sArgument.CompareNoCase(_T("c")) == 0){{{_tprintf(Print(Information, _T("ICInfo"));_T("szName %ls\n")#pragma endregion_T(" fccType: %s, fccHandler %s\n")#pragma region ICOpen_T(" dwFlags %s\n")if(!bOpen)_T(" dwVersion 0x%x, dwVersionICM 0x%x\n")continue;_T(" szDescription \"%ls\"\n")static const struct_T(" szDriver \"%ls\"\n"){,UINT nMode;(LPCWSTR) Information.szName,LPCTSTR pszName;StringFromFourcc(Information.fccType), StringFromFourcc(Information.fccHandler),} g_pModes[] =StringFromFlags(Information.dwFlags),{Information.dwVersion, Information.dwVersionICM,{ ICMODE_COMPRESS, _T("ICMODE_COMPRESS") },(LPCWSTR) Information.szDescription,{ ICMODE_DECOMPRESS, _T("ICMODE_DECOMPRESS") },(LPCWSTR) Information.szDriver,{ ICMODE_FASTDECOMPRESS, _T("ICMODE_FASTDECOMPRESS") },0);{ ICMODE_QUERY, _T("ICMODE_QUERY") },{ ICMODE_FASTCOMPRESS, _T("ICMODE_FASTCOMPRESS") },};for(SIZE_T nIndex = 0; nIndex < DIM(g_pModes); nIndex++){HIC hImageCompressor = ICOpen(Information.fccType, Information.fccHandler, g_pModes[nIndex].nMode);if(!hImageCompressor)continue;_tprintf(_T(" ") _T("ICOpen: wMode %s (%d)\n"), g_pModes[nIndex].pszName, g_pModes[nIndex].nMode);#pragma region ICGetInfoICINFO Information;ZeroMemory(&Information, sizeof Information);Information.dwSize = sizeof Information;if(ICGetInfo(hImageCompressor, &Information, sizeof Information))Print(Information, _T("ICGetInfo"), _T(" "));#pragma endregion_W(ICClose(hImageCompressor) == ICERR_OK);}#pragma endregion{{{