projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Typo: 'staticly' -> 'statically'.
[synfig.git]
/
synfig-core
/
trunk
/
src
/
modules
/
lyr_std
/
sphere_distort.cpp
diff --git
a/synfig-core/trunk/src/modules/lyr_std/sphere_distort.cpp
b/synfig-core/trunk/src/modules/lyr_std/sphere_distort.cpp
index
6194b0e
..
8998cc9
100644
(file)
--- a/
synfig-core/trunk/src/modules/lyr_std/sphere_distort.cpp
+++ b/
synfig-core/trunk/src/modules/lyr_std/sphere_distort.cpp
@@
-6,6
+6,7
@@
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
**
** \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
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
@@
-407,7
+408,7
@@
bool Layer_SphereDistort::accelerated_render(Context context,Surface *surface,in
/*synfig::warning("Spherize: Bounding box (%f,%f)-(%f,%f)",
expandr.minx,expandr.miny,expandr.maxx,expandr.maxy);*/
/*synfig::warning("Spherize: Bounding box (%f,%f)-(%f,%f)",
expandr.minx,expandr.miny,expandr.maxx,expandr.maxy);*/
- //now that we have the bouding rectangle of ALL the pixels (should be...)
+ //now that we have the bou
n
ding rectangle of ALL the pixels (should be...)
//order it so that it's in the same orientation as the tl,br pair
//synfig::warning("Spherize: Organize like tl,br");
//order it so that it's in the same orientation as the tl,br pair
//synfig::warning("Spherize: Organize like tl,br");
@@
-504,19
+505,14
@@
bool Layer_SphereDistort::accelerated_render(Context context,Surface *surface,in
}
//sample at that pixel location based on the quality
}
//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));
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));
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));
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.put_value(background[round_to_int(ys)][round_to_int(xs)]);
- }
}
p.dec_x(w);
}
}
p.dec_x(w);
}
@@
-555,16
+551,14
@@
Layer_SphereDistort::get_bounding_rect()const
switch(type)
{
case TYPE_NORMAL:
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:
break;
case TYPE_DISTH:
+ bounds = Rect::vertical_strip(center[0]-radius, center[0]+radius);
break;
case TYPE_DISTV:
break;
case TYPE_DISTV:
+ bounds = Rect::horizontal_strip(center[1]-radius, center[1]+radius);
break;
default:
break;
break;
default:
break;
@@
-572,4
+566,3
@@
Layer_SphereDistort::get_bounding_rect()const
return bounds;
}
return bounds;
}
-