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

C++ FreeImage_Initialise函数代码示例

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

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



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

示例1: main

int main(int argc,char* argv[]) {
    if(argc != 2 && argc != 3) {
        std::cerr << "Usage: path to the OFF file" << std::endl;
        throw 2;
    }
    
    if (argc == 3) {
        pre_simplified = true;
        collapse_file = argv[2];
    }
    printHelp();
	
	//Initialize GLUT
	FreeImage_Initialise();
	glutInit(&argc,argv);
	glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
	glutCreateWindow("HW1: Meshes");
	init(argv[1]);

	glutDisplayFunc(shared::display);
	glutSpecialFunc(specialKey);
	glutKeyboardFunc(keyboard);
	glutReshapeFunc(reshape);
	glutReshapeWindow(w,h);
	
	glutMainLoop();	
	FreeImage_DeInitialise();

	return 0;
}
开发者ID:azgo14,项目名称:CS283,代码行数:30,代码来源:main.cpp


示例2: main

int main(int argc,char* argv[]) {
	
	//Initialize GLUT
	FreeImage_Initialise();
	glutInit(&argc,argv);
	glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
	glutCreateWindow("HW1: Transformations");
	init();
	glutDisplayFunc(display);
	glutSpecialFunc(specialKey);
	glutKeyboardFunc(keyboard);
	glutReshapeFunc(reshape);
	glutReshapeWindow(w,h);
	
	if(argc > 1) {
		allowGrader = true;
		grader.init(argv[1]);
		grader.loadCommands(argv[1]);
		grader.bindDisplayFunc(display);
		grader.bindSpecialFunc(specialKey);
		grader.bindKeyboardFunc(keyboard);
		grader.bindScreenshotFunc(saveScreenshot);
	}
	
	printHelp();
	glutMainLoop();	
	FreeImage_DeInitialise();

	return 0;
}
开发者ID:Cesar287,项目名称:ComputerGraphics,代码行数:30,代码来源:main.cpp


示例3: FreeImage_Initialise

void pre_lzw::do_lzw(const QDir & d){
    FreeImage_Initialise(true);
    QString label_out = "";
    QString dst = ui.lineEdit_2->text();
    QString d_src = d.path();
    QString serial_str = d_src.right(5);
    QDir dst_dir(dst);
    dst_dir.mkdir(serial_str);
    QString image_name = "", image_name_path(""), saved_name("");
    int dot_pos = 0;
    QFileInfoList handled_images = d.entryInfoList();
    QList<QFileInfo>::iterator images_iter = handled_images.begin();
    
    FREE_IMAGE_FORMAT fif = FIF_UNKNOWN;
    for(; images_iter < handled_images.end(); ++images_iter){
        image_name_path = (*images_iter).absoluteFilePath();
        if((*images_iter).isDir()){
            continue;
        }
        FIBITMAP *handled_image = 0;
        image_name = (*images_iter).fileName();
        dot_pos = image_name.indexOf(".");
        saved_name = dst + "\\" + serial_str + "\\" + image_name.left(dot_pos) + "_c.tif";
        label_out += saved_name + "\n";
        fif = FreeImage_GetFileType(image_name_path.toStdString().c_str());
        handled_image = FreeImage_Load(fif, image_name_path.toStdString().c_str());
        FreeImage_Save(FIF_TIFF, handled_image, saved_name.toStdString().c_str(), TIFF_LZW);
        FreeImage_Unload(handled_image);
    }
//    ui.label->setText(label_out);
    FreeImage_DeInitialise();

}
开发者ID:sulei1324,项目名称:lab_codes,代码行数:33,代码来源:pre_lzw.cpp


示例4: FreeImage_Initialise

void Film::output(string path){
  int maxIntensity = 255;
  int bpp = 24;
  RGBQUAD color;
  FreeImage_Initialise();
  FIBITMAP* bitmap = FreeImage_Allocate(sceneWidth,
					sceneHeight,
					bpp);
  for(int h = 0; h < sceneHeight; h++){
    vector<Color> row = pixelData[h];
    for(int w = 0; w < sceneWidth; w++){
      Color pixelColor = row[w];
      color.rgbRed = pixelColor.getR() * maxIntensity;
      color.rgbGreen = pixelColor.getG() * maxIntensity;
      color.rgbBlue = pixelColor.getB() * maxIntensity;
      FreeImage_SetPixelColor(bitmap, w, h, &color);
    }
  }
  if (FreeImage_Save(FIF_PNG, bitmap, path.c_str(), 0)) {
    cout << "Image saved to " << path << endl;
    cout << sceneWidth << endl;
  }
  else {
    cerr << "Couldn't save image to " << path << endl;
    exit(1);
  }

  FreeImage_DeInitialise();
}
开发者ID:sebanie,项目名称:tracingrays,代码行数:29,代码来源:Film.cpp


示例5: assert

void CoreImplementationWinSDL::init()
{
	// Load SDL
	assert(SDL_Init(SDL_INIT_VIDEO) == 0);

	FreeImage_Initialise();
}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:7,代码来源:CoreWinSdl.cpp


示例6: FreeImage_Initialise

TextureManager::TextureManager()
{
	// call this ONLY when linking with FreeImage as a static library
	#ifdef FREEIMAGE_LIB
		FreeImage_Initialise();
	#endif
}
开发者ID:aashishthite,项目名称:Graphics,代码行数:7,代码来源:TextureManager.cpp


示例7: main

int main(int argc, char** argv)
{
    FreeImage_Initialise();

    gLua.init();
    gConfig.init();
    gDatabase.init();
    gLog.init();

    Window win;
    
    win.loadZoneModel(argc > 1 ? argv[1] : "gfaydark");
    
    for (;;)
    {
        gTimerPool.check();
        
        if (!win.mainLoop())
            break;
        
        gTemp.reset();
        Clock::sleepMilliseconds(25);
    }
    
    gLog.signalClose();
    gLog.waitUntilClosed();
    
    FreeImage_DeInitialise();
    return 0;
}
开发者ID:Xackery,项目名称:ZEQ,代码行数:30,代码来源:main.cpp


示例8: initSDL

void Client::init()
{
    initSDL();

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

    m_gui = GUI::instance();
    m_mainMenu = new MainMenu(this);
    m_mainMenu->showMainMenu();

    m_debugMenu = new DebugMenu(this);
    m_debugMenu->show();

    if (Settings::instance()->startupFlags() & Settings::PlayNowStartupFlag) {
        startMultiplayerHost("Dingo");
    }

//dws    std::stringstream ss;
//    ss << "Player";
//    std::random_device device;
//    std::mt19937 rand(device());
//    std::uniform_int_distribution<> distribution(0, INT_MAX);
//
//    ss << distribution(rand);
//
//    startMultiplayerHost(ss.str());
}
开发者ID:EmmetCooper,项目名称:ore-infinium,代码行数:30,代码来源:client.cpp


示例9: InitDLL

void InitDLL(const char* dllname)
{
	if (!dllname || strlen(dllname) < 3)
			return;
	m_dll = LoadLibraryA(dllname);
	if (!m_dll)
	{
		DWORD err = GetLastError();
		ReportErrWithLastErr(err, "Load Library Failed!:%s", dllname);
		return ;
	}
	gCreateAIPtr = (CreateAIControl_FunPtr)GetProcAddress(m_dll, "CreateAIControl");
	if (!gCreateAIPtr)
	{
		DWORD err = GetLastError();
		ReportErrWithLastErr(err, "GetProcAddress!:CreateAIControl");
		return;
	}

	gDeleteAIPtr = (DeleteAIControl_FunPtr)GetProcAddress(m_dll, "DeleteAIControl");
	if (!gDeleteAIPtr)
	{
		DWORD err = GetLastError();
		ReportErrWithLastErr(err, "GetProcAddress!:DeleteAIControl");
		return;
	}

	gAIControl = gCreateAIPtr();

	FreeImage_Initialise();

}
开发者ID:sssa2000,项目名称:AIGameDemo,代码行数:32,代码来源:Globals.cpp


示例10: main

int 
main(int argc, char *argv[]) {

	char *input_filename = "images\\input.tif";
	char *output_filename = "images\\clone.tif";

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

	// initialize our own FreeImage error handler

	FreeImage_SetOutputMessage(MyMessageFunc);

	// Copy 'input.tif' to 'clone.tif'

	CloneMultiPage(FIF_TIFF, input_filename, output_filename, 0);

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

	return 0;
}
开发者ID:12019,项目名称:svn.gov.pt,代码行数:26,代码来源:CloneMultiPage.cpp


示例11: main

int main(int argc, char* args[]) {
	
	/* Check arguments */
	if (argc <= 1) {
		std::cerr << "Error: No input files.\n";
		std::cin.get();
		return -1;
	}
	
	/* Initialize FreeImage */
	#ifdef FREEIMAGE_LIB
		FreeImage_Initialise();
	#endif
	std::cout << "Using FreeImage version " << FreeImage_GetVersion() << "\n";
	
	/* Convert all files */
	for (int i = 1; i < argc; i++) convert(args[i]);
	
	/* Deinitialize FreeImage */
	#ifdef FREEIMAGE_LIB
		FreeImage_DeInitialise();
	#endif
	std::cout << "\nFinished." << std::endl;
	
	/* Wait for input */
	std::cin.get();
	
	return 0;
}
开发者ID:casfire,项目名称:RG_tools,代码行数:29,代码来源:cfrt_convert.cpp


示例12: 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 FreeImage error handler

	FreeImage_SetOutputMessage(MyMessageFunc);

	// print version & copyright infos

	cout << "FreeImage " << FreeImage_GetVersion() << "\n";
	cout << FreeImage_GetCopyrightMessage() << "\n\n";

	// Print input formats (including external plugins) known by the library
	fstream importFile("fif_import.csv", ios::out);
	PrintImportFormats(importFile);
	importFile.close();

	// Print output formats (including plugins) known by the library
	// for each export format, supported bitdepths are given
	fstream exportFile("fif_export.csv", ios::out);
	PrintExportFormats(exportFile);
	exportFile.close();

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

	return 0;

}
开发者ID:12019,项目名称:svn.gov.pt,代码行数:35,代码来源:FIFImportExport.cpp


示例13: FreeImage_Initialise

TextureLoader::TextureLoader()
{
	if(initialised != true)
	{
		FreeImage_Initialise();
	}
}
开发者ID:Khedesh,项目名称:Traffic,代码行数:7,代码来源:texture_loader.cpp


示例14: main

int main(int argc, char *argv[])
{
    //  initialize the GLUT library.
    glutInit(&argc, argv);
    // set the display mode
    glutInitDisplayMode(GLUT_RGBA | GLUT_ALPHA | GLUT_DEPTH | GLUT_DOUBLE);
    // set the window size
    glutInitWindowSize(windowWidth, windowHeight);
    // creates a top-level window.
    glutCreateWindow("LengXuegang's Homework");
    // initialize the extension entry points
    GLenum error = glewInit();
    if (GLEW_OK != error)
    {
        fprintf(stderr, "Error: %s\n", glewGetErrorString(error));
        exit(-1);
    }

    FreeImage_Initialise(false);

    const char *version = FreeImage_GetVersion();
    fprintf(stdout, "version: %s", version);

    const char *copyright = FreeImage_GetCopyrightMessage();
    fprintf(stdout, "copyright: %s", copyright);

    initPrograms();

    GLint n = initVertex();
    if (n < 0)
    {
        fprintf(stderr, "init vertex failed");
        exit(-1);
    }

    GLint uModelMatrix = glGetUniformLocation(program->getProgramID(), "u_ModelMatrix");
    // GLint uMvpMatrix = glGetUniformLocation(program, "u_MvpMatrix");
    GLint uNormalMatrix = glGetUniformLocation(program->getProgramID(), "u_NormalMatrix");
    GLint uLightColor = glGetUniformLocation(program->getProgramID(), "u_LightColor");
    GLint uLightPosition = glGetUniformLocation(program->getProgramID(), "u_LightPosition");
    GLint uAmbientLight = glGetUniformLocation(program->getProgramID(), "u_AmbientLight");

    glUniform3f(uLightColor, 0.5, 0.9, 0.1);
    glUniform3f(uLightPosition, 1.0, 2.0, 3.0);
    glUniform3f(uAmbientLight, 0.6, 0.6, 0.6);

    // glUniformMatrix4fv(uModelMatrix, )
    // glUniformMatrix4fv(uNormalMatrix, )
    // sets the display callback for the current window.
    glutDisplayFunc(display);
    // sets the reshape callback for the current window.
    glutReshapeFunc(reshape);
    // sets the special keyboard callback for the current window.
    // glutSpecialFunc(specialKey);
    // enters the GLUT event processing loop.
    glutMainLoop();

    return 0;
}
开发者ID:lengxuegang,项目名称:openglDemo,代码行数:59,代码来源:homework.cpp


