Knowing how many flat pixels there are is useful for computing the costs for the gray-weighted distance transform. It is easy enough to compute this in identifyflats as flat pixels are identified, and return the number of flats from the function.
include/topotoolbox.h now indicates that identifyflats returns a ptrdiff_t.
src/identifyflats.c now increments a counter every time a flat is identified and returns that counter
test/random_dem.cpp is modified to check that the number of identified flats returned from identifyflats is equal to those identified while running the test.
Knowing how many flat pixels there are is useful for computing the costs for the gray-weighted distance transform. It is easy enough to compute this in
identifyflats
as flat pixels are identified, and return the number of flats from the function.include/topotoolbox.h now indicates that
identifyflats
returns a ptrdiff_t.src/identifyflats.c now increments a counter every time a flat is identified and returns that counter
test/random_dem.cpp is modified to check that the number of identified flats returned from
identifyflats
is equal to those identified while running the test.