mirror of
https://github.com/BinomialLLC/basis_universal.git
synced 2026-06-08 08:33:53 +00:00
Minor performance tweak to the DIB creation loop
This commit is contained in:
@@ -41,13 +41,11 @@ HBITMAP rgbToBitmap(const uint32_t* src, uint32_t const imgW, uint32_t const img
|
||||
*/
|
||||
if (hbmp && pixels) {
|
||||
uint32_t* dst = static_cast<uint32_t*>(pixels);
|
||||
for (unsigned y = 0; y < imgH; y++) {
|
||||
for (unsigned x = 0; x < imgW; x++) {
|
||||
uint32_t rgba = *src++;
|
||||
*dst++ = ((rgba & 0x000000FF) << 16)
|
||||
| ((rgba & 0xFF00FF00) )
|
||||
| ((rgba & 0x00FF0000) >> 16);
|
||||
}
|
||||
for (unsigned xy = imgW * imgH; xy > 0; xy--) {
|
||||
uint32_t rgba = *src++;
|
||||
*dst++ = ((rgba & 0x000000FF) << 16)
|
||||
| ((rgba & 0xFF00FF00) )
|
||||
| ((rgba & 0x00FF0000) >> 16);
|
||||
}
|
||||
GdiFlush();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user