xref: /haiku/src/libs/icon/transformer/PerspectiveTransformer.h (revision 893988af824e65e49e55f517b157db8386e8002b)
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 "Transformer.h"
13 
14 #include <agg_conv_transform.h>
15 #include <agg_trans_perspective.h>
16 
17 
18 namespace BPrivate {
19 namespace Icon {
20 
21 typedef agg::conv_transform<VertexSource,
22 							agg::trans_perspective>	Perspective;
23 
24 class PerspectiveTransformer : public Transformer,
25 							   public Perspective,
26 							   public agg::trans_perspective {
27  public:
28 	enum {
29 		archive_code	= 'prsp',
30 	};
31 
32 								PerspectiveTransformer(
33 									VertexSource& source);
34 								PerspectiveTransformer(
35 									VertexSource& source,
36 									BMessage* archive);
37 
38 	virtual						~PerspectiveTransformer();
39 
40 	// Transformer interface
41 	virtual	Transformer*		Clone(VertexSource& source) const;
42 
43 	virtual	void				rewind(unsigned path_id);
44 	virtual	unsigned			vertex(double* x, double* y);
45 
46 	virtual	void				SetSource(VertexSource& source);
47 
48 	virtual	double				ApproximationScale() const;
49 
50 #ifdef ICON_O_MATIC
51 	// IconObject interface
52 	virtual	status_t			Archive(BMessage* into,
53 										bool deep = true) const;
54 
55 #endif
56 };
57 
58 }	// namespace Icon
59 }	// namespace BPrivate
60 
61 #endif	// PERSPECTIVE_TRANSFORMER_H
62