All pastes #180301 Raw Edit

Anonymous

public text v1 · immutable
#180301 ·published 2006-09-23 00:31 UTC
rendered paste body
void
_ex_image_flip_horizontal(Etk_Image *im)
{
   unsigned int *data;
   int           w, h;
   int           x, y;
   unsigned int *p1, *p2, tmp;

   if(im->use_edje)
     return;

   etk_image_size_get(im, &w, &h);
   data = evas_object_image_data_get(im->image_object, ETK_TRUE);
   _ex_image_data_copy(im, data, w, h); /* for undo */

   for (y = 0; y < h; y++)
     {
        p1 = data + (y * w);
        p2 = data + ((y + 1) * w) - 1;
        for (x = 0; x < (w >> 1); x++)
          {
             tmp = *p1;
             *p1 = *p2;
             *p2 = tmp;
             p1++;
             p2--;
          }
     }

   evas_object_image_data_set(im->image_object, data);
   evas_object_image_data_update_add(im->image_object, 0, 0, w, h);
}