Browse Source

add lanczos and lanczos fallback to i.rectify

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44063 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 14 years ago
parent
commit
0f6d45f329

+ 2 - 2
imagery/i.rectify/cubic_f.c

@@ -49,7 +49,7 @@ void p_cubic_f(struct cache *ibuffer,	/* input buffer                  */
     if (Rast_is_d_null_value(obufptr)) {
         p_bilinear(ibuffer, obufptr, cell_type, row_idx, col_idx, cellhd);
         /* fallback to nearest if bilinear is null */
-	    if (Rast_is_d_null_value(obufptr))
-		Rast_set_d_value(obufptr, cell, cell_type);
+	if (Rast_is_d_null_value(obufptr))
+	    Rast_set_d_value(obufptr, cell, cell_type);
     }
 }

+ 5 - 0
imagery/i.rectify/global.h

@@ -107,3 +107,8 @@ extern void p_bilinear_f(struct cache *, void *, int, double *, double *,
 /* cubic_f.c */
 extern void p_cubic_f(struct cache *, void *, int, double *, double *,
 		    struct Cell_head *);
+/* lanczos.c */
+extern void p_lanczos(struct cache *, void *, int, double *, double *,
+		    struct Cell_head *);
+extern void p_lanczos_f(struct cache *, void *, int, double *, double *,
+		    struct Cell_head *);

+ 5 - 5
imagery/i.rectify/i.rectify.html

@@ -121,17 +121,17 @@ cells in the input map. The <em>method=cubic</em> method determines the new valu
 the cell based on a weighted distance average of the 16 surrounding cells in
 the input map.
 <p>
-The bilinear and cubic interpolation methods are most appropriate for
-continuous data and cause some smoothing. Both options should not be used
+The bilinear, cubic and lanczos interpolation methods are most appropriate for
+continuous data and cause some smoothing. These options should not be used
 with categorical data, since the cell values will be altered.
 <p>
-In the bilinear and cubic methods, if any of the surrounding cells used to
+In the bilinear, cubic and lanczos methods, if any of the surrounding cells used to
 interpolate the new cell value are NULL, the resulting cell will be NULL, even if
 the nearest cell is not NULL. This will cause some thinning along NULL borders,
-such as the coasts of land areas in a DEM. The bilinear_f and cubic_f
+such as the coasts of land areas in a DEM. The bilinear_f, cubic_f and lanczos_f
 interpolation methods can be used if thinning along NULL edges is not desired.
 These methods "fall back" to simpler interpolation methods along NULL borders.
-That is, from cubic to bilinear to nearest.
+That is, from lanczos to cubic to bilinear to nearest.
 <p>
 If nearest neighbor assignment is used, the output map has the same raster
 format as the input map. If any of the other interpolations is used, the

+ 2 - 0
imagery/i.rectify/main.c

@@ -64,8 +64,10 @@ struct menu menu[] = {
     {p_nearest, "nearest", "nearest neighbor"},
     {p_bilinear, "bilinear", "bilinear"},
     {p_cubic, "cubic", "cubic convolution"},
+    {p_lanczos, "lanczos", "lanczos filter"},
     {p_bilinear_f, "bilinear_f", "bilinear with fallback"},
     {p_cubic_f, "cubic_f", "cubic convolution with fallback"},
+    {p_lanczos_f, "lanczos_f", "lanczos filter with fallback"},
     {NULL, NULL, NULL}
 };