xref: /haiku/src/add-ons/screen_savers/butterfly/Butterfly.h (revision 57d51b24ffd6225014793bd152ec0e32883ad69c)
1*57d51b24SRyan Leavengood /*
2*57d51b24SRyan Leavengood  * Copyright 2010-2011, Haiku, Inc. All Rights Reserved.
3*57d51b24SRyan Leavengood  * Distributed under the terms of the MIT License.
4*57d51b24SRyan Leavengood  *
5*57d51b24SRyan Leavengood  * Authors:
6*57d51b24SRyan Leavengood  *		Geoffry Song, goffrie@gmail.com
7*57d51b24SRyan Leavengood  */
8*57d51b24SRyan Leavengood #ifndef _BUTTERFLY_H_
9*57d51b24SRyan Leavengood #define _BUTTERFLY_H_
10*57d51b24SRyan Leavengood 
11*57d51b24SRyan Leavengood 
12*57d51b24SRyan Leavengood #include <ScreenSaver.h>
13*57d51b24SRyan Leavengood 
14*57d51b24SRyan Leavengood 
15*57d51b24SRyan Leavengood class Butterfly : public BScreenSaver {
16*57d51b24SRyan Leavengood public:
17*57d51b24SRyan Leavengood 						Butterfly(BMessage* archive, image_id imageId);
18*57d51b24SRyan Leavengood 
19*57d51b24SRyan Leavengood 	virtual	void		StartConfig(BView* view);
20*57d51b24SRyan Leavengood 	virtual status_t	StartSaver(BView* view, bool preview);
21*57d51b24SRyan Leavengood 	virtual void		Draw(BView* view, int32 frame);
22*57d51b24SRyan Leavengood 
23*57d51b24SRyan Leavengood private:
24*57d51b24SRyan Leavengood 			float		fT;
25*57d51b24SRyan Leavengood 			// previously calculated points
26*57d51b24SRyan Leavengood 			BPoint		fLast[3];
27*57d51b24SRyan Leavengood 			// transformation from graph coordinates to view coordinates
28*57d51b24SRyan Leavengood 			float		fScale;
29*57d51b24SRyan Leavengood 			BPoint		fTrans;
30*57d51b24SRyan Leavengood 			// bounding box of drawn figure
31*57d51b24SRyan Leavengood 			BRect		fBounds;
32*57d51b24SRyan Leavengood 
33*57d51b24SRyan Leavengood 	inline	rgb_color	_HueToColor(float hue);
34*57d51b24SRyan Leavengood 	inline	BPoint		_Iterate();
35*57d51b24SRyan Leavengood };
36*57d51b24SRyan Leavengood 
37*57d51b24SRyan Leavengood #endif  // _BUTTERFLY_H_
38*57d51b24SRyan Leavengood 
39