Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/modules/loaders/eet


Modified Files:
        evas_image_load_eet.c 


Log Message:


fix eet load of premul images - need to check they are not "bad" :)

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/loaders/eet/evas_image_load_eet.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- evas_image_load_eet.c       30 Sep 2006 10:18:36 -0000      1.3
+++ evas_image_load_eet.c       2 Oct 2006 05:28:39 -0000       1.4
@@ -57,7 +57,7 @@
    unsigned int         w, h;
    int                  alpha, compression, quality, lossy;
    Eet_File            *ef;
-   DATA32              *body;
+   DATA32              *body, *p, *end;
 
    if ((!file) || (!key)) return 0;
    if ((im->image) && (im->image->data)) return 1;
@@ -89,6 +89,23 @@
    im->image->h = h;
    im->image->data = body;
    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   
 //   evas_common_image_premul(im);
    eet_close(ef);



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to