PostGIS  2.1.10dev-r@@SVN_REVISION@@
rt_pg.h
Go to the documentation of this file.
1 /*
2  * $Id: rt_pg.h 12738 2014-07-06 17:35:36Z dustymugs $
3  *
4  * WKTRaster - Raster Types for PostGIS
5  * http://trac.osgeo.org/postgis/wiki/WKTRaster
6  *
7  * Copyright (C) 2010-2011 Jorge Arevalo <jorge.arevalo@deimos-space.com>
8  * Copyright (C) 2010-2011 David Zwarg <dzwarg@azavea.com>
9  * Copyright (C) 2009-2011 Pierre Racine <pierre.racine@sbf.ulaval.ca>
10  * Copyright (C) 2009-2011 Mateusz Loskot <mateusz@loskot.net>
11  * Copyright (C) 2008-2009 Sandro Santilli <strk@keybit.net>
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  */
28 
29 #ifndef RT_PG_H_INCLUDED
30 #define RT_PG_H_INCLUDED
31 
32 #include <stdint.h> /* for int16_t and friends */
33 
34 #include "rt_api.h"
35 #include "../../postgis_config.h"
36 #include "../raster_config.h"
37 
38 /* Debugging macros */
39 #if POSTGIS_DEBUG_LEVEL > 0
40 
41 /* Display a simple message at NOTICE level */
42 #define POSTGIS_RT_DEBUG(level, msg) \
43  do { \
44  if (POSTGIS_DEBUG_LEVEL >= level) \
45  ereport(NOTICE, (errmsg_internal("[%s:%s:%d] " msg, __FILE__, __func__, __LINE__))); \
46  } while (0);
47 
48 /* Display a formatted message at NOTICE level (like printf, with variadic arguments) */
49 #define POSTGIS_RT_DEBUGF(level, msg, ...) \
50  do { \
51  if (POSTGIS_DEBUG_LEVEL >= level) \
52  ereport(NOTICE, (errmsg_internal("[%s:%s:%d] " msg, __FILE__, __func__, __LINE__, __VA_ARGS__))); \
53  } while (0);
54 
55 #else
56 
57 /* Empty prototype that can be optimised away by the compiler for non-debug builds */
58 #define POSTGIS_RT_DEBUG(level, msg) \
59  ((void) 0)
60 
61 /* Empty prototype that can be optimised away by the compiler for non-debug builds */
62 #define POSTGIS_RT_DEBUGF(level, msg, ...) \
63  ((void) 0)
64 
65 #endif
66 
67 
68 typedef struct rt_pgband8_t {
69  uint8_t pixtype;
70  uint8_t data[1];
71 } rt_pgband8;
72 
73 typedef struct rt_pgband16_t {
74  uint8_t pixtype;
75  uint8_t pad;
76  uint8_t data[1];
77 } rt_pgband16;
78 
79 typedef struct rt_pgband32_t {
80  uint8_t pixtype;
81  uint8_t pad0;
82  uint8_t pad1;
83  uint8_t pad2;
84  uint8_t data[1];
85 } rt_pgband32;
86 
87 typedef struct rt_pgband64_t {
88  uint8_t pixtype;
89  uint8_t pad[7];
90  uint8_t data[1];
91 } rt_pgband64;
92 
93 typedef struct rt_pgband_t {
94  uint8_t pixtype;
95  uint8_t data[1];
96 } rt_pgband;
97 
98 /* Header of PostgreSQL-stored RASTER value,
99  * and binary representation of it */
101 
102 #endif /* RT_PG_H_INCLUDED */
struct rt_pgband16_t rt_pgband16
This library is the generic raster handling section of PostGIS.
uint8_t data[1]
Definition: rt_pg.h:84
uint8_t pad0
Definition: rt_pg.h:81
uint8_t data[1]
Definition: rt_pg.h:76
uint8_t pixtype
Definition: rt_pg.h:94
uint8_t pixtype
Definition: rt_pg.h:88
uint8_t pixtype
Definition: rt_pg.h:74
struct rt_pgband64_t rt_pgband64
uint8_t data[1]
Definition: rt_pg.h:95
struct rt_pgband8_t rt_pgband8
uint8_t pad1
Definition: rt_pg.h:82
uint8_t pad[7]
Definition: rt_pg.h:89
uint8_t pad2
Definition: rt_pg.h:83
uint8_t pixtype
Definition: rt_pg.h:69
Struct definitions.
Definition: rt_api.h:2175
struct rt_pgband32_t rt_pgband32
uint8_t pad
Definition: rt_pg.h:75
uint8_t data[1]
Definition: rt_pg.h:90
uint8_t data[1]
Definition: rt_pg.h:70
struct rt_pgband_t rt_pgband
uint8_t pixtype
Definition: rt_pg.h:80