當前位置: 首頁>>代碼示例>>C++>>正文


C++ FreeImage_Initialise函數代碼示例

本文整理匯總了C++中FreeImage_Initialise函數的典型用法代碼示例。如果您正苦於以下問題:C++ FreeImage_Initialise函數的具體用法?C++ FreeImage_Initialise怎麽用?C++ FreeImage_Initialise使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了FreeImage_Initialise函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的FreeImage_Initialise函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。