I'm making a bottom-top rgb pixel array to top-bottom. I've checked the value of something and it gives me the expected output. No value is greater than obj.size() and no value is less than 0, I don't know what's up :/
std::vector<std::string> BMP_READER::TopBottom(std::vector<std::string> obj)
{
if (y_height <= 1) { return obj; } // nothing to reverse if its only one row
std::vector<std::string> new_v;
for (int h = 0; h < y_height; h++)
{
for (int i = x_width; i >= 1; i--)
{
int something = (obj.size() - i) - (x_width*h); // error
std::string val = obj[something];
new_v.push_back(val);
}
}
return new_v;
}