MCPcopy Create free account
hub / github.com/DentonW/DevIL / ILAPIENTRY ilSaveImage

Function ILAPIENTRY ilSaveImage

DevIL/src-IL/src/il_io.cpp:2527–2698  ·  view source on GitHub ↗

Saves the current image based on the extension given in FileName. ! \param FileName Ansi or Unicode string, depending on the compiled version of DevIL, that gives the filename to save to. \return Boolean value of failure or success. Returns IL_FALSE if saving failed.*/

Source from the content-addressed store, hash-verified

2525 the filename to save to.
2526 \return Boolean value of failure or success. Returns IL_FALSE if saving failed.*/
2527ILboolean ILAPIENTRY ilSaveImage(ILconst_string FileName)
2528{
2529 ILstring Ext;
2530 ILboolean bRet = IL_FALSE;
2531
2532 if (FileName == NULL || ilStrLen(FileName) < 1) {
2533 ilSetError(IL_INVALID_PARAM);
2534 return IL_FALSE;
2535 }
2536
2537 if (iCurImage == NULL) {
2538 ilSetError(IL_ILLEGAL_OPERATION);
2539 return IL_FALSE;
2540 }
2541
2542 Ext = iGetExtension(FileName);
2543 if (Ext == NULL) {
2544 ilSetError(IL_INVALID_PARAM);
2545 return IL_FALSE;
2546 }
2547
2548 #ifndef IL_NO_BMP
2549 if (!iStrCmp(Ext, IL_TEXT("bmp"))) {
2550 bRet = ilSaveBmp(FileName);
2551 goto finish;
2552 }
2553 #endif
2554
2555 #ifndef IL_NO_CHEAD
2556 if (!iStrCmp(Ext, IL_TEXT("h"))) {
2557 bRet = ilSaveCHeader(FileName, (char*)"IL_IMAGE");
2558 goto finish;
2559 }
2560 #endif
2561
2562 #ifndef IL_NO_DDS
2563 if (!iStrCmp(Ext, IL_TEXT("dds"))) {
2564 bRet = ilSaveDds(FileName);
2565 goto finish;
2566 }
2567 #endif
2568
2569 #ifndef IL_NO_EXR
2570 if (!iStrCmp(Ext, IL_TEXT("exr"))) {
2571 bRet = ilSaveExr(FileName);
2572 goto finish;
2573 }
2574 #endif
2575
2576 #ifndef IL_NO_HDR
2577 if (!iStrCmp(Ext, IL_TEXT("hdr"))) {
2578 bRet = ilSaveHdr(FileName);
2579 goto finish;
2580 }
2581 #endif
2582
2583 #ifndef IL_NO_JP2
2584 if (!iStrCmp(Ext, IL_TEXT("jp2"))) {

Callers

nothing calls this directly

Calls 15

ilStrLenFunction · 0.85
ilSetErrorFunction · 0.85
iGetExtensionFunction · 0.85
iStrCmpFunction · 0.85
ilSaveBmpFunction · 0.85
ilSaveCHeaderFunction · 0.85
ilSaveDdsFunction · 0.85
ilSaveExrFunction · 0.85
ilSaveHdrFunction · 0.85
ilSaveJp2Function · 0.85
ilSaveJpegFunction · 0.85
ilSavePcxFunction · 0.85

Tested by

no test coverage detected