if (pm->color_optimize && country_graph && rgb_r && rgb_g && rgb_b)
map_optimal_coloring(pm->seed, country_graph, rgb_r, rgb_g, rgb_b);
else if (pm->color_scheme_str){
- map_palette_optimal_coloring(pm->color_scheme_str, "0,100", country_graph, 0.01, -10,
+ map_palette_optimal_coloring(pm->color_scheme_str, country_graph, 0.01, -10,
&rgb_r, &rgb_g, &rgb_b);
}
#include <edgepaint/lab.h>
#include <edgepaint/node_distinct_coloring.h>
-void map_palette_optimal_coloring(char *color_scheme, char *lightness, SparseMatrix A0, double accuracy, int seed,
+void map_palette_optimal_coloring(char *color_scheme, SparseMatrix A0, double accuracy, int seed,
float **rgb_r, float **rgb_g, float **rgb_b){
/*
for a graph A, get a distinctive color of its nodes so that the color distanmce among all nodes are maximized. Here
accuracy is the threshold given so that when finding the coloring for each node, the optimal is
with in "accuracy" of the true global optimal.
color_scheme: rgb, gray, lab, or one of the color palettes in color_palettes.h, or a list of hex rgb colors separaterd by comma like "#ff0000,#00ff00"
- lightness: of the form 0,70, specifying the range of lightness of LAB color. Ignored if scheme is not COLOR_LAB.
- . if NULL, 0,70 is assumed
A: the graph of n nodes
accuracy: how accurate to find the optimal
cdim: dimension of the color space
SparseMatrix_export(stdout, A);
}
+ // lightness: of the form 0,70, specifying the range of lightness of LAB
+ // color. Ignored if scheme is not COLOR_LAB.
+ char *lightness = "0,100";
+
node_distinct_coloring(color_scheme, lightness, weightedQ, A, accuracy, seed,
&cdim, &colors);
const char* opacity, SparseMatrix A, FILE*);
void map_optimal_coloring(int seed, SparseMatrix A, float *rgb_r, float *rgb_g, float *rgb_b);
-void map_palette_optimal_coloring(char *color_scheme, char *lightness, SparseMatrix A, double accuracy, int seed, float **rgb_r, float **rgb_g, float **rgb_b);
+void map_palette_optimal_coloring(char *color_scheme, SparseMatrix A, double accuracy, int seed, float **rgb_r, float **rgb_g, float **rgb_b);
enum {POLY_LINE_REAL_EDGE, POLY_LINE_NOT_REAL_EDGE};
#define neighbor(t, i, edim, elist) elist[(edim)*(t)+i]