| 359 | } |
| 360 | |
| 361 | static 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 | |
| 381 | static QDataStream & operator>> ( QDataStream & s, Color565 & c ) |
| 382 | { |
nothing calls this directly
no outgoing calls
no test coverage detected