KHTML
ColorDistance.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef ColorDistance_h
00023 #define ColorDistance_h
00024 #if ENABLE(SVG)
00025
00026 namespace WebCore {
00027
00028 class Color;
00029
00030 class ColorDistance {
00031 public:
00032 ColorDistance();
00033 ColorDistance(const Color& fromColor, const Color& toColor);
00034 ColorDistance(int redDiff, int blueDiff, int greenDiff);
00035
00036 ColorDistance scaledDistance(float scaleFactor) const;
00037 Color addToColorAndClamp(const Color&) const;
00038
00039 static Color addColorsAndClamp(const Color&, const Color&);
00040
00041 bool isZero() const;
00042
00043 float distance() const;
00044
00045 private:
00046 short m_redDiff;
00047 short m_greenDiff;
00048 short m_blueDiff;
00049 };
00050 }
00051
00052 #endif // ENABLE(SVG)
00053 #endif // ColorDistance_h