1 /* === S Y N F I G ========================================================= */ 2 /*! \file lumakey.h 3 ** \brief Header file for implementation of the "Luma Key" 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 ** === N O T E S =========================================================== 24 ** 25 ** ========================================================================= */ 26 27 /* === S T A R T =========================================================== */ 28 29 #ifndef __SYNFIG_LUMAKEY_H 30 #define __SYNFIG_LUMAKEY_H 31 32 /* === H E A D E R S ======================================================= */ 33 34 #include <synfig/layers/layer_composite_fork.h> 35 #include <synfig/color.h> 36 #include <synfig/vector.h> 37 38 /* === M A C R O S ========================================================= */ 39 40 /* === T Y P E D E F S ===================================================== */ 41 42 /* === C L A S S E S & S T R U C T S ======================================= */ 43 44 using namespace synfig; 45 using namespace std; 46 using namespace etl; 47 48 class LumaKey : public Layer_CompositeFork, public Layer_NoDeform 49 { 50 SYNFIG_LAYER_MODULE_EXT 51 private: 52 53 public: 54 LumaKey(); 55 56 virtual bool set_param(const String & param, const ValueBase &value); 57 58 virtual ValueBase get_param(const String & param)const; 59 60 virtual Color get_color(Context context, const Point &pos)const; 61 62 virtual Vocab get_param_vocab()const; 63 64 Layer::Handle hit_check(Context context, const Point &point)const; 65 using Layer::get_bounding_rect; 66 virtual Rect get_bounding_rect(Context context)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; reads_context()70 virtual bool reads_context()const { return true; } 71 72 protected: 73 virtual rendering::Task::Handle build_rendering_task_vfunc(Context context) const; 74 }; // END of class LumaKey 75 76 /* === E N D =============================================================== */ 77 78 #endif 79