MCPcopy Create free account
hub / github.com/cpvrlab/ImagePlay / readRaw32BitInterleaved

Method readRaw32BitInterleaved

IPL/src/IPLFileIO.cpp:366–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366bool IPLFileIO::readRaw32BitInterleaved(int stride, IPLRawImageType format, IPLImage *&image, std::ifstream &file)
367{
368 char buffer[4];
369 int x=0;
370 int y=0;
371 while(file.good())
372 {
373 file.read(buffer, 4);
374
375 ipl_basetype r,g,b,a;
376 if(format == 1)
377 {
378 r = ((uchar) buffer[0]) * FACTOR_TO_FLOAT;
379 g = ((uchar) buffer[1]) * FACTOR_TO_FLOAT;
380 b = ((uchar) buffer[2]) * FACTOR_TO_FLOAT;
381 a = ((uchar) buffer[3]) * FACTOR_TO_FLOAT;
382 }
383 else
384 {
385 a = ((uchar) buffer[0]) * FACTOR_TO_FLOAT;
386 b = ((uchar) buffer[1]) * FACTOR_TO_FLOAT;
387 g = ((uchar) buffer[2]) * FACTOR_TO_FLOAT;
388 r = ((uchar) buffer[3]) * FACTOR_TO_FLOAT;
389 }
390
391 image->plane(0)->cp(x, y) = r;
392 image->plane(1)->cp(x, y) = g;
393 image->plane(2)->cp(x, y) = b;
394
395 x++;
396 if(x % stride == 0)
397 {
398 x = 0;
399 y++;
400 }
401 }
402 return true;
403}
404
405bool IPLFileIO::readRaw24BitPlanar(int stride, IPLRawImageType format, IPLImage *&image, std::ifstream &file)
406{

Callers

nothing calls this directly

Calls 1

planeMethod · 0.80

Tested by

no test coverage detected