summaryrefslogtreecommitdiffstats
path: root/Smoke/colormap.c
diff options
context:
space:
mode:
Diffstat (limited to 'Smoke/colormap.c')
-rw-r--r--Smoke/colormap.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/Smoke/colormap.c b/Smoke/colormap.c
index 565b815..0921b94 100644
--- a/Smoke/colormap.c
+++ b/Smoke/colormap.c
@@ -20,17 +20,17 @@ static int colormap_num_colors = PALETTE_MAXCOLORS;
static float colormap_alpha = 1.0f;
-static int colormap_scaling = FALSE;
+static int colormap_scaling = TRUE;
static int colormap_clamping = FALSE;
-static float scale_min = 0.0f;
+static float colormap_scale_min = 0.0f;
-static float scale_max = 1.0f;
+static float colormap_scale_max = 1.0f;
-static float clamp_min = 0.0f;
+static float colormap_clamp_min = 0.0f;
-static float clamp_max = 0.9999f;
+static float colormap_clamp_max = 0.9999f;
static fftw_real *colormap_frame;
@@ -85,67 +85,72 @@ int colormap_get_clamping(void)
return colormap_clamping;
}
+void colormap_set_tempscale(float temp)
+{
+ printf("temp: %f\n", temp);
+}
+
void colormap_set_scale_min(float min_scale)
{
if (colormap_scaling) {
- scale_min = min_scale;
+ colormap_scale_min = min_scale;
}
}
float colormap_get_scale_min(void)
{
- return scale_min;
+ return colormap_scale_min;
}
void colormap_set_scale_max(float max_scale)
{
if (colormap_scaling) {
- scale_max = max_scale;
+ colormap_scale_max = max_scale;
}
}
float colormap_get_scale_max(void)
{
- return scale_max;
+ return colormap_scale_max;
}
void colormap_set_clamp_min(float min_clamp)
{
if (colormap_clamping) {
- clamp_min = min_clamp;
+ colormap_clamp_min = min_clamp;
}
}
float colormap_get_clamp_min(void)
{
- return clamp_min;
+ return colormap_clamp_min;
}
void colormap_set_clamp_max(float max_clamp)
{
if (colormap_clamping) {
- clamp_max = max_clamp;
+ colormap_clamp_max = max_clamp;
}
}
float colormap_get_clamp_max(void)
{
- return clamp_max;
+ return colormap_clamp_max;
}
static float remap(float value)
{
- value -= scale_min;
- value /= (scale_max - scale_min);
+ value -= colormap_scale_min;
+ value /= (colormap_scale_max - colormap_scale_min);
return value;
}
static float clamp(float value)
{
- if (value < clamp_min) value = clamp_min;
- if (value > clamp_max) value = clamp_max;
+ if (value < colormap_clamp_min) value = colormap_clamp_min;
+ if (value > colormap_clamp_max) value = colormap_clamp_max;
return value;
}