• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FreeImage_DeInitialise函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FreeImage_DeInitialise函数的典型用法代码示例。如果您正苦于以下问题:C++ FreeImage_DeInitialise函数的具体用法?C++ FreeImage_DeInitialise怎么用?C++ FreeImage_DeInitialise使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了FreeImage_DeInitialise函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: FreeImage_DeInitialise

TextureManager::~TextureManager() {
// call this ONLY when linking with FreeImage as a static library
#ifdef FREEIMAGE_LIB
  FreeImage_DeInitialise();
#endif

  UnloadAllTextures();
  m_inst = 0;
}
开发者ID:dooglz,项目名称:Celestial-Drift,代码行数:9,代码来源:TextureManager.cpp


示例2: main

int main(int argc, char** argv) 
{
	DLL_API void DLL_CALLCONV FreeImage_Initialise(BOOL load_local_plugins_only FI_DEFAULT(FALSE));
	for(int i = 1; i < argc; i++)
	{
		fileRead(argv[i]);
	}
	FreeImage_DeInitialise();
	return 0;
};
开发者ID:cfvalente,项目名称:radiance_interpolation,代码行数:10,代码来源:main.cpp


示例3: main

int 
main(int argc, char *argv[]) {
	
	// call this ONLY when linking with FreeImage as a static library
#ifdef FREEIMAGE_LIB
	FreeImage_Initialise();
#endif // FREEIMAGE_LIB

	// initialize your own FreeImage error handler

	FreeImage_SetOutputMessage(FreeImageErrorHandler);

	// print version & copyright infos

	printf("FreeImage version : %s", FreeImage_GetVersion());
	printf("\n");
	printf(FreeImage_GetCopyrightMessage());
	printf("\n");


	if(argc != 3) {
		printf("Usage : CreateAlpha <input file name> <output file name>\n");
		return 0;
	}

	// Load the source image
	FIBITMAP *src = GenericLoader(argv[1], 0);
	if(src) {
		// Create a transparent image from the lightness image of src
		FIBITMAP *dst = CreateAlphaFromLightness(src);

		if(dst) {
			// Save the destination image
			bool bSuccess = GenericWriter(dst, argv[2], 0);
			if(!bSuccess) {
				printf("\nUnable to save %s file", argv[2]);
				printf("\nThis format does not support 32-bit images");
			}

			// Free dst
			FreeImage_Unload(dst);
		}

		// Free src
		FreeImage_Unload(src);
	}

	// call this ONLY when linking with FreeImage as a static library
#ifdef FREEIMAGE_LIB
	FreeImage_DeInitialise();
#endif // FREEIMAGE_LIB

	return 0;
}
开发者ID:AIESeattleGameArt,项目名称:Programming_2014,代码行数:54,代码来源:CreateAlpha.cpp


示例4: ofInitFreeImage

//----------------------------------------------------------
// static variable for freeImage initialization:
void ofInitFreeImage(bool deinit=false){
	// need a new bool to avoid c++ "deinitialization order fiasco":
	// http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.15
	static bool	* bFreeImageInited = new bool(false);
	if(!bFreeImageInited && !deinit){
		FreeImage_Initialise();
		*bFreeImageInited = true;
	}
	if(bFreeImageInited && deinit){
		FreeImage_DeInitialise();
	}
}
开发者ID:prettyextreme,项目名称:openFrameworks-0.7,代码行数:14,代码来源:ofImage.cpp


示例5: FreeImage_DeInitialise

	//---------------------------------------------------------------------
	void FreeImageCodec::shutdown(void)
	{
		FreeImage_DeInitialise();

		for (RegisteredCodecList::iterator i = msCodecList.begin();
			i != msCodecList.end(); ++i)
		{
			Codec::unRegisterCodec(*i);
			OGRE_DELETE *i;
		}
		msCodecList.clear();

	}
开发者ID:LiberatorUSA,项目名称:GUCE,代码行数:14,代码来源:OgreFreeImageCodec.cpp


示例6: FreeImage_Unload

/**
 * destructor
 */
