-
Notifications
You must be signed in to change notification settings - Fork 0
/
pcd2bmp.h
84 lines (75 loc) · 1.6 KB
/
pcd2bmp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
typedef struct {
unsigned int bmpSize;
int width;
int height;
unsigned short bitsPerPixel;
unsigned int imageSize;
char* data;
} Bitmap;
typedef enum PCD_field_type_label{
X,
Y,
Z,
RGB,
NORMAL,
MOMENT_INVARIANT
}PCD_field_type;
typedef enum PCD_data_storage_label {
ASCII,
BINARY
}PCD_data_storage;
typedef enum PCD_file_format_label {
VERSION,
FIELDS,
SIZE,
TYPE,
COUNT,
WIDTH,
HEIGHT,
VIEWPOINT,
POINTS,
DATA,
POINT_CLOUD
}PCD_file_format;
typedef struct {
PCD_field_type type;
int size;
int count;
char data_type;
} PCD_Field;
typedef struct {
float r;
float i;
float j;
float k;
} Quaternion;
typedef struct {
Quaternion position;
Quaternion rotation;
float focal_length;
} Camera;
typedef struct {
int height;
int width;
float viewpoint[7];
Camera camera;
int numFields;
PCD_Field* fields;
char* data;
float* float_data;
int numPoints;
PCD_data_storage data_storage;
} PCD;
PCD* NewPCDFromFile(char* fileName);
PCD* NewPCD4FromFile(char* fileName);
void DeletePCD(PCD* pcd);
Bitmap* NewBitmap(unsigned int width, unsigned int height, unsigned short bitsPerPixel);
void DeleteBitmap(Bitmap* bmp);
void SaveBitmap(Bitmap* bmp, char* fileName);
int Show3DProjection(Bitmap* bmp, PCD* pcd, int pointSize, int zoomToFit);
void pcd2bmp(char* src, char* dest, int pointSize);