00001
00002
00003 #ifndef fggradientH
00004 #define fggradientH
00005
00006 #ifdef FG_NAMESPACE
00007 namespace fgl {
00008 #endif
00009
00010
00011
00012 #ifdef __BORLANDC__
00013 #pragma option push -b
00014 #pragma option push -a4
00015 #endif
00016
00021 class FGGradient
00022 {
00023 public:
00026 enum FGGradientMode { Wrap, Reflect, Repeat };
00029 enum FGGradientFunction { Linear, LinearXY, Radial, Diamond, Conic, Sqrt };
00030
00031 private:
00032 FGGradientMode mode;
00033 FGGradientFunction fnc;
00034
00035 void* array;
00036
00037 void init();
00038
00039 public:
00040 FGGradient();
00041 ~FGGradient();
00042
00046 FGGradient(FGColor& _start_color, FGColor& _end_color);
00050 FGGradient(FGColor& _start_color, FGColor& _middle_color, FGColor& _end_color);
00051
00055 void SetFunction(FGGradientFunction f) { fnc = f; }
00059 void SetMode(FGGradientMode m) { mode = m; }
00060
00069 void Draw(FGDrawBuffer& image, FGPoint& _start_point, FGPoint& _end_point, FGRect* rectangle=0);
00070
00078 void Draw(FGDrawBuffer& image, FGRect* rectangle=0);
00079 };
00080
00081 #ifdef __BORLANDC__
00082 #pragma option pop
00083 #pragma option pop
00084 #endif
00085
00086 #ifdef FG_NAMESPACE
00087 }
00088 #endif
00089
00090
00091 #endif