Implementation of sRGB image support. Overhauls the linearization setup to utilize the sRGB image types, as well as refactors the use of ColorF and ColorI to be properly internally consistent. ColorIs are used only for front-facing/editing/UI settings, and ColorFs, now renamed to LinearColorF to reduce confusion of purpose, are used for color info in the engine itself. This avoids confusing and expensive conversions back and forth between types and avoids botches with linearity. Majority work done by @rextimmy

This commit is contained in:
Areloch 2017-06-23 11:36:20 -05:00
parent 8780f83262
commit 25686ed4be
294 changed files with 3894 additions and 2813 deletions

View file

@ -271,9 +271,9 @@ bool Stream::write(const ColorI& rColor)
return success;
}
bool Stream::write(const ColorF& rColor)
bool Stream::write(const LinearColorF& rColor)
{
ColorI temp = rColor;
ColorI temp = LinearColorF(rColor).toColorI();
return write(temp);
}
@ -287,7 +287,7 @@ bool Stream::read(ColorI* pColor)
return success;
}
bool Stream::read(ColorF* pColor)
bool Stream::read(LinearColorF* pColor)
{
ColorI temp;
bool success = read(&temp);

View file

@ -41,7 +41,7 @@
/// @}
class ColorI;
class ColorF;
class LinearColorF;
struct NetAddress;
class RawData;
class String;
@ -155,11 +155,11 @@ public:
/// Write an integral color to the stream.
bool write(const ColorI&);
/// Write a floating point color to the stream.
bool write(const ColorF&);
bool write(const LinearColorF&);
/// Read an integral color from the stream.
bool read(ColorI*);
/// Read a floating point color from the stream.
bool read(ColorF*);
bool read(LinearColorF*);
/// Write a network address to the stream.
bool write(const NetAddress &);