[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12300] branches/qdune/blender/extern/ qdune: Added another filter type (lanczos) just in case it might be useful.

Alfredo de Greef eeshlo at yahoo.com
Fri Oct 19 05:56:23 CEST 2007


Revision: 12300
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12300
Author:   eeshlo
Date:     2007-10-19 05:56:22 +0200 (Fri, 19 Oct 2007)

Log Message:
-----------
Added another filter type (lanczos) just in case it might be useful.

Modified Paths:
--------------
    branches/qdune/blender/extern/qdune/hider/ZbufferHider.cpp
    branches/qdune/blender/extern/qdune/ribparse/ri.cpp
    branches/qdune/blender/extern/qdune/ribparse/ri.h

Modified: branches/qdune/blender/extern/qdune/hider/ZbufferHider.cpp
===================================================================
--- branches/qdune/blender/extern/qdune/hider/ZbufferHider.cpp	2007-10-19 03:09:30 UTC (rev 12299)
+++ branches/qdune/blender/extern/qdune/hider/ZbufferHider.cpp	2007-10-19 03:56:22 UTC (rev 12300)
@@ -114,9 +114,6 @@
 	// if only z channel set, then filtering can be skipped
 	only_z = (opt.displayMode == Options::DM_Z);
 
-	cout << "Current filterwidth: " << xwidth << ", " << ywidth << endl;
-	cout << "Current samples: " << xsamples << ", " << ysamples << endl;
-
 	// the amount of extra samples needed for filtering
 	// one pixel covers one full set of samples in each direction,
 	// filterwidth is in pixels, so the number of samples covered by the filter is width*samples,

Modified: branches/qdune/blender/extern/qdune/ribparse/ri.cpp
===================================================================
--- branches/qdune/blender/extern/qdune/ribparse/ri.cpp	2007-10-19 03:09:30 UTC (rev 12299)
+++ branches/qdune/blender/extern/qdune/ribparse/ri.cpp	2007-10-19 03:56:22 UTC (rev 12300)
@@ -396,9 +396,9 @@
 
 RtFloat RiSepSincFilter(RtFloat v, RtFloat width)
 {
+	if ((v > -RI_EPSILON) && (v < RI_EPSILON)) return (RtFloat)1;
 	v *= (RtFloat)M_PI;
-	if ((v > -RI_EPSILON) && (v < RI_EPSILON)) return (RtFloat)1;
-	return (sinf(v) / v);
+	return sinf(v) / v;
 }
 
 // some extra ones for Blender compatibility
@@ -436,6 +436,13 @@
 	return 0.f;
 }
 
+RtFloat RiSepLanczosFilter(RtFloat v, RtFloat width)
+{
+	if ((v = ABS(v)) < width) return RiSepSincFilter(v, width)*RiSepSincFilter(v/width, width);
+	return 0.f;
+}
+
+
 //------------------------------------------------------------------------------
 // The original Ri filter functions implemented using the above seperable funcs
 
@@ -479,6 +486,11 @@
 	return RiSepMitchellFilter(x, xwidth)*RiSepMitchellFilter(y, ywidth);
 }
 
+RtFloat RiLanczosFilter(RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth)
+{
+	return RiSepLanczosFilter(x, xwidth)*RiSepLanczosFilter(y, ywidth);
+}
+
 //------------------------------------------------------------------------------
 
 RtToken RiDeclare(const char* name, const char* declaration)

Modified: branches/qdune/blender/extern/qdune/ribparse/ri.h
===================================================================
--- branches/qdune/blender/extern/qdune/ribparse/ri.h	2007-10-19 03:09:30 UTC (rev 12299)
+++ branches/qdune/blender/extern/qdune/ribparse/ri.h	2007-10-19 03:56:22 UTC (rev 12300)
@@ -112,6 +112,7 @@
 extern RtFloat RiQuadFilter(RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth);
 extern RtFloat RiCubicFilter(RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth);
 extern RtFloat RiMitchellFilter(RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth);
+extern RtFloat RiLanczosFilter(RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth);
 /* separable versions of all of the above */
 extern RtFloat RiSepGaussianFilter(RtFloat v, RtFloat width);
 extern RtFloat RiSepBoxFilter(RtFloat v, RtFloat width);
@@ -121,6 +122,7 @@
 extern RtFloat RiSepQuadFilter(RtFloat v, RtFloat width);
 extern RtFloat RiSepCubicFilter(RtFloat v, RtFloat width);
 extern RtFloat RiSepMitchellFilter(RtFloat v, RtFloat width);
+extern RtFloat RiSepLanczosFilter(RtFloat v, RtFloat width);
 
 /* Graphics State */
 extern RtVoid RiBegin(RtToken name);





More information about the Bf-blender-cvs mailing list