Added sRGB (gamma-correct) support for Images, Canvases, and the main screen.

love.graphics.newImage(path, “srgb”) creates a new Image whose texels are treated as being in the sRGB color space, so they are linearized when drawing/sampling from the image.

love.graphics.newCanvas(w, h, “srgb”) creates a new Canvas whose texels are treated as being in the sRGB color space, so drawing to the Canvas does a linear->sRGB conversion (but blends linearly), and sampling from it (drawing it or using it in a shader) converts from sRGB to linear space.

The "srgb" window flag does the same as Canvases for the main screen.
This commit is contained in:
Alex Szpakowski
2014-02-02 18:31:41 -04:00
parent 9e746c56fa
commit ce4fdf4ac9
20 changed files with 237 additions and 95 deletions
+2
View File
@@ -57,6 +57,7 @@ public:
SETTING_CENTERED,
SETTING_DISPLAY,
SETTING_HIGHDPI,
SETTING_SRGB,
SETTING_MAX_ENUM
};
@@ -157,6 +158,7 @@ struct WindowSettings
bool centered; // = true
int display; // = 0
bool highdpi; // false
bool sRGB; // false
}; // WindowSettings