// ==========================================================// FreeImage 3 Test Script//// Design and implementation by// - Herv Drolon (drolon@infonie.fr)//// This file is part of FreeImage 3//// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER// THIS DISCLAIMER.//// Use at your own risk!// ==========================================================#include "TestSuite.h"// ----------------------------------------------------------/**FreeImage error handler@param fif Format / Plugin responsible for the error@param message Error message*/void FreeImageErrorHandler(FREE_IMAGE_FORMAT fif, const char *message) {printf("\n*** ");if(fif != FIF_UNKNOWN) {printf("%s Format\n", FreeImage_GetFormatFromFIF(fif));}printf("%s", message);printf(" ***\n");}// ----------------------------------------------------------int main(int argc, char *argv[]) {unsigned width = 512;unsigned height = 512;#if defined(_DEBUG) && defined(WIN32)// check for memory leaks at program exit (after the 'return 0')// through a call to _CrtDumpMemoryLeaks// note that in debug mode, objects allocated with the new operator// may be destroyed *after* the end of the main function.// OpenEXR// note that OpenEXR produce so called "false memory leaks"// see http://lists.nongnu.org/archive/html/openexr-devel/2013-11/msg00000.html_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF);#endif#if defined(FREEIMAGE_LIB) || !defined(WIN32)FreeImage_Initialise();#endif// initialize our own FreeImage error handlerFreeImage_SetOutputMessage(FreeImageErrorHandler);// test plugins capabilitiesshowPlugins();// test the clone functiontestAllocateCloneUnload("exif.jpg");// test internal image typestestImageType(width, height);// test loading / saving / converting image types using the TIFF plugintestImageTypeTIFF(width, height);// test memory IOtestMemIO("sample.png");testMemIO("exif.jxr");// test multipage functionstestMultiPage("sample.png");// test multipage streamingtestStreamMultiPage("sample.tif");// test multipage streaming with memory IOtestMultiPageMemory("sample.tif");// test JPEG lossless transform & croppingtestJPEG();// test get/set channeltestImageChannels(width, height);// test loading header onlytestHeaderOnly();// test Exif raw metadata loading & savingtestExifRaw();// test thumbnail functionstestThumbnail("exif.jpg", 0);// test wrapped user buffertestWrappedBuffer("exif.jpg", 0);// test viewstestCreateView("exif.jpg", 0);#if defined(FREEIMAGE_LIB) || !defined(WIN32)FreeImage_DeInitialise();#endifreturn 0;}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。