forked from enlightenment/efl
fix eet load of premul images - need to check they are not "bad" :)
SVN revision: 26291
This commit is contained in:
parent
87af70ceef
commit
7794ad5de9
|
@ -57,7 +57,7 @@ evas_image_load_file_data_eet(RGBA_Image *im, const char *file, const char *key)
|
||||||
unsigned int w, h;
|
unsigned int w, h;
|
||||||
int alpha, compression, quality, lossy;
|
int alpha, compression, quality, lossy;
|
||||||
Eet_File *ef;
|
Eet_File *ef;
|
||||||
DATA32 *body;
|
DATA32 *body, *p, *end;
|
||||||
|
|
||||||
if ((!file) || (!key)) return 0;
|
if ((!file) || (!key)) return 0;
|
||||||
if ((im->image) && (im->image->data)) return 1;
|
if ((im->image) && (im->image->data)) return 1;
|
||||||
|
@ -89,6 +89,23 @@ evas_image_load_file_data_eet(RGBA_Image *im, const char *file, const char *key)
|
||||||
im->image->h = h;
|
im->image->h = h;
|
||||||
im->image->data = body;
|
im->image->data = body;
|
||||||
im->image->no_free = 0;
|
im->image->no_free = 0;
|
||||||
|
if (alpha)
|
||||||
|
{
|
||||||
|
end = body +(w * h);
|
||||||
|
for (p = body; p < end; p++)
|
||||||
|
{
|
||||||
|
DATA32 r, g, b, a;
|
||||||
|
|
||||||
|
a = A_VAL(p);
|
||||||
|
r = R_VAL(p);
|
||||||
|
g = G_VAL(p);
|
||||||
|
b = B_VAL(p);
|
||||||
|
if (r > a) r = a;
|
||||||
|
if (g > a) g = a;
|
||||||
|
if (b > a) b = a;
|
||||||
|
*p = ARGB_JOIN(a, r, g, b);
|
||||||
|
}
|
||||||
|
}
|
||||||
// result is already premultiplied now if u compile with edje
|
// result is already premultiplied now if u compile with edje
|
||||||
// evas_common_image_premul(im);
|
// evas_common_image_premul(im);
|
||||||
eet_close(ef);
|
eet_close(ef);
|
||||||
|
|
Loading…
Reference in New Issue