-
Notifications
You must be signed in to change notification settings - Fork 0
/
rasterize.h
67 lines (49 loc) · 1.21 KB
/
rasterize.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
#ifndef RASTERIZER_H
#define RASTERIZER_H
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include <sys/param.h>
#include <glib-2.0/glib.h>
#define EMPTY_VAL 0.0f
typedef struct {
double x;
double y;
double z;
} Point3D;
typedef struct PointNode_t {
Point3D p;
struct PointNode_t *next;
} PointNode;
typedef struct {
double lu_long;
double lu_lat;
double rl_long;
double rl_lat;
double gsd; // in metres
char *pointsFileName;
} Config;
typedef struct {
float *pixels;
int rows;
int cols;
Config *config;
} Image;
typedef struct {
PointNode **nodes;
Config *config;
int rows;
int cols;
} Index;
void printImage(Image *image);
void printIndexBins(Index *index);
void rasterize(Index *index, Image *image);
void addPointToIndex(Index *index, Point3D *point);
void addToBin(PointNode **current, Point3D* point);
void readPointsFromFile(char *filename, Index *index);
void readConfig(char *filename, Config *config);
void calcImageSize(Config *config, int *rows, int *cols);
void point2Index(Config *config, Point3D *point, int *row, int *col);
void pixel2Point(Image *image, int *row, int *col, Point3D *point);
#endif