1 /* === S Y N F I G ========================================================= */
2 /*!	\file shade.h
3 **	\brief Header file for implementation of the "Shade" layer
4 **
5 **	$Id$
6 **
7 **	\legal
8 **	Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **	Copyright (c) 2008 Chris Moore
10 **	Copyright (c) 2012-2013 Carlos López
11 **
12 **	This package is free software; you can redistribute it and/or
13 **	modify it under the terms of the GNU General Public License as
14 **	published by the Free Software Foundation; either version 2 of
15 **	the License, or (at your option) any later version.
16 **
17 **	This package is distributed in the hope that it will be useful,
18 **	but WITHOUT ANY WARRANTY; without even the implied warranty of
19 **	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 **	General Public License for more details.
21 **	\endlegal
22 */
23 /* ========================================================================= */
24 
25 /* === H E A D E R S ======================================================= */
26 
27 #ifndef __SYNFIG_LAYER_SHADE_H__
28 #define __SYNFIG_LAYER_SHADE_H__
29 
30 /* -- H E A D E R S --------------------------------------------------------- */
31 
32 #include <synfig/layers/layer_composite_fork.h>
33 #include <synfig/color.h>
34 #include <synfig/vector.h>
35 #include <synfig/blur.h>
36 
37 namespace synfig
38 {
39 namespace modules
40 {
41 namespace lyr_std
42 {
43 
44 class Layer_Shade : public Layer_CompositeFork
45 {
46 	SYNFIG_LAYER_MODULE_EXT
47 private:
48 	//!Parameter: (Vector)
49 	ValueBase param_size;
50 	//!Parameter: (int)
51 	ValueBase param_type;
52 	//!Parameter: (Color)
53 	ValueBase param_color;
54 	//!Parameter: (Vector)
55 	ValueBase param_origin;
56 	//!Parameter: (bool)
57 	ValueBase param_invert;
58 
59 public:
60 	Layer_Shade();
61 
62 	virtual bool set_param(const String & param, const ValueBase &value);
63 
64 	virtual ValueBase get_param(const String & param)const;
65 
66 	virtual Color get_color(Context context, const Point &pos)const;
67 
68 	virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
69 	virtual bool accelerated_cairorender(Context context,cairo_t *cr, int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
70 	virtual Rect get_full_bounding_rect(Context context)const;
71 	virtual Vocab get_param_vocab()const;
reads_context()72 	virtual bool reads_context()const { return true; }
73 
74 protected:
75 	virtual rendering::Task::Handle build_composite_fork_task_vfunc(ContextParams context_params, rendering::Task::Handle sub_task)const;
76 }; // END of class Layer_Shade
77 
78 }; // END of namespace lyr_std
79 }; // END of namespace modules
80 }; // END of namespace synfig
81 
82 /* -- E X T E R N S --------------------------------------------------------- */
83 
84 /* -- E N D ----------------------------------------------------------------- */
85 
86 #endif
87