#include <Elementary.h>
struct info
{
int *pix;
};
static void
{
double x, xx, y, cx, cy, cox, coy;
int iteration, hx, hy, val, r, g, b, rr, gg, bb;
int itermax = 10000;
double magnify = 0.02;
magnify += ((double)(rand() % 100) / 100.0) / 4.0;
cox = (double)(rand() % 100) / 100.0;
coy = (double)(rand() % 100) / 100.0;
cox /= (magnify * 3.0);
r = rand() % 255; g = rand() % 255; b = rand() % 255;
for (hy = 0; hy < h; hy++)
{
for (hx = 0; hx < w; hx++)
{
cx = (((float)hx) / ((float)w) - 0.5) / (magnify * 3.0);
cy = (((float)hy) / ((float)h) - 0.5) / (magnify * 3.0);
cx += cox;
cy += coy;
x = 0.0;
y = 0.0;
for (iteration = 1; iteration < itermax; iteration++)
{
xx = (x * x) - (y * y) + cx;
y = (2.0 * x * y) + cy;
x = xx;
if (((x * x) + (y * y)) > 100.0) iteration = 999999;
}
val = (((x * x) + (y * y)) * 2.55) / 100.0;
if (val > 255) val = 255;
if (iteration >= 99999)
{
rr = (r * val) / 255;
gg = (g * val) / 255;
bb = (b * val) / 255;
pix[(hy * w) + hx] =
(val << 24) | (rr << 16) | (gg << 8) | (bb);
}
else
pix[(hy * w) + hx] = 0xffffffff;
}
}
}
static void
{
struct info *inf = data;
mandel(th, inf->pix, 256, 256);
}
static void
{
struct info *inf = data;
free(inf->pix);
free(inf);
}
static void
{
struct info *inf = data;
free(inf->pix);
free(inf);
}
anim(void *data)
{
double t, z;
int w, h, v;
v = ((int)(uintptr_t)o) & 0xff;
w = 100 + ((v * 100) >> 8);
h = 100 + ((v * 100) >> 8);
z = (double)(v) / 100.0;
x = (w * sin(t));
y = (h * cos(t + z));
}
EAPI_MAIN int
{
int i;
for (i = 0; i < 64; i++)
{
struct info *inf;
inf = malloc(sizeof(struct info));
if (inf)
{
inf->obj = o;
inf->pix = malloc(256 * 256 * sizeof(int));
}
}
return 0;
}