Subject: [E-devel] [PATCH][EDJE] Patch to remove the alpha from image
header while saving if the alpha is set to 1 but the image is fully
opaque
Attached to the mail is a patch to set the alpha information for an
image header to 0 with alpha present but all the texels being opaque.
Continuing to our discussion, as suggested by many people in the
community it has been implemented at edje_cc level.
Change description:
While compiling the edc file, image data for image files is
scanned to find out whether the alpha value in header is set to 1 and
is not being used in the image.
If this is the case, while writing to eet the alpha is set to 0 to
avoid blending for such images in the graphics pipeline when used by
evas.
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@70954
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
David Seikel <onefang at gmail.com>
Mikael Sans <sans.mikael@gmail.com>
Jérôme Pinot <ngc891@gmail.com>
+Rajeev Ranjan (Rajeev) <rajeev.r@samsung.com> <rajeev.jnnce@gmail.com>
2012-05-10 Cedric Bail
* Preserve user box and table items during call of edje_object_file_set.
+
+2012-04-30 Rajeev Ranjan (Rajeev)
+
+ * Add edje_cc optimization to remove alpha channel flag from images
+ with absolutely no alpha in them if marked as havin alpha in the
+ originals
+
int im_w, im_h;
int im_alpha;
char buf[256];
+ unsigned int *start, *end;
+ Eina_Bool opaque = EINA_TRUE;
evas_object_image_size_get(im, &im_w, &im_h);
im_alpha = evas_object_image_alpha_get(im);
if (qual < min_quality) qual = min_quality;
if (qual > max_quality) qual = max_quality;
}
+ if (im_alpha)
+ {
+ start = (unsigned int *) im_data;
+ end = start + (im_w * im_h);
+ while (start < end)
+ {
+ if ((*start & 0xff000000) != 0xff000000)
+ {
+ opaque = EINA_FALSE;
+ break;
+ }
+ start++;
+ }
+ if (opaque) im_alpha = 0;
+ }
if (mode == 0)
bytes = eet_data_image_write(ef, buf,
im_data, im_w, im_h,