/// ImageBufAlgo::contrast ---------------------------------------------------
/// Formula: out = (in-pivot)*contrast + pivot
///
/// Parameters:
/// R - Output image R must have float pixel data type. R can be
/// initialized by the caller or not. If initialized and
/// R.nchannels() != A.nchannels(), then false is returned.
/// If not initialized, then it is initialized from A's spec
/// but the format is set to float, since output images from
/// IBA functions have float pixel data type by convention.
/// A - Input image A must have float pixel data type and at
/// least one channel.
/// contrast - A float parameter that can take values >= 0. Values < 0
/// are not allowed because the image colors get inverted.
/// Values closer to 0 result in values closer to pivot
/// and values further than 0 result in values further than
/// pivot. Values above 1 result in very strong contrast.
/// pivot - A float parameter that must be in range 0->1. All
/// pixel values deviate from this pivot value to lesser
/// or greater degree. Values closer to pivot deviate
/// less, and values further deviate to bigger degree. This
/// is the case because contrast adjustment essentially is
/// a multiplication.
/// roi - The operation will be applied only to this region. If
/// roi is not defined, then it is initialized from R.
/// If it is defined but not fully contained in R's region,
/// then its new value is the intersection region with R.
/// threads - Number of threads.
/// --------------------------------------------------------------------------
bool DLLPUBLIC contrast (ImageBuf &R, const ImageBuf &A,
float contrast, float pivot,
ROI roi = ROI(), int threads = 0);