Class to represent a raw camera image and set the parameters related to processing it.
Image processing steps
The actual raw image loading and processing up to demosaicing is done with dcraw. Since dcraw pipeline may have some nonlinear processing steps (at least when camera ICC profile is used) that are done after color correction the resulting image can have color effects that depend in non-desirable way from actual white balance settings.
To avoid this I load image from dcraw always using the daylight color correction recommended in the image file (stored to daylightMultipliers). I then do the actual white balance correction here. This is certainly non-optimal and at least in theory can lead to lost accuracy or even color clipping. But at least it behaves predictably.
As a summary, the processing steps done for raw image are
- dcraw loads raw data
- dcraw scales raw channels using daylight multipliers
- draw does demosaicing (using 2x2 box filter if small resolution is enough or AHD interpolation
- dcraw converts to linear sRGB color space using either camera specific color matrix or ICC profile
- This class loads image from dcraw and forms image mipmap for JAI renderable pipeline
- This class finalizes color correction to desired white balance
- This class does exposure & contrast adjustments and converts the image from linear to gamma corrected sRGB color space.
- Base class ( {@link PhotovaultImage}) applies desired lookup tables in gamma corrected RGB & IHS color spaces if needed and instructs JAI to render final image.