Remove unnecessary sRGB conversions

This commit is contained in:
baldurk
2022-06-16 16:30:00 +01:00
parent 0fce39ff04
commit 1eee00f01d
2 changed files with 0 additions and 14 deletions
-7
View File
@@ -507,13 +507,6 @@ private:
if(m_IsDepth)
r = g = b = qBound(0.0f, (val.depth - m_Display.rangeMin) / rangesize, 1.0f);
// Convert from linear color to sRGB
{
r = (r <= 0.0031308f) ? r * 12.92f : 1.055f * (float)powf(r, 1.0f / 2.4f) - 0.055f;
g = (g <= 0.0031308f) ? g * 12.92f : 1.055f * (float)powf(g, 1.0f / 2.4f) - 0.055f;
b = (b <= 0.0031308f) ? b * 12.92f : 1.055f * (float)powf(b, 1.0f / 2.4f) - 0.055f;
}
// Round to nearest value in [0,255]
return QBrush(QColor::fromRgb((int)(255.0f * r + 0.5f), (int)(255.0f * g + 0.5f),
(int)(255.0f * b + 0.5f)));
-7
View File
@@ -953,13 +953,6 @@ void TextureViewer::UI_UpdateStatusText()
float g = qBound(0.0f, m_CurHoverValue.floatValue[1], 1.0f);
float b = qBound(0.0f, m_CurHoverValue.floatValue[2], 1.0f);
if(tex.format.SRGBCorrected() || (tex.creationFlags & TextureCategory::SwapBuffer))
{
r = powf(r, 1.0f / 2.2f);
g = powf(g, 1.0f / 2.2f);
b = powf(b, 1.0f / 2.2f);
}
swatchColor = QColor(int(255.0f * r), int(255.0f * g), int(255.0f * b));
}