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

Function channelReadPure

DevIL/src-IL/src/il_pic.cpp:330–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328
329
330ILboolean channelReadPure(ILubyte *scan, ILint width, ILint noCol, ILint *off, ILint bytes)
331{
332 ILubyte col[4];
333 ILint count;
334 int i, j, k;
335
336 for (i = width; i > 0; ) {
337 count = igetc();
338 if (count == IL_EOF)
339 return IL_FALSE;
340 if (count > width)
341 count = width;
342 i -= count;
343
344 if (ieof())
345 return IL_FALSE;
346
347 for (j = 0; j < noCol; j++)
348 if (iread(&col[j], 1, 1) != 1)
349 return IL_FALSE;
350
351 for (k = 0; k < count; k++, scan += bytes) {
352 for(j = 0; j < noCol; j++)
353 scan[off[j] + k] = col[j];
354 }
355 }
356 return IL_TRUE;
357}
358
359
360ILboolean channelReadMixed(ILubyte *scan, ILint width, ILint noCol, ILint *off, ILint bytes)

Callers 1

readScanlineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected