[babl] extensions: clamping to [0.0, 1.0] is not needed



commit 904cee6af73a1429a28d424734614f7d5ca08df9
Author: Téo Mazars <teo mazars ensimag fr>
Date:   Sun Jun 30 15:58:43 2013 +0200

    extensions: clamping to [0.0, 1.0] is not needed
    
    As babl allows out of sRGB gamut values.

 extensions/CIE.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)
---
diff --git a/extensions/CIE.c b/extensions/CIE.c
index b83a07e..5f34051 100644
--- a/extensions/CIE.c
+++ b/extensions/CIE.c
@@ -933,11 +933,6 @@ static const double LRAMP = 7.99959199;
 static double xnn, znn;
 
 
-#ifndef CLAMP
-#define CLAMP(x, l, u)    ((x) < (l) ? (l) : ((x) > (u) ? (u) : (x)))
-#endif
-
-
 typedef double CMatrix[3][3];
 typedef double CVector[3];
 
@@ -1282,11 +1277,6 @@ cpercep_space_to_rgb (double  inr,
 
   xyz_to_rgb (&inr, &ing, &inb);
 
-  /* yes, essential.  :( */
-  inr = CLAMP (inr, 0.0, 1.0);
-  ing = CLAMP (ing, 0.0, 1.0);
-  inb = CLAMP (inb, 0.0, 1.0);
-
   *outr = inr;
   *outg = ing;
   *outb = inb;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]