From: joncruz Date: Mon, 3 Apr 2006 08:43:23 +0000 (+0000) Subject: initial parsing of icc-color() X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=32ee59dbd78b91513523c995e356234b67792bf4;p=inkscape.git initial parsing of icc-color() --- diff --git a/src/style.cpp b/src/style.cpp index 3693c5d2b..20ae8fa93 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -2914,7 +2914,38 @@ sp_style_read_ipaint(SPIPaint *paint, gchar const *str, SPStyle *style, SPDocume ++str; } if (strneq(str, "icc-color(", 10)) { - /* fixme: Parse icc-color to paint->iccColor here. */ + str += 10; + + SVGICCColor* tmp = new SVGICCColor(); + while ( *str && *str != ' ' && *str!= ',' && *str != ')' ) { + tmp->colorProfile += *str++; + } + while ( g_ascii_isspace(*str) || *str == ',' ) { + ++str; + } + + while ( *str && *str != ')' ) { + if ( g_ascii_isdigit(*str) || *str == '.' ) { + gchar* endPtr = 0; + gdouble dbl = g_ascii_strtod( str, &endPtr ); + if ( !errno ) { + tmp->colors.push_back( dbl ); + str = endPtr; + } else { + delete tmp; + tmp = 0; + break; + } + + while ( tmp && g_ascii_isspace(*str) || *str == ',' ) { + ++str; + } + } else { + break; + } + + } + paint->iccColor = tmp; } } }