![]() | editing-note |
---|---|
(Bill) These Conversion Formulas will likely move to Section 2.7 Fixed-Point Data Conversions (RGB to sRGB and sRGB to RGB) and section 2.6 Numeric Representation and Computation (RGB to Shared Exponent and Shared Exponent to RGB) |
An RGB color (red, green, blue) is transformed to a shared exponent color (redshared, greenshared, blueshared, expshared) as follows:
First, the components (red, green, blue) are clamped to (redclamped, greenclamped, blueclamped) as:
Where:
![]() | Note |
---|---|
NaN, if supported, is handled as in IEEE 754-2008
|
The largest clamped component, maxclamped is determined:
A preliminary shared exponent exp' is computed:
The shared exponent expshared is computed:
Finally, three integer values in the range 0 to 2N are computed:
A shared exponent color (redshared, greenshared, blueshared, expshared) is transformed to an RGB color (red, green, blue) as follows:
Where: