I have successfully loaded a .jpg image using the library libsoil-dev as found for Debian using the command
uchar* img = SOIL_load_image(pfname_texture.c_str(),
&img_width, &img_height, NULL, 0);
The latter two parameters are int* channels and int force_channels whatever that may mean in detail, but they seem to touch stuff like the alpha channel.
Using said command I know width and height of the image in pixels.
Now I want to flop it horizontally (meaning the left and right edges switch sides). This would be easy if I knew the size of uchar* img. However, as things stand I do not, because I cannot be sure how many uchars make up one pixel. Plus I do not know how the pixels are ordered in memory (linewise, columnwise, from top to bottom or vice versa, you name it). Any ideas?