My understanding of the rendering of a typical RAW file, which contains 14 bits per channel, is that it is simply clipped to the 8 bits per channel used by most image viewers. Presumably camera defaults are to take the middle slice of that range, whereas processing programs allow the user to shift the 8-bit "window" left and right.
RAW data can be looked at as a special case of HDR data, which can be constructed with 16 or more bits per channel. With HDR techniques we don't want to clip the data and so instead we "tone map" it. My understanding of tone mapping is that it's a surjective transformation but that it requires user construction. I.e., there is no default tone mapping.
What I'm wondering is whether any programs provide a default mapping from HDR to 8-bit images one might call "compression," which would just transform each HDR pixel to an 8-bit pixel without clipping (but obviously losing dynamic detail across the spectrum).
So, for example, can one ask for a "compressed" rendering of a RAW file in Lightroom? For each channel this would map 0 to 0 and 2^14 to 2^8, with other values mapped linearly in between.
I have a suspicion that some contrast setting effectively does this, but I'm looking for a full understanding.