MCPcopy Create free account
hub / github.com/DentonW/DevIL / ilResizeImage

Function ilResizeImage

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

Like ilTexImage but doesn't destroy the palette.

Source from the content-addressed store, hash-verified

1116
1117// Like ilTexImage but doesn't destroy the palette.
1118ILAPI ILboolean ILAPIENTRY ilResizeImage(ILimage *Image, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILubyte Bpc)
1119{
1120 if (Image == NULL) {
1121 ilSetError(IL_INVALID_PARAM);
1122 return IL_FALSE;
1123 }
1124
1125 if (Image->Data != NULL)
1126 ifree(Image->Data);
1127
1128 Image->Depth = Depth;
1129 Image->Width = Width;
1130 Image->Height = Height;
1131 Image->Bpp = Bpp;
1132 Image->Bpc = Bpc;
1133 Image->Bps = Bpp * Bpc * Width;
1134 Image->SizeOfPlane = Image->Bps * Height;
1135 Image->SizeOfData = Image->SizeOfPlane * Depth;
1136
1137 Image->Data = (ILubyte*)ialloc(Image->SizeOfData);
1138 if (Image->Data == NULL) {
1139 return IL_FALSE;
1140 }
1141
1142 return IL_TRUE;
1143}

Callers 3

ILAPIENTRY iluRotate_Function · 0.85
ILAPIENTRY iluScale_Function · 0.85
iConvertPaletteFunction · 0.85

Calls 1

ilSetErrorFunction · 0.85

Tested by

no test coverage detected