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

Function ILAPIENTRY iCopyPal

DevIL/src-IL/src/il_pal.cpp:563–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561
562
563ILAPI ILpal* ILAPIENTRY iCopyPal()
564{
565 ILpal *Pal;
566
567 if (iCurImage == NULL || iCurImage->Pal.Palette == NULL ||
568 iCurImage->Pal.PalSize == 0 || iCurImage->Pal.PalType == IL_PAL_NONE) {
569 ilSetError(IL_ILLEGAL_OPERATION);
570 return NULL;
571 }
572
573 Pal = (ILpal*)ialloc(sizeof(ILpal));
574 if (Pal == NULL) {
575 return NULL;
576 }
577 if (!iCopyPalette(Pal, &iCurImage->Pal)) {
578 ifree(Pal);
579 return NULL;
580 }
581
582 return Pal;
583}
584
585
586// Converts the palette to the DestFormat format.

Callers

nothing calls this directly

Calls 2

ilSetErrorFunction · 0.85
iCopyPaletteFunction · 0.85

Tested by

no test coverage detected