[babl] babl: fix fixed to double conversions
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] babl: fix fixed to double conversions
- Date: Sat, 9 Jun 2018 17:23:13 +0000 (UTC)
commit e2ace5f161d65a00282c09cf2a13fc182bffc139
Author: Elle Stone <ellestone ninedegreesbelow com>
Date: Sat Jun 9 19:18:43 2018 +0200
babl: fix fixed to double conversions
See issue #18 https://gitlab.gnome.org/GNOME/babl/issues/18
babl/babl-icc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/babl/babl-icc.c b/babl/babl-icc.c
index e8393e3..973da7f 100644
--- a/babl/babl-icc.c
+++ b/babl/babl-icc.c
@@ -165,12 +165,12 @@ static u8f8_t d_to_u8f8 (double value)
static double s15f16_to_d (s15f16_t fix)
{
- return fix.integer + fix.fraction / 65535.0;
+ return fix.integer + fix.fraction / 65536.0;
}
static double u8f8_to_d (u8f8_t fix)
{
- return fix.integer + fix.fraction / 255.0;
+ return fix.integer + fix.fraction / 256.0;
}
static void write_s15f16 (ICC *state, int offset, double value)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]