I need help with arrays. My assignment is use a 3D array to create an image. Use an array of the form arr[300][200][3]. For this homework, you need to use an array of the form arr[3][400][500]. It will have 400 rows and 500 columns. You need to first initialize the array as described in class and after that write the array to a ppm image file. When viewed using Gimp, it should display USM. The letters would be 200 pixels high and 100 pixels wide each. Use at least 15 pixels for the width of the stroke. Use different colors for each letter and a different color for the background.
This is what I have so far. I am a beginner and trying to figure all of this out so I know that I have a lot wrong.
void initialize(unsigned char a[][200][3], int nrows, int ncols, int nc);
void printAll(unsigned char a[][200][3], int nrows, int ncols, int nc);
void writeAll(unsigned char a[][200][3], int nrows, int ncols, int nc);
void writeAllB(unsigned char a[][200][3], int nrows, int ncols, int nc);
Lol. Glad to see I'm not the only one confused about this assignment. Everyone else in our class seems to be. I'd be interested to see if anyone's gotten farther than this.
If everyone in the whole class is confused then the teacher has failed to explain him/her-self. You should all confront the teacher and ask for clarification.
If you are expected to fill a 3d array containing 3 2d arrays of 400x500, and this data is to contain the pixels for the 3 letters: "U", "S", "M", then it would appear that each of the array items of 400x500 is each a letter; "U", "S", "M". Thus each letter is made up of a 400x500 matrix.
1) Write a function that will accept a char* and creates a 400x500 matrix representing the letter in the arg to the function.
2) Iterate through the array; three iterations, and on each iteration call the function that will "print" the "letter" from the array item.
I mabe completely wrong, but that is my observation from the information provided.