-/* === S I N F G =========================================================== */
-/*! \file renddesc.h_
+/* === S Y N F I G ========================================================= */
+/*! \file synfig/renddesc.cpp
** \brief RendDesc
**
-** $Id: renddesc.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+** $Id$
**
** \legal
-** Copyright (c) 2002 Robert B. Quattlebaum Jr.
+** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2008 Chris Moore
**
-** This software and associated documentation
-** are CONFIDENTIAL and PROPRIETARY property of
-** the above-mentioned copyright holder.
+** This package is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public License as
+** published by the Free Software Foundation; either version 2 of
+** the License, or (at your option) any later version.
**
-** You may not copy, print, publish, or in any
-** other way distribute this software without
-** a prior written agreement with
-** the copyright holder.
+** This package is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** General Public License for more details.
** \endlegal
*/
/* ========================================================================= */
using namespace std;
using namespace etl;
-using namespace sinfg;
+using namespace synfig;
/* === M A C R O S ========================================================= */
int
RendDesc::get_frame_start()const
{
- return time_begin*frame_rate;
+ return round_to_int(time_begin*frame_rate);
}
RendDesc &
int
RendDesc::get_frame_end()const
{
- return time_end*frame_rate;
+ return round_to_int(time_end*frame_rate);
}
RendDesc &
RendDesc &
RendDesc::set_interlaced(bool x)
-{ interlaced=x; return *this; }
+{ interlaced=x; return *this; }
//! Return the status of the clamp flag
const bool &
//! Set the clamp flag
RendDesc &
RendDesc::set_clamp(bool x)
-{ clamp=x; return *this; }
+{ clamp=x; return *this; }
//! Set constraint flags
RendDesc &
RendDesc::get_antialias()const
{ return a; }
-//! Set the antilaias amount
+//! Set the antialias amount
RendDesc &
RendDesc::set_antialias(const int &x)
{ a=x; return *this; }
/*
const Gamma &
RendDesc::get_gamma()const
-{ return gamma; }
+{ return gamma; }
RendDesc &
RendDesc::set_gamma(const Gamma &x)
Vector new_size(x-br_);
new_size[0]=abs(new_size[0]);
new_size[1]=abs(new_size[1]);
-
+
Vector old_size(tl_-br_);
old_size[0]=abs(old_size[0]);
old_size[1]=abs(old_size[1]);
-
+
if(new_size[0]!=old_size[0])
w_=round_to_int(new_size[0]*w_/old_size[0]);
-
+
if(new_size[1]!=old_size[1])
h_=round_to_int(new_size[1]*h_/old_size[1]);
}
-
+
tl_=x; return *this;
}
Vector new_size(x-tl_);
new_size[0]=abs(new_size[0]);
new_size[1]=abs(new_size[1]);
-
+
Vector old_size(tl_-br_);
old_size[0]=abs(old_size[0]);
old_size[1]=abs(old_size[1]);
-
+
if(new_size[0]!=old_size[0])
w_=round_to_int(new_size[0]*w_/old_size[0]);
-
+
if(new_size[1]!=old_size[1])
h_=round_to_int(new_size[1]*h_/old_size[1]);
}
{ tl_=__tl; br_=__br; return *this; }
RendDesc &
-RendDesc::set_viewport(Real a,Real b,Real c,Real d)
+RendDesc::set_viewport(Vector::value_type a, Vector::value_type b, Vector::value_type c, Vector::value_type d)
{ tl_=Point(a,b); br_=Point(c,d); return *this; }
Real
{
const Real pw(get_pw());
const Real ph(get_ph());
-
+
tl_[0]+=pw*x;
tl_[1]+=ph*y;
w_=w;
h_=h;
-
+
return *this;
}