fipImage::~fipImage(){
	
	if ( pImageData ){
		FreeImage_Unload( pImageData );
	}
	
	ulImageInstances--;
	if ( ( ulImageInstances == 0 ) && bFreeImageInitialised ){
		FreeImage_DeInitialise();
		bFreeImageInitialised = false;
	}
	
}
开发者ID:BioKom,项目名称:Fib,代码行数:16,代码来源:fipImage.cpp


示例7: main

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. 
	_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF);
#endif

#if defined(FREEIMAGE_LIB) || !defined(WIN32)
	FreeImage_Initialise();
#endif

	// initialize our own FreeImage error handler
	FreeImage_SetOutputMessage(FreeImageErrorHandler);

	// test plugins capabilities
	showPlugins();

	// test the clone function
	testAllocateCloneUnload("exif.jpg");

	// test internal image types
	testImageType(width, height);

	// test loading / saving / converting image types using the TIFF plugin
	testImageTypeTIFF(width, height);

	// test multipage creation
	testBuildMPage("sample.png", "sample.ico", FIF_ICO, 24);
	testBuildMPage("sample.png", "sample.tif", FIF_TIFF, 24);
	//testBuildMPage("sample.png", "sample.gif", FIF_GIF, 8);

	// test multipage cache
	testMPageCache("sample.png");

	// test memory IO
	testMemIO("sample.png");

	// test JPEG lossless transform & cropping
	testJPEG();
	
#if defined(FREEIMAGE_LIB) || !defined(WIN32)
	FreeImage_DeInitialise();
#endif

	return 0;
}
开发者ID:BackupTheBerlios,项目名称:mimplugins-svn,代码行数:51,代码来源:MainTestSuite.cpp


示例8: FreeImage_DeInitialise

App::~App()
{
	m_pluginManager.UnloadAll();

	m_commandLineParser.DisposeCommands();

	for (IdeType* type : m_ides)
	{
		delete type;
	}
	m_ides.clear();
	
	FreeImage_DeInitialise();
}
开发者ID:TLeonardUK,项目名称:MicroBuild,代码行数:14,代码来源:App.cpp


示例9: enet_host_destroy

Client::~Client()
{
    enet_host_destroy(m_client);

    delete m_mainPlayer;

    // call this ONLY when linking with FreeImage as a static library
#ifdef FREEIMAGE_LIB
    FreeImage_DeInitialise();
#endif

    SDL_DestroyWindow(m_window);
    SDL_Quit();
}
开发者ID:EmmetCooper,项目名称:ore-infinium,代码行数:14,代码来源:client.cpp


示例10: AfxEnableControlContainer

BOOL CBigle3DApp::InitInstance()
{
    AfxEnableControlContainer();

    // Standard initialization
    // If you are not using these features and wish to reduce the size
    //  of your final executable, you should remove from the following
    //  the specific initialization routines you do not need.

    // call this ONLY when linking with FreeImage as a static library
    //FreeImage_Initialise();

    // initialize your own FreeImage error handler
    FreeImage_SetOutputMessage(MyMessageFunc);

    CStartPP pp1;
    CFondPP pp2;
    CReliefPP pp3;
    CCreateImgPP pp4;
    CAboutPP pp5;
    pp1.m_psp.dwFlags -= PSP_HASHELP;
    pp2.m_psp.dwFlags -= PSP_HASHELP;
    pp3.m_psp.dwFlags -= PSP_HASHELP;
    pp4.m_psp.dwFlags -= PSP_HASHELP;
    pp5.m_psp.dwFlags -= PSP_HASHELP;
    m_ps.AddPage( &pp1 );
    m_ps.AddPage( &pp2 );
    m_ps.AddPage( &pp3 );
    m_ps.AddPage( &pp4 );
    m_ps.AddPage( &pp5 );
    m_ps.SetWizardMode();
    m_pMainWnd = &m_ps;
    int nResponse = (int)m_ps.DoModal();
    if (nResponse == IDOK)
    {
        // TODO: Place code here to handle when the dialog is
        //  dismissed with OK
    }
    else if (nResponse == IDCANCEL)
    {
        // TODO: Place code here to handle when the dialog is
        //  dismissed with Cancel
    }

    FreeImage_DeInitialise();

    // Since the dialog has been closed, return FALSE so that we exit the
    //  application, rather than start the application's message pump.
    return FALSE;
}
开发者ID:wernight,项目名称:bigle3d,代码行数:50,代码来源:Bigle+3D.cpp


