69{
70 uint32_t i;
72 int* delta;
75
76
78 {
81 return v;
82 }
83
85
86
87
89 delta[0] = round(prevPoint->
y * scale);
90 delta[1] = round(prevPoint->
x * scale);
91
92
93 for (i = 1; i < pa->
npoints; i++)
94 {
96 delta[2 * i] = round(point->
y * scale) - round(prevPoint->
y * scale);
97 delta[(2 * i) + 1] =
98 round(point->
x * scale) - round(prevPoint->
x * scale);
99 prevPoint = point;
100 }
101
102
103
104 for (i = 0; i < pa->
npoints * 2; i++)
105 {
106
107 delta[i] *= 2;
108
109 if (delta[i] < 0) {
110 delta[i] = ~(delta[i]);
111 }
112 }
113
115 for (i = 0; i < pa->
npoints * 2; i++)
116 {
117 int numberToEncode = delta[i];
118
119 while (numberToEncode >= 0x20)
120 {
121
122
123 int nextValue = (0x20 | (numberToEncode & 0x1f)) + 63;
125
126
127 numberToEncode >>= 5;
128 }
129
130 numberToEncode += 63;
132 }
133
137
138 return v;
139}
void * lwalloc(size_t size)
#define LWSIZE_SET(varsize, len)
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
stringbuffer_t * stringbuffer_create(void)
Allocate a new stringbuffer_t.
int stringbuffer_aprintf(stringbuffer_t *s, const char *fmt,...)
Appends a formatted string to the current string buffer, using the format and argument list provided.
lwvarlena_t * stringbuffer_getvarlenacopy(stringbuffer_t *s)
void stringbuffer_destroy(stringbuffer_t *s)
Free the stringbuffer_t and all memory managed within it.