I'm a bit lost as to how I would take a pgm file stored into a vector and flip the order of the cells so as to make the final image a negative flip. I don't want the answer handed to me, I would just like some tips in the right direction! Thanks!
Asked
Active
Viewed 525 times
0
-
1What do you mean by "negative flip" - Do you mean horizontal? vertical? or inverting the values? – DiJuMx Feb 04 '14 at 19:00
-
Binary or text pgm format? If you're parsing text, just loop backwards through the bitmap array (you will still be reading forwards through the file). – Ben Voigt Feb 04 '14 at 19:24
-
Text format. And I mean by taking the lightest values and making them the darkest and vice versa. Like a negative film. – user3250013 Feb 04 '14 at 19:24
-
1@user3250013 In that case, since your pixel values are likely in the range 0-255, wouldn't simply making your output pixel be `255-input` be what you're looking for? – twalberg Feb 04 '14 at 22:14