Creates a new ILimage based on the specifications given
| 61 | |
| 62 | // Creates a new ILimage based on the specifications given |
| 63 | ILAPI ILimage* ILAPIENTRY ilNewImage(ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc) |
| 64 | { |
| 65 | ILimage *Image; |
| 66 | |
| 67 | if (Bpp == 0 || Bpp > 4) { |
| 68 | return NULL; |
| 69 | } |
| 70 | |
| 71 | Image = (ILimage*)ialloc(sizeof(ILimage)); |
| 72 | if (Image == NULL) { |
| 73 | return NULL; |
| 74 | } |
| 75 | |
| 76 | if (!ilInitImage(Image, Width, Height, Depth, Bpp, ilGetFormatBpp(Bpp), ilGetTypeBpc(Bpc), NULL)) { |
| 77 | if (Image->Data != NULL) { |
| 78 | ifree(Image->Data); |
| 79 | } |
| 80 | ifree(Image); |
| 81 | return NULL; |
| 82 | } |
| 83 | |
| 84 | return Image; |
| 85 | } |
| 86 | |
| 87 | |
| 88 | // Same as above but allows specification of Format and Type |
nothing calls this directly
no test coverage detected