It's not at all clear what algorithm a standard texturing library would use, and it's probably not a true projection, so if accuracy is important, you many need to do this yourself (or do some research into what specific algorithms are being used for a given library).
The basic algorithm is simple. Basically you just need to find where line emanating from your projection point intersect your surface. In more detail: 1) decide on your projection point, 2) decide on a bunch of lines emanating from your projection point that will give you resolution you need on your warped surface, 3) determine where these lines intersect your surface (the exact method will depend on your surface representation), 4) assume that your flat image is placed somewhere between your projection point and warped surface and find the intersection of the line with the flat surface and assign this value to the location on the warped surface.
On the other hand, if your surface is described mathematically, there may be a simple equation for this, as would be the case, for example, if you were mapping a plane to a sphere.