1
1
[ Procedural texture] ( https://en.wikipedia.org/wiki/Procedural_texture )
2
- * 2D [ color gradient] ( https://en.wikipedia.org/wiki/Color_gradient )
2
+ * 2D [ color gradient] ( https://en.wikipedia.org/wiki/Color_gradient ) . For 1D color gradient see [ here ] ( https://gitlab.com/adammajewski/color_gradient )
3
3
* [ defined by a function whose value is computed rather than looked up] ( http://math.hws.edu/graphicsbook/c7/s3.html )
4
4
5
5
64
64
![ ] ( ./images/cabsi.png " cabs inverted ")
65
65
66
66
### carg(z)
67
- ![ ] ( ./images/carg.png " carg ")
68
67
![ ] ( ./images/cargm.png " carg modified ")
69
68
![ ] ( ./images/cturn.png " cturn ")
70
69
![ ] ( ./images/conic.png " conic ")
@@ -115,12 +114,16 @@ Parts
115
114
116
115
117
116
## color modes
117
+ * color depth
118
+ * color from palette
119
+
118
120
119
121
[ Color depth] ( https://en.wikipedia.org/wiki/Color_depth )
120
122
* 24 bit color (rgb)
121
123
* 8 bit color mode: gray shades ( where r=g=b)
122
124
* 1 bit color mode: Black and White ( b&w )
123
- * direct color, palette mode
125
+
126
+
124
127
125
128
``` pas
126
129
case ColorType of
@@ -222,9 +225,10 @@ double conic(double complex z)
222
225
223
226
// https://en.wikipedia.org/wiki/Himmelblau%27s_function
224
227
double GiveHimmelblau(double x, double y){
225
- // mapped input to [-6,6]x[-6,6]
226
- x *= 6.0;
227
- y *= 6.0;
228
+ // map input to [-m,m]x[-m,m]
229
+ double m = 6.0;
230
+ x *= m;
231
+ y *= m;
228
232
double a = x*x+y-11.0;
229
233
double b = x+y*y-7.0;
230
234
// mapped output to
@@ -241,11 +245,15 @@ double GiveHimmelblau(double x, double y){
241
245
*/
242
246
double checker ( double x, double y){
243
247
244
- int ix = floor(5.0*x);
245
- int iy = floor(5.0*y);
248
+ double m = 5.0;
249
+ // map input from [-1,1]x[-1,1] to [-m,m]x[-m,m]
250
+ int ix = floor(m*x);
251
+ int iy = floor(m*y);
246
252
247
253
248
254
return abs(ix + iy) % 2;
255
+
256
+
249
257
}
250
258
```
251
259
0 commit comments