本文整理汇总了C++中FreeImage_DeInitialise函数的典型用法代码示例。如果您正苦于以下问题:C++ FreeImage_DeInitialise函数的具体用法?C++ FreeImage_DeInitialise怎么用?C++ FreeImage_DeInitialise使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FreeImage_DeInitialise函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
};
示例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;
}
示例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();
}
}
示例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();
}
示例6: FreeImage_Unload
/**
* destructor
*/
fipImage::~fipImage(){
if ( pImageData ){
FreeImage_Unload( pImageData );
}
ulImageInstances--;
if ( ( ulImageInstances == 0 ) && bFreeImageInitialised ){
FreeImage_DeInitialise();
bFreeImageInitialised = false;
}
}
示例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;
}
示例8: FreeImage_DeInitialise
App::~App()
{
m_pluginManager.UnloadAll();
m_commandLineParser.DisposeCommands();
for (IdeType* type : m_ides)
{
delete type;
}
m_ides.clear();
FreeImage_DeInitialise();
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例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 !
}
示例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;
}
示例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();
}