pmghandling.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <ctype.h>
5 #define _USE_MATH_DEFINES
6 #include <math.h>
7 #include "pgmhandling.h"
8 #pragma warning(disable: 4996)
9 
10 unsigned char fontCharBlock8x12[]; // forward declaration
11 
12 void PGMSet(PGMData *data, unsigned char ucColor)
13 {
14  for (int i = 0; i < data->row; i++)
15  {
16  for (int j = 0; j < data->col; j++)
17  {
18  data->matrix[i][j] = ucColor;
19  }
20  }
21 }
22 
23 unsigned char PGMGetPixel(PGMData *data, int x0, int y0)
24 {
25  return(data->matrix[y0][x0]);
26 }
27 
28 void PGMDrawCross(PGMData *data, int x0, int y0, unsigned char ucColor, int halfLen, int width)
29 {
30  for (int i = x0 - halfLen; i <= (x0 + halfLen); i++)
31  {
32  for (int ii = -width / 2; ii <= width / 2; ii++)
33  {
34  for (int jj = -width / 2; jj <= width / 2; jj++)
35  {
36  PGMSetPixel(data, i + ii, y0 + jj, ucColor);
37  }
38  }
39  }
40  for (int j = y0 - halfLen; j <= (y0 + halfLen); j++)
41  {
42  for (int ii = -width / 2; ii <= width / 2; ii++)
43  {
44  for (int jj = -width / 2; jj <= width / 2; jj++)
45  {
46  PGMSetPixel(data, x0 + ii, j + jj, ucColor);
47  }
48  }
49  }
50 }
51 void PGMSetPixel(PGMData *data, int x0, int y0, unsigned char ucColor)
52 {
53  if ((y0 < 0) || (x0 < 0))
54  {
55  printf("ACHTUNG!\n");
56  }
57  else
58  {
59 
60  if ((x0 >= data->col) || (y0 >= data->row))
61  {
62  printf("ACHTUNG!\n");
63  }
64  else
65  {
66  data->matrix[y0][x0] = ucColor;
67  }
68  }
69 }
70 
71 void PGMLine(PGMData *data, int x0, int y0, int x1, int y1, unsigned char ucColor)
72 {
73 
74  int dx = abs(x1 - x0), sx = x0 < x1 ? 1 : -1;
75  int dy = abs(y1 - y0), sy = y0 < y1 ? 1 : -1;
76  int err = (dx > dy ? dx : -dy) / 2, e2;
77 
78  for (;;) {
79  PGMSetPixel(data, x0, y0, ucColor);
80  if (x0 == x1 && y0 == y1) break;
81  e2 = err;
82  if (e2 > -dx) { err -= dy; x0 += sx; }
83  if (e2 < dy) { err += dx; y0 += sy; }
84  }
85 }
86 
87 
88 
89 int **allocate_dynamic_matrix(int row, int col)
90 {
91  int **ret_val;
92  int i;
93 
94  ret_val = (int **)malloc(sizeof(int *) * row);
95  if (ret_val == NULL) {
96  perror("memory allocation failure");
97  exit(EXIT_FAILURE);
98  }
99 
100  for (i = 0; i < row; ++i) {
101  ret_val[i] = (int *)malloc(sizeof(int) * col);
102  if (ret_val[i] == NULL) {
103  perror("memory allocation failure");
104  exit(EXIT_FAILURE);
105  }
106  }
107 
108  return ret_val;
109 }
110 
111 void deallocate_dynamic_matrix(int **matrix, int row)
112 {
113  int i;
114 
115  for (i = 0; i < row; ++i) {
116  free(matrix[i]);
117  }
118  free(matrix);
119 }
120 
121 #define HI(num) (((num) & 0x0000FF00) << 8)
122 #define LO(num) ((num) & 0x000000FF)
123 
124 void SkipComments(FILE *fp)
125 {
126  int ch;
127  char line[100];
128  while ((ch = fgetc(fp)) != EOF && isspace(ch)) {
129  ;
130  }
131 
132  if (ch == '#') {
133  fgets(line, sizeof(line), fp);
134  SkipComments(fp);
135  }
136  else {
137  fseek(fp, -1, SEEK_CUR);
138  }
139 }
140 
141 /*for reading:*/
142 PGMData* readPGM(PGMData *data, const char *file_name)
143 {
144  FILE *pgmFile;
145  char version[3];
146  int i, j;
147  int lo, hi;
148  pgmFile = fopen(file_name, "rb");
149  if (pgmFile == NULL) {
150  perror("cannot open file to read");
151  exit(EXIT_FAILURE);
152  }
153  fgets(version, sizeof(version), pgmFile);
154  if (strcmp(version, "P5")) {
155  fprintf(stderr, "Wrong file type!\n");
156  exit(EXIT_FAILURE);
157  }
158  SkipComments(pgmFile);
159  fscanf(pgmFile, "%d", &data->col);
160  SkipComments(pgmFile);
161  fscanf(pgmFile, "%d", &data->row);
162  SkipComments(pgmFile);
163  fscanf(pgmFile, "%d", &data->max_gray);
164  fgetc(pgmFile);
165 
166  data->matrix = allocate_dynamic_matrix(data->row, data->col);
167  if (data->max_gray > 255) {
168  for (i = 0; i < data->row; ++i) {
169  for (j = 0; j < data->col; ++j) {
170  hi = fgetc(pgmFile);
171  lo = fgetc(pgmFile);
172  data->matrix[i][j] = (hi << 8) + lo;
173  }
174  }
175  }
176  else {
177  for (i = 0; i < data->row; ++i) {
178  for (j = 0; j < data->col; ++j) {
179  lo = fgetc(pgmFile);
180  data->matrix[i][j] = lo;
181  }
182  }
183  }
184 
185  fclose(pgmFile);
186  return data;
187 
188 }
189 
190 /*and for writing*/
191 
192 void writePGM(const PGMData *data, const char *filename)
193 {
194  FILE *pgmFile;
195  int i, j;
196  int hi, lo;
197 
198  pgmFile = fopen(filename, "wb");
199  if (pgmFile == NULL) {
200  perror("cannot open file to write");
201  exit(EXIT_FAILURE);
202  }
203 
204  fprintf(pgmFile, "P5 ");
205  fprintf(pgmFile, "%d %d ", data->col, data->row);
206  fprintf(pgmFile, "%d ", data->max_gray);
207 
208  if (data->max_gray > 255) {
209  for (i = 0; i < data->row; ++i) {
210  for (j = 0; j < data->col; ++j) {
211  hi = HI(data->matrix[i][j]);
212  lo = LO(data->matrix[i][j]);
213  fputc(hi, pgmFile);
214  fputc(lo, pgmFile);
215  }
216 
217  }
218  }
219  else {
220  for (i = 0; i < data->row; ++i) {
221  for (j = 0; j < data->col; ++j) {
222  lo = LO(data->matrix[i][j]);
223  fputc(lo, pgmFile);
224  }
225  }
226  }
227 
228  fclose(pgmFile);
229 }
230 
231 void freePGM(const PGMData *data)
232 {
233  deallocate_dynamic_matrix(data->matrix, data->row);
234 }
235 
236 PGMData* initPgm(int rows, int cols)
237 {
238  PGMData* tmp = (PGMData *)malloc(sizeof(PGMData));
239  tmp->col = cols;
240  tmp->row = rows;
241  tmp->max_gray = 255;
242  tmp->matrix = allocate_dynamic_matrix(rows, cols);
243  return(tmp);
244 }
245 
246 
247 
248 void PGMPutText(PGMData *data, char *szText, int xPos, int yPos, unsigned char ucColor)
249 {
250  int strLen = (int)strlen(szText);
251  int xTmp = xPos;
252  for (int i = 0; i < strLen; i++)
253  {
254  char ch = szText[i];
255  if ((ch >= ' ') && (ch < 0x80))
256  {
257  int idx = ch - ' ';
258  int offset = idx * 12;
259  for (int ii = 0; ii < 12; ii++)
260  {
261  unsigned char ucBitMask = fontCharBlock8x12[offset + ii];
262  for (int jj = 0; jj < 8; jj++)
263  {
264  if (ucBitMask & (0x01 << (7 - jj)))
265  {
266  PGMSetPixel(data, xTmp + jj, yPos + ii, ucColor);
267  }
268  }
269  }
270  }
271  xTmp += 8;
272  }
273 }
274 
275 
276 void PGMEllipse(const PGMData *data, float xc, float yc, float *vecArr, unsigned char ucColor)
277 {
278 
279  double halfmajoraxissize = vecArr[0] * vecArr[0] + vecArr[2] * vecArr[2];
280  double halfminoraxissize = vecArr[1] * vecArr[1] + vecArr[3] * vecArr[3];
281 
282  halfmajoraxissize = sqrt(halfmajoraxissize);
283  halfminoraxissize = sqrt(halfminoraxissize);
284  double halfBiggestSize = (halfminoraxissize > halfmajoraxissize) ? halfminoraxissize : halfmajoraxissize;
285 
286  float a, b;
287  a = (float)halfmajoraxissize;
288  b = (float)halfminoraxissize;
289  float theta = (float)atan2(vecArr[2], vecArr[0]);
290 
291  int numStepsEsti = (int)(halfBiggestSize * 6.28); // Kreisumfang mal grob abschaetzen
292 
293  if (numStepsEsti < 1)
294  {
295  numStepsEsti = 1;
296  }
297  float stepWidth = (float)(2.0 * M_PI / numStepsEsti);
298  numStepsEsti++; // damit der Kreis geschlossen wird
299  int xpi = 0;
300  int ypi = 0;
301  for (int i = 0; i < numStepsEsti; i++)
302  {
303  float t = i * stepWidth;
304  int xcur = (int)(xc + a*cos(t)*cos(theta) - b*sin(t)*sin(theta));
305  int ycur = (int)(yc + b*sin(t)*cos(theta) + a*cos(t)*sin(theta));
306 
307  if (i > 0)
308  {
309  PGMLine((PGMData *)data, xpi, ypi, xcur, ycur, ucColor);
310 
311  }
312  xpi = xcur;
313  ypi = ycur;
314  }
315 
316 }
317 
318 
319 
320 unsigned char fontCharBlock8x12[] =
321 {
322  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 , //
323  0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00 , // !
324  0x00,0x36,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 , // "
325  0x00,0x00,0x14,0x14,0x3E,0x14,0x14,0x3E,0x14,0x14,0x00,0x00 , // #
326  0x00,0x08,0x1C,0x32,0x30,0x1C,0x06,0x26,0x1C,0x08,0x08,0x00 , // $
327  0x00,0x13,0x2B,0x2B,0x16,0x0C,0x1A,0x35,0x35,0x32,0x00,0x00 , // %
328  0x00,0x1C,0x36,0x36,0x1C,0x1D,0x37,0x36,0x36,0x1B,0x00,0x00 , // &
329  0x00,0x0C,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 , // '
330  0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00 , // (
331  0x00,0x30,0x18,0x0C,0x0C,0x0C,0x0C,0x0C,0x18,0x30,0x00,0x00 , // )
332  0x00,0x00,0x00,0x36,0x1C,0x7F,0x1C,0x36,0x00,0x00,0x00,0x00 , // *
333  0x00,0x00,0x00,0x00,0x0C,0x0C,0x3F,0x0C,0x0C,0x00,0x00,0x00 , // +
334  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x0C,0x18 , // ,
335  0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0x00,0x00 , // -
336  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x00,0x00 , // .
337  0x00,0x06,0x06,0x0C,0x0C,0x18,0x18,0x30,0x30,0x60,0x00,0x00 , // /
338  0x00,0x1E,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3C,0x00,0x00 , // 0
339  0x00,0x0C,0x1C,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00 , // 1
340  0x00,0x1C,0x36,0x36,0x06,0x0C,0x0C,0x18,0x30,0x3E,0x00,0x00 , // 2
341  0x00,0x1C,0x36,0x06,0x06,0x1C,0x06,0x06,0x36,0x1C,0x00,0x00 , // 3
342  0x00,0x18,0x18,0x18,0x36,0x36,0x36,0x3F,0x06,0x06,0x00,0x00 , // 4
343  0x00,0x3E,0x30,0x30,0x30,0x3C,0x06,0x06,0x36,0x1C,0x00,0x00 , // 5
344  0x00,0x0C,0x18,0x18,0x30,0x3C,0x36,0x36,0x36,0x1C,0x00,0x00 , // 6
345  0x00,0x3E,0x06,0x06,0x0C,0x0C,0x0C,0x18,0x18,0x18,0x00,0x00 , // 7
346  0x00,0x1C,0x36,0x36,0x36,0x1C,0x36,0x36,0x36,0x1C,0x00,0x00 , // 8
347  0x00,0x1C,0x36,0x36,0x36,0x1E,0x0C,0x0C,0x18,0x30,0x00,0x00 , // 9
348  0x00,0x00,0x00,0x1C,0x1C,0x00,0x00,0x00,0x1C,0x1C,0x00,0x00 , // :
349  0x00,0x00,0x00,0x1C,0x1C,0x00,0x00,0x00,0x1C,0x1C,0x0C,0x18 , // , //
350  0x00,0x02,0x06,0x0C,0x18,0x30,0x18,0x0C,0x06,0x02,0x00,0x00 , // <
351  0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x3E,0x00,0x00,0x00,0x00 , // =
352  0x00,0x20,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x20,0x00,0x00 , // >
353  0x00,0x1C,0x36,0x36,0x06,0x0C,0x18,0x00,0x18,0x18,0x00,0x00 , // ?
354  0x00,0x0E,0x19,0x33,0x35,0x35,0x35,0x32,0x18,0x0F,0x00,0x00 , // @
355  0x00,0x08,0x1C,0x36,0x36,0x36,0x3E,0x36,0x36,0x36,0x00,0x00 , // A
356  0x00,0x3C,0x36,0x36,0x36,0x3C,0x36,0x36,0x36,0x3C,0x00,0x00 , // B
357  0x00,0x1C,0x36,0x36,0x30,0x30,0x30,0x36,0x36,0x1C,0x00,0x00 , // C
358  0x00,0x3C,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3C,0x00,0x00 , // D
359  0x00,0x3E,0x30,0x30,0x30,0x3C,0x30,0x30,0x30,0x3E,0x00,0x00 , // E
360  0x00,0x3E,0x30,0x30,0x30,0x3C,0x30,0x30,0x30,0x30,0x00,0x00 , // F
361  0x00,0x1C,0x36,0x30,0x30,0x36,0x36,0x36,0x36,0x1C,0x00,0x00 , // G
362  0x00,0x36,0x36,0x36,0x36,0x3E,0x36,0x36,0x36,0x36,0x00,0x00 , // H
363  0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x1E,0x00,0x00 , // I
364  0x00,0x06,0x06,0x06,0x06,0x06,0x06,0x36,0x36,0x1C,0x00,0x00 , // J
365  0x00,0x36,0x36,0x36,0x3C,0x38,0x3C,0x36,0x36,0x36,0x00,0x00 , // K
366  0x00,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3E,0x00,0x00 , // L
367  0x00,0x63,0x63,0x77,0x77,0x7F,0x6B,0x6B,0x63,0x63,0x00,0x00 , // M
368  0x00,0x33,0x33,0x3B,0x3B,0x3F,0x37,0x33,0x33,0x33,0x00,0x00 , // N
369  0x00,0x1C,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x1C,0x00,0x00 , // O
370  0x00,0x3C,0x36,0x36,0x36,0x3C,0x30,0x30,0x30,0x30,0x00,0x00 , // P
371  0x00,0x1C,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x1C,0x0C,0x06 , // Q
372  0x00,0x3C,0x36,0x36,0x36,0x3C,0x36,0x36,0x36,0x36,0x00,0x00 , // R
373  0x00,0x1C,0x36,0x32,0x38,0x1C,0x0E,0x26,0x36,0x1C,0x00,0x00 , // S
374  0x00,0x3F,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00 , // T
375  0x00,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x1C,0x00,0x00 , // U
376  0x00,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x1C,0x08,0x00,0x00 , // V
377  0x00,0x63,0x63,0x6B,0x6B,0x6B,0x6B,0x36,0x36,0x36,0x00,0x00 , // W
378  0x00,0x36,0x36,0x36,0x1C,0x08,0x1C,0x36,0x36,0x36,0x00,0x00 , // X
379  0x00,0x33,0x33,0x33,0x33,0x1E,0x0C,0x0C,0x0C,0x0C,0x00,0x00 , // Y
380  0x00,0x3E,0x06,0x0C,0x0C,0x18,0x18,0x30,0x30,0x3E,0x00,0x00 , // Z
381  0x00,0x1E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1E , // [
382  0x00,0x30,0x30,0x18,0x18,0x0C,0x0C,0x06,0x06,0x03,0x00,0x00 , // Backslash
383  0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C , // ]
384  0x00,0x08,0x1C,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 , // ^
385  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F , // _
386  0x00,0x18,0x18,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 , // `
387  0x00,0x00,0x00,0x00,0x1C,0x06,0x1E,0x36,0x36,0x1E,0x00,0x00 , // a
388  0x00,0x30,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x3C,0x00,0x00 , // b
389  0x00,0x00,0x00,0x00,0x1C,0x36,0x30,0x30,0x36,0x1C,0x00,0x00 , // c
390  0x00,0x06,0x06,0x06,0x1E,0x36,0x36,0x36,0x36,0x1E,0x00,0x00 , // d
391  0x00,0x00,0x00,0x00,0x1C,0x36,0x3E,0x30,0x32,0x1C,0x00,0x00 , // e
392  0x00,0x0E,0x18,0x18,0x3E,0x18,0x18,0x18,0x18,0x18,0x00,0x00 , // f
393  0x00,0x00,0x00,0x00,0x1E,0x36,0x36,0x36,0x1E,0x06,0x26,0x1C , // g
394  0x00,0x30,0x30,0x30,0x3C,0x36,0x36,0x36,0x36,0x36,0x00,0x00 , // h
395  0x00,0x0C,0x00,0x00,0x1C,0x0C,0x0C,0x0C,0x0C,0x1E,0x00,0x00 , // i
396  0x00,0x0C,0x00,0x00,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x38 , // j
397  0x00,0x30,0x30,0x30,0x36,0x3C,0x38,0x3C,0x36,0x36,0x00,0x00 , // k
398  0x00,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x1E,0x00,0x00 , // l
399  0x00,0x00,0x00,0x00,0x76,0x7F,0x6B,0x6B,0x6B,0x63,0x00,0x00 , // m
400  0x00,0x00,0x00,0x00,0x3C,0x36,0x36,0x36,0x36,0x36,0x00,0x00 , // n
401  0x00,0x00,0x00,0x00,0x1C,0x36,0x36,0x36,0x36,0x1C,0x00,0x00 , // o
402  0x00,0x00,0x00,0x00,0x3C,0x36,0x36,0x36,0x36,0x3C,0x30,0x30 , // p
403  0x00,0x00,0x00,0x00,0x1E,0x36,0x36,0x36,0x36,0x1E,0x06,0x06 , // q
404  0x00,0x00,0x00,0x00,0x36,0x3E,0x30,0x30,0x30,0x30,0x00,0x00 , // r
405  0x00,0x00,0x00,0x00,0x1E,0x30,0x3C,0x1E,0x06,0x3C,0x00,0x00 , // s
406  0x00,0x00,0x18,0x18,0x3C,0x18,0x18,0x18,0x18,0x0E,0x00,0x00 , // t
407  0x00,0x00,0x00,0x00,0x36,0x36,0x36,0x36,0x36,0x1E,0x00,0x00 , // u
408  0x00,0x00,0x00,0x00,0x36,0x36,0x36,0x36,0x1C,0x08,0x00,0x00 , // v
409  0x00,0x00,0x00,0x00,0x63,0x6B,0x6B,0x6B,0x3E,0x36,0x00,0x00 , // w
410  0x00,0x00,0x00,0x00,0x36,0x36,0x1C,0x1C,0x36,0x36,0x00,0x00 , // x
411  0x00,0x00,0x00,0x00,0x36,0x36,0x36,0x36,0x1C,0x0C,0x18,0x30 , // y
412  0x00,0x00,0x00,0x00,0x3E,0x06,0x0C,0x18,0x30,0x3E,0x00,0x00 , // z
413  0x00,0x0E,0x18,0x18,0x18,0x30,0x18,0x18,0x18,0x0E,0x00,0x00 , // {
414  0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18 , // |
415  0x00,0x30,0x18,0x18,0x18,0x0C,0x18,0x18,0x18,0x30,0x00,0x00 , // }
416  0x00,0x1A,0x3E,0x2C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 , // ~
417  0x00,0x00,0x00,0x08,0x1C,0x36,0x22,0x22,0x3E,0x3E,0x00,0x00 , // 
418 };
419 
420 
421 #if 0
422 void PGMEllipseRotated
423 t = linspace(0, 2 * pi, 100);
424 theta = deg2rad(105);
425 a = 2;
426 b = 1;
427 x0 = 0.15;
428 y0 = 0.30;
429 x = x0 + a*cos(t)*cos(theta) - b*sin(t)*sin(theta);
430 y = y0 + b*sin(t)*cos(theta) + a*cos(t)*sin(theta);
431 figure;
432 plot(x, y);
433 axis equal;
434 #endif
435 #if 0
436 https://stackoverflow.com/questions/2163370/byte-codes-for-pixel-maps-for-ascii-characters
437 #endif
_PGMData::col
int col
Definition: pgmhandling.h:7
readPGM
PGMData * readPGM(PGMData *data, const char *file_name)
Definition: pmghandling.c:142
LO
#define LO(num)
Definition: pmghandling.c:122
NULL
#define NULL
_PGMData::max_gray
int max_gray
Definition: pgmhandling.h:8
SkipComments
void SkipComments(FILE *fp)
Definition: pmghandling.c:124
allocate_dynamic_matrix
int ** allocate_dynamic_matrix(int row, int col)
Definition: pmghandling.c:89
initPgm
PGMData * initPgm(int rows, int cols)
Definition: pmghandling.c:236
PGMSet
void PGMSet(PGMData *data, unsigned char ucColor)
Definition: pmghandling.c:12
HI
#define HI(num)
Definition: pmghandling.c:121
PGMLine
void PGMLine(PGMData *data, int x0, int y0, int x1, int y1, unsigned char ucColor)
Definition: pmghandling.c:71
_PGMData
Definition: pgmhandling.h:5
_PGMData::matrix
int ** matrix
Definition: pgmhandling.h:9
writePGM
void writePGM(const PGMData *data, const char *filename)
Definition: pmghandling.c:192
data
data
PGMSetPixel
void PGMSetPixel(PGMData *data, int x0, int y0, unsigned char ucColor)
Definition: pmghandling.c:51
fontCharBlock8x12
unsigned char fontCharBlock8x12[]
Definition: pmghandling.c:10
deg2rad
#define deg2rad
Definition: BasicDatatypes.hpp:83
imu_timestamp_test.filename
string filename
Definition: imu_timestamp_test.py:69
setup.version
version
Definition: tools/imu_delay_tester/setup.py:8
PGMDrawCross
void PGMDrawCross(PGMData *data, int x0, int y0, unsigned char ucColor, int halfLen, int width)
Definition: pmghandling.c:28
freePGM
void freePGM(const PGMData *data)
Definition: pmghandling.c:231
PGMGetPixel
unsigned char PGMGetPixel(PGMData *data, int x0, int y0)
Definition: pmghandling.c:23
_PGMData::row
int row
Definition: pgmhandling.h:6
imu_delay_tester.line
line
Definition: imu_delay_tester.py:135
PGMEllipse
void PGMEllipse(const PGMData *data, float xc, float yc, float *vecArr, unsigned char ucColor)
Definition: pmghandling.c:276
PGMPutText
void PGMPutText(PGMData *data, char *szText, int xPos, int yPos, unsigned char ucColor)
Definition: pmghandling.c:248
pgmhandling.h
stderr
stderr
deallocate_dynamic_matrix
void deallocate_dynamic_matrix(int **matrix, int row)
Definition: pmghandling.c:111
t
geometry_msgs::TransformStamped t


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:09