Like ilTexImage but doesn't destroy the palette.
| 1116 | |
| 1117 | // Like ilTexImage but doesn't destroy the palette. |
| 1118 | ILAPI 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 | } |
no test coverage detected