30 #ifndef RT_SERIALIZE_H_INCLUDED
31 #define RT_SERIALIZE_H_INCLUDED
35 #define BANDTYPE_FLAGS_MASK 0xF0
36 #define BANDTYPE_PIXTYPE_MASK 0x0F
37 #define BANDTYPE_FLAG_OFFDB (1<<7)
38 #define BANDTYPE_FLAG_HASNODATA (1<<6)
39 #define BANDTYPE_FLAG_ISNODATA (1<<5)
40 #define BANDTYPE_FLAG_RESERVED3 (1<<4)
42 #define BANDTYPE_PIXTYPE(x) ((x)&BANDTYPE_PIXTYPE_MASK)
43 #define BANDTYPE_IS_OFFDB(x) ((x)&BANDTYPE_FLAG_OFFDB)
44 #define BANDTYPE_HAS_NODATA(x) ((x)&BANDTYPE_FLAG_HASNODATA)
45 #define BANDTYPE_IS_NODATA(x) ((x)&BANDTYPE_FLAG_ISNODATA)
47 #if POSTGIS_DEBUG_LEVEL > 2
52 d_print_binary_hex(
const char* msg,
const uint8_t *
const raw,
uint32_t size);
55 d_binptr_to_pos(
const uint8_t *
const ptr,
const uint8_t *
const end,
size_t size);
57 #define CHECK_BINPTR_POSITION(ptr, end, size, pos) \
58 { if (pos != d_binptr_to_pos(ptr, end, size)) { \
59 fprintf(stderr, "Check of binary stream pointer position failed on line %d\n", __LINE__); \
60 fprintf(stderr, "\tactual = %lu, expected = %lu\n", (long unsigned)d_binptr_to_pos(ptr, end, size), (long unsigned)pos); \
65 #define CHECK_BINPTR_POSITION(ptr, end, size, pos) ((void)0);
85 setBits(
char* ch,
double val,
int bits,
int bitOffset);
This library is the generic raster handling section of PostGIS.
void swap_char(uint8_t *a, uint8_t *b)
uint8_t isMachineLittleEndian(void)
void flip_endian_32(uint8_t *d)
void flip_endian_16(uint8_t *d)
uint8_t read_uint8(const uint8_t **from)
void write_uint16(uint8_t **to, uint8_t littleEndian, uint16_t v)
double read_float64(const uint8_t **from, uint8_t littleEndian)
float read_float32(const uint8_t **from, uint8_t littleEndian)
void flip_endian_64(uint8_t *d)
int8_t read_int8(const uint8_t **from)
int16_t read_int16(const uint8_t **from, uint8_t littleEndian)
int32_t read_int32(const uint8_t **from, uint8_t littleEndian)
uint32_t read_uint32(const uint8_t **from, uint8_t littleEndian)
uint16_t read_uint16(const uint8_t **from, uint8_t littleEndian)