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

Function ilReadBinaryPpm

DevIL/src-IL/src/il_pnm.cpp:364–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362
363
364ILimage *ilReadBinaryPpm(PPMINFO *Info)
365{
366 ILuint Size;
367
368 Size = Info->Width * Info->Height * Info->Bpp;
369
370 if (!ilTexImage(Info->Width, Info->Height, 1, (ILubyte)(Info->Bpp), 0, IL_UNSIGNED_BYTE, NULL)) {
371 return IL_FALSE;
372 }
373 iCurImage->Origin = IL_ORIGIN_UPPER_LEFT;
374
375 /* 4/3/2007 Dario Meloni
376 Here it seems we have eaten too much bytes and it is needed to fix
377 the starting point
378 works well on various images
379
380 No more need of this workaround. fixed iGetWord
381 iseek(0,IL_SEEK_END);
382 ILuint size = itell();
383 iseek(size-Size,IL_SEEK_SET);
384 */
385 if (iread(iCurImage->Data, 1, Size ) != Size) {
386 ilCloseImage(iCurImage);
387 return NULL;
388 }
389 return iCurImage;
390}
391
392
393ILimage *ilReadBitPbm(PPMINFO *Info)

Callers 1

iLoadPnmInternalFunction · 0.85

Calls 1

ilCloseImageFunction · 0.85

Tested by

no test coverage detected