示例11: main

int main() {

#if defined(FREEIMAGE_LIB) || !defined(WIN32)
	FreeImage_Initialise();
#endif

	fipImage img;
	img.load("img.png");
	std::cout << img.getWidth() << "x" << img.getHeight() << std::endl;

#if defined(FREEIMAGE_LIB) || !defined(WIN32)
	FreeImage_DeInitialise();
#endif

	return 0;
}
开发者ID:AleemDev,项目名称:waf,代码行数:16,代码来源:fip.cpp


示例12: vp

void ThinLens::render_scene(World& w) {
	RGBColor L;
	Ray ray;
	ViewPlane vp(w.vp);
	FreeImage_Initialise();
	FIBITMAP* bitmap = FreeImage_Allocate(vp.hres, vp.vres, 24);
	RGBQUAD color;
	int depth = 0;

	Point2D sp;
	Point2D pp;
	Point2D dp;
	Point2D lp;

	vp.s /= zoom;

	for(int r = 0; r < vp.vres; r++)
		for(int c = 0 ; c < vp.hres; c++) {
			L = black;

			for(int n = 0; n < vp.num_samples; n++) {
				sp = vp.sampler_ptr -> sample_unit_square();
				pp.x = vp.s * (c - vp.hres / 2.0 + sp.x);
				pp.y = vp.s * (r - vp.vres / 2.0 + sp.y);

				dp = sampler_ptr -> sample_unit_disk();
				lp = dp * lens_radius;

				ray.o = eye + lp.x * u + lp.y * v;
				ray.d = ray_direction(pp, lp);
				L += w.tracer_ptr -> trace_ray(ray);
			}

			L /= vp.num_samples;
			L *= exposure_time;
			w.display_pixel(r, c, L);
			color.rgbRed = (int)(L.r*255);
			color.rgbGreen = (int)(L.g*255);
			color.rgbBlue = (int)(L.b*255);
			FreeImage_SetPixelColor(bitmap, c, r, &color);
		}
	if (FreeImage_Save(FIF_PNG, bitmap, "test.png", 0))
		std::cout << "Image Successfully Saved!" << std::endl;

	FreeImage_DeInitialise();

}
开发者ID:elendorial,项目名称:RayTracer,代码行数:47,代码来源:ThinLens.cpp


示例13: FreeImage_Initialise

void Scene::saveImage(int t){
    FreeImage_Initialise();
    BYTE* pixels = new BYTE[ 3 * WIDTH * HEIGHT];

    glReadPixels(0, 0, WIDTH, HEIGHT, GL_BGR, GL_UNSIGNED_BYTE, pixels);
    FIBITMAP* image = FreeImage_ConvertFromRawBits(pixels, WIDTH, HEIGHT, 3 * WIDTH, 24, 0x0000FF, 0xFF0000, 0x00FF00, false);
    // get a string to concat with an int
    stringstream nameStream;
    nameStream << "test" << t << ".png";
    string name = nameStream.str();
    char *a = new char[name.size() + 1];
    a[name.size()] = 0;
    memcpy(a, name.c_str(), name.size());
    if(FreeImage_Save(FIF_BMP, image, a, 0))
        cout << "Image " << t << " successfully saved! " << endl ;
    FreeImage_DeInitialise(); //Cleanup !
}
开发者ID:simonc312,项目名称:cs184final,代码行数:17,代码来源:scene.cpp


示例14: DllMain

BOOL APIENTRY
DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
	switch (ul_reason_for_call) {
		case DLL_PROCESS_ATTACH :
			FreeImage_Initialise(FALSE);
			break;

		case DLL_PROCESS_DETACH :
			FreeImage_DeInitialise();
			break;

		case DLL_THREAD_ATTACH :
		case DLL_THREAD_DETACH :
			break;
    }

    return TRUE;
}
开发者ID:barsnadcat,项目名称:steelandconcrete,代码行数:18,代码来源:FreeImage.cpp


示例15: FreeImage_Initialise

