Light, Distance, Color, Object: Where is the Internal Renderer Code that uses these?

I’m trying to get some matrices containing data that provides the light values (brightness, color, that sort of stuff), distance from camera, absolute color before lighting, and identity of whatever is in the corresponding pixel of what a scene camera is looking at. I know for certain, based on all that I’ve read, that no 3d rendering engine actually provides these values to a scripter directly. But I know darned well that Blender’s Internal Renderer should at least see these values at some point or another. It has to, since it has to act based on them. It has to know how far a point is from the camera since Freestyle uses this value (quite well too). It has to know what the light value is at a pixel to know what’s going on at that point. And so on. At some point, each of these values has to be used by the renderer.

So while there is no existing way to just have python get these values direct, the source code should have some idea what they are.

I’m fairly confident, even with my novice level coding skills, that if I knew where the values I’m looking for were that it would be easy for me could easily insert some lines of code that copy the values to matrices and write them somewhere for Python or a text editor or something to access. But I don’t think I can easily figure out where in Blender’s source code I can find these values.

So, where in Blender’s Source Code can I find where Blender’s Internal Renderer examines the light, distance, color, and identity of the object at each pixel it makes for an image?