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