[GRASS-SVN] r33461 - grass/trunk/include
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Sep 16 03:33:46 EDT 2008
Author: glynn
Date: 2008-09-16 03:33:46 -0400 (Tue, 16 Sep 2008)
New Revision: 33461
Modified:
grass/trunk/include/gis.h
grass/trunk/include/imagery.h
Log:
Un-nest structure declarations to make headers SWIG-friendly
Fix G_DEV_NULL definition (strings need double-quotes, not single quotes)
Modified: grass/trunk/include/gis.h
===================================================================
--- grass/trunk/include/gis.h 2008-09-16 07:19:01 UTC (rev 33460)
+++ grass/trunk/include/gis.h 2008-09-16 07:33:46 UTC (rev 33461)
@@ -149,10 +149,10 @@
#define GRASS_DIRSEP '/'
#ifdef __MINGW32__
# define HOST_DIRSEP '\\'
-# define G_DEV_NULL 'NUL:'
+# define G_DEV_NULL "NUL:"
#else
# define HOST_DIRSEP '/'
-# define G_DEV_NULL '/dev/null'
+# define G_DEV_NULL "/dev/null"
#endif
/**/ typedef enum
@@ -278,16 +278,17 @@
double bottom;
};
+struct _Color_Value_
+{
+ DCELL value;
+ unsigned char red;
+ unsigned char grn;
+ unsigned char blu;
+};
+
struct _Color_Rule_
{
- struct
- {
- DCELL value;
- unsigned char red;
- unsigned char grn;
- unsigned char blu;
- } low, high;
-
+ struct _Color_Value_ low, high;
struct _Color_Rule_ *next;
struct _Color_Rule_ *prev;
};
Modified: grass/trunk/include/imagery.h
===================================================================
--- grass/trunk/include/imagery.h 2008-09-16 07:19:01 UTC (rev 33460)
+++ grass/trunk/include/imagery.h 2008-09-16 07:33:46 UTC (rev 33461)
@@ -6,23 +6,27 @@
/* File/directory name lengths */
#define INAME_LEN GNAME_MAX /* coupled to raster map name length */
+struct Ref_Color
+{
+ unsigned char *table; /* color table for min-max values */
+ unsigned char *index; /* data translation index */
+ unsigned char *buf; /* data buffer for reading color file */
+ int fd; /* for image i/o */
+ CELL min, max; /* min,max CELL values */
+ int n; /* index into Ref_Files */
+};
+
+struct Ref_Files
+{
+ char name[INAME_LEN]; /* length is not in sync with other definitions */
+ char mapset[INAME_LEN];
+};
+
struct Ref
{
int nfiles;
- struct Ref_Files
- {
- char name[INAME_LEN]; /* length is not in sync with other definitions */
- char mapset[INAME_LEN];
- } *file;
- struct Ref_Color
- {
- unsigned char *table; /* color table for min-max values */
- unsigned char *index; /* data translation index */
- unsigned char *buf; /* data buffer for reading color file */
- int fd; /* for image i/o */
- CELL min, max; /* min,max CELL values */
- int n; /* index into Ref_Files */
- } red, grn, blu;
+ struct Ref_Files *file;
+ struct Ref_Color red, grn, blu;
};
struct Tape_Info
@@ -42,53 +46,61 @@
int *status;
};
+struct One_Sig
+{
+ char desc[100];
+ int npoints;
+ double *mean; /* one mean for each band */
+ double **var; /* covariance band-band */
+ int status; /* may be used to 'delete' a signature */
+ float r, g, b; /* color */
+ int have_color;
+};
+
struct Signature
{
int nbands;
int nsigs;
char title[100];
- struct One_Sig
- {
- char desc[100];
- int npoints;
- double *mean; /* one mean for each band */
- double **var; /* covariance band-band */
- int status; /* may be used to 'delete' a signature */
- float r, g, b; /* color */
- int have_color;
- } *sig;
+ struct One_Sig *sig;
};
+struct SubSig
+{
+ double N;
+ double pi;
+ double *means;
+ double **R;
+ double **Rinv;
+ double cnst;
+ int used;
+};
+
+struct ClassData
+{
+ int npixels;
+ int count;
+ double **x; /* pixel list: x[npixels][nbands] */
+ double **p; /* prob p[npixels][subclasses] */
+};
+
+struct ClassSig
+{
+ long classnum;
+ char *title;
+ int used;
+ int type;
+ int nsubclasses;
+ struct SubSig *SubSig;
+ struct ClassData ClassData;
+};
+
struct SigSet
{
int nbands;
int nclasses;
char *title;
- struct ClassSig
- {
- long classnum;
- char *title;
- int used;
- int type;
- int nsubclasses;
- struct SubSig
- {
- double N;
- double pi;
- double *means;
- double **R;
- double **Rinv;
- double cnst;
- int used;
- } *SubSig;
- struct ClassData
- {
- int npixels;
- int count;
- double **x; /* pixel list: x[npixels][nbands] */
- double **p; /* prob p[npixels][subclasses] */
- } ClassData;
- } *ClassSig;
+ struct ClassSig *ClassSig;
};
#define SIGNATURE_TYPE_MIXED 1
More information about the grass-commit
mailing list