Premier commit
[powerfractal.git] / PoFGui / Pkg_Outils_Fractals.ads
1
2
3 package Pkg_Outils_Fractals is
4
5 --------------------------TYPES--------------------------
6 type T_Couleur is record
7 R : Natural;
8 G : Natural;
9 B : Natural;
10 end record;
11
12 type T_Tab_Couleur is array (Natural range <>) of T_Couleur;
13
14 type T_Matrice_Couleur is array (0..Largeur_Ecran, 0..Hauteur_Ecran) of T_Couleur;
15 type T_Matrice_Iteration is array (Integer range <>, Integer range <>) of Natural;
16
17 type T_Centre is record
18 X : Long_Float := 0.6; --(0.6) (1.63)
19 Y : Long_Float := 0.0; --(0.0) (0.001)
20 end record;
21
22 -------------------------VARIABLES------------------------
23 NB_Iteration_Max : Positive := 256; --Nombre d'iteration
24
25 C_Diverge_Limite : Long_Float := 4.0; --doit être compris entre 0 et 4 (4 etant la valeur par défaut(normal))
26
27 Zoom : Long_Float := 1.0/4.0; --Facteur de zoom sur la fractal(1/4) (1200.0)
28
29 Centre : T_Centre := (-0.6, 0.0);
30
31 Cx : Long_Float := -0.577;
32 Cy : Long_Float := 0.468;
33
34
35 Nb_Iteration : Natural;
36
37 Points : T_Tab_Couleur := ((255,0,0), (0,255,0), (0,0,255), (255,255,0) );
38
39 Antialiasing : Boolean := False;
40
41 -- Degrade : T_Tab_Couleur(1 .. Nb_Iteration_Max);
42
43 Matrice_Ecran : T_Matrice_Iteration (0..Largeur_Ecran, 0..Hauteur_Ecran);
44 Matrice_Couleur : T_Matrice_Couleur;
45
46 ------------------------------------------------------------------------------------------------
47 -- Nom : Creer_Degrade --
48 -- But : Creer un tableau de degrade de couleur en fonction de couleur determinee --
49 ------------------------------------------------------------------------------------------------
50 procedure Creer_Degrade (Points_Definis_Param : in T_Tab_Couleur; Degrade : out T_Tab_Couleur; Nb_Iteration : in Natural);
51
52 ------------------------------------------------------------------------------------------------
53 -- Nom : Affiche_Degrade --
54 -- But : Affiche le degrade sur la longueur demandé sur 5 pixels de hauteur --
55 ------------------------------------------------------------------------------------------------
56 procedure Affiche_Degrade (Points_Definis : in T_Tab_Couleur; Longueur : in Integer);
57 ------------------------------------------------------------------------------------------------
58 -- Nom : Conversion_Couleur --
59 -- But : Convertit une matrice d'iteration en une matrice de couleur --
60 ------------------------------------------------------------------------------------------------
61 procedure Conversion_Couleur (Matrice : in T_Matrice_Iteration; Degrade : in T_Tab_Couleur; Matrice_Couleur : out T_Matrice_Couleur);
62
63 ------------------------------------------------------------------------------------------------
64 -- Nom : Calcul_Antialiasing --
65 -- But : Contracter une matrice en une autre 2 fois plus petite --
66 ------------------------------------------------------------------------------------------------
67 function Calcul_Antialiasing(Matrice_Antialiasing : T_Matrice_Iteration) return T_Matrice_Iteration;
68
69 ------------------------------------------------------------------------------------------------
70 -- Nom : Mandel_Gen --
71 -- But : Genere une matrice d'iteration selon Mandelbrot --
72 ------------------------------------------------------------------------------------------------
73 function Mandel_Gen (Largeur_Zone, Hauteur_Zone : Natural ; Zoom, C_Diverge_Limite : Long_Float;
74 NB_Iteration_Max : Positive; Centre : T_Centre;
75 Antialiasing : Boolean := False) return T_Matrice_Iteration;
76
77 ------------------------------------------------------------------------------------------------
78 -- Nom : Julia_Gen --
79 -- But : Genere une matrice d'iteration selon Mandelbrot --
80 ------------------------------------------------------------------------------------------------
81 function Julia_Gen (Largeur_Zone, Hauteur_Zone : Natural; Zoom, C_Diverge_Limite : Long_Float;
82 NB_Iteration_Max : Positive; Centre : T_Centre; Cx, Cy : Long_Float; Antialiasing : Boolean)
83 return T_Matrice_Iteration;
84
85
86 end Pkg_Outils_Fractals;