From c7c5a53324eb688932612964c8fb47ad80b217c8 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Sun, 15 Oct 2017 11:06:27 -0700 Subject: [PATCH] indent rgblinear.c rgblinear.h --- src/rgblinear.c | 13 +++++++------ src/rgblinear.h | 3 +-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/rgblinear.c b/src/rgblinear.c index d0bb299ea..e915e895f 100644 --- a/src/rgblinear.c +++ b/src/rgblinear.c @@ -33,13 +33,14 @@ unsigned char linear_to_sRGB(float linear) { unsigned slot; + slot = linear * 4096.0 + 0.5; if (slot > 4095) - { - if (linear > 0.5) - slot = 4095; - else - slot = 0; - } + { + if (linear > 0.5) + slot = 4095; + else + slot = 0; + } return linear_to_sRGB_table[slot]; } diff --git a/src/rgblinear.h b/src/rgblinear.h index 7bca5f64f..7fe31ec9e 100644 --- a/src/rgblinear.h +++ b/src/rgblinear.h @@ -305,8 +305,7 @@ static const unsigned char linear_to_sRGB_table[4096] = "\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd" "\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe" "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe" - "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff" - "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"; + "\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"; unsigned char linear_to_sRGB(float linear) FUNCTION;