55 |
FPARAM(type, 0); |
FPARAM(type, 0); |
56 |
FPARAM(scale, 1); |
FPARAM(scale, 1); |
57 |
FPARAM(bias, 0); |
FPARAM(bias, 0); |
58 |
|
FPARAM(seed, 1); |
59 |
if(components > 4) return; |
if(components > 4) return; |
60 |
|
|
61 |
|
if (seed != 1) { |
62 |
|
srandom((unsigned)seed); |
63 |
|
} |
64 |
|
|
65 |
int ind=0, i, j; |
int ind=0, i, j; |
66 |
float x, y; |
float x, y; |
97 |
break; |
break; |
98 |
case 4: |
case 4: |
99 |
if (components >= 1) data[ind++] = saw(x); |
if (components >= 1) data[ind++] = saw(x); |
100 |
if (components >= 2) data[ind++] = saw(1 - xstep - x); |
if (components >= 2) data[ind++] = saw(y); |
101 |
if (components >= 3) data[ind++] = saw(y); |
if (components >= 3) data[ind++] = saw(1 - xstep - x); |
102 |
if (components >= 4) data[ind++] = saw(1 - ystep - y); |
if (components >= 4) data[ind++] = saw(1 - ystep - y); |
103 |
break; |
break; |
104 |
case 5: |
case 5: |
105 |
if (components >= 1) data[ind++] = triangle(x); |
if (components >= 1) data[ind++] = triangle(x); |
106 |
if (components >= 2) data[ind++] = triangle(.5 + x); |
if (components >= 2) data[ind++] = triangle(y); |
107 |
if (components >= 3) data[ind++] = triangle(y); |
if (components >= 3) data[ind++] = triangle(.5 + x); |
108 |
if (components >= 4) data[ind++] = triangle(.5 + y); |
if (components >= 4) data[ind++] = triangle(.5 + y); |
109 |
break; |
break; |
110 |
case 6: |
case 6: |
111 |
if (components >= 1) data[ind++] = stripe(x); |
if (components >= 1) data[ind++] = stripe(x); |
112 |
if (components >= 2) data[ind++] = stripe(1 - xstep - x); |
if (components >= 2) data[ind++] = stripe(y); |
113 |
if (components >= 3) data[ind++] = stripe(y); |
if (components >= 3) data[ind++] = stripe(1 - xstep - x); |
114 |
if (components >= 4) data[ind++] = stripe(1 - ystep - y); |
if (components >= 4) data[ind++] = stripe(1 - ystep - y); |
115 |
break; |
break; |
116 |
|
case 7: |
117 |
|
if (components >= 1) data[ind++] = rand() / (RAND_MAX + 1.0); |
118 |
|
if (components >= 2) data[ind++] = rand() / (RAND_MAX + 1.0); |
119 |
|
if (components >= 3) data[ind++] = rand() / (RAND_MAX + 1.0); |
120 |
|
if (components >= 4) data[ind++] = rand() / (RAND_MAX + 1.0); |
121 |
|
break; |
122 |
|
|
123 |
} |
} |
124 |
} |
} |