diff options
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-19 18:55:42 +0000 |
|---|---|---|
| committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-19 22:26:34 +0000 |
| commit | cf5edc95c552fe32d365f33b77e2213e814a980a (patch) | |
| tree | 9206667956e077dffe01724924e15d5c52ce423f /src/extension/internal | |
| parent | Run clang-tidy’s modernize-redundant-void-arg pass. (diff) | |
| download | inkscape-cf5edc95c552fe32d365f33b77e2213e814a980a.tar.gz inkscape-cf5edc95c552fe32d365f33b77e2213e814a980a.zip | |
Replace functions with methods in SPColor.
Diffstat (limited to 'src/extension/internal')
| -rw-r--r-- | src/extension/internal/cairo-render-context.cpp | 8 | ||||
| -rw-r--r-- | src/extension/internal/emf-inout.cpp | 4 | ||||
| -rw-r--r-- | src/extension/internal/emf-print.cpp | 20 | ||||
| -rw-r--r-- | src/extension/internal/latex-pstricks.cpp | 4 | ||||
| -rw-r--r-- | src/extension/internal/metafile-print.cpp | 4 | ||||
| -rw-r--r-- | src/extension/internal/pov-out.cpp | 2 | ||||
| -rw-r--r-- | src/extension/internal/wmf-inout.cpp | 4 | ||||
| -rw-r--r-- | src/extension/internal/wmf-print.cpp | 18 |
8 files changed, 32 insertions, 32 deletions
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)); |
