]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - image.h
convert lightmaps to sRGB for nice sRGB support
[xonotic/darkplaces.git] / image.h
diff --git a/image.h b/image.h
index 60fbcce681c1aa93311efc3d4e3e1dd6f61de373..04d33378ff1be29f4a6610dc2b97b37103c2d91f 100644 (file)
--- a/image.h
+++ b/image.h
@@ -50,8 +50,10 @@ void Image_FixTransparentPixels_f(void);
 extern cvar_t r_fixtrans_auto;
 
 #define Image_LinearFloatFromsRGB(c) (((c) < 11) ? (c) * 0.000302341331f : (float)pow(((c)*(1.0f/256.0f) + 0.055f)*(1.0f/1.0555f), 2.4f))
+#define Image_sRGBFloatFromLinear(c) (((c) < 1) ? (c) * 0.05046875f : 1.055f * (float)pow((c)*(1.0f/256.0f), 1.0f/2.4f) - 0.055f)
 
 void Image_MakeLinearColorsFromsRGB(unsigned char *pout, const unsigned char *pin, int numpixels);
+void Image_MakesRGBColorsFromLinear(unsigned char *pout, const unsigned char *pin, int numpixels);
 
 #endif