void Film::WriteImage(std::string fname){
	/*Before you use FreeImage, call FreeImage_Initialise(). 
	To record the colors for each pixel, use an array of one byte elements. 
	Then convert this array to a FIBITMAP object as follows, assuming the bytes are in RGB order:*/
	FreeImage_Initialise();
	int pix = width * height;
	BYTE *pixels = new BYTE[3 * pix];
	memcpy((void *)pixels, (void *)colorbuffer, width * height * 3);

	FIBITMAP *img = FreeImage_ConvertFromRawBits(pixels, width, height, width * 3, 24, 0xFF0000, 0x00FF00, 0x0000FF, false);

	std::cout << "Saving screenshot: " << fname << "\n";

	FreeImage_Save(FIF_PNG, img, fname.c_str(), 0);
	
	delete pixels;
	FreeImage_DeInitialise();
}
开发者ID:xianyuMeng,项目名称:Berkeley-CS184.1-CG,代码行数:18,代码来源:Film.cpp


示例16: vp

void Fisheye::render_scene(World& w) {
	RGBColor L;
	ViewPlane vp(w.vp);
	FreeImage_Initialise();
	FIBITMAP* bitmap = FreeImage_Allocate(vp.hres, vp.vres, 24);
	RGBQUAD color;
	int hres = vp.hres;
	int vres = vp.vres;
	float s = vp.s;
	Ray ray;
	int depth = 0;
	Point2D sp;
	Point2D pp;
	float r_squared;

	ray.o  = eye;

	for(int r = 0; r < vres; r++)
		for(int c = 0; c < hres; c++) {
			L = black;

			for(int j = 0; j < vp.num_samples; j++) {
				sp = vp.sampler_ptr -> sample_unit_square();
				pp.x = s * (c - hres / 2.0 + sp.x);
				pp.y = s * (r - vres / 2.0 + sp.y);
				ray.d = ray_direction(pp, hres, vres, s, r_squared);

				if(r_squared <= 1.0)
					L += w.tracer_ptr -> trace_ray(ray);
			}

			L /= vp.num_samples;
			L *= exposure_time;
			w.display_pixel(r, c, L);
			color.rgbRed = (int)(L.r*255);
			color.rgbGreen = (int)(L.g*255);
			color.rgbBlue = (int)(L.b*255);
			FreeImage_SetPixelColor(bitmap, c, r, &color);
		}
	if (FreeImage_Save(FIF_PNG, bitmap, "test.png", 0))
		std::cout << "Image Successfully Saved!" << std::endl;
	FreeImage_DeInitialise();
}
开发者ID:elendorial,项目名称:RayTracer,代码行数:43,代码来源:Fisheye.cpp


示例17: main

int main(int argc, const char **argv) {
	if (argc == 5) {
		doingTransfer = true;
	}
	else {
		doingTransfer = false;
	}
	if (argc != 3 && argc != 5) {
		std::cerr << "usage: " << argv[0] << " <src> <dst> <src-crsp> <dst-crsp> " << std::endl;
		return 2;
	}

	blockHeight = 64;
	blockWidth = 64;
	numIterations = 1;
	vertOverlapAmount = 10;
	horizOverlapAmount = 10;
	FreeImage_Initialise(true);

	const int rows = 8;
	const int cols = 8;

	Image * const src = new Image();
	src->load(argv[1]);
	Image * const dst = allocate(rows, cols);
	srand(time(NULL));
	Image * const src_crsp = doingTransfer ? new Image() : NULL;
	Image * const dst_crsp = doingTransfer ? new Image() : NULL;
	if (doingTransfer) {
		src_crsp->load(argv[3]);
		dst_crsp->load(argv[4]);
	}
	quilt(dst, dst_crsp, rows, cols, src, src_crsp);
	dst->save(argv[2]);

	delete dst;
	delete src;
	delete dst_crsp;
	delete src_crsp;

	FreeImage_DeInitialise();
}
开发者ID:WaveMotion,项目名称:cs283hw4,代码行数:42,代码来源:Quilt.cpp


示例18: SAFE_RELEASE

