本文整理匯總了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;
}
示例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;
}
示例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();
}
示例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();
}
示例5: assert
void CoreImplementationWinSDL::init()
{
// Load SDL
assert(SDL_Init(SDL_INIT_VIDEO) == 0);
FreeImage_Initialise();
}
示例6: FreeImage_Initialise
TextureManager::TextureManager()
{
// call this ONLY when linking with FreeImage as a static library
#ifdef FREEIMAGE_LIB
FreeImage_Initialise();
#endif
}
示例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;
}
示例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());
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例13: FreeImage_Initialise
TextureLoader::TextureLoader()
{
if(initialised != true)
{
FreeImage_Initialise();
}
}
示例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;
}
示例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;
}