| 561 | |
| 562 | |
| 563 | ILAPI 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. |
nothing calls this directly
no test coverage detected