Skip to content
Snippets Groups Projects
Commit e81704d2 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Ctrl+Up/Down to change alpha level in colormap

parent e4b83f26
No related branches found
No related tags found
No related merge requests found
// $Id: ColorTable.cpp,v 1.12 2002-08-27 02:03:34 geuzaine Exp $
// $Id: ColorTable.cpp,v 1.13 2002-08-28 17:55:12 geuzaine Exp $
//
// Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle
//
......@@ -44,7 +44,7 @@ void ColorTable_InitParam(int number, GmshColorTable *ct,
ct->fpar[COLORTABLE_BETA] = 0.0;
}
if(alpha_flag) {
ct->fpar[COLORTABLE_ALPHAPOW] = 2.;
ct->fpar[COLORTABLE_ALPHAPOW] = 1.;
ct->fpar[COLORTABLE_ALPHAVAL] = 255.;
}
......@@ -209,12 +209,8 @@ void ColorTable_Recompute(GmshColorTable *ct, int rgb_flag, int alpha_flag){
}
if (alpha_flag) {
if (ct->fpar[COLORTABLE_ALPHAVAL]<0) {
a = (int)( 255.0 * pow( s, ct->fpar[COLORTABLE_ALPHAPOW] ) );
}
else {
a = (int)( ct->fpar[COLORTABLE_ALPHAVAL] );
}
a = (int)( ct->fpar[COLORTABLE_ALPHAVAL] *
ct->fpar[COLORTABLE_ALPHAPOW] );
}
else {
a = UNPACK_ALPHA( ct->table[i] );
......
// $Id: Colorbar_Window.cpp,v 1.25 2002-05-20 18:28:25 geuzaine Exp $
// $Id: Colorbar_Window.cpp,v 1.26 2002-08-28 17:55:12 geuzaine Exp $
//
// Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle
//
......@@ -482,9 +482,9 @@ int Colorbar_Window::handle(int event){
compute = 1;
}
else if(Fl::test_shortcut(FL_CTRL + FL_Up)){
ct->fpar[COLORTABLE_ALPHAPOW] -= 0.05;
if (ct->fpar[COLORTABLE_ALPHAPOW] < 0.0)
ct->fpar[COLORTABLE_ALPHAPOW] = 0.0;
ct->fpar[COLORTABLE_ALPHAPOW] += 0.05;
if (ct->fpar[COLORTABLE_ALPHAPOW] > 1.0)
ct->fpar[COLORTABLE_ALPHAPOW] = 1.0;
compute = 1;
}
else if(Fl::test_shortcut(FL_Down)){
......@@ -492,7 +492,9 @@ int Colorbar_Window::handle(int event){
compute = 1;
}
else if(Fl::test_shortcut(FL_CTRL + FL_Down)){
ct->fpar[COLORTABLE_ALPHAPOW] += 0.05;
ct->fpar[COLORTABLE_ALPHAPOW] -= 0.05;
if (ct->fpar[COLORTABLE_ALPHAPOW] < 0.0)
ct->fpar[COLORTABLE_ALPHAPOW] = 0.0;
compute = 1;
}
else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment