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

check if colortable has some alpha components

parent 0f85227b
No related branches found
No related tags found
No related merge requests found
// $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 // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle
// //
...@@ -264,4 +264,11 @@ void ColorTable_Print(GmshColorTable *ct, FILE *fp){ ...@@ -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;
}
...@@ -48,8 +48,8 @@ typedef struct{ ...@@ -48,8 +48,8 @@ typedef struct{
// float parameters indices // float parameters indices
#define COLORTABLE_CURVE 0 // curvature */ #define COLORTABLE_CURVE 0 // curvature
#define COLORTABLE_BIAS 1 // offset */ #define COLORTABLE_BIAS 1 // offset
#define COLORTABLE_ALPHAPOW 2 // alpha channel power #define COLORTABLE_ALPHAPOW 2 // alpha channel power
#define COLORTABLE_ALPHAVAL 3 // alpha channel value #define COLORTABLE_ALPHAVAL 3 // alpha channel value
#define COLORTABLE_BETA 4 // beta coeff for brighten #define COLORTABLE_BETA 4 // beta coeff for brighten
...@@ -59,5 +59,6 @@ void ColorTable_Recompute (GmshColorTable * ct, int rgb_flag, int alpha_flag); ...@@ -59,5 +59,6 @@ void ColorTable_Recompute (GmshColorTable * ct, int rgb_flag, int alpha_flag);
void ColorTable_Copy(GmshColorTable *ct); void ColorTable_Copy(GmshColorTable *ct);
void ColorTable_Paste(GmshColorTable *ct); void ColorTable_Paste(GmshColorTable *ct);
void ColorTable_Print(GmshColorTable *ct, FILE *fp) ; void ColorTable_Print(GmshColorTable *ct, FILE *fp) ;
int ColorTable_IsAlpha(GmshColorTable *ct) ;
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment