hello all, I'm having a lot of trouble with this assignment. I'm supposed to make an image manipulator using CxImage library...I run into a problem when I want to, for example brighten/darken the image. This will be quite difficult to grasp from the code I will post here, and the whole zipped file along with the libraries and such is too big to attach so I will only attach my .cpp file, any how, here is the brighten function:
I think that the problem is with pict.setPixel() function. Here is how it is defined:Code:void applyBrighten(Picture& pict) { int width = pict.getWidth(); int height = pict.getHeight(); int addMe = 50; Color tColor(0, 0, 0); for (int i=0; i < width; i++){ for (int j=0; j < height; j++){ tColor = pict.getPixel(i, j); tColor = tColor.addToColor(addMe); pict.setPixel(i, j, tColor); } } }
I'm sure that this is very difficult to grasp by just looking at these snippets, so if anyone is willing to take some time to look at the complete program I would greatly appreciate it. If you want me to send the other files, libraries please say so,Code:void setPixel(int i, int j, const Color& c) {matrix[i][j] = c; }
axon



LinkBack URL
About LinkBacks



