diff --git a/Common/ColorTable.cpp b/Common/ColorTable.cpp index c259027a3e563dcccb5ff9d994596f797ff28087..1584c9c8fed48dca8aa6f20c7179afc30ad12c1d 100644 --- a/Common/ColorTable.cpp +++ b/Common/ColorTable.cpp @@ -1,4 +1,4 @@ -// $Id: ColorTable.cpp,v 1.11 2002-05-20 18:28:24 geuzaine Exp $ +// $Id: ColorTable.cpp,v 1.12 2002-08-27 02:03:34 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -264,4 +264,11 @@ void ColorTable_Print(GmshColorTable *ct, FILE *fp){ } - +int ColorTable_IsAlpha(GmshColorTable *ct){ + int i, a; + for (i=0;i<ct->size;i++) { + a = UNPACK_ALPHA( ct->table[i] ); + if(a<255) return 1; + } + return 0; +} diff --git a/Common/ColorTable.h b/Common/ColorTable.h index 4f94c0683fb49c0b797a2e64998b150a0453c293..ccc22ea7ecb27b5ceeb4317e0dc29eec5aedc478 100644 --- a/Common/ColorTable.h +++ b/Common/ColorTable.h @@ -48,8 +48,8 @@ typedef struct{ // float parameters indices -#define COLORTABLE_CURVE 0 // curvature */ -#define COLORTABLE_BIAS 1 // offset */ +#define COLORTABLE_CURVE 0 // curvature +#define COLORTABLE_BIAS 1 // offset #define COLORTABLE_ALPHAPOW 2 // alpha channel power #define COLORTABLE_ALPHAVAL 3 // alpha channel value #define COLORTABLE_BETA 4 // beta coeff for brighten @@ -59,5 +59,6 @@ void ColorTable_Recompute (GmshColorTable * ct, int rgb_flag, int alpha_flag); void ColorTable_Copy(GmshColorTable *ct); void ColorTable_Paste(GmshColorTable *ct); void ColorTable_Print(GmshColorTable *ct, FILE *fp) ; +int ColorTable_IsAlpha(GmshColorTable *ct) ; #endif