byte[] tableau1 = new byte[84987];
byte[] tableau2 = new byte[84988];
MessageBox.Show(GC.GetGeneration(tableau1).ToString());
MessageBox.Show(GC.GetGeneration(tableau2).ToString());
unsafe
{
byte* monTableau = stackalloc byte[50];
byte* monTableau2 = stackalloc byte[50];
byte cpt = 0;
do
monTableau[cpt] = 5;
monTableau2[cpt] = 3;
}
while (cpt++ < 49);
MessageBox.Show(monTableau[0].ToString());
MessageBox.Show(monTableau[49].ToString());
MessageBox.Show(monTableau2[0].ToString());
MessageBox.Show(monTableau2[49].ToString());
while (cpt++ < 51);
while (cpt++ < 52);
MessageBox.Show(monTableau[52].ToString());
MessageBox.Show(monTableau2[52].ToString());
//tables de précalculs des multiplications pour le calcul du niveau de gris
int* multiBleu = stackalloc int[256];
int* multiVert = stackalloc int[256];
int* multiRouge = stackalloc int[256];
//le pattern a appliquer sur des niveaux de gris de 64
byte[] pat = new byte[64]{0,32,8,40,34,2,10,42,
48,16,56,24,50,18,58,26,
12,44,4,36,14,46,6,38,
60,28,52,20,62,30,54,22,
3,35,11,43,1,33,9,41,
51,19,59,27,49,17,57,25,
15,47,7,39,13,45,5,37,
63,31,55,23,61,29,53,21};
byte* pattern = stackalloc byte[64];
for (int i = 0; i < 64; i++)
pattern[i] = pat[i];
Marshal.Copy(pat, 0, new IntPtr(pattern), 64);