59a524dc1fe5156027713b9873fc886e0d3658d0
[synfig.git] / synfig-core / trunk / src / modules / lyr_std / bevel.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file bevel.h
3 **      \brief Header file for implementation of the "Bevel" layer
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **
10 **      This package is free software; you can redistribute it and/or
11 **      modify it under the terms of the GNU General Public License as
12 **      published by the Free Software Foundation; either version 2 of
13 **      the License, or (at your option) any later version.
14 **
15 **      This package is distributed in the hope that it will be useful,
16 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
17 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 **      General Public License for more details.
19 **      \endlegal
20 */
21 /* ========================================================================= */
22
23 /* === H E A D E R S ======================================================= */
24
25 #ifndef __SYNFIG_LAYER_BEVEL_H__
26 #define __SYNFIG_LAYER_BEVEL_H__
27
28 /* -- H E A D E R S --------------------------------------------------------- */
29
30 #include <synfig/layer_composite.h>
31 #include <synfig/color.h>
32 #include <synfig/vector.h>
33 #include <synfig/blur.h>
34 #include <synfig/angle.h>
35
36 using namespace synfig;
37 using namespace std;
38 using namespace etl;
39
40 class Layer_Bevel : public synfig::Layer_Composite
41 {
42         SYNFIG_LAYER_MODULE_EXT
43 private:
44         synfig::Real    softness;
45         int                             type;
46
47         synfig::Color   color1;
48         synfig::Color   color2;
49
50         synfig::Angle   angle;
51         synfig::Real            depth;
52
53         synfig::Vector  offset;
54         synfig::Vector  offset45;
55
56         bool use_luma;
57         bool solid;
58
59         void calc_offset();
60 public:
61         Layer_Bevel();
62
63         virtual bool set_param(const String & param, const synfig::ValueBase &value);
64
65         virtual ValueBase get_param(const String & param)const;
66
67         virtual Color get_color(Context context, const Point &pos)const;
68
69         virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
70
71         virtual synfig::Rect get_full_bounding_rect(Context context)const;
72         virtual Vocab get_param_vocab()const;
73         virtual bool reads_context()const { return true; }
74 }; // END of class Layer_Bevel
75
76 /* -- E X T E R N S --------------------------------------------------------- */
77
78 /* -- E N D ----------------------------------------------------------------- */
79
80 #endif