xref: /haiku/src/libs/icon/transformer/PerspectiveTransformer.h (revision f23596149e0d173463f70629581aa10cc305d32e)
1 /*
2  * Copyright 2006, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 
9 #ifndef PERSPECTIVE_TRANSFORMER_H
10 #define PERSPECTIVE_TRANSFORMER_H
11 
12 #include <agg_conv_transform.h>
13 #include <agg_trans_perspective.h>
14 
15 #include "Transformer.h"
16 
17 typedef agg::conv_transform<VertexSource,
18 							agg::trans_perspective>	Perspective;
19 
20 class PerspectiveTransformer : public Transformer,
21 							   public Perspective,
22 							   public agg::trans_perspective {
23  public:
24 	enum {
25 		archive_code	= 'prsp',
26 	};
27 
28 								PerspectiveTransformer(
29 									VertexSource& source);
30 #ifdef ICON_O_MATIC
31 								PerspectiveTransformer(
32 									VertexSource& source,
33 									BMessage* archive);
34 #endif
35 	virtual						~PerspectiveTransformer();
36 
37 	// Transformer interface
38 	virtual	Transformer*		Clone(VertexSource& source) const;
39 
40 	virtual	void				rewind(unsigned path_id);
41 	virtual	unsigned			vertex(double* x, double* y);
42 
43 	virtual	void				SetSource(VertexSource& source);
44 
45 	virtual	double				ApproximationScale() const;
46 
47 #ifdef ICON_O_MATIC
48 	// IconObject interface
49 	virtual	status_t			Archive(BMessage* into,
50 										bool deep = true) const;
51 
52 #endif
53 };
54 
55 #endif // PERSPECTIVE_TRANSFORMER_H
56