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

Function ILAPIENTRY ilSetPixels

DevIL/src-IL/src/il_manip.cpp:759–799  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757
758
759void ILAPIENTRY ilSetPixels(ILint XOff, ILint YOff, ILint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, void *Data)
760{
761 void *Converted;
762
763 if (iCurImage == NULL) {
764 ilSetError(IL_ILLEGAL_OPERATION);
765 return;
766 }
767 if (Data == NULL) {
768 ilSetError(IL_INVALID_PARAM);
769 return;
770 }
771
772 if (Format == iCurImage->Format && Type == iCurImage->Type) {
773 Converted = (void*)Data;
774 }
775 else {
776 Converted = ilConvertBuffer(Width * Height * Depth * ilGetBppFormat(Format) * ilGetBpcType(Type), Format, iCurImage->Format, Type, iCurImage->Type, NULL, Data);
777 if (!Converted)
778 return;
779 }
780
781 if (YOff + Height <= 1) {
782 ilSetPixels1D(XOff, Width, Converted);
783 }
784 else if (ZOff + Depth <= 1) {
785 ilSetPixels2D(XOff, YOff, Width, Height, Converted);
786 }
787 else {
788 ilSetPixels3D(XOff, YOff, ZOff, Width, Height, Depth, Converted);
789 }
790
791 if (Format == iCurImage->Format && Type == iCurImage->Type) {
792 return;
793 }
794
795 if (Converted != Data)
796 ifree(Converted);
797
798 return;
799}
800
801
802

Callers

nothing calls this directly

Calls 6

ilSetErrorFunction · 0.85
ilGetBppFormatFunction · 0.85
ilGetBpcTypeFunction · 0.85
ilSetPixels1DFunction · 0.85
ilSetPixels2DFunction · 0.85
ilSetPixels3DFunction · 0.85

Tested by

no test coverage detected