for(int i = 0; i < hdr.getHeight(); i++){
for(int j = 0; j < hdr.getWidth(); j++){
Pixel temp = vec.at(i * hdr.getWidth() + j);
vec.at(i * hdr.getWidth() + j) = vec.at(i * hdr.getWidth() + ((i * hdr.getWidth()) - j));
vec.at(i * hdr.getWidth() + ((i * hdr.getWidth()) - j)) = temp;
}
}
I've been working on this class assignment pretty much all day, and all sense and reason and critical thinking abilities have absolutely left me. I understand the concept of iterating through a 1D vector as a 2D, in that
i * # of cols + j
Basically bypasses an entire row and references the first element in a "column," but trying to do that, and replacing the original pixel with the pixel at the mirrored position is absolutely escaping me.