Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
FlameFractalHsl.cs
1using System;
2using System.Threading;
3using System.Collections.Generic;
4using System.Text;
5using SkiaSharp;
11
13{
21 {
26 ScriptNode Preview, ScriptNode Parallel, ScriptNode DimX, ScriptNode DimY, ScriptNode SuperSampling,
27 ScriptNode Gamma, ScriptNode LightFactor, ScriptNode Seed, int Start, int Length, Expression Expression)
28 : base(new ScriptNode[] { xc, yc, dr, N, FlameFunctions, Preview, Parallel, DimX, DimY, SuperSampling,
29 Gamma, LightFactor, Seed },
30 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
31 ArgumentType.Scalar, ArgumentType.Vector, ArgumentType.Scalar, ArgumentType.Scalar,
32 ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
33 ArgumentType.Scalar, ArgumentType.Scalar }, Start, Length, Expression)
34 {
35 }
36
41 ScriptNode Preview, ScriptNode Parallel, ScriptNode DimX, ScriptNode DimY, ScriptNode SuperSampling,
42 ScriptNode Gamma, ScriptNode LightFactor, int Start, int Length, Expression Expression)
43 : base(new ScriptNode[] { xc, yc, dr, N, FlameFunctions, Preview, Parallel, DimX, DimY, SuperSampling,
44 Gamma, LightFactor },
45 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
46 ArgumentType.Scalar, ArgumentType.Vector, ArgumentType.Scalar, ArgumentType.Scalar,
47 ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
48 ArgumentType.Scalar }, Start, Length, Expression)
49 {
50 }
51
56 ScriptNode Preview, ScriptNode Parallel, ScriptNode DimX, ScriptNode DimY, ScriptNode SuperSampling,
58 : base(new ScriptNode[] { xc, yc, dr, N, FlameFunctions, Preview, Parallel, DimX, DimY, SuperSampling,
59 Gamma },
60 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
61 ArgumentType.Scalar, ArgumentType.Vector, ArgumentType.Scalar, ArgumentType.Scalar,
62 ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar },
64 {
65 }
66
71 ScriptNode Preview, ScriptNode Parallel, ScriptNode DimX, ScriptNode DimY, ScriptNode SuperSampling,
73 : base(new ScriptNode[] { xc, yc, dr, N, FlameFunctions, Preview, Parallel, DimX, DimY, SuperSampling },
74 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
75 ArgumentType.Scalar, ArgumentType.Vector, ArgumentType.Scalar, ArgumentType.Scalar,
76 ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar },
78 {
79 }
80
85 ScriptNode Preview, ScriptNode Parallel, ScriptNode DimX, ScriptNode DimY, int Start, int Length,
87 : base(new ScriptNode[] { xc, yc, dr, N, FlameFunctions, Preview, Parallel, DimX, DimY },
88 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
89 ArgumentType.Scalar, ArgumentType.Vector, ArgumentType.Scalar, ArgumentType.Scalar,
90 ArgumentType.Scalar, ArgumentType.Scalar },
92 {
93 }
94
99 ScriptNode Preview, ScriptNode Parallel, ScriptNode DimX, int Start, int Length, Expression Expression)
100 : base(new ScriptNode[] { xc, yc, dr, N, FlameFunctions, Preview, Parallel, DimX },
101 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
102 ArgumentType.Scalar, ArgumentType.Vector, ArgumentType.Scalar, ArgumentType.Scalar,
103 ArgumentType.Scalar },
105 {
106 }
107
112 ScriptNode Preview, ScriptNode Parallel, int Start, int Length, Expression Expression)
113 : base(new ScriptNode[] { xc, yc, dr, N, FlameFunctions, Preview, Parallel },
114 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
115 ArgumentType.Scalar, ArgumentType.Vector, ArgumentType.Scalar, ArgumentType.Scalar },
117 {
118 }
119
124 ScriptNode Preview, int Start, int Length, Expression Expression)
125 : base(new ScriptNode[] { xc, yc, dr, N, FlameFunctions, Preview },
126 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
127 ArgumentType.Scalar, ArgumentType.Vector, ArgumentType.Scalar },
129 {
130 }
131
137 : base(new ScriptNode[] { xc, yc, dr, N, FlameFunctions },
138 new ArgumentType[] { ArgumentType.Scalar, ArgumentType.Scalar, ArgumentType.Scalar,
139 ArgumentType.Scalar, ArgumentType.Vector },
141 {
142 }
143
147 public override string[] DefaultArgumentNames
148 {
149 get
150 {
151 return new string[]
152 {
153 "xc", "yc", "dr", "N", "FlameFunctions", "Preview", "Parallel",
154 "DimX", "DimY", "SuperSampling", "Gamma", "LightFactor", "Seed"
155 };
156 }
157 }
158
162 public override string FunctionName => nameof(FlameFractalHsl);
163
168 {
169 double xc, yc;
170 double dr;
171 long N;
172 int dimx, dimy;
173 int i, c;
174 int Seed;
175
176 i = 0;
177 c = Arguments.Length;
178 xc = Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
179 yc = Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
180 dr = Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
181 N = (long)Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
182 if (N <= 0)
183 throw new ScriptRuntimeException("N in calls to FlameFractalHsl() must be a positive integer.", this);
184
185 object Obj = Arguments[i].AssociatedObjectValue;
186 string FunctionsExpression = this.Arguments[i++].SubExpression;
187
188 if (!(Obj is Array FlameArray))
189 throw new ScriptRuntimeException("The fifth parameter to FlameFractalHsl must be an array, containing flame definitions.", this);
190
191 List<FlameFunction> FlameFunctions = new List<FlameFunction>();
192 double Weight;
193 double Gamma;
194 double LightFactor;
195 int SuperSampling;
196 FlameFunction CurrentFunction = null;
197
198 foreach (object FlameItem in FlameArray)
199 {
200 if (FlameItem is DoubleMatrix M)
201 {
202 CurrentFunction = new FlameFunction(M, this);
203 FlameFunctions.Add(CurrentFunction);
204 }
205 else if (FlameItem is SKColor || FlameItem is string)
206 {
207 if (CurrentFunction is null)
208 {
209 M = new DoubleMatrix(new double[,] { { 1, 0 }, { 0, 1 } });
210 CurrentFunction = new FlameFunction(M, this);
211 FlameFunctions.Add(CurrentFunction);
212 }
213
214 SKColor cl = Graph.ToColor(FlameItem);
215 cl.ToHsl(out float H, out float S, out float L);
216
217 CurrentFunction.SetColorHsl(H, S, L);
218 CurrentFunction = null;
219 }
220 else if (FlameItem is IFlameVariation FlameVariation)
221 {
222 if (CurrentFunction is null)
223 {
224 M = new DoubleMatrix(new double[,] { { 1, 0 }, { 0, 1 } });
225 CurrentFunction = new FlameFunction(M, this);
226 FlameFunctions.Add(CurrentFunction);
227 }
228
229 CurrentFunction.Add(FlameVariation);
230 }
231 else if (FlameItem is ILambdaExpression LambdaExpression)
232 {
233 if (CurrentFunction is null)
234 {
235 M = new DoubleMatrix(new double[,] { { 1, 0 }, { 0, 1 } });
236 CurrentFunction = new FlameFunction(M, this);
237 FlameFunctions.Add(CurrentFunction);
238 }
239
240 CurrentFunction.Add(LambdaExpression);
241 }
242 else
243 {
244 try
245 {
246 Weight = Expression.ToDouble(FlameItem);
247
248 if (CurrentFunction is null)
249 {
250 M = new DoubleMatrix(new double[,] { { 1, 0 }, { 0, 1 } });
251 CurrentFunction = new FlameFunction(M, this);
252 FlameFunctions.Add(CurrentFunction);
253 }
254
255 CurrentFunction.SetWeight(Weight);
256 }
257 catch (Exception)
258 {
259 throw new ScriptRuntimeException("Invalid flame variation definition.", this);
260 }
261 }
262 }
263
264 if (i < c && Arguments[i].AssociatedObjectValue is bool Preview)
265 i++;
266 else
267 Preview = false;
268
269 if (i < c && Arguments[i].AssociatedObjectValue is bool Parallel)
270 i++;
271 else
272 Parallel = false;
273
274 if (i < c)
275 dimx = (int)Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
276 else
277 dimx = 320;
278
279 if (i < c)
280 dimy = (int)Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
281 else
282 dimy = 200;
283
284 if (i < c)
285 SuperSampling = (int)Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
286 else
287 SuperSampling = 2;
288
289 if (i < c)
290 Gamma = Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
291 else
292 Gamma = 2.2;
293
294 if (i < c)
295 LightFactor = Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
296 else
297 LightFactor = 1.0;
298
299 if (i < c)
300 Seed = (int)Expression.ToDouble(Arguments[i++].AssociatedObjectValue);
301 else
302 {
303 lock (gen)
304 {
305 Seed = gen.Next();
306 }
307
308 Variables.ConsoleOut?.WriteLine("Seed = " + Seed.ToString(), Variables);
309 }
310
311 if (i < c)
312 {
313 throw new ScriptRuntimeException("Parameter mismatch in call to FlameFractalHsl(xc,yc,dr,N,FlameFunctions[,Preview[,Parallel[,dimx[,dimy[,SuperSampling[,Gamma[,LightFactor[,Seed]]]]]]]]).",
314 this);
315 }
316
317 if (dimx <= 0 || dimx > 5000 || dimy <= 0 || dimy > 5000)
318 throw new ScriptRuntimeException("Image size must be within 1x1 to 5000x5000", this);
319
320 FlameFunction[] Functions = FlameFunctions.ToArray();
321
322 if (dr <= 0)
323 {
324 FlameFractalRgba.EstimateSize(out xc, out yc, out dr, Functions, dimx, dimy, Seed, 5000, Variables, this);
325
326 Variables.ConsoleOut?.WriteLine("X-center: " + Expression.ToString(xc), Variables);
327 Variables.ConsoleOut?.WriteLine("Y-center: " + Expression.ToString(yc), Variables);
328 Variables.ConsoleOut?.WriteLine("Width: " + Expression.ToString(dr), Variables);
329 }
330
331 return CalcFlame(xc, yc, dr, N, Functions, dimx, dimy, Seed, SuperSampling, Gamma, LightFactor, Preview, Parallel, Variables, this,
332 this.FractalZoomScript, new object[] { dimx, dimy, N, FunctionsExpression, Seed, SuperSampling, Gamma, LightFactor, Preview, Parallel });
333 }
334
335 private readonly static Random gen = new Random();
336
337 private string FractalZoomScript(double r, double i, double Size, object State)
338 {
339 object[] Parameters = (object[])State;
340 int DimX = (int)Parameters[0];
341 int DimY = (int)Parameters[1];
342 long N = (long)Parameters[2];
343 string FunctionsExpression = (string)Parameters[3];
344 int Seed = (int)Parameters[4];
345 int SuperSampling = (int)Parameters[5];
346 double Gamma = (double)Parameters[6];
347 double LightFactor = (double)Parameters[7];
348 bool Preview = (bool)Parameters[8];
349 bool Parallel = (bool)Parameters[9];
350
351 StringBuilder sb = new StringBuilder();
352
353 sb.Append("FlameFractalHsl(");
354 sb.Append(Expression.ToString(r));
355 sb.Append(',');
356 sb.Append(Expression.ToString(i));
357 sb.Append(',');
358 sb.Append(Expression.ToString(Size / 4));
359 sb.Append(',');
360 sb.Append(N.ToString());
361 sb.Append(',');
362 sb.Append(FunctionsExpression);
363 sb.Append(',');
364 sb.Append(Expression.ToString(Preview));
365 sb.Append(',');
366 sb.Append(Expression.ToString(Parallel));
367 sb.Append(',');
368 sb.Append(DimX.ToString());
369 sb.Append(',');
370 sb.Append(DimY.ToString());
371 sb.Append(',');
372 sb.Append(SuperSampling.ToString());
373 sb.Append(',');
374 sb.Append(Expression.ToString(Gamma));
375 sb.Append(',');
376 sb.Append(Expression.ToString(LightFactor));
377 sb.Append(',');
378 sb.Append(Seed.ToString());
379 sb.Append(')');
380
381 return sb.ToString();
382 }
383
387 public static FractalGraph CalcFlame(double xCenter, double yCenter, double rDelta, long N,
388 FlameFunction[] Functions, int Width, int Height, int Seed, int SuperSampling, double Gamma,
389 double LightFactor, bool Preview, bool Parallel, Variables Variables, ScriptNode Node,
390 FractalZoomScript FractalZoomScript, object State)
391 {
392 double TotWeight = 0;
393 double Weight;
394 int i, c = Functions.Length;
395 Random Gen = new Random(Seed);
396
397 if (c < 1)
398 throw new ScriptRuntimeException("At least one flame function needs to be provided.", Node);
399
400 if (SuperSampling < 1)
401 throw new ScriptRuntimeException("SuperSampling must be a postitive integer.", Node);
402
404 Preview = false;
405
406 Array.Sort(Functions, (f1, f2) =>
407 {
408 double d = f2.Weight - f1.Weight;
409 if (d < 0)
410 return -1;
411 else if (d > 0)
412 return 1;
413 else
414 return 0;
415 });
416
417 double[] SumWeights = new double[c];
419
420 for (i = 0; i < c; i++)
421 {
422 f = Functions[i];
423 Weight = f.Weight;
424 if (Weight < 0)
425 throw new ScriptRuntimeException("Weights must be non-negative.", Node);
426
427 f.DefinitionDone();
428 TotWeight += Weight;
429 SumWeights[i] = TotWeight;
430 }
431
432 if (TotWeight == 0)
433 throw new ScriptRuntimeException("The total weight of all functions must be postitive.", Node);
434
435 for (i = 0; i < c; i++)
436 SumWeights[i] /= TotWeight;
437
438 double AspectRatio = ((double)Width) / Height;
439 double xMin, xMax, yMin, yMax;
440
441 xMin = xCenter - rDelta / 2;
442 xMax = xMin + rDelta;
443 yMin = yCenter - rDelta / (2 * AspectRatio);
444 yMax = yMin + rDelta / AspectRatio;
445
446 int NrGames = Parallel ? System.Environment.ProcessorCount : 1;
447
448 if (NrGames <= 1)
449 {
450 FlameState P = new FlameState(Gen, xMin, xMax, yMin, yMax, Width, Height, SuperSampling, N, ColorMode.Hsl, Node);
451 Variables v = new Variables();
452 Variables.CopyTo(v);
453
454 RunChaosGame(v, Functions, SumWeights, P, Preview, Gamma, LightFactor, Node);
455
456 return new FractalGraph(Variables, P.RenderBitmapHsl(Gamma, LightFactor, false, SKColors.Black), xMin, yMin, xMax, yMax, rDelta,
457 false, Node, FractalZoomScript, State);
458 }
459 else
460 {
461 FlameState[] P = new FlameState[NrGames];
462 WaitHandle[] Done = new WaitHandle[NrGames];
463 Thread[] T = new Thread[NrGames];
464
465 try
466 {
467 for (i = 0; i < NrGames; i++)
468 {
469 Done[i] = new ManualResetEvent(false);
470 P[i] = new FlameState(Gen, xMin, xMax, yMin, yMax, Width, Height, SuperSampling,
471 i < NrGames - 1 ? N / NrGames : N - (N / NrGames) * (NrGames - 1),
472 ColorMode.Hsl, Node);
473
474 Variables v = new Variables();
475 Variables.CopyTo(v);
476
477 T[i] = new Thread(new ParameterizedThreadStart(ChaosGameThread))
478 {
479 Name = "FlameFractal thread #" + (i + 1).ToString(),
480 Priority = ThreadPriority.BelowNormal
481 };
482
483 T[i].Start(new object[] { Done[i], i, v, Functions, SumWeights, P[i],
484 Node, i == 0 && Preview, Gamma, LightFactor });
485 }
486
487 WaitHandle.WaitAll(Done);
488
489 for (i = 1; i < NrGames; i++)
490 P[0].Add(P[i]);
491
492 return new FractalGraph(Variables, P[0].RenderBitmapHsl(Gamma, LightFactor, false, SKColors.Black), xMin, yMin, xMax, yMax, rDelta,
493 false, Node, FractalZoomScript, State);
494 }
495 catch (ThreadAbortException)
496 {
497 for (i = 0; i < NrGames; i++)
498 {
499 try
500 {
501 if (T[i] is null)
502 continue;
503
504 if (Done[i] is null || !Done[i].WaitOne(0))
505 T[i].Abort();
506 }
507 catch (Exception)
508 {
509 // Ignore
510 }
511 }
512
513 return null;
514 }
515 finally
516 {
517 for (i = 0; i < NrGames; i++)
518 {
519 try
520 {
521 Done[i]?.Close();
522 }
523 catch (Exception)
524 {
525 // Ignore
526 }
527 }
528 }
529 }
530 }
531
532 private static void ChaosGameThread(object P)
533 {
534 object[] Parameters = (object[])P;
535 ManualResetEvent Done = (ManualResetEvent)Parameters[0];
536 //int GameNr = (int)Parameters[1];
537 Variables v = (Variables)Parameters[2];
538 FlameFunction[] Functions = (FlameFunction[])Parameters[3];
539 double[] SumWeights = (double[])Parameters[4];
540 FlameState P2 = (FlameState)Parameters[5];
541 ScriptNode Node = (ScriptNode)Parameters[6];
542 bool Preview = (bool)Parameters[7];
543 double Gamma = (double)Parameters[8];
544 double LightFactor = (double)Parameters[9];
545
546 try
547 {
548 RunChaosGame(v, Functions, SumWeights, P2, Preview, Gamma, LightFactor, Node);
549 }
550 catch (ThreadAbortException)
551 {
552 Thread.ResetAbort();
553 }
554 catch (Exception)
555 {
556 // Ignore.
557 }
558 finally
559 {
560 Done.Set();
561 }
562 }
563
564 private static void RunChaosGame(Variables v, FlameFunction[] Functions,
565 double[] SumWeights, FlameState P, bool Preview, double Gamma, double LightFactor,
566 ScriptNode Node)
567 {
568 Random Gen = new Random();
569 FlameFunction f;
570 double Weight;
571 int i, j;
572 int c = Functions.Length;
573
574 for (i = 0; i < 20; i++)
575 {
576 Weight = Gen.NextDouble();
577 j = 0;
578 while (j < c - 1 && SumWeights[j] <= Weight)
579 j++;
580
581 f = Functions[j];
582 if (!f.Operate(P, v))
583 {
584 P.N = 0;
585 break;
586 }
587 }
588
589 if (Preview || v.HandlesStatus)
590 {
591 DateTime Start = DateTime.Now;
592 DateTime NextPreview = Start.AddSeconds(1);
593 DateTime PrevPreview = Start;
594 DateTime Temp;
595 DateTime Temp2;
596 TimeSpan TimeLeft;
597 int NextPreviewDeciSeconds = 10;
598 int NrIterationsPerPreview = 4096;
599 int Pos = NrIterationsPerPreview;
600 long NrIterations;
601 long PrevNrIterations = 0;
602 long NrIterationsSinceLast;
603 double PercentDone;
604 double IterationsPerSeconds;
605
606 do
607 {
608 if (Pos-- <= 0)
609 {
610 Pos = NrIterationsPerPreview;
611 Temp = DateTime.Now;
612 if (Temp > NextPreview)
613 {
614 NextPreview = Temp.AddSeconds(NextPreviewDeciSeconds * 0.1);
615 if (NextPreviewDeciSeconds < 50)
616 NextPreviewDeciSeconds++;
617
618 if (Preview)
619 {
620 v.Preview(Node.Expression, new GraphBitmap(v, P.RenderBitmapHsl(Gamma, LightFactor, true, SKColors.Black)));
621
622 Temp2 = DateTime.Now;
623
624 double d = (Temp2 - Temp).TotalSeconds;
625 double d2 = (Temp - PrevPreview).TotalSeconds;
626
627 if (d / d2 > 0.1)
628 {
629 NrIterationsPerPreview <<= 1;
630 if (NrIterationsPerPreview < 0)
631 NrIterationsPerPreview = int.MaxValue;
632 }
633 }
634
635 NrIterations = P.N0 - P.N;
636 NrIterationsSinceLast = NrIterations - PrevNrIterations;
637 IterationsPerSeconds = NrIterationsSinceLast / (Temp - PrevPreview).TotalSeconds;
638 PercentDone = (100 * (1.0 - ((double)P.N) / P.N0));
639 TimeLeft = new TimeSpan((long)((Temp - Start).Ticks * 100 / PercentDone));
640 v.Status(Node.Expression, P.N.ToString() + " iterations left, " + NrIterations.ToString() + " iterations done, " + IterationsPerSeconds.ToString("F0") + " iterations/s, " + PercentDone.ToString("F1") + "% done, Time Left: " + TimeLeft.ToString() + ".");
641 PrevNrIterations = NrIterations;
642 PrevPreview = Temp;
643 }
644 }
645
646 Weight = Gen.NextDouble();
647 j = 0;
648 while (j < c - 1 && SumWeights[j] <= Weight)
649 j++;
650
651 f = Functions[j];
652 if (!f.Operate(P, v))
653 break;
654 }
655 while (P.IncHistogram());
656
657 v.Status(Node.Expression, string.Empty);
658 }
659 else
660 {
661 do
662 {
663 Weight = Gen.NextDouble();
664 j = 0;
665 while (j < c - 1 && SumWeights[j] <= Weight)
666 j++;
667
668 f = Functions[j];
669 if (!f.Operate(P, v))
670 break;
671 }
672 while (P.IncHistogram());
673 }
674 }
675
676 }
677}
Class managing a script expression.
Definition: Expression.cs:39
static double ToDouble(object Object)
Converts an object to a double value.
Definition: Expression.cs:4824
static string ToString(double Value)
Converts a value to a string, that can be parsed as part of an expression.
Definition: Expression.cs:4496
Defines a clickable fractal graph in the complex plane.
Definition: FractalGraph.cs:22
Calculates a flame fractal in HSL space. Intensity is mapped along the L-axis. Gamma correction is do...
FlameFractalHsl(ScriptNode xc, ScriptNode yc, ScriptNode dr, ScriptNode N, ScriptNode FlameFunctions, ScriptNode Preview, ScriptNode Parallel, ScriptNode DimX, ScriptNode DimY, int Start, int Length, Expression Expression)
TODO
FlameFractalHsl(ScriptNode xc, ScriptNode yc, ScriptNode dr, ScriptNode N, ScriptNode FlameFunctions, ScriptNode Preview, ScriptNode Parallel, ScriptNode DimX, ScriptNode DimY, ScriptNode SuperSampling, ScriptNode Gamma, ScriptNode LightFactor, ScriptNode Seed, int Start, int Length, Expression Expression)
TODO
FlameFractalHsl(ScriptNode xc, ScriptNode yc, ScriptNode dr, ScriptNode N, ScriptNode FlameFunctions, ScriptNode Preview, ScriptNode Parallel, ScriptNode DimX, ScriptNode DimY, ScriptNode SuperSampling, int Start, int Length, Expression Expression)
TODO
FlameFractalHsl(ScriptNode xc, ScriptNode yc, ScriptNode dr, ScriptNode N, ScriptNode FlameFunctions, ScriptNode Preview, int Start, int Length, Expression Expression)
TODO
FlameFractalHsl(ScriptNode xc, ScriptNode yc, ScriptNode dr, ScriptNode N, ScriptNode FlameFunctions, ScriptNode Preview, ScriptNode Parallel, ScriptNode DimX, int Start, int Length, Expression Expression)
TODO
FlameFractalHsl(ScriptNode xc, ScriptNode yc, ScriptNode dr, ScriptNode N, ScriptNode FlameFunctions, ScriptNode Preview, ScriptNode Parallel, ScriptNode DimX, ScriptNode DimY, ScriptNode SuperSampling, ScriptNode Gamma, int Start, int Length, Expression Expression)
TODO
FlameFractalHsl(ScriptNode xc, ScriptNode yc, ScriptNode dr, ScriptNode N, ScriptNode FlameFunctions, ScriptNode Preview, ScriptNode Parallel, ScriptNode DimX, ScriptNode DimY, ScriptNode SuperSampling, ScriptNode Gamma, ScriptNode LightFactor, int Start, int Length, Expression Expression)
TODO
override IElement Evaluate(IElement[] Arguments, Variables Variables)
TODO
FlameFractalHsl(ScriptNode xc, ScriptNode yc, ScriptNode dr, ScriptNode N, ScriptNode FlameFunctions, int Start, int Length, Expression Expression)
TODO
FlameFractalHsl(ScriptNode xc, ScriptNode yc, ScriptNode dr, ScriptNode N, ScriptNode FlameFunctions, ScriptNode Preview, ScriptNode Parallel, int Start, int Length, Expression Expression)
TODO
static FractalGraph CalcFlame(double xCenter, double yCenter, double rDelta, long N, FlameFunction[] Functions, int Width, int Height, int Seed, int SuperSampling, double Gamma, double LightFactor, bool Preview, bool Parallel, Variables Variables, ScriptNode Node, FractalZoomScript FractalZoomScript, object State)
TODO
Calculates a flame fractal in RGBA space. Intensity is calculated along the A-axis....
static void EstimateSize(out double xCenter, out double yCenter, out double rDelta, FlameFunction[] Functions, int Width, int Height, int Seed, long N, Variables Variables, ScriptNode Node)
TODO
Handles bitmap-based graphs.
Definition: GraphBitmap.cs:13
Base class for graphs.
Definition: Graph.cs:79
static SKColor ToColor(object Object)
Converts an object to a color.
Definition: Graph.cs:828
Base class for multivariate funcions.
ScriptNode[] Arguments
Function arguments.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
override string ToString()
Definition: ScriptNode.cs:359
Expression Expression
Expression of which the node is a part.
Definition: ScriptNode.cs:177
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Collection of variables.
Definition: Variables.cs:25
TextWriter ConsoleOut
Console out interface. Can be used by functions and script to output data to the console.
Definition: Variables.cs:219
void Preview(Expression Expression, IElement Result)
Reports a preview of the final result.
Definition: Variables.cs:455
bool HandlesPreview
If previews are desired.
Definition: Variables.cs:437
bool HandlesStatus
If status messages are desired.
Definition: Variables.cs:501
void Status(Expression Expression, string Result)
Reports current status of execution.
Definition: Variables.cs:481
void CopyTo(Variables Variables)
Copies available variables to another variable collection.
Definition: Variables.cs:400
Basic interface for all types of elements.
Definition: IElement.cs:20
Base interface for lambda expressions.
delegate string FractalZoomScript(double r, double i, double Size, object State)
Generates new script when zoomed.
ArgumentType
Type of parameter used in a function definition or a lambda definition.
Definition: IFunction.cs:9