Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/modules/savers/png


Modified Files:
        evas_image_save_png.c 


Log Message:


cedric's cache changes patch

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/savers/png/evas_image_save_png.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- evas_image_save_png.c       28 Oct 2006 03:02:23 -0000      1.6
+++ evas_image_save_png.c       12 Apr 2008 00:32:30 -0000      1.7
@@ -27,7 +27,7 @@
    png_color_8         sig_bit;
    int                 num_passes = 1, pass;
 
-   if (!im || !im->image || !im->image->data || !file)
+   if (!im || !im->image.data || !file)
       return 0;
    
    f = fopen(file, "wb");
@@ -64,7 +64,7 @@
    
    if (im->flags & RGBA_IMAGE_HAS_ALPHA)
      {
-       data = malloc(im->image->w * im->image->h * sizeof(DATA32));
+       data = malloc(im->cache_entry.w * im->cache_entry.h * sizeof(DATA32));
        if (!data)
          {
            fclose(f);
@@ -72,10 +72,10 @@
            png_destroy_info_struct(png_ptr, (png_infopp) & info_ptr);
            return 0;
          }
-       memcpy(data, im->image->data, im->image->w * im->image->h * 
sizeof(DATA32));
-       evas_common_convert_argb_unpremul(data, im->image->w * im->image->h);
+       memcpy(data, im->image.data, im->cache_entry.w * im->cache_entry.h * 
sizeof(DATA32));
+       evas_common_convert_argb_unpremul(data, im->cache_entry.w * 
im->cache_entry.h);
        png_init_io(png_ptr, f);
-        png_set_IHDR(png_ptr, info_ptr, im->image->w, im->image->h, 8,
+        png_set_IHDR(png_ptr, info_ptr, im->cache_entry.w, im->cache_entry.h, 
8,
                     PNG_COLOR_TYPE_RGB_ALPHA, png_ptr->interlaced,
                     PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
 #ifdef WORDS_BIGENDIAN
@@ -86,12 +86,12 @@
      }
    else
      {
-       data = im->image->data;
+       data = im->image.data;
        png_init_io(png_ptr, f);
-       png_set_IHDR(png_ptr, info_ptr, im->image->w, im->image->h, 8,
+       png_set_IHDR(png_ptr, info_ptr, im->cache_entry.w, im->cache_entry.h, 8,
                     PNG_COLOR_TYPE_RGB, png_ptr->interlaced,
                     PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
-       png_data = alloca(im->image->w * 3 * sizeof(char));
+       png_data = alloca(im->cache_entry.w * 3 * sizeof(char));
      }
    sig_bit.red = 8;
    sig_bit.green = 8;
@@ -108,13 +108,13 @@
      {
        ptr = data;
        
-       for (y = 0; y < im->image->h; y++)
+       for (y = 0; y < im->cache_entry.h; y++)
          {
             if (im->flags & RGBA_IMAGE_HAS_ALPHA)
               row_ptr = (png_bytep) ptr;
             else
               {
-                 for (j = 0, x = 0; x < im->image->w; x++)
+                 for (j = 0, x = 0; x < im->cache_entry.w; x++)
                    {
                       png_data[j++] = (ptr[x] >> 16) & 0xff;
                       png_data[j++] = (ptr[x] >> 8) & 0xff;
@@ -123,7 +123,7 @@
                  row_ptr = (png_bytep) png_data;
               }
             png_write_rows(png_ptr, &row_ptr, 1);
-            ptr += im->image->w;
+            ptr += im->cache_entry.w;
          }
      }
    png_write_end(png_ptr, info_ptr);



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to