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

Function ILAPIENTRY ilNewImageFull

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

Same as above but allows specification of Format and Type

Source from the content-addressed store, hash-verified

87
88// Same as above but allows specification of Format and Type
89ILAPI ILimage* ILAPIENTRY ilNewImageFull(ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data)
90{
91 ILimage *Image;
92
93 if (Bpp == 0 || Bpp > 4) {
94 return NULL;
95 }
96
97 Image = (ILimage*)ialloc(sizeof(ILimage));
98 if (Image == NULL) {
99 return NULL;
100 }
101
102 if (!ilInitImage(Image, Width, Height, Depth, Bpp, Format, Type, Data)) {
103 if (Image->Data != NULL) {
104 ifree(Image->Data);
105 }
106 ifree(Image);
107 return NULL;
108 }
109
110 return Image;
111}
112
113
114//! Changes the current bound image to use these new dimensions (current data is destroyed).

Callers

nothing calls this directly

Calls 1

ilInitImageFunction · 0.85

Tested by

no test coverage detected