// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#define IMP310300 //GG Don't raise in constructor when an HLS color
-// is defined with hue sets to undefined (grey color)
-
-
//-Version
-
//-Design Declaration des variables specifiques aux couleurs
-
//-Warning Une couleur est definie, soit en RGB, soit en HLS,
// soit par un nom predefini extrait des noms X11.
-
//-References
-
//-Language C++ 2.0
-
//-Declarations
-
// for Test method
-#include <Standard_ErrorHandler.hxx>
-
// for the class
-#include <Quantity_Color.ixx>
+
+#include <Quantity_Color.hxx>
#include <Quantity_Color_1.hxx>
+#include <Quantity_ColorDefinitionError.hxx>
+#include <Standard_ErrorHandler.hxx>
#include <Standard_OutOfRange.hxx>
#include <TCollection_AsciiString.hxx>
-// for Test method (suite et fin)
#include <string.h>
-
+// for Test method (suite et fin)
void call_hlsrgb(float h, float l, float s, float& r, float& g, float& b);
void call_rgbhls(float r, float g, float b, float& h, float& l, float& s);
break;
case Quantity_TOC_HLS :
-#ifdef IMP310300
if ( (R1 < 0. && R1 != RGBHLS_H_UNDEFINED && R3 != 0.0)
|| (R1 > 360.) ||
-#else
- if ( R1 < 0. || R1 > 359. ||
-#endif
R2 < 0. || R2 > 1. ||
R3 < 0. || R3 > 1. )
Standard_OutOfRange::Raise ("Color out");
}
-Quantity_Color& Quantity_Color::Assign (const Quantity_Color& Other) {
-
- MyRed = Standard_ShortReal (Other.Red ());
- MyGreen = Standard_ShortReal (Other.Green ());
- MyBlue = Standard_ShortReal (Other.Blue ());
- return (*this);
-
-}
-
void Quantity_Color::SetValues (const Quantity_NameOfColor AName) {
Quantity_Color::ValuesOf
break;
case Quantity_TOC_HLS :
-#ifdef IMP310300
if ( R1 < 0. || R1 > 360. ||
-#else
- if ( R1 < 0. || R1 > 359. ||
-#endif
R2 < 0. || R2 > 1. ||
R3 < 0. || R3 > 1. )
Standard_OutOfRange::Raise ("Color out");
hcopy = h;
lmuls = l * s;
-#ifdef IMP310300
if (s == 0.0 && h == RGBHLS_H_UNDEFINED) {
-#else
- if (s == 0.0) {
- if (h == RGBHLS_H_UNDEFINED)
- /* cas teinte indefinie */
- h = RGBHLS_H_UNDEFINED;
- else
-#endif
/* cas achromatique */
r = g = b = l;
}