MCPcopy Create free account
hub / github.com/codestation/qcma / LoadR5G6B5

Function LoadR5G6B5

common/dds.cpp:361–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361static bool LoadR5G6B5( QDataStream & s, const DDSHeader & header, QImage & img )
362{
363 const uint w = header.width;
364 const uint h = header.height;
365
366 for( uint y = 0; y < h; y++ ) {
367 QRgb * scanline = (QRgb *) img.scanLine( y );
368 for( uint x = 0; x < w; x++ ) {
369 Color565 color;
370 s >> color.u;
371 uchar r = (color.c.r << 3) | (color.c.r >> 2);
372 uchar g = (color.c.g << 2) | (color.c.g >> 4);
373 uchar b = (color.c.b << 3) | (color.c.b >> 2);
374 scanline[x] = qRgb(r, g, b);
375 }
376 }
377
378 return true;
379}
380
381static QDataStream & operator>> ( QDataStream & s, Color565 & c )
382{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected