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

Function WriteDevILHeader

DevIL/src-IL/src/il_wdp.cpp:80–112  ·  view source on GitHub ↗

@TODO: Put in ilPKImageEncode_WritePixels_DevIL?

Source from the content-addressed store, hash-verified

78
79//@TODO: Put in ilPKImageEncode_WritePixels_DevIL?
80ERR WriteDevILHeader(PKImageEncode* pIE)
81{
82 struct WMPStream* pS = pIE->pStream;
83
84 if (IsEqualGUID(&GUID_PKPixelFormat24bppRGB, &pIE->guidPixFormat) || IsEqualGUID(&GUID_PKPixelFormat24bppBGR, &pIE->guidPixFormat))
85 {
86 pIE->cbPixel = 3;
87 }
88 else if (IsEqualGUID(&GUID_PKPixelFormat32bppBGRA, &pIE->guidPixFormat)
89 || IsEqualGUID(&GUID_PKPixelFormat32bppBGR, &pIE->guidPixFormat)
90 || IsEqualGUID(&GUID_PKPixelFormat32bppPBGRA, &pIE->guidPixFormat))
91 {
92 pIE->cbPixel = 4;
93 }
94 else if (IsEqualGUID(&GUID_PKPixelFormat8bppGray, &pIE->guidPixFormat))
95 {
96 pIE->cbPixel = 1;
97 }
98 else if (IsEqualGUID(&GUID_PKPixelFormat16bppGray, &pIE->guidPixFormat))
99 {
100 pIE->cbPixel = 2;
101 }
102 else if (IsEqualGUID(&GUID_PKPixelFormat128bppRGBAFloat, &pIE->guidPixFormat))
103 {
104 pIE->cbPixel = 16;//4;
105 }
106
107
108 pIE->offPixel = pIE->offStart;
109 pIE->fHeaderDone = !IL_FALSE;
110
111 return WMP_errSuccess;
112}
113
114ERR ilPKImageEncode_WritePixels_DevIL(PKImageEncode* pIE, U32 cLine, U8* pbPixel, U32 cbStride)
115{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected