hi everyone. I'm a beginner and i need help with a university project in c++. I'm not asking you to do it, but since the professor is not really into answering questions i thought you guys could help to visualize what i actually have to do in order to start the project right!
this is the task: Template class showing images with 1,2,3,4 channels. Class which implements kernel image processing. Reading and writing in PPM / PGM format.
the first point is not a problem. the second seems a little worrying but overall i think i could manage to do it. I do have some issues with the PPM/PGM format part though. I literally have no clues about how to implement it, could someone give me a hint?
also, how may classes should i create? 1 template class, 1 for kernel image processing 1 for writing in ppm format, 1 for writing in pgm format, and finally 1 for reading pgm and 1 for reading ppm? i think it should be like this according to the single responsibility principle, shouldn't it?
I'm pretty confused... Help anyone?
I don't even have an idea what a PPM/PGM format looks like, so take these advices with a grain of salt.
The core task sounds to me like reading and displaying a PPM / PGM file. A bit of Googling shows that it's binary, I imagine you would need something like fread()
We want a minimal working example first, so we can put aside the issue of figuring out how many classes you want. Instead, focus on researching the PPM / PGM format.
You are supposed to figure out how to read the file and put it into a 2D array.
unsigned char img[x][y];
If you manage to do this, I imagine you'd want to display this array as an image, do you have any resource or ideas on how to do that? You'll need something like SDL to put write (coloured) pixels onto an output window.
PPM - Portable Pix Map
PGM - Portable Grey Map
PBM - Portable Bit Map
are all text formats that have been around since the 1980s on Unix systems, not too common outside of them. See...