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

Function ILAPIENTRY ilNewImage

DevIL/src-IL/src/il_devil.cpp:63–85  ·  view source on GitHub ↗

Creates a new ILimage based on the specifications given

Source from the content-addressed store, hash-verified

61
62// Creates a new ILimage based on the specifications given
63ILAPI 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

Callers

nothing calls this directly

Calls 3

ilInitImageFunction · 0.85
ilGetFormatBppFunction · 0.85
ilGetTypeBpcFunction · 0.85

Tested by

no test coverage detected