gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
ColorTable.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 
6 #ifndef COLORTABLE_H
7 #define COLORTABLE_H
8 
9 #include <stdio.h>
10 #include <vector>
11 #include <string>
12 
13 #define COLORTABLE_NBMAX_PARAM 10
14 #define COLORTABLE_NBMAX_COLOR 1024
15 
16 typedef struct {
17  unsigned int table[COLORTABLE_NBMAX_COLOR];
18  int size; // must be >= 2
20  double dpar[COLORTABLE_NBMAX_PARAM];
22 
23 // COLORTABLE_MODE
24 
25 #define COLORTABLE_RGB 1
26 #define COLORTABLE_HSV 2
27 
28 // integer parameters indices
29 
30 #define COLORTABLE_NUMBER 0 // predefined curve index
31 #define COLORTABLE_INVERT 1 // invert (rbg<->255-rgb)
32 #define COLORTABLE_SWAP 2 // swap (min<->max)
33 #define COLORTABLE_ROTATION 3 // rotation
34 #define COLORTABLE_MODE 4 // mode (rgb, hsv)
35 
36 // double parameters indices
37 
38 #define COLORTABLE_CURVATURE 0 // curvature
39 #define COLORTABLE_BIAS 1 // offset
40 #define COLORTABLE_ALPHA 2 // alpha channel value
41 #define COLORTABLE_BETA 3 // beta coeff for brighten
42 #define COLORTABLE_ALPHAPOW 4 // alpha channel power value
43 
44 void ColorTable_InitParam(int number, GmshColorTable *ct);
48 void ColorTable_Print(GmshColorTable *ct, FILE *fp,
49  std::vector<std::string> *vec = nullptr);
52 
53 void RGB_to_HSV(double R, double G, double B, double *H, double *S, double *V);
54 void HSV_to_RGB(double H, double S, double V, double *R, double *G, double *B);
55 
56 #endif
COLORTABLE_NBMAX_PARAM
#define COLORTABLE_NBMAX_PARAM
Definition: ColorTable.h:13
ColorTable_IsAlpha
int ColorTable_IsAlpha(GmshColorTable *ct)
Definition: ColorTable.cpp:1112
COLORTABLE_NBMAX_COLOR
#define COLORTABLE_NBMAX_COLOR
Definition: ColorTable.h:14
ColorTable_InitParam
void ColorTable_InitParam(int number, GmshColorTable *ct)
Definition: ColorTable.cpp:22
HSV_to_RGB
void HSV_to_RGB(double H, double S, double V, double *R, double *G, double *B)
Definition: ColorTable.cpp:1124
ColorTable_Copy
void ColorTable_Copy(GmshColorTable *ct)
Definition: ColorTable.cpp:1055
ColorTable_Diff
int ColorTable_Diff(GmshColorTable *ct1, GmshColorTable *ct2)
Definition: ColorTable.cpp:1071
ColorTable_Print
void ColorTable_Print(GmshColorTable *ct, FILE *fp, std::vector< std::string > *vec=nullptr)
Definition: ColorTable.cpp:1079
S
#define S
Definition: DefaultOptions.h:21
RGB_to_HSV
void RGB_to_HSV(double R, double G, double B, double *H, double *S, double *V)
Definition: ColorTable.cpp:1173
GmshColorTable
Definition: ColorTable.h:16
ColorTable_Paste
void ColorTable_Paste(GmshColorTable *ct)
Definition: ColorTable.cpp:1063
GmshColorTable::size
int size
Definition: ColorTable.h:18
ColorTable_Recompute
void ColorTable_Recompute(GmshColorTable *ct)
Definition: ColorTable.cpp:724