Add rygorous's float->srgb8 conversion routine to the stdlib.

Issue #230
This commit is contained in:
Matt Pharr
2012-04-27 10:03:19 -10:00
parent 0e2b315ded
commit 0c5d7ff8f2
2 changed files with 144 additions and 0 deletions

View File

@@ -147,6 +147,7 @@ Contents:
* `Converting Between Array-of-Structures and Structure-of-Arrays Layout`_
* `Conversions To and From Half-Precision Floats`_
* `Converting to sRGB8`_
+ `Systems Programming Support`_
@@ -3691,6 +3692,22 @@ precise.
uniform int16 float_to_half_fast(uniform float f)
Converting to sRGB8
-------------------
The sRGB color space is used in many applications in graphics and imaging;
see the `Wikipedia page on sRGB`_ for more information. The ``ispc``
standard library provides two functions for converting floating-point color
values to 8-bit values in the sRGB space.
.. _Wikipedia page on sRGB: http://en.wikipedia.org/wiki/SRGB
::
int float_to_srgb8(float v)
uniform int float_to_srgb8(uniform float v)
Systems Programming Support
---------------------------