Hi,
   First of all, thanks for your feedbacks about the previous implementation at 
eet level. 

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.

Thank You.
Regards,
Rajeev



------- Original Message -------
Sender : Carsten Haitzler<ras...@rasterman.com>
Date : Apr 16, 2012 12:43 (GMT+05:30)
Title : Re: [E-devel] [PATCH][EET] Patch to remove the alpha from image header 
while saving if the alpha is set to 1 but the image is fully opaque

On Mon, 16 Apr 2012 07:05:14 +0000 (GMT) Rajeev Ranjan 
said:

> Hi Gustavo,
>    Thanks for your information on evas_image_loader when pixels are being
> scanned and sparse_alpha flag is being set. But this common function
> "evas_common_image_set_alpha_sparse" is being called only for loaders of svg
> and tiff files, not for other formats.
> 
> Besides in this function, we are already scanning image data texels in order
> to determine alpha_sparse. So if we do similar stuff for determining opacity
> of image in some other function, then scanning will happen twice for any
> image while loading which will affect the performance(load time). Then the
> option we are left with is to set the apha flag here itself in this function
> while scanning the image data and call this function from loaders for all
> image formats. Whether this option in your opinion is good as this function
> name suggests for setting the alpha_sparse, not the alpha value.
> 
> And this change will affect the image loading performance every time it gets
> loaded where as if we do it in edje_cc code, then this will affect only the
> eet creation flow using edje_cc, not the normal operation.
> 
> Others including Raster has suggested for scanning the image data in edje_cc
> saving flow which in my opinion should be good as it will not affect the
> normal flow performance.
> 
> I would like to know whether this should be default behavior of edje_cc or
> shall I add it as an option to the compiler. If it should be an option, then
> what option flag do you suggest! I think -o should be good.

default in edje_cc sounds just fine to me. it's an optimization.

> Please let me know your opinion on this.
> Thank You.
> Regards,
> Rajeev
> 
> ------- Original Message -------
> Sender : Gustavo Sverzut Barbieri 
> Date : Fri, 13 Apr 2012 11:24:29 -0300
> Title : Re: [E-devel] [PATCH][EET] Patch to remove the alpha from image
> header while saving if the alpha is set to 1 but the image is fully opaque
> 
> On 04/13/12 22:55, Gustavo Sverzut Barbieri  wrote:
> > On Fri, 13 Apr 2012 13:54:50 +0000 (GMT) Rajeev Ranjan
> > said:
> >
> > Hi Rajeev,
> 
> > As far as I remember there is already an alpha analysis being done by
> > Evas image loaders to set "sparse alpha" flag. I believe the same
> > analysis can be used to detect no-alpha situation.
> 
> > If so, doing in Evas is a best fit as it will work with images loaded
> > from internet or disk.
> 
> > BR,
> > -- Gustavo
> >
> 
> >> Hi,
> >>     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.
> >>
> >> The objective of this patch is to avoid the alpha blending for the images
> >> which don't use alpha but while creating, the alpha channel has been added
> >> by the creator. In order to do so, the image individual texels are scanned
> >> to find if alpha is used in the image for any texel and the image is fully
> >> opaque, while saving the alpha is set to 0. If the alpha information in
> >> image header is set to 0 already, then this stage is skipped.
> >>
> >> This implementation can be done at either eet level or edje level.
> >> Currently in this patch it has been done in eet.
> >>
> >> If required, it can be implemented in edje_cc itself rather than in eet
> >> image data saving. One more option can be to make this scanning optional
> >> which can be done in edje_cc through an option provided this is implementd
> >> at edje_cc level rather than at eet level.
> >>
> >> Change Description:
> >>
> >>     While writing the image to eet file, the image data is scanned to find
> >> out whether the alpha value in header is set to 1 and is not being used in
> >> the image. If that is the case while writing, we set the alpha to 0 to
> >> avoid blending for such images in the graphics pipeline.
> >>
> >> This will be an optimization for rendering once the image is loaded from
> >> eet file as alpha blending can be avoided for such images.
> >>
> >> Signed-Off-By: RAJEEV RANJAN
> >>
> >> Please review the same and provide your feedbacks.
> >> Thank You.
> >> Regards,
> >> Rajeev
> >

-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com

Attachment: edje_cc.patch
Description: Binary data

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to