diff options
author | Thomas White <taw@physics.org> | 2012-05-30 17:17:11 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-05-30 17:17:11 +0200 |
commit | 4e0fe58f0d35f2a73f718917b2b99dc17fb9f7dd (patch) | |
tree | 4b1279360d9d4de28825e4608f554c187ed6ee0d /libcrystfel/src/render.c | |
parent | 781b32aa84eb9fb3092636beb3f6e4fee43add6c (diff) |
Formatting
Diffstat (limited to 'libcrystfel/src/render.c')
-rw-r--r-- | libcrystfel/src/render.c | 69 |
1 files changed, 37 insertions, 32 deletions
diff --git a/libcrystfel/src/render.c b/libcrystfel/src/render.c index c9e1f01e..5d0cf9e8 100644 --- a/libcrystfel/src/render.c +++ b/libcrystfel/src/render.c @@ -64,34 +64,35 @@ static void render_rgb(double val, double max, s = 6; } switch ( s ) { - case 0 : { /* Black to blue */ - r = 0; g = 0; b = p; - break; - } - case 1 : { /* Blue to pink */ - r = p; g = 0; b = 1.0; - break; - } - case 2 : { /* Pink to red */ - r = 1.0; g = 0; b = (1.0-p)*1.0; - break; - } - case 3 : { /* Red to Orange */ - r = 1.0; g = 0.5*p; b = 0; - break; - } - case 4 : { /* Orange to Yellow */ - r = 1.0; g = 0.5 + 0.5*p; b = 0; - break; - } - case 5 : { /* Yellow to White */ - r = 1.0; g = 1.0; b = 1.0*p; - break; - } - case 6 : { /* Pixel has hit the maximum value */ - r = 1.0; g = 1.0; b = 1.0; - break; - } + + case 0 : /* Black to blue */ + r = 0; g = 0; b = p; + break; + + case 1 : /* Blue to pink */ + r = p; g = 0; b = 1.0; + break; + + case 2 : /* Pink to red */ + r = 1.0; g = 0; b = (1.0-p)*1.0; + break; + + case 3 : /* Red to Orange */ + r = 1.0; g = 0.5*p; b = 0; + break; + + case 4 : /* Orange to Yellow */ + r = 1.0; g = 0.5 + 0.5*p; b = 0; + break; + + case 5 : /* Yellow to White */ + r = 1.0; g = 1.0; b = 1.0*p; + break; + + case 6 : /* Pixel has hit the maximum value */ + r = 1.0; g = 1.0; b = 1.0; + break; + } *rp = r; @@ -144,16 +145,20 @@ void render_scale(double val, double max, int scale, double *rp, double *gp, double *bp) { switch ( scale ) { - case SCALE_COLOUR : + + case SCALE_COLOUR : render_rgb(val, max, rp, gp, bp); break; - case SCALE_MONO : + + case SCALE_MONO : render_mono(val, max, rp, gp, bp); break; - case SCALE_INVMONO : + + case SCALE_INVMONO : render_invmono(val, max, rp, gp, bp); break; - case SCALE_RATIO : + + case SCALE_RATIO : render_ratio(val, max, rp, gp, bp); break; } |