#ifdef G_OS_WIN32 #define WIN32_LEAN_AND_MEAN 1 #include #endif #include #include "fluids.h" #include "funcs.h" #include "palette.h" #include "flowvis.h" static int flowvis_render = FALSE; static int flowvis_num_colors = PALETTE_MAXCOLORS; static int flowvis_colormap = PALETTE_BLACKWHITE; static float flowvis_alpha = 1.0f; static float flowvis_sort = FLOWVIS_SORT_FRAME; static fftw_real *flowvis_frame; static fftw_real **flowvis_history; static int hisdex = 0; void flowvis_set_hisdex(int arg) { int idx = (fluids_get_hisdex() + 1) % HISTORY_SIZE; hisdex = (arg + idx) % HISTORY_SIZE; } int flowvis_get_hisdex(void) { return hisdex; } void flowvis_set_render(int render_flowvis) { flowvis_render = render_flowvis; } int flowvis_get_render(void) { return flowvis_render; } void flowvis_set_num_colors(int num_colors) { flowvis_num_colors = num_colors; } int flowvis_get_num_colors(void) { return flowvis_num_colors; } void flowvis_set_colormap(int colormap) { flowvis_colormap = colormap; } int flowvis_get_colormap(void) { return flowvis_colormap; } void flowvis_set_alpha(float alpha) { flowvis_alpha = alpha; } float flowvis_get_alpha(void) { return flowvis_alpha; } void flowvis_set_frame(fftw_real *frame) { flowvis_frame = frame; } fftw_real *flowvis_get_frame(void) { return flowvis_frame; } void flowvis_set_sort(int sort) { flowvis_sort = sort; } int flowvis_get_sort(void) { return flowvis_sort; } void flowvis_set_history(fftw_real **history) { flowvis_history = history; } fftw_real *flowvis_get_history(int hisdex) { return flowvis_history[hisdex]; } struct color4f flowvis_get_color(float value) { struct color4f return_value; return_value = set_palette(flowvis_colormap, value, flowvis_num_colors); return_value.a = flowvis_alpha; return return_value; }