I want to warp a flat image in a way that it appears to be the projection coming from a cylinder.
I have a flat image like this:

and I want to show it as something like this in 2D image:

I'm a bit phased out on geometrical projections. I visited some other questions like this but I don't understand how will I represent these cylindrical coordinates (theta and rho) into x,y coordinates in cartesian (x,y) plane. Could you guys help me with an elaborative example? I'm coding it for iPhone and I'm not using any 3rd party library like OpenCV etc.
Thanks a bunch.