Most of it can be done in OpenGL.
Loading and saving images isn't an OpenGL function though.
To do this you need to load the bitmap into memory.
Create a destination bitmap in memory.
Set Open GL to render to your destination bitmap.
Apply the original bitmap as a texture to a square mesh.
Rotate the mesh.
Render the mesh.
Save the destination bitmap.
This link describes how to render to a texture.
http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-14-render-to-texture/[
^]
Note that some OpenGL functions use the GL_RGB parameter.
For 24 bit windows bitmaps, you can use GL_BGR instead, as windows has the Red Green and Blue reversed.
For 32 bit windows bitmaps, use GL_BGRA
These settings allow you to use the bitmap buffers directly, without the need for code that corrects the color order.