Replacing old Colormap in Image tab
from file gui/tab/image.cpp
//! Color map for raw diffraction image: black-red-gold.
QRgb intenImage(float inten, float maxInten, bool curved)
{
if (qIsNaN(inten))
return qRgb(0x00, 0xff, 0xff);
if (qIsInf(inten))
return qRgb(0xff, 0xff, 0xff);
if (qIsNaN(maxInten) || maxInten <= 0)
return qRgb(0x00, 0x00, 0x00);
inten /= maxInten;
if (curved && inten > 0)
inten = qPow(inten, .6f);
float const low = .25f, mid = .5f, high = .75f;
if (inten < low)
return qRgb(int(0xff * inten * 4), 0, 0);
if (inten < mid)
return qRgb(0xff, int(0xff * (inten - low) * 4), 0);
if (inten < high)
return qRgb(int(0xff - (0xff * (inten - mid) * 4)), 0xff, int(0xff * (inten - mid) * 4));
return qRgb(int(0xff * (inten - high) * 4), 0xff, 0xff);
}
We recently took the effort to implement a QCP based and much more convenient user configurable ColorMap. We could also use this colormap here for the image tab. Additionally, this old Colormap doesnt seem to well to new detector data for Stress-Spec. So, a user configurable colormap would also be appreciated. However, I don't see this as a high priority.