summaryrefslogtreecommitdiffstats
path: root/Smoke/glyphs.c
blob: 7c46eb0b795ca8f3f21fd6acac3856e3d2571822 (plain)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#ifdef G_OS_WIN32
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif

#include <rfftw.h>

#include "funcs.h"
#include "fluids.h"
#include "palette.h"

#include "glyphs.h"

static int glyphs_render            = FALSE;
static int glyphs_num_colors        = PALETTE_MAXCOLORS;
static int glyphs_colormap          = PALETTE_BLACKWHITE;
static int glyphs_sort              = GLYPH_ARROWS;
static int glyphs_dataset_color     = DATASET_RHO;
static int glyphs_dataset_direction = DATASET_RHO;

static float glyphs_alpha = 0.5f;
static fftw_real *glyphs_frame;


void glyphs_set_render(int render_glyphs)
{
  glyphs_render = render_glyphs;
}

int glyphs_get_render(void)
{
  return glyphs_render;
}

void glyphs_set_num_colors(int num_colors)
{
  glyphs_num_colors = num_colors;
}

int glyphs_get_num_colors(void)
{
  return glyphs_num_colors;
}

void glyphs_set_colormap(int colormap)
{
  glyphs_colormap = colormap;
}

int glyphs_get_colormap(void)
{
  return glyphs_colormap;
}

void glyphs_set_alpha(float alpha)
{
  glyphs_alpha = alpha;
}

float glyphs_get_alpha(void)
{
  return glyphs_alpha;
}

void glyphs_set_dataset_color(int dataset)
{
  glyphs_dataset_color = dataset;
}

int glyphs_get_dataset_color(void)
{
  return glyphs_dataset_color;
}

void glyphs_set_dataset_direction(int dataset)
{
  glyphs_dataset_direction = dataset;
}

int glyphs_get_dataset_direction(void)
{
  return glyphs_dataset_direction;
}

void glyphs_set_sort(int sort)
{
  glyphs_sort = sort;
}

int glyphs_get_sort(void)
{
  return glyphs_sort;
}

void glyphs_set_frame(fftw_real *frame)
{
  glyphs_frame = frame;
}

fftw_real *glyphs_get_frame(void)
{
  return glyphs_frame;
}


struct color4f glyphs_get_color(float value)
{
  struct color4f return_value;

  return_value = set_palette(glyphs_colormap, value, glyphs_num_colors);
  return_value.a = glyphs_alpha;

  return return_value;
}