summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2010-08-19 05:23:39 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-08-19 05:23:39 +0000
commit5e1a73b0b3fef3a57e2af1fe70c127210c5ec727 (patch)
tree80156c9c1ab9b04f32614036d50f2d55c6e1e425
parentd54129448a725bef9e67f4f2e0d3f70b49092e23 (diff)
properly use stride return for manipulating argb pixels.
SVN revision: 51381
-rw-r--r--src/bin/image_data_argb.c6
-rw-r--r--src/bin/image_data_argb_alpha.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/bin/image_data_argb.c b/src/bin/image_data_argb.c
index edcffbd..191ba24 100644
--- a/src/bin/image_data_argb.c
+++ b/src/bin/image_data_argb.c
@@ -26,10 +26,10 @@ static void _setup(void)
26 { 26 {
27 o = evas_object_image_add(evas); 27 o = evas_object_image_add(evas);
28 o_images[i] = o; 28 o_images[i] = o;
29 evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
29 evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888); 30 evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888);
30 evas_object_image_size_set(o, 640, 480); 31 evas_object_image_size_set(o, 640, 480);
31 evas_object_image_alpha_set(o, 0); 32 evas_object_image_alpha_set(o, 0);
32 evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
33 evas_object_image_fill_set(o, 0, 0, 640, 480); 33 evas_object_image_fill_set(o, 0, 0, 640, 480);
34 evas_object_resize(o, 640, 480); 34 evas_object_resize(o, 640, 480);
35 evas_object_show(o); 35 evas_object_show(o);
@@ -47,7 +47,7 @@ static void _cleanup(void)
47/* loop - do things */ 47/* loop - do things */
48static void _loop(double t, int f) 48static void _loop(double t, int f)
49{ 49{
50 int i; 50 int i, st;
51 Evas_Coord x, y, w, h; 51 Evas_Coord x, y, w, h;
52 for (i = 0; i < 1; i++) 52 for (i = 0; i < 1; i++)
53 { 53 {
@@ -61,6 +61,7 @@ static void _loop(double t, int f)
61 evas_object_resize(o_images[i], w, h); 61 evas_object_resize(o_images[i], w, h);
62 evas_object_image_fill_set(o_images[i], 0, 0, w, h); 62 evas_object_image_fill_set(o_images[i], 0, 0, w, h);
63 data = evas_object_image_data_get(o_images[i], 1); 63 data = evas_object_image_data_get(o_images[i], 1);
64 st = evas_object_image_stride_get(o_images[i]);
64 p = data; 65 p = data;
65 ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24)); 66 ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24));
66 for (y = 0; y < 480; y++) 67 for (y = 0; y < 480; y++)
@@ -70,6 +71,7 @@ static void _loop(double t, int f)
70 *p = ((((x * y) + f) << 8) ^ (x - y - f)) | 0xff000000; 71 *p = ((((x * y) + f) << 8) ^ (x - y - f)) | 0xff000000;
71 p++; 72 p++;
72 } 73 }
74 p += (st - w);
73 } 75 }
74 evas_object_image_data_set(o_images[i], data); 76 evas_object_image_data_set(o_images[i], data);
75 evas_object_image_data_update_add(o_images[i], 0, 0, 640, 480); 77 evas_object_image_data_update_add(o_images[i], 0, 0, 640, 480);
diff --git a/src/bin/image_data_argb_alpha.c b/src/bin/image_data_argb_alpha.c
index 2651152..0cdba76 100644
--- a/src/bin/image_data_argb_alpha.c
+++ b/src/bin/image_data_argb_alpha.c
@@ -26,10 +26,10 @@ static void _setup(void)
26 { 26 {
27 o = evas_object_image_add(evas); 27 o = evas_object_image_add(evas);
28 o_images[i] = o; 28 o_images[i] = o;
29 evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
29 evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888); 30 evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888);
30 evas_object_image_size_set(o, 640, 480); 31 evas_object_image_size_set(o, 640, 480);
31 evas_object_image_alpha_set(o, 1); 32 evas_object_image_alpha_set(o, 1);
32 evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
33 evas_object_image_fill_set(o, 0, 0, 640, 480); 33 evas_object_image_fill_set(o, 0, 0, 640, 480);
34 evas_object_resize(o, 640, 480); 34 evas_object_resize(o, 640, 480);
35 evas_object_show(o); 35 evas_object_show(o);
@@ -47,7 +47,7 @@ static void _cleanup(void)
47/* loop - do things */ 47/* loop - do things */
48static void _loop(double t, int f) 48static void _loop(double t, int f)
49{ 49{
50 int i; 50 int i, st;
51 Evas_Coord x, y, w, h; 51 Evas_Coord x, y, w, h;
52 for (i = 0; i < 1; i++) 52 for (i = 0; i < 1; i++)
53 { 53 {
@@ -61,6 +61,7 @@ static void _loop(double t, int f)
61 evas_object_resize(o_images[i], w, h); 61 evas_object_resize(o_images[i], w, h);
62 evas_object_image_fill_set(o_images[i], 0, 0, w, h); 62 evas_object_image_fill_set(o_images[i], 0, 0, w, h);
63 data = evas_object_image_data_get(o_images[i], 1); 63 data = evas_object_image_data_get(o_images[i], 1);
64 st = evas_object_image_stride_get(o_images[i]);
64 p = data; 65 p = data;
65 ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24)); 66 ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24));
66 for (y = 0; y < 480; y++) 67 for (y = 0; y < 480; y++)
@@ -81,6 +82,7 @@ static void _loop(double t, int f)
81 *p = (a << 24) | (r << 16) | (g << 8) | b; 82 *p = (a << 24) | (r << 16) | (g << 8) | b;
82 p++; 83 p++;
83 } 84 }
85 p += (st - w);
84 } 86 }
85 evas_object_image_data_set(o_images[i], data); 87 evas_object_image_data_set(o_images[i], data);
86 evas_object_image_data_update_add(o_images[i], 0, 0, 640, 480); 88 evas_object_image_data_update_add(o_images[i], 0, 0, 640, 480);