A theoretical question...
Finally having some working GUI, I created a very simple icon, which is used with winit for creating an icon. The 'image' is scaled up to 256 x 256 using 3 Rgba colors.
// declare const or static, local or global?
static LEMMIX_ICON: [u8; 256] =
[
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,
0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,
0,0,0,0,2,0,1,2,2,1,0,2,0,0,0,0,
0,0,0,0,0,2,0,2,2,0,2,0,0,0,0,0,
0,0,0,0,0,0,2,3,3,2,0,0,0,0,0,0,
0,0,0,0,0,0,0,3,3,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,3,3,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,3,3,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,3,3,0,0,0,0,0,0,0,
0,0,0,0,0,0,2,2,2,2,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
];
During the creation / decoding of the image I use this encoded array.
Should I declare this array as global const or static?
Should I declare this array as local const or static (inside my function, the only place where it is used)?
And does it matter?
And where does the data reside in the application in all 4 cases?