void Globals::CleanUp()
{
	SAFE_RELEASE(gEntityFactory);
	SAFE_RELEASE(timer);
	SAFE_RELEASE(gWorld);
	SAFE_RELEASE(gKeyControl);
	SAFE_DELETE(gFpsCamera);
	SAFE_DELETE(gFollowCamera);
	SAFE_DELETE(gRTSCamera);
	gCurrentCamera = 0;
	gAIControl = 0;
	if (gDeleteAIPtr)
		gDeleteAIPtr();
	if (m_dll)
		FreeModule(m_dll);
	SAFE_DELETE(gFxEffectManager);
	SAFE_DELETE(gRender);
	SAFE_DELETE(gUI);
	FreeImage_DeInitialise();
}
开发者ID:sssa2000,项目名称:AIGameDemo,代码行数:20,代码来源:Globals.cpp


示例19: main

int main(int argc, char *argv[])
{
	if (argc != 3)
	{
		printf("Usage : cworld2img input_filename.bin output_filename.png\n\n");
		return 0;
	}
	FreeImage_Initialise();
	FIBITMAP *bitmap = FreeImage_Allocate(WORLD_WIDTH, WORLD_HEIGHT, 32);
	if(!bitmap)
	{
		printf("Error while allocating image. Aborting");
		return -1;
	}
	FILE *fd = fopen(argv[1], "rb");
	fread(c_world.solids, sizeof(block), WORLD_HEIGHT * WORLD_WIDTH, fd);
	fclose(fd);
	for(int i = 0; i < WORLD_HEIGHT; i++)
	{
		for(int j = 0; j < WORLD_WIDTH; j++)
		{
			switch(c_world.solids[WORLD_WIDTH * i + j])
			{
			case BLCK_AIR:
				FreeImage_SetPixelColor(bitmap, j, WORLD_HEIGHT - i, &qpixel_air);break;
			case BLCK_DIRT:
				FreeImage_SetPixelColor(bitmap, j, WORLD_HEIGHT - i, &qpixel_dirt);break;
			default:
				FreeImage_SetPixelColor(bitmap, j, WORLD_HEIGHT - i, &qpixel_unknown);break;
			}
		}
	}
	if(!FreeImage_Save(FIF_PNG, bitmap, argv[2], 0))
	{
		printf("Error while saving image. Aborting");
		return -1;
	}
	FreeImage_DeInitialise();
	return 0;
}
开发者ID:omegacoleman,项目名称:cworld2img,代码行数:40,代码来源:cworld2img.cpp


示例20: azL

//----------------------------------------------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------------------------------------------
void azImage::Initialize()
{
	azSz szFilePath = azL("F://Dev//Aztec//Bin//Debug//Test.png");

	FreeImage_Initialise();

	fipImage oFreeImage;
#ifdef UNICODE
	azBool bLoaded = (0 != oFreeImage.loadU(szFilePath));
#else // UNICODE
    azBool bLoaded = (0 != oFreeImage.load(szFilePath));
#endif // UNICODE
	azAssert(bLoaded, "Image extension or format not supported");

	azAssert(oFreeImage.getBitsPerPixel() <= 32, "More than 32 BPP images not yet supported, there will be some data loss");

	// Always convert to RGBA 32 bits
	azBool bConverted = (0 != oFreeImage.convertTo32Bits());
	azAssert(bConverted, "Image recognized but we failed to convert it to 32 BPP");

	m_uWidth = oFreeImage.getWidth();
	m_uHeight = oFreeImage.getHeight();
	m_uBpp = oFreeImage.getBitsPerPixel();
	azAssert(m_uBpp == 32, "Convert didn't work properly");

	azUInt uBufferSize = GetBufferSize();
	m_abData = azNewArray(azByte, uBufferSize);

	// There is no C++ wrapping for this method.
    FreeImage_ConvertToRawBits(m_abData,
		oFreeImage,
		oFreeImage.getScanWidth(),
		m_uBpp,
		FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK,
		true);  
	
	oFreeImage.clear();

	FreeImage_DeInitialise();
}
开发者ID:arouton,项目名称:Aztec,代码行数:43,代码来源:azImage.cpp



注:本文中的FreeImage_DeInitialise函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FreeImage_GetBPP函数代码示例发布时间:2022-05-30
下一篇:
C++ FreeImage_ConvertTo32Bits函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap