157d51b24SRyan Leavengood /* 257d51b24SRyan Leavengood * Copyright 2010-2011, Haiku, Inc. All Rights Reserved. 357d51b24SRyan Leavengood * Distributed under the terms of the MIT License. 457d51b24SRyan Leavengood * 557d51b24SRyan Leavengood * Authors: 657d51b24SRyan Leavengood * Geoffry Song, goffrie@gmail.com 757d51b24SRyan Leavengood */ 857d51b24SRyan Leavengood #ifndef _BUTTERFLY_H_ 957d51b24SRyan Leavengood #define _BUTTERFLY_H_ 1057d51b24SRyan Leavengood 1157d51b24SRyan Leavengood 1257d51b24SRyan Leavengood #include <ScreenSaver.h> 1357d51b24SRyan Leavengood 1457d51b24SRyan Leavengood 1557d51b24SRyan Leavengood class Butterfly : public BScreenSaver { 1657d51b24SRyan Leavengood public: 17*1fd632e6SAxel Dörfler Butterfly(BMessage* archive, image_id imageID); 1857d51b24SRyan Leavengood 1957d51b24SRyan Leavengood virtual void StartConfig(BView* view); 2057d51b24SRyan Leavengood virtual status_t StartSaver(BView* view, bool preview); 2157d51b24SRyan Leavengood virtual void Draw(BView* view, int32 frame); 2257d51b24SRyan Leavengood 2357d51b24SRyan Leavengood private: 24*1fd632e6SAxel Dörfler inline rgb_color _HueToColor(float hue); 25*1fd632e6SAxel Dörfler inline BPoint _Iterate(); 26*1fd632e6SAxel Dörfler 27*1fd632e6SAxel Dörfler private: 283107597aSRyan Leavengood // base value for calculating the curves on each iteration 293107597aSRyan Leavengood float fBase; 3057d51b24SRyan Leavengood // previously calculated points 3157d51b24SRyan Leavengood BPoint fLast[3]; 3257d51b24SRyan Leavengood // transformation from graph coordinates to view coordinates 3357d51b24SRyan Leavengood float fScale; 3457d51b24SRyan Leavengood BPoint fTrans; 3557d51b24SRyan Leavengood // bounding box of drawn figure 3657d51b24SRyan Leavengood BRect fBounds; 3757d51b24SRyan Leavengood }; 3857d51b24SRyan Leavengood 3957d51b24SRyan Leavengood 40*1fd632e6SAxel Dörfler #endif // _BUTTERFLY_H_ 41