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