示例15: FreeImage_Initialise

painter::painter()
{
	boost::filesystem::create_directory(default_pic_path);
	FreeImage_Initialise();

	border_color = new RGBQUAD;
	border_color->rgbBlue = border_color->rgbGreen = border_color->rgbRed = 100;
}
开发者ID:dobsapetike,项目名称:Cellular-Pattern-Evolution,代码行数:8,代码来源:Painter.cpp


示例16: textureFromBytes

Ogre::TexturePtr textureFromBytes(const QByteArray &ba,
                                  const std::string &name) {

  static bool fi_init = false;
  if (!fi_init) {
    FreeImage_Initialise();
  }

  void *data = const_cast<char *>(ba.data());
  FIMEMORY *mem =
      FreeImage_OpenMemory(reinterpret_cast<BYTE *>(data), ba.size());
  FREE_IMAGE_FORMAT fif = FreeImage_GetFileTypeFromMemory(mem, 0);
  if (fif == FIF_UNKNOWN) {
    FreeImage_CloseMemory(mem);
    throw std::runtime_error("Image format is not supported for loading");
  }
  FIBITMAP *bmp = FreeImage_LoadFromMemory(fif, mem, 0);
  FreeImage_CloseMemory(mem);
  if (!bmp) {
    throw std::runtime_error("Failed to decode image");
  }
  FIBITMAP *converted = FreeImage_ConvertTo24Bits(bmp);
  FreeImage_Unload(bmp);
  if (!converted) {
    throw std::runtime_error("Failed to convert image to 24 bit");
  }

  const unsigned w = FreeImage_GetWidth(converted);
  const unsigned h = FreeImage_GetHeight(converted);
  const unsigned data_size = w * h * 3;
  BYTE *image_data = FreeImage_GetBits(converted);

  ROS_INFO("Loading a %u x %u texture", w, h);

  //  create texture
  Ogre::TexturePtr texture;
  try {
    Ogre::DataStreamPtr data_stream;
    data_stream.bind(new Ogre::MemoryDataStream(image_data, data_size));

    const Ogre::String res_group =
        Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME;
    Ogre::TextureManager &texture_manager =
        Ogre::TextureManager::getSingleton();
    texture =
        texture_manager.loadRawData(name, res_group, data_stream, w, h,
                                    Ogre::PF_R8G8B8, Ogre::TEX_TYPE_2D, 0);
  }
  catch (...) {
    //  clean up FreeImage before re-throwing
    FreeImage_Unload(converted);
    throw;
  }

  return texture;
}
开发者ID:Exchizz,项目名称:rviz_satellite,代码行数:56,代码来源:aerialmap_display.cpp


示例17: FreeImage_Initialise

/**
 * standard constructor of an fipImage object
 */
fipImage::fipImage(){
	
	if ( ! bFreeImageInitialised ){
		FreeImage_Initialise();
		bFreeImageInitialised = true;
	}
	ulImageInstances++;
	
	pImageData = NULL;
}
开发者ID:BioKom,项目名称:Fib,代码行数:13,代码来源:fipImage.cpp


示例18: FreeImageInit

	static void FreeImageInit()
	{
		static bool Init = false;

		if(!Init)
		{
			Init = true;
			FreeImage_Initialise(false);
			atexit(FreeImageFree);
		}
	}
开发者ID:vetional,项目名称:ogl-samples,代码行数:11,代码来源:png.cpp


示例19: FreeImage_Initialise

//----------------------------------------------------------
ofImage::ofImage(const ofImage& mom) {

	if (!bFreeImageInited){
		FreeImage_Initialise();
		bFreeImageInited = true;
	}

	clear();
	clone(mom);
	update();
}
开发者ID:alfredoBorboa,项目名称:openFrameworks,代码行数:12,代码来源:ofImage.cpp


示例20: 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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ FreeImage_Load函数代码示例发布时间:2022-05-30
下一篇:
C++ FreeImage_GetScanLine函数代码示例发布时间: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