From: Matthew Fernandez Date: Sun, 20 Jun 2021 18:36:50 +0000 (-0700) Subject: remove unused lab_gamut_from_file X-Git-Tag: 2.48.0~28^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7451e892cdb5393d8d0dbfcffacf100e0a270965;p=graphviz remove unused lab_gamut_from_file --- diff --git a/lib/edgepaint/lab.c b/lib/edgepaint/lab.c index 83e81fcbd..503999b8b 100644 --- a/lib/edgepaint/lab.c +++ b/lib/edgepaint/lab.c @@ -137,53 +137,6 @@ color_rgb XYZ2RGB(color_xyz color){ return color_rgb_init(r, g, b); } -double *lab_gamut_from_file(char *gamut_file, const char *lightness, int *n){ - /* give a list of n points in the file defining the LAB color gamut. return NULL if the mgamut file is not found. - lightness is a string of the form 0,70, or NULL. - */ - FILE *fp; - enum {buf_len = 10000}; - char buf[buf_len]; - double *xx, *x; - - int l1 = 0, l2 = 70; - - if (lightness && sscanf(lightness, "%d,%d", &l1, &l2) == 2){ - if (l1 < 0) l1 = 0; - if (l2 > 100) l2 = 100; - if (l1 > l2) l1 = l2; - } else { - l1 = 0; l2 = 70; - } - - - *n = 0; - - if (Verbose) - fprintf(stderr,"LAB color lightness range = %d,%d\n", l1, l2); - - fp = fopen(gamut_file, "r"); - if (!fp) return NULL; - while (fgets(buf, buf_len, fp)){ - (*n)++; - } - rewind(fp); - - x = malloc(sizeof(double)*3*(*n)); - xx = x; - *n = 0; - while (fgets(buf, buf_len, fp)){ - sscanf(buf,"%lf %lf %lf", xx, xx+1, xx+2); - if (*xx >= l1 && *xx <= l2){ - xx += 3; - (*n)++; - } - } - fclose(fp); - return x; -} - - double *lab_gamut(const char *lightness, int *n){ /* give a list of n points in the file defining the LAB color gamut. lightness is a string of the form 0,70, or NULL. diff --git a/lib/edgepaint/lab.h b/lib/edgepaint/lab.h index 5c86e7bc8..76bbcbabb 100644 --- a/lib/edgepaint/lab.h +++ b/lib/edgepaint/lab.h @@ -34,7 +34,6 @@ color_rgb color_rgb_init(double r, double g, double b); color_xyz color_xyz_init(double x, double y, double z); color_lab color_lab_init(double l, double a, double b); QuadTree lab_gamut_quadtree(const char *lightness, int max_qtree_level); /* construct a quadtree of the LAB gamut points */ -double *lab_gamut_from_file(char *gamut_file, const char *lightness, int *n); /* give a list of n points in the file defining the LAB color gamut */ double *lab_gamut(const char *lightness, int *n); /* give a list of n points in the file defining the LAB color gamut */ void color_blend_rgb2lab(char *color_list, const int maxpoints, double **colors); /* give a color list of the form "#ff0000,#00ff00,...", get a list of around maxpoints colors in an array colors0 of size [maxpoints*3] of the form {{l,a,b},...}.