Browse Source

Committed correct header files for the 3D raster library

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55464 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 12 years ago
parent
commit
ede143bf2a
2 changed files with 19 additions and 23 deletions
  1. 8 12
      include/defs/raster3d.h
  2. 11 11
      include/raster3d.h

+ 8 - 12
include/defs/raster3d.h

@@ -48,12 +48,8 @@ void Rast3d_filename(char *, const char *, const char *, const char *);
 /* fpcompress.c */
 void Rast3d_fpcompress_print_binary(char *, int);
 void Rast3d_fpcompress_dissect_xdr_double(unsigned char *);
-int Rast3d_fpcompress_write_xdr_nums(int, char *, int, int, char *, int, int, int);
-int Rast3d_fpcompress_write_xdr_floats(int, char *, int, int, char *, int, int);
-int Rast3d_fpcompress_write_xdr_double(int, char *, int, int, char *, int, int);
+int Rast3d_fpcompress_write_xdr_nums(int, char *, int, int, char *, int);
 int Rast3d_fpcompress_read_xdr_nums(int, char *, int, int, int, char *, int);
-int Rast3d_fpcompress_read_xdr_floats(int, char *, int, int, int, char *);
-int Rast3d_fpcompress_read_xdr_doubles(int, char *, int, int, int, char *);
 
 /* alloc.c */
 void *Rast3d_malloc(int);
@@ -78,8 +74,8 @@ int Rast3d_read_colors(const char *, const char *, struct Colors *);
 int Rast3d_write_colors(const char *, const char *, struct Colors *);
 
 /* defaults.c */
-void Rast3d_set_compression_mode(int, int, int, int);
-void Rast3d_get_compression_mode(int *, int *, int *, int *);
+void Rast3d_set_compression_mode(int, int);
+void Rast3d_get_compression_mode(int *, int *);
 void Rast3d_set_cache_size(int);
 int Rast3d_get_cache_size(void);
 void Rast3d_set_cache_limit(int);
@@ -177,7 +173,7 @@ int Rast3d_is_null_value_num(const void *, int);
 void Rast3d_set_null_value(void *, int, int);
 
 /* open2.c */
-void *Rast3d_open_new_param(const char *, int , int, RASTER3D_Region *, int, int, int, int, int, int, int);
+void *Rast3d_open_new_param(const char *, int , int, RASTER3D_Region *, int, int, int, int, int, int);
 /* open.c */
 void *Rast3d_open_cell_old_no_header(const char *, const char *);
 void *Rast3d_open_cell_old(const char *, const char *, RASTER3D_Region *, int, int);
@@ -186,7 +182,7 @@ void *Rast3d_open_new_opt_tile_size(const char *, int , RASTER3D_Region * , int
 
 /* param.c */
 void Rast3d_set_standard3d_input_params(void);
-int Rast3d_get_standard3d_params(int *, int *, int *, int *, int *, int *, int *,
+int Rast3d_get_standard3d_params(int *, int *, int *, int *, int *,
 			    int *, int *, int *, int *, int *);
 void Rast3d_set_window_params(void);
 char *Rast3d_get_window_params(void);
@@ -255,18 +251,18 @@ void Rast3d_get_block(RASTER3D_Map *, int, int, int, int, int, int, void *, int)
 int Rast3d_read_header(RASTER3D_Map *, int *, int *, double *, double *, double *,
 		   double *, double *, double *, int *, int *, int *,
 		   double *, double *, double *, int *, int *, int *, int *,
-		   int *, int *, int *, int *, int *, int *, int *, char **, int *);
+		   int *, int *, int *, int *, int *, int *, int *, char **, int *, int *);
 int Rast3d_write_header(RASTER3D_Map *, int, int, double, double, double, double,
 		    double, double, int, int, int, double, double, double,
 		    int, int, int, int, int, int, int, int, int, int, int,
-		    char *, int);
+		    char *, int, int);
 int Rast3d_rewrite_header(RASTER3D_Map * map);
 int Rast3d_cache_size_encode(int, int);
 int Rast3d__compute_cache_size(RASTER3D_Map *, int);
 int Rast3d_fill_header(RASTER3D_Map *, int, int, int, int, int, int, int, int, int,
 		   int, int, int, int, int, int, int, double, double, double,
 		   double, double, double, int, int, int, double, double,
-		   double, char *, int);
+		   double, char *, int, int);
 /* headerinfo.c */
 void Rast3d_get_coords_map(RASTER3D_Map *, int *, int *, int *);
 void Rast3d_get_coords_map_window(RASTER3D_Map *, int *, int *, int *);

+ 11 - 11
include/raster3d.h

@@ -4,17 +4,16 @@
 #include <grass/gis.h>
 #include <grass/raster.h>
 
+#define RASTER3D_MAP_VERSION 2 /* Second version of the raster 3D map layout.
+                                * Old maps withput version information are
+                                * defined as version == 1 when reading the header.
+                                */
+
 #define RASTER3D_TILE_SAME_AS_FILE 2
 
 #define RASTER3D_NO_COMPRESSION 0
 #define RASTER3D_COMPRESSION 1
 
-#define RASTER3D_USE_LZW 1
-#define RASTER3D_NO_LZW 0
-
-#define RASTER3D_USE_RLE 1
-#define RASTER3D_NO_RLE 0
-
 #define RASTER3D_MAX_PRECISION -1
 
 #define RASTER3D_NO_CACHE 0
@@ -72,6 +71,7 @@ typedef void resample_fn(struct RASTER3D_Map *, int, int, int, void *, int);
 
 typedef struct RASTER3D_Map
 {
+	int version; /* The version of the raster 3D map layout */
 
     char *fileName;
     char *tempName;
@@ -110,10 +110,10 @@ typedef struct RASTER3D_Map
     /* data concering the compression */
     int precision;		/* RASTER3D_MAX_PRECISION or, 0 .. 23 for float, 
 				   0 .. 52 for double */
-    int compression;		/* RASTER3D_NO_COMPRESSION or RASTER3D_USE_COMPRESSION */
-    int useLzw;			/* RASTER3D_USE_LZW or RASTER3D_NO_LZW */
-    int useRle;			/* RASTER3D_USE_RLE or RASTER3D_NO_RLE */
-    int useXdr;			/* RASTER3D_USE_XDR or RASTER3D_NO_XDR */
+    int compression;		/* RASTER3D_NO_COMPRESSION or RASTER3D_COMPRESSION */
+    int useLzw;			/* RASTER3D_USE_LZW or RASTER3D_NO_LZW !!! only kept for backward compatibility */
+    int useRle;			/* RASTER3D_USE_RLE or RASTER3D_NO_RLE !!! only kept for backward compatibility */
+    int useXdr;			/* RASTER3D_USE_XDR or RASTER3D_NO_XDR !!! only kept for backward compatibility */
 
     /* pointer to first tile in file */
     int offset;
@@ -158,7 +158,7 @@ typedef struct RASTER3D_Map
 
     int useCache;		/* 1 if cache is used */
     void *cache;		/* pointer to cache structure */
-    int cacheFD;		/* file discriptor of cache file -- write mode only */
+    int cacheFD;		/* file descriptor of cache file -- write mode only */
     char *cacheFileName;	/* filename of cache file -- write mode only */
     long cachePosLast;		/* position of last entry in cache file -- write */
     /* mode only */