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

Function ILAPIENTRY ilCopyImage_

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

Creates a copy of Src and returns it.

Source from the content-addressed store, hash-verified

1066
1067// Creates a copy of Src and returns it.
1068ILAPI ILimage* ILAPIENTRY ilCopyImage_(ILimage *Src)
1069{
1070 ILimage *Dest;
1071
1072 if (Src == NULL) {
1073 ilSetError(IL_INVALID_PARAM);
1074 return NULL;
1075 }
1076
1077 Dest = ilNewImage(Src->Width, Src->Height, Src->Depth, Src->Bpp, Src->Bpc);
1078 if (Dest == NULL) {
1079 return NULL;
1080 }
1081
1082 if (ilCopyImageAttr(Dest, Src) == IL_FALSE)
1083 return NULL;
1084
1085 memcpy(Dest->Data, Src->Data, Src->SizeOfData);
1086
1087 return Dest;
1088}
1089
1090
1091ILuint ILAPIENTRY ilCloneCurImage()

Callers

nothing calls this directly

Calls 2

ilSetErrorFunction · 0.85
ilCopyImageAttrFunction · 0.85

Tested by

no test coverage detected