Enlightenment CVS committal
Author : sebastid
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_spectrum.c
Log Message:
Formatting
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_spectrum.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- e_spectrum.c 14 Aug 2006 23:30:31 -0000 1.5
+++ e_spectrum.c 15 Aug 2006 19:36:21 -0000 1.6
@@ -1,3 +1,6 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
#include "e.h"
Evas_Smart *_e_spectrum_smart = NULL;
@@ -23,7 +26,7 @@
_e_spectrum_smart_add(Evas_Object *o)
{
E_Spectrum *sp;
- sp = calloc(1, sizeof(E_Spectrum));
+ sp = E_NEW(E_Spectrum, 1);
if (!sp) return;
@@ -151,51 +154,51 @@
Evas_Smart *smart;
if ( _e_spectrum_smart ) return;
_e_spectrum_smart = evas_smart_new("e_spectrum",
- _e_spectrum_smart_add,
- _e_spectrum_smart_del,
- NULL, NULL, NULL, NULL, NULL,
- _e_spectrum_smart_move,
- _e_spectrum_smart_resize,
- _e_spectrum_smart_show,
- _e_spectrum_smart_hide,
- _e_spectrum_smart_color_set,
- _e_spectrum_smart_clip_set,
- _e_spectrum_smart_clip_unset,
- NULL);
+ _e_spectrum_smart_add,
+ _e_spectrum_smart_del,
+ NULL, NULL, NULL, NULL, NULL,
+ _e_spectrum_smart_move,
+ _e_spectrum_smart_resize,
+ _e_spectrum_smart_show,
+ _e_spectrum_smart_hide,
+ _e_spectrum_smart_color_set,
+ _e_spectrum_smart_clip_set,
+ _e_spectrum_smart_clip_unset,
+ NULL);
}
void
_e_spectrum_color_calc(E_Spectrum *sp, float vx, float vy, float vz, int *r,
int *g, int *b)
{
switch (sp->mode)
- {
+ {
case E_COLOR_COMPONENT_R:
- *r = 255 * vz;
- *g = 255 * vy;
- *b = 255 * vx;
- break;
+ *r = 255 * vz;
+ *g = 255 * vy;
+ *b = 255 * vx;
+ break;
case E_COLOR_COMPONENT_G:
- *r = 255 * vx;
- *g = 255 * vz;
- *b = 255 * vy;
- break;
+ *r = 255 * vx;
+ *g = 255 * vz;
+ *b = 255 * vy;
+ break;
case E_COLOR_COMPONENT_B:
- *r = 255 * vy;
- *g = 255 * vx;
- *b = 255 * vz;
- break;
+ *r = 255 * vy;
+ *g = 255 * vx;
+ *b = 255 * vz;
+ break;
case E_COLOR_COMPONENT_H:
- evas_color_hsv_to_rgb(vz * 360.0, vy, vx, r, g, b);
- break;
+ evas_color_hsv_to_rgb(vz * 360.0, vy, vx, r, g, b);
+ break;
case E_COLOR_COMPONENT_S:
- evas_color_hsv_to_rgb(vx * 360.0, vz, vy, r, g, b);
- break;
+ evas_color_hsv_to_rgb(vx * 360.0, vz, vy, r, g, b);
+ break;
case E_COLOR_COMPONENT_V:
- evas_color_hsv_to_rgb(vy * 360.0, vx, vz, r, g, b);
- break;
+ evas_color_hsv_to_rgb(vy * 360.0, vx, vz, r, g, b);
+ break;
default:
- break;
- }
+ break;
+ }
}
void
@@ -207,41 +210,41 @@
if (!sp || !sp->cv) return;
switch (sp->mode)
- {
- case E_COLOR_COMPONENT_R:
- rr = sp->cv->r;
- gg = (1 - (y / (double)(sp->ih))) * 255;
- bb = (x / (double)(sp->iw)) * 255;
- break;
- case E_COLOR_COMPONENT_G:
- rr = (x / (double)(sp->iw)) * 255;
- gg = sp->cv->g;
- bb = (1 - (y / (double)(sp->ih))) * 255;
- break;
- case E_COLOR_COMPONENT_B:
- rr = (1 - (y / (double)(sp->ih))) * 255;
- gg = (x / (double)(sp->iw)) * 255;
- bb = sp->cv->b;
- break;
- case E_COLOR_COMPONENT_H:
- h = sp->cv->h;
- s = 1 - (y / (double)(sp->ih));
- v = x / (double)(sp->iw);
- evas_color_hsv_to_rgb(h, s, v, &rr, &gg, &bb);
- break;
- case E_COLOR_COMPONENT_S:
- s = sp->cv->s;
- v = 1 - (y / (double)(sp->ih));
- h = x / (double)(sp->iw) * 360;
- evas_color_hsv_to_rgb(h, s, v, &rr, &gg, &bb);
- break;
- case E_COLOR_COMPONENT_V:
- v = sp->cv->v;
- h = (1 - (y / (double)(sp->ih))) * 360;
- s = x / (double)(sp->iw);
- evas_color_hsv_to_rgb(h, s, v, &rr, &gg, &bb);
- break;
- }
+ {
+ case E_COLOR_COMPONENT_R:
+ rr = sp->cv->r;
+ gg = (1 - (y / (double)(sp->ih))) * 255;
+ bb = (x / (double)(sp->iw)) * 255;
+ break;
+ case E_COLOR_COMPONENT_G:
+ rr = (x / (double)(sp->iw)) * 255;
+ gg = sp->cv->g;
+ bb = (1 - (y / (double)(sp->ih))) * 255;
+ break;
+ case E_COLOR_COMPONENT_B:
+ rr = (1 - (y / (double)(sp->ih))) * 255;
+ gg = (x / (double)(sp->iw)) * 255;
+ bb = sp->cv->b;
+ break;
+ case E_COLOR_COMPONENT_H:
+ h = sp->cv->h;
+ s = 1 - (y / (double)(sp->ih));
+ v = x / (double)(sp->iw);
+ evas_color_hsv_to_rgb(h, s, v, &rr, &gg, &bb);
+ break;
+ case E_COLOR_COMPONENT_S:
+ s = sp->cv->s;
+ v = 1 - (y / (double)(sp->ih));
+ h = x / (double)(sp->iw) * 360;
+ evas_color_hsv_to_rgb(h, s, v, &rr, &gg, &bb);
+ break;
+ case E_COLOR_COMPONENT_V:
+ v = sp->cv->v;
+ h = (1 - (y / (double)(sp->ih))) * 360;
+ s = x / (double)(sp->iw);
+ evas_color_hsv_to_rgb(h, s, v, &rr, &gg, &bb);
+ break;
+ }
if (r) *r = rr;
if (g) *g = gg;
@@ -259,44 +262,44 @@
data = evas_object_image_data_get(sp->o_spectrum, 1);
if (!data)
- {
- sp->draw_timer = NULL;
- return 0;
- }
+ {
+ sp->draw_timer = NULL;
+ return 0;
+ }
switch(sp->mode)
- {
- case E_COLOR_COMPONENT_R:
- vz = (float)sp->cv->r / 255;
- break;
- case E_COLOR_COMPONENT_G:
- vz = (float)sp->cv->g / 255;
- break;
- case E_COLOR_COMPONENT_B:
- vz = (float)sp->cv->b / 255;
- break;
- case E_COLOR_COMPONENT_H:
- vz = sp->cv->h / 360;
- break;
- case E_COLOR_COMPONENT_S:
- vz = sp->cv->s;
- break;
- case E_COLOR_COMPONENT_V:
- vz = sp->cv->v;
- break;
- }
+ {
+ case E_COLOR_COMPONENT_R:
+ vz = (float)sp->cv->r / 255;
+ break;
+ case E_COLOR_COMPONENT_G:
+ vz = (float)sp->cv->g / 255;
+ break;
+ case E_COLOR_COMPONENT_B:
+ vz = (float)sp->cv->b / 255;
+ break;
+ case E_COLOR_COMPONENT_H:
+ vz = sp->cv->h / 360;
+ break;
+ case E_COLOR_COMPONENT_S:
+ vz = sp->cv->s;
+ break;
+ case E_COLOR_COMPONENT_V:
+ vz = sp->cv->v;
+ break;
+ }
for (i = 0; i < sp->ih; i++)
- {
- vy = (float)i / sp->ih;
- for (j = 0; j < sp->iw; j++)
{
- vx = (float)j / sp->iw;
- //_e_spectrum_2d_color_at(sp, j, i, &r, &g, &b);
- _e_spectrum_color_calc(sp, vx, vy, vz, &r, &g, &b);
- data[(i * sp->iw) + j] = (sp->cv->a << 24) | (r << 16) | (g << 8) | b;
+ vy = (float)i / sp->ih;
+ for (j = 0; j < sp->iw; j++)
+ {
+ vx = (float)j / sp->iw;
+ //_e_spectrum_2d_color_at(sp, j, i, &r, &g, &b);
+ _e_spectrum_color_calc(sp, vx, vy, vz, &r, &g, &b);
+ data[(i * sp->iw) + j] = (sp->cv->a << 24) | (r << 16) | (g << 8) |
b;
+ }
}
- }
evas_object_image_data_set(sp->o_spectrum, data);
evas_object_image_data_update_add(sp->o_spectrum, 0, 0, sp->iw, sp->ih);
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs