summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-19 18:55:42 +0000
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-19 22:26:34 +0000
commitcf5edc95c552fe32d365f33b77e2213e814a980a (patch)
tree9206667956e077dffe01724924e15d5c52ce423f
parentRun clang-tidy’s modernize-redundant-void-arg pass. (diff)
downloadinkscape-cf5edc95c552fe32d365f33b77e2213e814a980a.tar.gz
inkscape-cf5edc95c552fe32d365f33b77e2213e814a980a.zip
Replace functions with methods in SPColor.
-rw-r--r--src/color.cpp32
-rw-r--r--src/color.h24
-rw-r--r--src/desktop-style.cpp2
-rw-r--r--src/extension/internal/cairo-render-context.cpp8
-rw-r--r--src/extension/internal/emf-inout.cpp4
-rw-r--r--src/extension/internal/emf-print.cpp20
-rw-r--r--src/extension/internal/latex-pstricks.cpp4
-rw-r--r--src/extension/internal/metafile-print.cpp4
-rw-r--r--src/extension/internal/pov-out.cpp2
-rw-r--r--src/extension/internal/wmf-inout.cpp4
-rw-r--r--src/extension/internal/wmf-print.cpp18
-rw-r--r--src/object/sp-mesh-array.cpp2
-rw-r--r--src/svg/svg-color.cpp2
-rw-r--r--src/ui/dialog/clonetiler.cpp6
-rw-r--r--src/ui/tools/flood-tool.cpp4
-rw-r--r--src/ui/tools/spray-tool.cpp2
-rw-r--r--src/ui/tools/tweak-tool.cpp18
-rw-r--r--src/ui/widget/color-scales.cpp88
-rw-r--r--src/ui/widget/color-wheel-selector.cpp4
-rw-r--r--src/ui/widget/selected-style.cpp4
-rw-r--r--src/widgets/gradient-vector.cpp2
21 files changed, 126 insertions, 128 deletions
diff --git a/src/color.cpp b/src/color.cpp
index 29efd5fee..149e659e2 100644
--- a/src/color.cpp
+++ b/src/color.cpp
@@ -221,14 +221,13 @@ std::string SPColor::toString() const
* \pre color != NULL && rgb != NULL && rgb[0-2] is meaningful
*/
void
-sp_color_get_rgb_floatv(SPColor const *color, float *rgb)
+SPColor::get_rgb_floatv(float *rgb) const
{
- return_if_fail (color != nullptr);
return_if_fail (rgb != nullptr);
- rgb[0] = color->v.c[0];
- rgb[1] = color->v.c[1];
- rgb[2] = color->v.c[2];
+ rgb[0] = v.c[0];
+ rgb[1] = v.c[1];
+ rgb[2] = v.c[2];
}
/**
@@ -236,15 +235,14 @@ sp_color_get_rgb_floatv(SPColor const *color, float *rgb)
* \pre color != NULL && cmyk != NULL && cmyk[0-3] is meaningful
*/
void
-sp_color_get_cmyk_floatv(SPColor const *color, float *cmyk)
+SPColor::get_cmyk_floatv(float *cmyk) const
{
- return_if_fail (color != nullptr);
return_if_fail (cmyk != nullptr);
- sp_color_rgb_to_cmyk_floatv( cmyk,
- color->v.c[0],
- color->v.c[1],
- color->v.c[2] );
+ SPColor::rgb_to_cmyk_floatv( cmyk,
+ v.c[0],
+ v.c[1],
+ v.c[2] );
}
/* Plain mode helpers */
@@ -253,7 +251,7 @@ sp_color_get_cmyk_floatv(SPColor const *color, float *cmyk)
* Fill hsv float array from r,g,b float values.
*/
void
-sp_color_rgb_to_hsv_floatv (float *hsv, float r, float g, float b)
+SPColor::rgb_to_hsv_floatv (float *hsv, float r, float g, float b)
{
float max, min, delta;
@@ -290,7 +288,7 @@ sp_color_rgb_to_hsv_floatv (float *hsv, float r, float g, float b)
* Fill rgb float array from h,s,v float values.
*/
void
-sp_color_hsv_to_rgb_floatv (float *rgb, float h, float s, float v)
+SPColor::hsv_to_rgb_floatv (float *rgb, float h, float s, float v)
{
double f, w, q, t, d;
@@ -331,7 +329,7 @@ sp_color_hsv_to_rgb_floatv (float *rgb, float h, float s, float v)
* Fill hsl float array from r,g,b float values.
*/
void
-sp_color_rgb_to_hsl_floatv (float *hsl, float r, float g, float b)
+SPColor::rgb_to_hsl_floatv (float *hsl, float r, float g, float b)
{
float max = MAX (MAX (r, g), b);
float min = MIN (MIN (r, g), b);
@@ -375,7 +373,7 @@ hue_2_rgb (float v1, float v2, float h)
* Fill rgb float array from h,s,l float values.
*/
void
-sp_color_hsl_to_rgb_floatv (float *rgb, float h, float s, float l)
+SPColor::hsl_to_rgb_floatv (float *rgb, float h, float s, float l)
{
if (s == 0) {
rgb[0] = l;
@@ -400,7 +398,7 @@ sp_color_hsl_to_rgb_floatv (float *rgb, float h, float s, float l)
* Fill cmyk float array from r,g,b float values.
*/
void
-sp_color_rgb_to_cmyk_floatv (float *cmyk, float r, float g, float b)
+SPColor::rgb_to_cmyk_floatv (float *cmyk, float r, float g, float b)
{
float c, m, y, k, kd;
@@ -431,7 +429,7 @@ sp_color_rgb_to_cmyk_floatv (float *cmyk, float r, float g, float b)
* Fill rgb float array from c,m,y,k float values.
*/
void
-sp_color_cmyk_to_rgb_floatv (float *rgb, float c, float m, float y, float k)
+SPColor::cmyk_to_rgb_floatv (float *rgb, float c, float m, float y, float k)
{
float kd;
diff --git a/src/color.h b/src/color.h
index 02a4fc90f..1bc29673f 100644
--- a/src/color.h
+++ b/src/color.h
@@ -62,24 +62,24 @@ struct SPColor {
union {
float c[3];
} v;
-};
-guint32 sp_color_get_rgba32_ualpha (const SPColor *color, guint32 alpha);
-guint32 sp_color_get_rgba32_falpha (const SPColor *color, float alpha);
+ guint32 get_rgba32_ualpha (guint32 alpha) const;
+ guint32 get_rgba32_falpha (float alpha) const;
-void sp_color_get_rgb_floatv (const SPColor *color, float *rgb);
-void sp_color_get_cmyk_floatv (const SPColor *color, float *cmyk);
+ void get_rgb_floatv (float *rgb) const;
+ void get_cmyk_floatv (float *cmyk) const;
-/* Plain mode helpers */
+ /* Plain mode helpers */
-void sp_color_rgb_to_hsv_floatv (float *hsv, float r, float g, float b);
-void sp_color_hsv_to_rgb_floatv (float *rgb, float h, float s, float v);
+ static void rgb_to_hsv_floatv (float *hsv, float r, float g, float b);
+ static void hsv_to_rgb_floatv (float *rgb, float h, float s, float v);
-void sp_color_rgb_to_hsl_floatv (float *hsl, float r, float g, float b);
-void sp_color_hsl_to_rgb_floatv (float *rgb, float h, float s, float l);
+ static void rgb_to_hsl_floatv (float *hsl, float r, float g, float b);
+ static void hsl_to_rgb_floatv (float *rgb, float h, float s, float l);
-void sp_color_rgb_to_cmyk_floatv (float *cmyk, float r, float g, float b);
-void sp_color_cmyk_to_rgb_floatv (float *rgb, float c, float m, float y, float k);
+ static void rgb_to_cmyk_floatv (float *cmyk, float r, float g, float b);
+ static void cmyk_to_rgb_floatv (float *rgb, float c, float m, float y, float k);
+};
#endif // SEEN_SP_COLOR_H
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp
index 3da49fd37..ae1863723 100644
--- a/src/desktop-style.cpp
+++ b/src/desktop-style.cpp
@@ -589,7 +589,7 @@ objects_query_fillstroke (const std::vector<SPItem*> &objects, SPStyle *style_re
if (paint_res->set && paint_effectively_set && paint->isColor()) {
gfloat d[3];
- sp_color_get_rgb_floatv (&paint->value.color, d);
+ paint->value.color.get_rgb_floatv(d);
// Check if this color is the same as previous
if (paintImpossible) {
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp
index d420f5c2a..da0797600 100644
--- a/src/extension/internal/cairo-render-context.cpp
+++ b/src/extension/internal/cairo-render-context.cpp
@@ -1281,7 +1281,7 @@ CairoRenderContext::_createPatternForPaintServer(SPPaintServer const *const pain
// add stops
for (gint i = 0; unsigned(i) < lg->vector.stops.size(); i++) {
float rgb[3];
- sp_color_get_rgb_floatv(&lg->vector.stops[i].color, rgb);
+ lg->vector.stops[i].color.get_rgb_floatv(rgb);
cairo_pattern_add_color_stop_rgba(pattern, lg->vector.stops[i].offset, rgb[0], rgb[1], rgb[2], lg->vector.stops[i].opacity * alpha);
}
} else if (SP_IS_RADIALGRADIENT (paintserver)) {
@@ -1303,7 +1303,7 @@ CairoRenderContext::_createPatternForPaintServer(SPPaintServer const *const pain
// add stops
for (gint i = 0; unsigned(i) < rg->vector.stops.size(); i++) {
float rgb[3];
- sp_color_get_rgb_floatv(&rg->vector.stops[i].color, rgb);
+ rg->vector.stops[i].color.get_rgb_floatv(rgb);
cairo_pattern_add_color_stop_rgba(pattern, rg->vector.stops[i].offset, rgb[0], rgb[1], rgb[2], rg->vector.stops[i].opacity * alpha);
}
} else if (SP_IS_MESHGRADIENT (paintserver)) {
@@ -1393,7 +1393,7 @@ CairoRenderContext::_setFillStyle(SPStyle const *const style, Geom::OptRect cons
}
} else if (style->fill.colorSet) {
float rgb[3];
- sp_color_get_rgb_floatv(&style->fill.value.color, rgb);
+ style->fill.value.color.get_rgb_floatv(rgb);
cairo_set_source_rgba(_cr, rgb[0], rgb[1], rgb[2], alpha);
@@ -1414,7 +1414,7 @@ CairoRenderContext::_setStrokeStyle(SPStyle const *style, Geom::OptRect const &p
if (style->stroke.isColor() || (style->stroke.isPaintserver() && !style->getStrokePaintServer()->isValid())) {
float rgb[3];
- sp_color_get_rgb_floatv(&style->stroke.value.color, rgb);
+ style->stroke.value.color.get_rgb_floatv(rgb);
cairo_set_source_rgba(_cr, rgb[0], rgb[1], rgb[2], alpha);
} else {
diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp
index fa15f8eb5..d0556e467 100644
--- a/src/extension/internal/emf-inout.cpp
+++ b/src/extension/internal/emf-inout.cpp
@@ -794,9 +794,9 @@ Emf::output_style(PEMF_CALLBACK_DATA d, int iType)
char tmp[1024] = {0};
float fill_rgb[3];
- sp_color_get_rgb_floatv( &(d->dc[d->level].style.fill.value.color), fill_rgb );
+ d->dc[d->level].style.fill.value.color.get_rgb_floatv(fill_rgb);
float stroke_rgb[3];
- sp_color_get_rgb_floatv(&(d->dc[d->level].style.stroke.value.color), stroke_rgb);
+ d->dc[d->level].style.stroke.value.color.get_rgb_floatv(stroke_rgb);
// for U_EMR_BITBLT with no image, try to approximate some of these operations/
// Assume src color is "white"
diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp
index 9320e3ce9..254000db3 100644
--- a/src/extension/internal/emf-print.cpp
+++ b/src/extension/internal/emf-print.cpp
@@ -378,7 +378,7 @@ int PrintEmf::create_brush(SPStyle const *style, PU_COLORREF fcolor)
opacity = 0.0; // basically the same as no fill
}
#endif
- sp_color_get_rgb_floatv(&style->fill.value.color, rgb);
+ style->fill.value.color.get_rgb_floatv(rgb);
hatchColor = U_RGB(255 * rgb[0], 255 * rgb[1], 255 * rgb[2]);
fmode = style->fill_rule.computed == 0 ? U_WINDING : (style->fill_rule.computed == 2 ? U_ALTERNATE : U_ALTERNATE);
@@ -646,7 +646,7 @@ int PrintEmf::create_pen(SPStyle const *style, const Geom::Affine &transform)
// default fill
}
} else if (style->stroke.isColor()) { // test last, always seems to be set, even for other types above
- sp_color_get_rgb_floatv(&style->stroke.value.color, rgb);
+ style->stroke.value.color.get_rgb_floatv(rgb);
brushStyle = U_BS_SOLID;
hatchColor = U_RGB(255 * rgb[0], 255 * rgb[1], 255 * rgb[2]);
hatchType = U_HS_SOLIDCLR;
@@ -1175,10 +1175,10 @@ unsigned int PrintEmf::fill(
SPRadialGradient *tg = (SPRadialGradient *)(gv.grad); // linear/radial are the same here
nstops = tg->vector.stops.size();
- sp_color_get_rgb_floatv(&tg->vector.stops[0].color, rgb);
+ tg->vector.stops[0].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[0].opacity; // first stop
c1 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
- sp_color_get_rgb_floatv(&tg->vector.stops[nstops - 1].color, rgb);
+ tg->vector.stops[nstops - 1].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[nstops - 1].opacity; // last stop
c2 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
@@ -1208,7 +1208,7 @@ unsigned int PrintEmf::fill(
(void) create_brush(style, &wc);
print_pathv(pathvr, fill_transform);
- sp_color_get_rgb_floatv(&tg->vector.stops[istop].color, rgb);
+ tg->vector.stops[istop].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[istop].opacity;
c2 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
@@ -1234,7 +1234,7 @@ unsigned int PrintEmf::fill(
doff_base = doff_range;
doff_range = tg->vector.stops[istop].offset; // next or last stop
c1 = c2;
- sp_color_get_rgb_floatv(&tg->vector.stops[istop].color, rgb);
+ tg->vector.stops[istop].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[istop].opacity;
c2 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
}
@@ -1300,7 +1300,7 @@ unsigned int PrintEmf::fill(
rcb.top = round(outUL[Y]);
rcb.right = round(outLR[X]);
rcb.bottom = round(outLR[Y]);
- sp_color_get_rgb_floatv(&tg->vector.stops[istop].color, rgb);
+ tg->vector.stops[istop].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[istop].opacity;
c2 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
@@ -1350,7 +1350,7 @@ unsigned int PrintEmf::fill(
pathvr = sp_pathvector_boolop(pathvc, pathv, bool_op_inters, (FillRule) fill_nonZero, frb);
print_pathv(pathvr, fill_transform);
- sp_color_get_rgb_floatv(&tg->vector.stops[istop].color, rgb);
+ tg->vector.stops[istop].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[istop].opacity;
c2 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
@@ -1375,7 +1375,7 @@ unsigned int PrintEmf::fill(
doff_base = doff_range;
doff_range = tg->vector.stops[istop].offset; // next or last stop
c1 = c2;
- sp_color_get_rgb_floatv(&tg->vector.stops[istop].color, rgb);
+ tg->vector.stops[istop].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[istop].opacity;
c2 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
}
@@ -2096,7 +2096,7 @@ unsigned int PrintEmf::text(Inkscape::Extension::Print * /*mod*/, char const *te
}
float rgb[3];
- sp_color_get_rgb_floatv(&style->fill.value.color, rgb);
+ style->fill.value.color.get_rgb_floatv(rgb);
// only change the text color when it needs to be changed
if (memcmp(htextcolor_rgb, rgb, 3 * sizeof(float))) {
memcpy(htextcolor_rgb, rgb, 3 * sizeof(float));
diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp
index 1d09fff82..f3bf06708 100644
--- a/src/extension/internal/latex-pstricks.cpp
+++ b/src/extension/internal/latex-pstricks.cpp
@@ -193,7 +193,7 @@ unsigned int PrintLatex::fill(Inkscape::Extension::Print * /*mod*/,
os.setf(std::ios::fixed);
fill_opacity=SP_SCALE24_TO_FLOAT(style->fill_opacity.value);
- sp_color_get_rgb_floatv(&style->fill.value.color, rgb);
+ style->fill.value.color.get_rgb_floatv(rgb);
os << "{\n\\newrgbcolor{curcolor}{" << rgb[0] << " " << rgb[1] << " " << rgb[2] << "}\n";
os << "\\pscustom[linestyle=none,fillstyle=solid,fillcolor=curcolor";
if (fill_opacity!=1.0) {
@@ -229,7 +229,7 @@ unsigned int PrintLatex::stroke(Inkscape::Extension::Print * /*mod*/,
os.setf(std::ios::fixed);
stroke_opacity=SP_SCALE24_TO_FLOAT(style->stroke_opacity.value);
- sp_color_get_rgb_floatv(&style->stroke.value.color, rgb);
+ style->stroke.value.color.get_rgb_floatv(rgb);
os << "{\n\\newrgbcolor{curcolor}{" << rgb[0] << " " << rgb[1] << " " << rgb[2] << "}\n";
os << "\\pscustom[linewidth=" << style->stroke_width.computed*scale<< ",linecolor=curcolor";
diff --git a/src/extension/internal/metafile-print.cpp b/src/extension/internal/metafile-print.cpp
index 4bb8eae32..26aade753 100644
--- a/src/extension/internal/metafile-print.cpp
+++ b/src/extension/internal/metafile-print.cpp
@@ -172,8 +172,8 @@ U_COLORREF PrintMetafile::avg_stop_color(SPGradient *gr)
ops = gr->vector.stops[0 ].opacity;
ope = gr->vector.stops[last].opacity;
- sp_color_get_rgb_floatv(&gr->vector.stops[0 ].color, rgbs);
- sp_color_get_rgb_floatv(&gr->vector.stops[last].color, rgbe);
+ gr->vector.stops[0 ].color.get_rgb_floatv(rgbs);
+ gr->vector.stops[last].color.get_rgb_floatv(rgbe);
/* Replace opacity at start & stop with that fraction background color, then average those two for final color. */
cr = U_RGB(
diff --git a/src/extension/internal/pov-out.cpp b/src/extension/internal/pov-out.cpp
index 0cfeeff94..05e906f9d 100644
--- a/src/extension/internal/pov-out.cpp
+++ b/src/extension/internal/pov-out.cpp
@@ -298,7 +298,7 @@ bool PovOutput::doCurve(SPItem *item, const String &id)
{
// see color.h for how to parse SPColor
float rgb[3];
- sp_color_get_rgb_floatv(&style->fill.value.color, rgb);
+ style->fill.value.color.get_rgb_floatv(rgb);
double const dopacity = ( SP_SCALE24_TO_FLOAT(style->fill_opacity.value)
* effective_opacity(shape) );
//gchar *str = g_strdup_printf("rgbf < %1.3f, %1.3f, %1.3f %1.3f>",
diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp
index b19ac8328..72d44e123 100644
--- a/src/extension/internal/wmf-inout.cpp
+++ b/src/extension/internal/wmf-inout.cpp
@@ -703,9 +703,9 @@ Wmf::output_style(PWMF_CALLBACK_DATA d)
char tmp[1024] = {0};
float fill_rgb[3];
- sp_color_get_rgb_floatv( &(d->dc[d->level].style.fill.value.color), fill_rgb );
+ d->dc[d->level].style.fill.value.color.get_rgb_floatv(fill_rgb);
float stroke_rgb[3];
- sp_color_get_rgb_floatv(&(d->dc[d->level].style.stroke.value.color), stroke_rgb);
+ d->dc[d->level].style.stroke.value.color.get_rgb_floatv(stroke_rgb);
// for U_WMR_BITBLT with no image, try to approximate some of these operations/
// Assume src color is "white"
diff --git a/src/extension/internal/wmf-print.cpp b/src/extension/internal/wmf-print.cpp
index 9318da939..613ae3f04 100644
--- a/src/extension/internal/wmf-print.cpp
+++ b/src/extension/internal/wmf-print.cpp
@@ -371,7 +371,7 @@ int PrintWmf::create_brush(SPStyle const *style, U_COLORREF *fcolor)
opacity = 0.0; // basically the same as no fill
}
*/
- sp_color_get_rgb_floatv(&style->fill.value.color, rgb);
+ style->fill.value.color.get_rgb_floatv(rgb);
hatchColor = U_RGB(255 * rgb[0], 255 * rgb[1], 255 * rgb[2]);
fmode = style->fill_rule.computed == 0 ? U_WINDING : (style->fill_rule.computed == 2 ? U_ALTERNATE : U_ALTERNATE);
@@ -545,7 +545,7 @@ int PrintWmf::create_pen(SPStyle const *style, const Geom::Affine &transform)
float rgb[3];
// WMF does not support hatched, bitmap, or gradient pens, just set the color.
- sp_color_get_rgb_floatv(&style->stroke.value.color, rgb);
+ style->stroke.value.color.get_rgb_floatv(rgb);
penColor = U_RGB(255 * rgb[0], 255 * rgb[1], 255 * rgb[2]);
using Geom::X;
@@ -698,10 +698,10 @@ unsigned int PrintWmf::fill(
SPRadialGradient *tg = (SPRadialGradient *)(gv.grad); // linear/radial are the same here
nstops = tg->vector.stops.size();
- sp_color_get_rgb_floatv(&tg->vector.stops[0].color, rgb);
+ tg->vector.stops[0].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[0].opacity;
c1 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
- sp_color_get_rgb_floatv(&tg->vector.stops[nstops - 1].color, rgb);
+ tg->vector.stops[nstops - 1].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[nstops - 1].opacity;
c2 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
@@ -731,7 +731,7 @@ unsigned int PrintWmf::fill(
(void) create_brush(style, &wc);
print_pathv(pathvr, fill_transform);
- sp_color_get_rgb_floatv(&tg->vector.stops[istop].color, rgb);
+ tg->vector.stops[istop].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[istop].opacity;
c2 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
@@ -756,7 +756,7 @@ unsigned int PrintWmf::fill(
doff_base = doff_range;
doff_range = tg->vector.stops[istop].offset; // next or last stop
c1 = c2;
- sp_color_get_rgb_floatv(&tg->vector.stops[istop].color, rgb);
+ tg->vector.stops[istop].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[istop].opacity;
c2 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
}
@@ -785,7 +785,7 @@ unsigned int PrintWmf::fill(
pathvr = sp_pathvector_boolop(pathvc, pathv, bool_op_inters, (FillRule) fill_nonZero, frb);
print_pathv(pathvr, fill_transform);
- sp_color_get_rgb_floatv(&tg->vector.stops[istop].color, rgb);
+ tg->vector.stops[istop].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[istop].opacity;
c2 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
@@ -809,7 +809,7 @@ unsigned int PrintWmf::fill(
doff_base = doff_range;
doff_range = tg->vector.stops[istop].offset; // next or last stop
c1 = c2;
- sp_color_get_rgb_floatv(&tg->vector.stops[istop].color, rgb);
+ tg->vector.stops[istop].color.get_rgb_floatv(rgb);
opa = tg->vector.stops[istop].opacity;
c2 = U_RGBA(255 * rgb[0], 255 * rgb[1], 255 * rgb[2], 255 * opa);
}
@@ -1478,7 +1478,7 @@ unsigned int PrintWmf::text(Inkscape::Extension::Print * /*mod*/, char const *te
}
float rgb[3];
- sp_color_get_rgb_floatv(&style->fill.value.color, rgb);
+ style->fill.value.color.get_rgb_floatv(rgb);
// only change the text color when it needs to be changed
if (memcmp(htextcolor_rgb, rgb, 3 * sizeof(float))) {
memcpy(htextcolor_rgb, rgb, 3 * sizeof(float));
diff --git a/src/object/sp-mesh-array.cpp b/src/object/sp-mesh-array.cpp
index 14ec3866b..2e1ff988f 100644
--- a/src/object/sp-mesh-array.cpp
+++ b/src/object/sp-mesh-array.cpp
@@ -1663,7 +1663,7 @@ void SPMeshNodeArray::bicubic( SPMeshNodeArray* smooth, SPMeshType type ) {
d[i].resize( smooth->patch_columns() + 1 );
for( unsigned j = 0; j < d[i].size(); ++j ) {
float rgb_color[3];
- sp_color_get_rgb_floatv( &this->nodes[ i*3 ][ j*3 ]->color, rgb_color );
+ this->nodes[ i*3 ][ j*3 ]->color.get_rgb_floatv(rgb_color);
d[i][j].g[0][0] = rgb_color[ 0 ];
d[i][j].g[1][0] = rgb_color[ 1 ];
d[i][j].g[2][0] = rgb_color[ 2 ];
diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp
index 32ced67a5..bd742cba0 100644
--- a/src/svg/svg-color.cpp
+++ b/src/svg/svg-color.cpp
@@ -358,7 +358,7 @@ static guint32 internal_sp_svg_read_color(gchar const *str, gchar const **end_pt
gfloat rgb[3];
- sp_color_hsl_to_rgb_floatv( rgb, h, s, l );
+ SPColor::hsl_to_rgb_floatv( rgb, h, s, l );
val = static_cast<guint>(floor(CLAMP(rgb[0], 0.0, 1.0) * 255.9999)) << 24;
val |= (static_cast<guint>(floor(CLAMP(rgb[1], 0.0, 1.0) * 255.9999)) << 16);
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp
index 9e7d71c32..9a4cd92ab 100644
--- a/src/ui/dialog/clonetiler.cpp
+++ b/src/ui/dialog/clonetiler.cpp
@@ -2287,7 +2287,7 @@ void CloneTiler::apply()
if (!initial_color.empty()) {
guint32 rgba = sp_svg_read_color (initial_color.data(), 0x000000ff);
float hsl[3];
- sp_color_rgb_to_hsl_floatv (hsl, SP_RGBA32_R_F(rgba), SP_RGBA32_G_F(rgba), SP_RGBA32_B_F(rgba));
+ SPColor::rgb_to_hsl_floatv (hsl, SP_RGBA32_R_F(rgba), SP_RGBA32_G_F(rgba), SP_RGBA32_B_F(rgba));
double eff_i = (color_alternatei? (i%2) : (i));
double eff_j = (color_alternatej? (j%2) : (j));
@@ -2301,7 +2301,7 @@ void CloneTiler::apply()
hsl[2] = CLAMP (hsl[2], 0, 1);
float rgb[3];
- sp_color_hsl_to_rgb_floatv (rgb, hsl[0], hsl[1], hsl[2]);
+ SPColor::hsl_to_rgb_floatv (rgb, hsl[0], hsl[1], hsl[2]);
sp_svg_write_color(color_string, sizeof(color_string), SP_RGBA32_F_COMPOSE(rgb[0], rgb[1], rgb[2], 1.0));
}
@@ -2334,7 +2334,7 @@ void CloneTiler::apply()
float a = SP_RGBA32_A_F(rgba);
float hsl[3];
- sp_color_rgb_to_hsl_floatv (hsl, r, g, b);
+ SPColor::rgb_to_hsl_floatv (hsl, r, g, b);
gdouble val = 0;
switch (pick) {
diff --git a/src/ui/tools/flood-tool.cpp b/src/ui/tools/flood-tool.cpp
index a6fc54f1f..bfd7f60dd 100644
--- a/src/ui/tools/flood-tool.cpp
+++ b/src/ui/tools/flood-tool.cpp
@@ -241,8 +241,8 @@ static bool compare_pixels(guint32 check, guint32 orig, guint32 merged_orig_pixe
(method == FLOOD_CHANNELS_L)) {
double dac = ac;
double dao = ao;
- sp_color_rgb_to_hsl_floatv(hsl_check, rc / dac, gc / dac, bc / dac);
- sp_color_rgb_to_hsl_floatv(hsl_orig, ro / dao, go / dao, bo / dao);
+ SPColor::rgb_to_hsl_floatv(hsl_check, rc / dac, gc / dac, bc / dac);
+ SPColor::rgb_to_hsl_floatv(hsl_orig, ro / dao, go / dao, bo / dao);
}
switch (method) {
diff --git a/src/ui/tools/spray-tool.cpp b/src/ui/tools/spray-tool.cpp
index ebfc10d8a..f8a70a7d0 100644
--- a/src/ui/tools/spray-tool.cpp
+++ b/src/ui/tools/spray-tool.cpp
@@ -662,7 +662,7 @@ static bool fit_item(SPDesktop *desktop,
if(picker && do_trace){
float hsl[3];
- sp_color_rgb_to_hsl_floatv (hsl, r, g, b);
+ SPColor::rgb_to_hsl_floatv (hsl, r, g, b);
gdouble val = 0;
switch (pick) {
diff --git a/src/ui/tools/tweak-tool.cpp b/src/ui/tools/tweak-tool.cpp
index f6b10d67a..1e9307a40 100644
--- a/src/ui/tools/tweak-tool.cpp
+++ b/src/ui/tools/tweak-tool.cpp
@@ -650,9 +650,9 @@ tweak_colorpaint (float *color, guint32 goal, double force, bool do_h, bool do_s
if (!do_h || !do_s || !do_l) {
float hsl_g[3];
- sp_color_rgb_to_hsl_floatv (hsl_g, SP_RGBA32_R_F(goal), SP_RGBA32_G_F(goal), SP_RGBA32_B_F(goal));
+ SPColor::rgb_to_hsl_floatv (hsl_g, SP_RGBA32_R_F(goal), SP_RGBA32_G_F(goal), SP_RGBA32_B_F(goal));
float hsl_c[3];
- sp_color_rgb_to_hsl_floatv (hsl_c, color[0], color[1], color[2]);
+ SPColor::rgb_to_hsl_floatv (hsl_c, color[0], color[1], color[2]);
if (!do_h) {
hsl_g[0] = hsl_c[0];
}
@@ -662,7 +662,7 @@ tweak_colorpaint (float *color, guint32 goal, double force, bool do_h, bool do_s
if (!do_l) {
hsl_g[2] = hsl_c[2];
}
- sp_color_hsl_to_rgb_floatv (rgb_g, hsl_g[0], hsl_g[1], hsl_g[2]);
+ SPColor::hsl_to_rgb_floatv (rgb_g, hsl_g[0], hsl_g[1], hsl_g[2]);
} else {
rgb_g[0] = SP_RGBA32_R_F(goal);
rgb_g[1] = SP_RGBA32_G_F(goal);
@@ -679,7 +679,7 @@ static void
tweak_colorjitter (float *color, double force, bool do_h, bool do_s, bool do_l)
{
float hsl_c[3];
- sp_color_rgb_to_hsl_floatv (hsl_c, color[0], color[1], color[2]);
+ SPColor::rgb_to_hsl_floatv (hsl_c, color[0], color[1], color[2]);
if (do_h) {
hsl_c[0] += g_random_double_range(-0.5, 0.5) * force;
@@ -697,7 +697,7 @@ tweak_colorjitter (float *color, double force, bool do_h, bool do_s, bool do_l)
hsl_c[2] += g_random_double_range(-hsl_c[2], 1 - hsl_c[2]) * force;
}
- sp_color_hsl_to_rgb_floatv (color, hsl_c[0], hsl_c[1], hsl_c[2]);
+ SPColor::hsl_to_rgb_floatv (color, hsl_c[0], hsl_c[1], hsl_c[2]);
}
static void
@@ -1044,17 +1044,17 @@ sp_tweak_dilate (TweakTool *tc, Geom::Point event_p, Geom::Point p, Geom::Point
// HSL inversion
float hsv[3];
float rgb[3];
- sp_color_rgb_to_hsv_floatv (hsv,
+ SPColor::rgb_to_hsv_floatv (hsv,
SP_RGBA32_R_F(fill_goal),
SP_RGBA32_G_F(fill_goal),
SP_RGBA32_B_F(fill_goal));
- sp_color_hsv_to_rgb_floatv (rgb, hsv[0]<.5? hsv[0]+.5 : hsv[0]-.5, 1 - hsv[1], 1 - hsv[2]);
+ SPColor::hsv_to_rgb_floatv (rgb, hsv[0]<.5? hsv[0]+.5 : hsv[0]-.5, 1 - hsv[1], 1 - hsv[2]);
fill_goal = SP_RGBA32_F_COMPOSE(rgb[0], rgb[1], rgb[2], 1);
- sp_color_rgb_to_hsv_floatv (hsv,
+ SPColor::rgb_to_hsv_floatv (hsv,
SP_RGBA32_R_F(stroke_goal),
SP_RGBA32_G_F(stroke_goal),
SP_RGBA32_B_F(stroke_goal));
- sp_color_hsv_to_rgb_floatv (rgb, hsv[0]<.5? hsv[0]+.5 : hsv[0]-.5, 1 - hsv[1], 1 - hsv[2]);
+ SPColor::hsv_to_rgb_floatv (rgb, hsv[0]<.5? hsv[0]+.5 : hsv[0]-.5, 1 - hsv[1], 1 - hsv[2]);
stroke_goal = SP_RGBA32_F_COMPOSE(rgb[0], rgb[1], rgb[2], 1);
#else
// RGB inversion
diff --git a/src/ui/widget/color-scales.cpp b/src/ui/widget/color-scales.cpp
index 12bb6ad28..162634a42 100644
--- a/src/ui/widget/color-scales.cpp
+++ b/src/ui/widget/color-scales.cpp
@@ -174,7 +174,7 @@ void ColorScales::_recalcColor()
_getCmykaFloatv(c);
float rgb[3];
- sp_color_cmyk_to_rgb_floatv(rgb, c[0], c[1], c[2], c[3]);
+ SPColor::cmyk_to_rgb_floatv(rgb, c[0], c[1], c[2], c[3]);
color.set(rgb[0], rgb[1], rgb[2]);
alpha = c[4];
break;
@@ -201,24 +201,24 @@ void ColorScales::_updateDisplay()
switch (_mode) {
case SP_COLOR_SCALES_MODE_RGB:
- sp_color_get_rgb_floatv(&color, c);
+ color.get_rgb_floatv(c);
c[3] = _color.alpha();
c[4] = 0.0;
break;
case SP_COLOR_SCALES_MODE_HSL:
- sp_color_get_rgb_floatv(&color, tmp);
- sp_color_rgb_to_hsl_floatv(c, tmp[0], tmp[1], tmp[2]);
+ color.get_rgb_floatv(tmp);
+ SPColor::rgb_to_hsl_floatv(c, tmp[0], tmp[1], tmp[2]);
c[3] = _color.alpha();
c[4] = 0.0;
break;
case SP_COLOR_SCALES_MODE_HSV:
- sp_color_get_rgb_floatv(&color, tmp);
- sp_color_rgb_to_hsv_floatv(c, tmp[0], tmp[1], tmp[2]);
+ color.get_rgb_floatv(tmp);
+ SPColor::rgb_to_hsv_floatv(c, tmp[0], tmp[1], tmp[2]);
c[3] = _color.alpha();
c[4] = 0.0;
break;
case SP_COLOR_SCALES_MODE_CMYK:
- sp_color_get_cmyk_floatv(&color, c);
+ color.get_cmyk_floatv(c);
c[4] = _color.alpha();
break;
default:
@@ -293,15 +293,15 @@ void ColorScales::_getRgbaFloatv(gfloat *rgba)
rgba[3] = getScaled(_a[3]);
break;
case SP_COLOR_SCALES_MODE_HSL:
- sp_color_hsl_to_rgb_floatv(rgba, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]));
+ SPColor::hsl_to_rgb_floatv(rgba, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]));
rgba[3] = getScaled(_a[3]);
break;
case SP_COLOR_SCALES_MODE_HSV:
- sp_color_hsv_to_rgb_floatv(rgba, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]));
+ SPColor::hsv_to_rgb_floatv(rgba, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]));
rgba[3] = getScaled(_a[3]);
break;
case SP_COLOR_SCALES_MODE_CMYK:
- sp_color_cmyk_to_rgb_floatv(rgba, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]), getScaled(_a[3]));
+ SPColor::cmyk_to_rgb_floatv(rgba, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]), getScaled(_a[3]));
rgba[3] = getScaled(_a[4]);
break;
default:
@@ -318,12 +318,12 @@ void ColorScales::_getCmykaFloatv(gfloat *cmyka)
switch (_mode) {
case SP_COLOR_SCALES_MODE_RGB:
- sp_color_rgb_to_cmyk_floatv(cmyka, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]));
+ SPColor::rgb_to_cmyk_floatv(cmyka, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]));
cmyka[4] = getScaled(_a[3]);
break;
case SP_COLOR_SCALES_MODE_HSL:
- sp_color_hsl_to_rgb_floatv(rgb, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]));
- sp_color_rgb_to_cmyk_floatv(cmyka, rgb[0], rgb[1], rgb[2]);
+ SPColor::hsl_to_rgb_floatv(rgb, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]));
+ SPColor::rgb_to_cmyk_floatv(cmyka, rgb[0], rgb[1], rgb[2]);
cmyka[4] = getScaled(_a[3]);
break;
case SP_COLOR_SCALES_MODE_CMYK:
@@ -422,7 +422,7 @@ void ColorScales::setMode(SPColorScalesMode mode)
_updating = TRUE;
c[0] = 0.0;
- sp_color_rgb_to_hsl_floatv(c, rgba[0], rgba[1], rgba[2]);
+ SPColor::rgb_to_hsl_floatv(c, rgba[0], rgba[1], rgba[2]);
setScaled(_a[0], c[0]);
setScaled(_a[1], c[1]);
@@ -458,7 +458,7 @@ void ColorScales::setMode(SPColorScalesMode mode)
_updating = TRUE;
c[0] = 0.0;
- sp_color_rgb_to_hsv_floatv(c, rgba[0], rgba[1], rgba[2]);
+ SPColor::rgb_to_hsv_floatv(c, rgba[0], rgba[1], rgba[2]);
setScaled(_a[0], c[0]);
setScaled(_a[1], c[1]);
@@ -491,7 +491,7 @@ void ColorScales::setMode(SPColorScalesMode mode)
gtk_widget_show(_b[4]);
_updating = TRUE;
- sp_color_rgb_to_cmyk_floatv(c, rgba[0], rgba[1], rgba[2]);
+ SPColor::rgb_to_cmyk_floatv(c, rgba[0], rgba[1], rgba[2]);
setScaled(_a[0], c[0]);
setScaled(_a[1], c[1]);
setScaled(_a[2], c[2]);
@@ -593,25 +593,25 @@ void ColorScales::_updateSliders(guint channels)
/* Hue is never updated */
if ((channels != CSC_CHANNEL_S) && (channels != CSC_CHANNEL_A)) {
/* Update saturation */
- sp_color_hsl_to_rgb_floatv(rgb0, getScaled(_a[0]), 0.0, getScaled(_a[2]));
- sp_color_hsl_to_rgb_floatv(rgbm, getScaled(_a[0]), 0.5, getScaled(_a[2]));
- sp_color_hsl_to_rgb_floatv(rgb1, getScaled(_a[0]), 1.0, getScaled(_a[2]));
+ SPColor::hsl_to_rgb_floatv(rgb0, getScaled(_a[0]), 0.0, getScaled(_a[2]));
+ SPColor::hsl_to_rgb_floatv(rgbm, getScaled(_a[0]), 0.5, getScaled(_a[2]));
+ SPColor::hsl_to_rgb_floatv(rgb1, getScaled(_a[0]), 1.0, getScaled(_a[2]));
_s[1]->setColors(SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 1.0),
SP_RGBA32_F_COMPOSE(rgbm[0], rgbm[1], rgbm[2], 1.0),
SP_RGBA32_F_COMPOSE(rgb1[0], rgb1[1], rgb1[2], 1.0));
}
if ((channels != CSC_CHANNEL_V) && (channels != CSC_CHANNEL_A)) {
/* Update value */
- sp_color_hsl_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), 0.0);
- sp_color_hsl_to_rgb_floatv(rgbm, getScaled(_a[0]), getScaled(_a[1]), 0.5);
- sp_color_hsl_to_rgb_floatv(rgb1, getScaled(_a[0]), getScaled(_a[1]), 1.0);
+ SPColor::hsl_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), 0.0);
+ SPColor::hsl_to_rgb_floatv(rgbm, getScaled(_a[0]), getScaled(_a[1]), 0.5);
+ SPColor::hsl_to_rgb_floatv(rgb1, getScaled(_a[0]), getScaled(_a[1]), 1.0);
_s[2]->setColors(SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 1.0),
SP_RGBA32_F_COMPOSE(rgbm[0], rgbm[1], rgbm[2], 1.0),
SP_RGBA32_F_COMPOSE(rgb1[0], rgb1[1], rgb1[2], 1.0));
}
if (channels != CSC_CHANNEL_A) {
/* Update alpha */
- sp_color_hsl_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]));
+ SPColor::hsl_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]));
_s[3]->setColors(SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 0.0),
SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 0.5),
SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 1.0));
@@ -621,25 +621,25 @@ void ColorScales::_updateSliders(guint channels)
/* Hue is never updated */
if ((channels != CSC_CHANNEL_S) && (channels != CSC_CHANNEL_A)) {
/* Update saturation */
- sp_color_hsv_to_rgb_floatv(rgb0, getScaled(_a[0]), 0.0, getScaled(_a[2]));
- sp_color_hsv_to_rgb_floatv(rgbm, getScaled(_a[0]), 0.5, getScaled(_a[2]));
- sp_color_hsv_to_rgb_floatv(rgb1, getScaled(_a[0]), 1.0, getScaled(_a[2]));
+ SPColor::hsv_to_rgb_floatv(rgb0, getScaled(_a[0]), 0.0, getScaled(_a[2]));
+ SPColor::hsv_to_rgb_floatv(rgbm, getScaled(_a[0]), 0.5, getScaled(_a[2]));
+ SPColor::hsv_to_rgb_floatv(rgb1, getScaled(_a[0]), 1.0, getScaled(_a[2]));
_s[1]->setColors(SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 1.0),
SP_RGBA32_F_COMPOSE(rgbm[0], rgbm[1], rgbm[2], 1.0),
SP_RGBA32_F_COMPOSE(rgb1[0], rgb1[1], rgb1[2], 1.0));
}
if ((channels != CSC_CHANNEL_V) && (channels != CSC_CHANNEL_A)) {
/* Update value */
- sp_color_hsv_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), 0.0);
- sp_color_hsv_to_rgb_floatv(rgbm, getScaled(_a[0]), getScaled(_a[1]), 0.5);
- sp_color_hsv_to_rgb_floatv(rgb1, getScaled(_a[0]), getScaled(_a[1]), 1.0);
+ SPColor::hsv_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), 0.0);
+ SPColor::hsv_to_rgb_floatv(rgbm, getScaled(_a[0]), getScaled(_a[1]), 0.5);
+ SPColor::hsv_to_rgb_floatv(rgb1, getScaled(_a[0]), getScaled(_a[1]), 1.0);
_s[2]->setColors(SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 1.0),
SP_RGBA32_F_COMPOSE(rgbm[0], rgbm[1], rgbm[2], 1.0),
SP_RGBA32_F_COMPOSE(rgb1[0], rgb1[1], rgb1[2], 1.0));
}
if (channels != CSC_CHANNEL_A) {
/* Update alpha */
- sp_color_hsv_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]));
+ SPColor::hsv_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]));
_s[3]->setColors(SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 0.0),
SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 0.5),
SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 1.0));
@@ -648,43 +648,43 @@ void ColorScales::_updateSliders(guint channels)
case SP_COLOR_SCALES_MODE_CMYK:
if ((channels != CSC_CHANNEL_C) && (channels != CSC_CHANNEL_CMYKA)) {
/* Update C */
- sp_color_cmyk_to_rgb_floatv(rgb0, 0.0, getScaled(_a[1]), getScaled(_a[2]), getScaled(_a[3]));
- sp_color_cmyk_to_rgb_floatv(rgbm, 0.5, getScaled(_a[1]), getScaled(_a[2]), getScaled(_a[3]));
- sp_color_cmyk_to_rgb_floatv(rgb1, 1.0, getScaled(_a[1]), getScaled(_a[2]), getScaled(_a[3]));
+ SPColor::cmyk_to_rgb_floatv(rgb0, 0.0, getScaled(_a[1]), getScaled(_a[2]), getScaled(_a[3]));
+ SPColor::cmyk_to_rgb_floatv(rgbm, 0.5, getScaled(_a[1]), getScaled(_a[2]), getScaled(_a[3]));
+ SPColor::cmyk_to_rgb_floatv(rgb1, 1.0, getScaled(_a[1]), getScaled(_a[2]), getScaled(_a[3]));
_s[0]->setColors(SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 1.0),
SP_RGBA32_F_COMPOSE(rgbm[0], rgbm[1], rgbm[2], 1.0),
SP_RGBA32_F_COMPOSE(rgb1[0], rgb1[1], rgb1[2], 1.0));
}
if ((channels != CSC_CHANNEL_M) && (channels != CSC_CHANNEL_CMYKA)) {
/* Update M */
- sp_color_cmyk_to_rgb_floatv(rgb0, getScaled(_a[0]), 0.0, getScaled(_a[2]), getScaled(_a[3]));
- sp_color_cmyk_to_rgb_floatv(rgbm, getScaled(_a[0]), 0.5, getScaled(_a[2]), getScaled(_a[3]));
- sp_color_cmyk_to_rgb_floatv(rgb1, getScaled(_a[0]), 1.0, getScaled(_a[2]), getScaled(_a[3]));
+ SPColor::cmyk_to_rgb_floatv(rgb0, getScaled(_a[0]), 0.0, getScaled(_a[2]), getScaled(_a[3]));
+ SPColor::cmyk_to_rgb_floatv(rgbm, getScaled(_a[0]), 0.5, getScaled(_a[2]), getScaled(_a[3]));
+ SPColor::cmyk_to_rgb_floatv(rgb1, getScaled(_a[0]), 1.0, getScaled(_a[2]), getScaled(_a[3]));
_s[1]->setColors(SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 1.0),
SP_RGBA32_F_COMPOSE(rgbm[0], rgbm[1], rgbm[2], 1.0),
SP_RGBA32_F_COMPOSE(rgb1[0], rgb1[1], rgb1[2], 1.0));
}
if ((channels != CSC_CHANNEL_Y) && (channels != CSC_CHANNEL_CMYKA)) {
/* Update Y */
- sp_color_cmyk_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), 0.0, getScaled(_a[3]));
- sp_color_cmyk_to_rgb_floatv(rgbm, getScaled(_a[0]), getScaled(_a[1]), 0.5, getScaled(_a[3]));
- sp_color_cmyk_to_rgb_floatv(rgb1, getScaled(_a[0]), getScaled(_a[1]), 1.0, getScaled(_a[3]));
+ SPColor::cmyk_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), 0.0, getScaled(_a[3]));
+ SPColor::cmyk_to_rgb_floatv(rgbm, getScaled(_a[0]), getScaled(_a[1]), 0.5, getScaled(_a[3]));
+ SPColor::cmyk_to_rgb_floatv(rgb1, getScaled(_a[0]), getScaled(_a[1]), 1.0, getScaled(_a[3]));
_s[2]->setColors(SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 1.0),
SP_RGBA32_F_COMPOSE(rgbm[0], rgbm[1], rgbm[2], 1.0),
SP_RGBA32_F_COMPOSE(rgb1[0], rgb1[1], rgb1[2], 1.0));
}
if ((channels != CSC_CHANNEL_K) && (channels != CSC_CHANNEL_CMYKA)) {
/* Update K */
- sp_color_cmyk_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]), 0.0);
- sp_color_cmyk_to_rgb_floatv(rgbm, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]), 0.5);
- sp_color_cmyk_to_rgb_floatv(rgb1, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]), 1.0);
+ SPColor::cmyk_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]), 0.0);
+ SPColor::cmyk_to_rgb_floatv(rgbm, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]), 0.5);
+ SPColor::cmyk_to_rgb_floatv(rgb1, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]), 1.0);
_s[3]->setColors(SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 1.0),
SP_RGBA32_F_COMPOSE(rgbm[0], rgbm[1], rgbm[2], 1.0),
SP_RGBA32_F_COMPOSE(rgb1[0], rgb1[1], rgb1[2], 1.0));
}
if (channels != CSC_CHANNEL_CMYKA) {
/* Update alpha */
- sp_color_cmyk_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]),
+ SPColor::cmyk_to_rgb_floatv(rgb0, getScaled(_a[0]), getScaled(_a[1]), getScaled(_a[2]),
getScaled(_a[3]));
_s[4]->setColors(SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 0.0),
SP_RGBA32_F_COMPOSE(rgb0[0], rgb0[1], rgb0[2], 0.5),
@@ -713,7 +713,7 @@ static const gchar *sp_color_scales_hue_map()
p = map;
for (h = 0; h < 1024; h++) {
gfloat rgb[3];
- sp_color_hsl_to_rgb_floatv(rgb, h / 1024.0, 1.0, 0.5);
+ SPColor::hsl_to_rgb_floatv(rgb, h / 1024.0, 1.0, 0.5);
*p++ = SP_COLOR_F_TO_U(rgb[0]);
*p++ = SP_COLOR_F_TO_U(rgb[1]);
*p++ = SP_COLOR_F_TO_U(rgb[2]);
diff --git a/src/ui/widget/color-wheel-selector.cpp b/src/ui/widget/color-wheel-selector.cpp
index b4b6e6e5c..8a74c8d7f 100644
--- a/src/ui/widget/color-wheel-selector.cpp
+++ b/src/ui/widget/color-wheel-selector.cpp
@@ -198,7 +198,7 @@ void ColorWheelSelector::_wheelChanged(GimpColorWheel *wheel, ColorWheelSelector
gimp_color_wheel_get_color(wheel, &h, &s, &v);
float rgb[3] = { 0, 0, 0 };
- sp_color_hsv_to_rgb_floatv(rgb, h, s, v);
+ SPColor::hsv_to_rgb_floatv(rgb, h, s, v);
SPColor color(rgb[0], rgb[1], rgb[2]);
@@ -227,7 +227,7 @@ void ColorWheelSelector::_updateDisplay()
_updating = true;
{
float hsv[3] = { 0, 0, 0 };
- sp_color_rgb_to_hsv_floatv(hsv, _color.color().v.c[0], _color.color().v.c[1], _color.color().v.c[2]);
+ SPColor::rgb_to_hsv_floatv(hsv, _color.color().v.c[0], _color.color().v.c[1], _color.color().v.c[2]);
gimp_color_wheel_set_color(GIMP_COLOR_WHEEL(_wheel), hsv[0], hsv[1], hsv[2]);
}
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index ceb3ca2ff..bc4a3558f 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -1212,7 +1212,7 @@ RotateableSwatch::~RotateableSwatch() = default;
double
RotateableSwatch::color_adjust(float *hsla, double by, guint32 cc, guint modifier)
{
- sp_color_rgb_to_hsl_floatv (hsla, SP_RGBA32_R_F(cc), SP_RGBA32_G_F(cc), SP_RGBA32_B_F(cc));
+ SPColor::rgb_to_hsl_floatv (hsla, SP_RGBA32_R_F(cc), SP_RGBA32_G_F(cc), SP_RGBA32_B_F(cc));
hsla[3] = SP_RGBA32_A_F(cc);
double diff = 0;
if (modifier == 2) { // saturation
@@ -1251,7 +1251,7 @@ RotateableSwatch::color_adjust(float *hsla, double by, guint32 cc, guint modifie
}
float rgb[3];
- sp_color_hsl_to_rgb_floatv (rgb, hsla[0], hsla[1], hsla[2]);
+ SPColor::hsl_to_rgb_floatv (rgb, hsla[0], hsla[1], hsla[2]);
gchar c[64];
sp_svg_write_color (c, sizeof(c),
diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp
index 26f3fc505..8aba394e9 100644
--- a/src/widgets/gradient-vector.cpp
+++ b/src/widgets/gradient-vector.cpp
@@ -332,7 +332,7 @@ unsigned long sp_gradient_to_hhssll(SPGradient *gr)
SPStop *stop = gr->getFirstStop();
unsigned long rgba = stop->get_rgba32();
float hsl[3];
- sp_color_rgb_to_hsl_floatv (hsl, SP_RGBA32_R_F(rgba), SP_RGBA32_G_F(rgba), SP_RGBA32_B_F(rgba));
+ SPColor::rgb_to_hsl_floatv (hsl, SP_RGBA32_R_F(rgba), SP_RGBA32_G_F(rgba), SP_RGBA32_B_F(rgba));
return ((int)(hsl[0]*100 * 10000)) + ((int)(hsl[1]*100 * 100)) + ((int)(hsl[2]*100 * 1));
}