1 /*! ========================================================================
3 ** Image Layer_TimeLoop Layer Implementation
4 ** $Id: timeloop.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $
6 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
8 ** This software and associated documentation
9 ** are CONFIDENTIAL and PROPRIETARY property of
10 ** the above-mentioned copyright holder.
12 ** You may not copy, print, publish, or in any
13 ** other way distribute this software without
14 ** a prior written agreement with
15 ** the copyright holder.
17 ** === N O T E S ===========================================================
19 ** ========================================================================= */
21 /* === H E A D E R S ======================================================= */
31 #include <sinfg/time.h>
32 #include <sinfg/context.h>
33 #include <sinfg/paramdesc.h>
34 #include <sinfg/renddesc.h>
35 #include <sinfg/value.h>
39 using namespace sinfg;
43 /* === M A C R O S ========================================================= */
45 /* === G L O B A L S ======================================================= */
47 SINFG_LAYER_INIT(Layer_TimeLoop);
48 SINFG_LAYER_SET_NAME(Layer_TimeLoop,"timeloop");
49 SINFG_LAYER_SET_LOCAL_NAME(Layer_TimeLoop,_("TimeLoop"));
50 SINFG_LAYER_SET_CATEGORY(Layer_TimeLoop,_("Other"));
51 SINFG_LAYER_SET_VERSION(Layer_TimeLoop,"0.1");
52 SINFG_LAYER_SET_CVS_ID(Layer_TimeLoop,"$Id: timeloop.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $");
54 /* === P R O C E D U R E S ================================================= */
56 /* === M E T H O D S ======================================================= */
58 Layer_TimeLoop::Layer_TimeLoop()
64 Layer_TimeLoop::~Layer_TimeLoop()
69 Layer_TimeLoop::set_param(const String & param, const ValueBase &value)
73 return Layer::set_param(param,value);
77 Layer_TimeLoop::get_param(const String & param)const
84 return Layer::get_param(param);
88 Layer_TimeLoop::get_param_vocab()const
90 Layer::Vocab ret(Layer::get_param_vocab());
92 ret.push_back(ParamDesc("start_time")
93 .set_local_name(_("Start Time"))
96 ret.push_back(ParamDesc("end_time")
97 .set_local_name(_("End Time"))
104 Layer_TimeLoop::set_time(Context context, Time time)const
106 Real diff(end_time-start_time);
108 time-=int(Real(time-start_time)/diff)*diff+start_time;
109 context.set_time(time);
113 Layer_TimeLoop::get_color(Context context, const Point &pos)const
115 return context.get_color(pos);
119 Layer_TimeLoop::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
121 return context.accelerated_render(surface,quality,renddesc,cb);