/*! \file sphere_distort.cpp
** \brief Sphere Distort File
**
-** $Id: sphere_distort.cpp,v 1.2 2005/01/24 05:00:18 darco Exp $
+** $Id$
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2007 Chris Moore
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
SYNFIG_LAYER_SET_LOCAL_NAME(Layer_SphereDistort,_("Spherize"));
SYNFIG_LAYER_SET_CATEGORY(Layer_SphereDistort,_("Distortions"));
SYNFIG_LAYER_SET_VERSION(Layer_SphereDistort,"0.2");
-SYNFIG_LAYER_SET_CVS_ID(Layer_SphereDistort,"$Id: sphere_distort.cpp,v 1.2 2005/01/24 05:00:18 darco Exp $");
+SYNFIG_LAYER_SET_CVS_ID(Layer_SphereDistort,"$Id$");
/* === P R O C E D U R E S ================================================= */
}
//sample at that pixel location based on the quality
- if(quality <= 4) //cubic
- {
+ if(quality <= 4) // cubic
p.put_value(background.cubic_sample(xs,ys));
- }else if(quality <= 5) //cosine
- {
+ else if(quality <= 5) // cosine
p.put_value(background.cosine_sample(xs,ys));
- }else if(quality <= 6) //linear
- {
+ else if(quality <= 6) // linear
p.put_value(background.linear_sample(xs,ys));
- }else //nearest
- {
+ else // nearest
p.put_value(background[round_to_int(ys)][round_to_int(xs)]);
- }
}
p.dec_x(w);
}
switch(type)
{
case TYPE_NORMAL:
- bounds=Rect(
- center[0]+(radius),
- center[1]+(radius),
- center[0]-(radius),
- center[1]-(radius)
- );
+ bounds=Rect(center[0]+radius, center[1]+radius,
+ center[0]-radius, center[1]-radius);
break;
case TYPE_DISTH:
+ bounds = Rect::vertical_strip(center[0]-radius, center[0]+radius);
break;
case TYPE_DISTV:
+ bounds = Rect::horizontal_strip(center[1]-radius, center[1]+radius);
break;
default:
break;
return bounds;
}
-