forked from trek-view/max2sphere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmax2sphere.h
79 lines (67 loc) · 1.67 KB
/
max2sphere.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
#include "bitmaplib.h"
#include <math.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#define LEFT 0
#define RIGHT 1
#define TOP 2
#define FRONT 3
#define BACK 4
#define DOWN 5
#define NEARLYONE 0.99999
typedef struct {
double x, y, z;
} XYZ;
typedef struct {
float u, v;
} UV;
typedef struct {
double a, b, c, d;
} PLANE;
typedef struct {
int outwidth, outheight;
size_t framewidth, frameheight;
size_t antialias, antialias2;
size_t n_start, n_stop;
PLANE faces[6];
char outfilename[256];
boolean debug;
size_t threads;
boolean skip_existing;
} PARAMS;
typedef struct {
int width, height;
int sidewidth;
int centerwidth;
int blendwidth;
int equi_width;
} FRAMESPECS;
typedef struct {
size_t worker_id;
pthread_mutex_t* counter_mutex;
size_t* ip_shared_counter;
const char* progName;
const char* last_argument;
BITMAP4* frame_input1;
BITMAP4* frame_input2;
BITMAP4* frame_spherical;
} THREAD_DATA;
// Prototypes
void* worker_function(void* input);
void set_frame_filename_from_template(char*, char*, int, const char*);
void process_single_image(THREAD_DATA*, int);
int CheckFrames(const char*, const char*, size_t*, size_t*);
void create_output_filename(char*, const char*, int);
int WriteSpherical(const char*, int, const BITMAP4*, int, int);
int ReadFrame(BITMAP4*, char*, int, int);
int FindFaceUV(double, double, UV*);
BITMAP4 GetColour(int, UV, BITMAP4*, BITMAP4*);
int CheckTemplate(char*, int);
BITMAP4 ColourBlend(BITMAP4, BITMAP4, double);
void RotateUV90(UV*);
void Init(void);
double GetRunTime(void);
void GiveUsage(char*);