|
|
@@ -68,15 +68,8 @@ pipi_image_t *pipi_load_gdi(const char *name) |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
|
|
|
|
/* FIXME: get rid of this loop, maybe by using BITMAPV4HEADER above |
|
|
|
* so that GDI reorders the pixels for us. */ |
|
|
|
for(y = 0; y < img->h; y++) |
|
|
|
for(x = 0; x < img->w; x++) |
|
|
|
{ |
|
|
|
/* Swap B and R, don't touch G and A. */ |
|
|
|
uint8_t tmp = data[0]; data[0] = data[2]; data[2] = tmp; |
|
|
|
data += 4; |
|
|
|
} |
|
|
|
/* FIXME: do we need to swap bytes? Apparently Vista doesn't need it, |
|
|
|
* but we'd need a more thorough test. */ |
|
|
|
|
|
|
|
img->codec_priv = NULL; |
|
|
|
|
|
|
@@ -133,9 +126,9 @@ int pipi_save_gdi(pipi_image_t *img, const char *name) |
|
|
|
for(x = 0; x < img->w; x++) |
|
|
|
{ |
|
|
|
uint8_t tmp[3]; |
|
|
|
tmp[0] = data[4 * (img->w * (img->h - 1 - y) + x) + 2]; |
|
|
|
tmp[0] = data[4 * (img->w * (img->h - 1 - y) + x) + 0]; |
|
|
|
tmp[1] = data[4 * (img->w * (img->h - 1 - y) + x) + 1]; |
|
|
|
tmp[2] = data[4 * (img->w * (img->h - 1 - y) + x) + 0]; |
|
|
|
tmp[2] = data[4 * (img->w * (img->h - 1 - y) + x) + 2]; |
|
|
|
WriteFile(hfile, tmp, 3, &ret, NULL); |
|
|
|
} |
|
|
|
if(padding) |
|
|
|