From 263d1ad5f4c0cf7f49270371597045244cf0099c Mon Sep 17 00:00:00 2001 From: David Frantz Date: Fri, 26 Jan 2024 12:35:35 +0100 Subject: [PATCH] histogram tool --- src/aux-level/_hist.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/aux-level/_hist.c b/src/aux-level/_hist.c index 40ddc95e..c39a797b 100644 --- a/src/aux-level/_hist.c +++ b/src/aux-level/_hist.c @@ -34,10 +34,6 @@ This program computes a histogram of the given image #include "../cross-level/const-cl.h" #include "../cross-level/konami-cl.h" #include "../cross-level/string-cl.h" -//#include "../cross-level/cube-cl.h" -//#include "../cross-level/warp-cl.h" -//#include "../lower-level/param-ll.h" -//#include "../lower-level/cube-ll.h" /** Geospatial Data Abstraction Library (GDAL) **/ #include "gdal.h" // public (C callable) GDAL entry points @@ -77,10 +73,6 @@ void usage(char *exe, int exit_code){ void parse_args(int argc, char *argv[], args_t *args){ int opt; -char buffer[NPOW_10]; -char *ptr = NULL; -const char *separator = ","; -int i; opterr = 0; @@ -150,7 +142,7 @@ int main(int argc, char *argv[]){ args_t args; GDALDatasetH fp; GDALRasterBandH band; -int p, i, j, nx, ny, nc; +int i, j, nx, ny; short *line = NULL; short nodata; int has_nodata; @@ -168,7 +160,6 @@ off_t counts[length]; nx = GDALGetRasterXSize(fp); ny = GDALGetRasterYSize(fp); - nc = nx*ny; alloc((void**)&line, nx, sizeof(short)); @@ -182,7 +173,7 @@ off_t counts[length]; - memset(counts, 0, sizeof(off_t)*(USHRT_MAX+1)); + memset(counts, 0, sizeof(off_t)*length); for (i=0; i