summaryrefslogtreecommitdiff
path: root/graphics.h
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-07-04 14:57:00 +0000
committerrodri <rgl@antares-labs.eu>2024-07-04 14:57:00 +0000
commit6d8fbc2953c6ae29ee5162ca04920d6cef85d0ce (patch)
tree17876fc78176c7877130766ac4b1fcb126062f5a /graphics.h
parent32219aaa35b07d6abceb7df9f802c9758b53eb72 (diff)
downloadlibgraphics-6d8fbc2953c6ae29ee5162ca04920d6cef85d0ce.tar.gz
libgraphics-6d8fbc2953c6ae29ee5162ca04920d6cef85d0ce.tar.bz2
libgraphics-6d8fbc2953c6ae29ee5162ca04920d6cef85d0ce.zip
rough color space conversion implementation.
colors are now properly processed in linear RGB space for lighting, shading and blending. sRGB is assumed for any texture sampled and the destination framebuffer. it's not perfect, but it does the job for now.
Diffstat (limited to 'graphics.h')
-rw-r--r--graphics.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/graphics.h b/graphics.h
index 7b46ed7..335b4b0 100644
--- a/graphics.h
+++ b/graphics.h
@@ -339,6 +339,10 @@ Point2 modulapt2(Point2, Point2);
Point3 modulapt3(Point3, Point3);
Memimage *rgb(ulong);
+/* color */
+Color srgb2linear(Color);
+Color linear2srgb(Color);
+
/* shadeop */
double sign(double);
double step(double, double);