How to load an internal blender image using OSL?
If I understand the question right. The internal images are values that are generated from coardinates and do not realy exist. You should be able to call the existing method eather direct or indirect.

If that don't worke for you all of the math to generate them isn't that hard to find on the internet.