-- cgit v1.2.3 From 77437ad04cbb9288b6e8898e8822a16588d55b4a Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Wed, 17 Jun 2009 16:58:37 +0000 Subject: adding a list of uint32 color references and forcing LCMS debugging (bzr r8050.1.2) --- color_uint32_references.txt | 163 ++++++++++++++++++++++++++++++++++ src/widgets/sp-color-icc-selector.cpp | 52 +++++------ 2 files changed, 189 insertions(+), 26 deletions(-) create mode 100644 color_uint32_references.txt diff --git a/color_uint32_references.txt b/color_uint32_references.txt new file mode 100644 index 000000000..da54edc3c --- /dev/null +++ b/color_uint32_references.txt @@ -0,0 +1,163 @@ +src/dropper-context.cpp:143:guint32 sp_dropper_context_get_color(SPEventContext *ec) +src/dropper-context.cpp:258: guint32 bg = sp_desktop_namedview(desktop)->pagecolor; +src/sp-namedview.cpp:60:static gboolean sp_nv_read_opacity(const gchar *str, guint32 *color); +src/sp-namedview.cpp:951:static gboolean sp_nv_read_opacity(const gchar *str, guint32 *color) +src/sp-namedview.cpp:964: *color = (*color & 0xffffff00) | (guint32) floor(v * 255.9999); +src/desktop-style.cpp:61: guint32 rgba = SP_RGBA32_F_COMPOSE(color[0], color[1], color[2], color[3]); +src/desktop-style.cpp:230: guint32 r = 0; // if there's no color, return black +src/desktop-style.cpp:308: guint32 r = 0; // if there's no color, return black +src/widgets/sp-color-wheel-selector.cpp:216: guint32 start = _color.toRGBA32( 0x00 ); +src/widgets/sp-color-wheel-selector.cpp:217: guint32 mid = _color.toRGBA32( 0x7f ); +src/widgets/sp-color-wheel-selector.cpp:218: guint32 end = _color.toRGBA32( 0xff ); +src/widgets/sp-color-wheel-selector.cpp:282: guint32 start = color.toRGBA32( 0x00 ); +src/widgets/sp-color-wheel-selector.cpp:283: guint32 mid = color.toRGBA32( 0x7f ); +src/widgets/sp-color-wheel-selector.cpp:284: guint32 end = color.toRGBA32( 0xff ); +src/widgets/sp-color-icc-selector.cpp:495: guint32 val = _color.toRGBA32(0); +src/widgets/sp-color-icc-selector.cpp:786: guint32 start = _color.toRGBA32( 0x00 ); +src/widgets/sp-color-icc-selector.cpp:787: guint32 mid = _color.toRGBA32( 0x7f ); +src/widgets/sp-color-icc-selector.cpp:788: guint32 end = _color.toRGBA32( 0xff ); +src/widgets/sp-color-icc-selector.cpp:851: guint32 prior = iccSelector->_color.toRGBA32(255); +src/widgets/paint-selector.cpp:1054: guint32 rgba = color.toRGBA32( alpha ); +src/widgets/sp-color-preview.cpp:133:sp_color_preview_new (guint32 rgba) +src/widgets/sp-color-preview.cpp:145:sp_color_preview_set_rgba32 (SPColorPreview *cp, guint32 rgba) +src/widgets/sp-color-slider.h:61:void sp_color_slider_set_colors (SPColorSlider *slider, guint32 start, guint32 mid, guint32 end); +src/widgets/gradient-vector.cpp:676:sp_average_color (guint32 c1, guint32 c2, gdouble p = 0.5) +src/widgets/gradient-vector.cpp:726: guint32 cnew = sp_average_color (c1, c2); +src/widgets/sp-color-slider.cpp:370:sp_color_slider_set_colors (SPColorSlider *slider, guint32 start, guint32 mid, guint32 end) +src/widgets/sp-color-preview.h:40:GtkWidget *sp_color_preview_new(guint32 rgba); +src/widgets/sp-color-preview.h:42:void sp_color_preview_set_rgba32(SPColorPreview *cp, guint32 color); +src/eraser-context.cpp:1017: guint32 fillColor = sp_desktop_get_color_tool (desktop, "/tools/eraser", true); +src/eraser-context.cpp:1018: //guint32 strokeColor = sp_desktop_get_color_tool (desktop, "/tools/eraser", false); +src/style.cpp:3101: guint32 const rgb0 = sp_svg_read_color(str, 0xff); +src/style.cpp:3158: guint32 const rgb0 = sp_svg_read_color(str, &str, 0xff); +src/draw-context.h:44: guint32 red_color; +src/draw-context.h:45: guint32 blue_color; +src/draw-context.h:46: guint32 green_color; +src/sp-guide.h:32: guint32 color; +src/sp-guide.h:33: guint32 hicolor; +src/color.h:67:guint32 sp_color_get_rgba32_ualpha (const SPColor *color, guint32 alpha); +src/color.h:68:guint32 sp_color_get_rgba32_falpha (const SPColor *color, float alpha); +src/svg/svg-color.cpp:202:sp_svg_read_color(gchar const *str, guint32 const dfl) +src/svg/svg-color.cpp:208:internal_sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 def) +src/svg/svg-color.cpp:338:sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 dfl) +src/svg/svg-color.cpp:343: guint32 const ret = internal_sp_svg_read_color(str, &end, dfl); +src/svg/svg-color.cpp:352: guint32 const check = internal_sp_svg_read_color(buf, &buf_end, 1); +src/svg/svg-color.cpp:430:sp_svg_write_color(gchar *buf, unsigned const buflen, guint32 const rgba32) +src/svg/svg-color-test.h:67: guint32 result = sp_svg_read_color( val[i], &end, 0x3 ); +src/svg/svg-color.h:8:guint32 sp_svg_read_color(gchar const *str, unsigned int dfl); +src/svg/svg-color.h:9:guint32 sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 def); +src/filters/flood.cpp:121: guint32 read_color; +src/filters/specularlighting.h:44: guint32 lighting_color; +src/filters/diffuselighting.h:41: guint32 lighting_color; +src/filters/flood.h:27: guint32 color; +src/desktop-style.h:60:guint32 sp_desktop_get_color (SPDesktop *desktop, bool is_fill); +src/desktop-style.h:63:guint32 sp_desktop_get_color_tool(SPDesktop *desktop, Glib::ustring const &tool, bool is_fill, bool* has_color = NULL); +src/gradient-context.cpp:434: guint32 c1 = average_color (c0, c2, +src/connector-context.h:58: guint32 red_color; +src/nodepath.h:332:SPCanvasItem *sp_nodepath_generate_helperpath(SPDesktop *desktop, SPCurve *curve, const Geom::Matrix & i2d, guint32 color); +src/display/sp-ctrlpoint.cpp:140:sp_ctrlpoint_set_color (SPCtrlPoint *cp, guint32 rgba) +src/display/nr-arena-image.cpp:230: guint32 rgba = prefs->getInt("/options/wireframecolors/images", 0xff0000ff); +src/display/nr-light.h:37: DistantLight(SPFeDistantLight *light, guint32 lighting_color); +src/display/nr-light.h:55: guint32 color; +src/display/nr-light.h:71: PointLight(SPFePointLight *light, guint32 lighting_color, const Geom::Matrix &trans); +src/display/nr-light.h:93: guint32 color; +src/display/nr-light.h:111: SpotLight(SPFeSpotLight *light, guint32 lighting_color, const Geom::Matrix &trans); +src/display/nr-light.h:136: guint32 color; +src/display/canvas-grid.cpp:503:static gboolean sp_nv_read_opacity(gchar const *str, guint32 *color) +src/display/canvas-grid.cpp:516: *color = (*color & 0xffffff00) | (guint32) floor(v * 255.9999); +src/display/canvas-grid.cpp:904: guint32 _empcolor; +src/display/canvas-grid.cpp:948: grid_dot (buf, ix, iy, color | (guint32)0x000000FF); // put alpha to max value +src/display/canvas-grid.cpp:954: grid_dot (buf, ix, iy, _empcolor | (guint32)0x000000FF); // put alpha to max value +src/display/nr-light.cpp:26:DistantLight::DistantLight(SPFeDistantLight *light, guint32 lighting_color) { +src/display/nr-light.cpp:46:PointLight::PointLight(SPFePointLight *light, guint32 lighting_color, const Geom::Matrix &trans) { +src/display/nr-light.cpp:69:SpotLight::SpotLight(SPFeSpotLight *light, guint32 lighting_color, const Geom::Matrix &trans) { +src/display/nr-arena-glyphs.cpp:453: guint32 rgba = item->arena->outlinecolor; +src/display/nr-filter-flood.cpp:65:void FilterFlood::set_color(guint32 c) { +src/display/sodipodi-ctrlrect.h:49: guint32 _border_color; +src/display/sodipodi-ctrlrect.h:50: guint32 _fill_color; +src/display/sodipodi-ctrlrect.h:51: guint32 _shadow_color; +src/display/sp-ctrlpoint.h:34:void sp_ctrlpoint_set_color (SPCtrlPoint *cp, guint32 rgba); +src/display/nr-arena-item.cpp:353: guint32 saved_rgba = item->arena->outlinecolor; // save current outline color +src/display/canvas-grid.h:90: guint32 color; /**< Color for normal lines */ +src/display/canvas-grid.h:91: guint32 empcolor; /**< Color for emphasis lines */ +src/display/nr-arena.h:54: guint32 outlinecolor; +src/display/sodipodi-ctrl.h:48: guint32 fill_color; +src/display/sodipodi-ctrl.h:49: guint32 stroke_color; +src/display/canvas-axonomgrid.cpp:278:static gboolean sp_nv_read_opacity(gchar const *str, guint32 *color) +src/display/canvas-axonomgrid.cpp:291: *color = (*color & 0xffffff00) | (guint32) floor(v * 255.9999); +src/display/canvas-axonomgrid.cpp:557: guint32 _empcolor; +src/display/nr-filter-diffuselighting.h:39: guint32 lighting_color; +src/display/nr-arena-shape.cpp:732: guint32 rgba = NR_ARENA_ITEM(shape)->arena->outlinecolor; +src/display/nr-filter-specularlighting.h:40: guint32 lighting_color; +src/display/canvas-bpath.cpp:41:void nr_pixblock_render_bpath_rgba (Shape* theS,uint32_t color,NRRectL &area,char* destBuf,int stride); +src/display/sp-canvas.h:63: guint32 bg_color; +src/display/nr-filter-flood.h:29: virtual void set_color(guint32 c); +src/display/nr-filter-flood.h:34: guint32 color; +src/gradient-chemistry.h:44:SPGradient *sp_document_default_gradient_vector (SPDocument *document, guint32 color = 0); +src/gradient-chemistry.h:65:guint32 average_color (guint32 c1, guint32 c2, gdouble p = 0.5); +src/ui/dialog/swatches.cpp:1418: guint32 together = color.toRGBA32(first.opacity); +src/ui/dialog/swatches.cpp:1423: guint32 together2 = color2.toRGBA32(second.opacity); +src/ui/dialog/print.cpp:54: guint32 bgcolor = 0x00000000; +src/ui/widget/style-swatch.cpp:283: guint32 color = paint->value.color.toRGBA32( SP_SCALE24_TO_FLOAT ((i == SS_FILL)? query->fill_opacity.value : query->stroke_opacity.value) ); +src/ui/widget/selected-style.cpp:538: guint32 color = sp_desktop_get_color(_desktop, true); +src/ui/widget/selected-style.cpp:550: guint32 color = sp_desktop_get_color(_desktop, false); +src/ui/widget/selected-style.cpp:584: guint32 color = _thisselected[SS_FILL]; +src/ui/widget/selected-style.cpp:604: guint32 color = _thisselected[SS_STROKE]; +src/ui/widget/selected-style.cpp:701: guint32 color = sp_svg_read_color(text.c_str(), 0x000000ff); // impossible value, as SVG color cannot have opacity +src/ui/widget/selected-style.cpp:719: guint32 color = sp_svg_read_color(text.c_str(), 0x000000ff); // impossible value, as SVG color cannot have opacity +src/ui/widget/selected-style.cpp:978: guint32 color = paint->value.color.toRGBA32( +src/ui/widget/selected-style.cpp:1176:RotateableSwatch::color_adjust(float *hsl, double by, guint32 cc, guint modifier) +src/ui/widget/color-picker.cpp:125: guint32 rgba = color.toRGBA32( alpha ); +src/ui/widget/selected-style.h:65: double color_adjust (float *hsl, double by, guint32 cc, guint state); +src/ui/widget/selected-style.h:74: guint32 startcolor; +src/ui/clipboard.cpp:1108: guint32 bgcolor = 0x00000000; +src/ui/clipboard.cpp:1351:void ClipboardManagerImpl::_setClipboardColor(guint32 color) +src/main.cpp:1361: guint32 bgcolor = 0x00000000; +src/main.cpp:1381: bgcolor &= (guint32) 0xffffff00; +src/main.cpp:1382: bgcolor |= (guint32) floor(value); +src/main.cpp:1385: bgcolor &= (guint32) 0xffffff00; +src/dialogs/clonetiler.cpp:1308: guint32 rgba = sp_svg_read_color (initial_color.data(), 0x000000ff); +src/dialogs/clonetiler.cpp:2448: guint32 rgba = 0x000000ff | sp_svg_read_color (prefs->getString(prefs_path + "initial_color").data(), 0x000000ff); +src/extension/extension.cpp:611:Extension::set_param_color (const gchar * name, guint32 color, SPDocument * doc, Inkscape::XML::Node * node) +src/extension/extension.h:187: guint32 get_param_color (const gchar * name, +src/extension/extension.h:209: guint32 set_param_color (const gchar * name, +src/extension/extension.h:210: guint32 color, +src/extension/internal/bitmap/colorize.h:21: guint32 _color; +src/extension/internal/odf.cpp:1553: guint32 fillCol = style->fill.value.color.toRGBA32( 0 ); +src/extension/internal/odf.cpp:1571: guint32 strokeCol = style->stroke.value.color.toRGBA32( 0 ); +src/extension/param/parameter.h:96: guint32 get_color (const SPDocument * doc, +src/extension/param/parameter.h:105: guint32 set_color (guint32 in, SPDocument * doc, Inkscape::XML::Node * node); +src/extension/param/parameter.cpp:258:Parameter::set_color (guint32 in, SPDocument * doc, Inkscape::XML::Node * node) +src/live_effects/parameter/point.cpp:123:PointParam::set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color) +src/live_effects/parameter/vector.h:53: void set_vector_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); +src/live_effects/parameter/vector.h:54: void set_origin_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); +src/live_effects/parameter/vector.h:71: guint32 vec_knot_color; +src/live_effects/parameter/vector.h:74: guint32 ori_knot_color; +src/live_effects/parameter/point.h:50: void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); +src/live_effects/parameter/point.h:63: guint32 knot_color; +src/live_effects/parameter/vector.cpp:126:VectorParam::set_vector_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color) +src/live_effects/parameter/vector.cpp:134:VectorParam::set_origin_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color) +src/knot-holder-entity.h:43: guint32 color = 0xffffff00); +src/nodepath.cpp:164:sp_nodepath_make_helper_item(Inkscape::NodePath::Path *np, /*SPDesktop *desktop, */const SPCurve *curve, bool show = false, guint32 color = 0xff0000ff) { +src/nodepath.cpp:5040:sp_nodepath_generate_helperpath(SPDesktop *desktop, SPCurve *curve, const Geom::Matrix & i2d, guint32 color = 0xff0000ff) { +src/nodepath.cpp:5060: guint32 color = prefs->getInt("/tools/nodes/highlight_color", 0xff0000ff); +src/knot-holder-entity.cpp:36: SPKnotShapeType shape, SPKnotModeType mode, guint32 color) +src/tweak-context.cpp:697:tweak_colorpaint (float *color, guint32 goal, double force, bool do_h, bool do_s, bool do_l) +src/tweak-context.cpp:749:tweak_color (guint mode, float *color, guint32 goal, double force, bool do_h, bool do_s, bool do_l) +src/tweak-context.cpp:1058: guint32 fill_goal = sp_desktop_get_color_tool(desktop, "/tools/tweak", true, &do_fill); +src/tweak-context.cpp:1059: guint32 stroke_goal = sp_desktop_get_color_tool(desktop, "/tools/tweak", false, &do_stroke); +src/sp-namedview.h:62: guint32 guidecolor; +src/sp-namedview.h:63: guint32 guidehicolor; +src/sp-namedview.h:64: guint32 bordercolor; +src/sp-namedview.h:65: guint32 pagecolor; +src/dropper-context.h:50:guint32 sp_dropper_context_get_color(SPEventContext *ec); +src/style.h:174: void setColor( guint32 val ) {value.color.set( val ); colorSet = true;} +src/gradient-chemistry.cpp:578:average_color (guint32 c1, guint32 c2, gdouble p) +src/gradient-chemistry.cpp:600: guint32 cnew = average_color (c1, c2, (offset - prev_stop->offset) / (next_stop->offset - prev_stop->offset)); +src/gradient-chemistry.cpp:1213:sp_document_default_gradient_vector(SPDocument *document, guint32 color) +src/dyna-draw-context.cpp:1234: guint32 fillColor = sp_desktop_get_color_tool (desktop, "/tools/calligraphic", true); +src/dyna-draw-context.cpp:1235: //guint32 strokeColor = sp_desktop_get_color_tool (desktop, "/tools/calligraphic", false); +src/sp-gradient.cpp:153: guint32 const color = sp_svg_read_color(p, 0); +src/sp-gradient.cpp:172: guint32 const color = sp_svg_read_color(p, 0); +src/sp-gradient.cpp:213: guint32 specifiedcolor = stop->specified_color.toRGBA32( 255 ); +src/sp-gradient.cpp:279: guint32 color = dfl; diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index b18290923..144e42aa2 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -23,14 +23,14 @@ #include "color-profile-fns.h" #include "color-profile.h" //#define DEBUG_LCMS -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS #include "preferences.h" #include #endif // DEBUG_LCMS #endif // ENABLE_LCMS -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS extern guint update_in_progress; #define DEBUG_MESSAGE(key, ...) \ {\ @@ -475,11 +475,11 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) if ( name ) { if ( tmp.icc && tmp.icc->colorProfile == name ) { -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("Already at name [%s]", name ); #endif // DEBUG_LCMS } else { -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("Need to switch to profile [%s]", name ); #endif // DEBUG_LCMS if ( tmp.icc ) { @@ -498,12 +498,12 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) SP_RGBA32_G_U(val), SP_RGBA32_B_U(val), 255}; -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("Shoving in [%02x] [%02x] [%02x]", pre[0], pre[1], pre[2]); #endif // DEBUG_LCMS icUInt16Number post[4] = {0,0,0,0}; cmsDoTransform( trans, pre, post, 1 ); -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("got on out [%04x] [%04x] [%04x] [%04x]", post[0], post[1], post[2], post[3]); #endif // DEBUG_LCMS guint count = _cmsChannelsOf( newProf->getColorSpace() ); @@ -515,7 +515,7 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) for ( guint i = 0; i < count; i++ ) { gdouble val = (((gdouble)post[i])/65535.0) * (gdouble)scales[i]; -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message(" scaled %d by %d to be %f", i, scales[i], val); #endif // DEBUG_LCMS tmp.icc->colors.push_back(val); @@ -523,7 +523,7 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) cmsHTRANSFORM retrans = newProf->getTransfToSRGB8(); if ( retrans ) { cmsDoTransform( retrans, post, pre, 1 ); -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message(" back out [%02x] [%02x] [%02x]", pre[0], pre[1], pre[2]); #endif // DEBUG_LCMS tmp.set(SP_RGBA32_U_COMPOSE(pre[0], pre[1], pre[2], 0xff)); @@ -533,7 +533,7 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) dirty = true; } } else { -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("NUKE THE ICC"); #endif // DEBUG_LCMS if ( tmp.icc ) { @@ -542,21 +542,21 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) dirty = true; _fixupHit( 0, this ); } else { -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("No icc to nuke"); #endif // DEBUG_LCMS } } if ( dirty ) { -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("+----------------"); g_message("+ new color is [%s]", tmp.toString().c_str()); #endif // DEBUG_LCMS _setProfile( tmp.icc ); //_adjustmentChanged( _fooAdj[0], SP_COLOR_ICC_SELECTOR(_csel) ); setColorAlpha( tmp, _alpha, true ); -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("+_________________"); #endif // DEBUG_LCMS } @@ -603,15 +603,15 @@ void ColorICCSelector::_profilesChanged( std::string const & name ) void ColorICCSelector::_colorChanged() { _updating = TRUE; -// sp_color_icc_set_color( SP_COLOR_ICC( _icc ), &color ); + //sp_color_icc_set_color( SP_COLOR_ICC( _icc ), &color ); -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message( "/^^^^^^^^^ %p::_colorChanged(%08x:%s)", this, _color.toRGBA32(_alpha), ( (_color.icc) ? _color.icc->colorProfile.c_str(): "" ) ); #endif // DEBUG_LCMS -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("FLIPPIES!!!! %p '%s'", _color.icc, (_color.icc ? _color.icc->colorProfile.c_str():"")); #endif // DEBUG_LCMS @@ -642,7 +642,7 @@ void ColorICCSelector::_colorChanged() if ( other != _color.toRGBA32(255) ) { _fixupNeeded = other; gtk_widget_set_sensitive( _fixupBtn, TRUE ); -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("Color needs to change 0x%06x to 0x%06x", _color.toRGBA32(255) >> 8, other >> 8 ); #endif // DEBUG_LCMS } @@ -654,7 +654,7 @@ void ColorICCSelector::_colorChanged() _updating = FALSE; -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message( "\\_________ %p::_colorChanged()", this ); #endif // DEBUG_LCMS } @@ -662,7 +662,7 @@ void ColorICCSelector::_colorChanged() #if ENABLE_LCMS void ColorICCSelector::_setProfile( SVGICCColor* profile ) { -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message( "/^^^^^^^^^ %p::_setProfile(%s)", this, ( (profile) ? profile->colorProfile.c_str() : "") ); @@ -730,7 +730,7 @@ void ColorICCSelector::_setProfile( SVGICCColor* profile ) } } -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message( "\\_________ %p::_setProfile()", this ); #endif // DEBUG_LCMS } @@ -800,7 +800,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC // gtk_adjustment_set_value( adjustment, floor ((adjustment->value) * adjustment->upper + 0.5) ); // } -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message( "/^^^^^^^^^ %p::_adjustmentChanged()", cs ); #endif // DEBUG_LCMS @@ -816,7 +816,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC SPColor newColor( iccSelector->_color ); gfloat scaled = ColorScales::getScaled( iccSelector->_adj ); if ( iccSelector->_adj == adjustment ) { -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("ALPHA"); #endif // DEBUG_LCMS } else { @@ -828,7 +828,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC } } if ( match >= 0 ) { -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message(" channel %d", match ); #endif // DEBUG_LCMS } @@ -852,7 +852,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC guint32 newer = other.toRGBA32(255); if ( prior != newer ) { -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("Transformed color from 0x%08x to 0x%08x", prior, newer ); g_message(" ~~~~ FLIP"); #endif // DEBUG_LCMS @@ -875,7 +875,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC iccSelector->_updateSliders( match ); iccSelector->_updating = FALSE; -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message( "\\_________ %p::_adjustmentChanged()", cs ); #endif // DEBUG_LCMS } @@ -900,13 +900,13 @@ void ColorICCSelector::_sliderReleased( SPColorSlider */*slider*/, SPColorICCSel // } } -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS void ColorICCSelector::_sliderChanged( SPColorSlider *slider, SPColorICCSelector *cs ) #else void ColorICCSelector::_sliderChanged( SPColorSlider */*slider*/, SPColorICCSelector */*cs*/ ) #endif // DEBUG_LCMS { -#ifdef DEBUG_LCMS +#if 1 //DEBUG_LCMS g_message("Changed %p and %p", slider, cs ); #endif // DEBUG_LCMS // ColorICCSelector* iccSelector = (ColorICCSelector*)(SP_COLOR_SELECTOR(cs)->base); -- cgit v1.2.3 From 521b94aa9a5ec58311750f1f014958ef5a0c53d3 Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Sat, 20 Jun 2009 06:33:55 +0000 Subject: bool sp_svg_read_icc_color( gchar const *str, SVGICCColor* dest ); (bzr r8050.1.3) --- src/svg/svg-color.cpp | 6 ++++++ src/svg/svg-color.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp index 9040d6e43..743d2bbc8 100644 --- a/src/svg/svg-color.cpp +++ b/src/svg/svg-color.cpp @@ -547,6 +547,12 @@ bool sp_svg_read_icc_color( gchar const *str, gchar const **end_ptr, SVGICCColor return good; } + +bool sp_svg_read_icc_color( gchar const *str, SVGICCColor* dest ) +{ + sp_svg_read_icc_color(str, NULL, dest); +} + /* Local Variables: mode:c++ diff --git a/src/svg/svg-color.h b/src/svg/svg-color.h index 692c1dd00..d1238dcab 100644 --- a/src/svg/svg-color.h +++ b/src/svg/svg-color.h @@ -10,6 +10,6 @@ guint32 sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 def); void sp_svg_write_color(char *buf, unsigned int buflen, unsigned int rgba32); bool sp_svg_read_icc_color( gchar const *str, gchar const **end_ptr, SVGICCColor* dest ); - +bool sp_svg_read_icc_color( gchar const *str, SVGICCColor* dest ); #endif /* !SVG_SVG_COLOR_H_SEEN */ -- cgit v1.2.3 From 59c1c219f9b89e50bd9fa9acce9bed9860a281e7 Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Sat, 20 Jun 2009 11:49:01 +0000 Subject: parsing and handling of icc-color in feFlood SVG Filters TODO: implement interface to set icc-color to the flood-color parameter (bzr r8050.1.4) --- src/display/nr-filter-flood.cpp | 27 ++++++++++++++---- src/display/nr-filter-flood.h | 3 ++ src/filters/flood.cpp | 25 +++++++++++++++-- src/filters/flood.h | 2 ++ src/svg/svg-color.cpp | 47 +++++++++++++++++++++++++++++-- src/svg/svg-color.h | 1 + src/widgets/sp-color-icc-selector.cpp | 52 +++++++++++++++++------------------ 7 files changed, 122 insertions(+), 35 deletions(-) diff --git a/src/display/nr-filter-flood.cpp b/src/display/nr-filter-flood.cpp index 026cbce16..06025392b 100644 --- a/src/display/nr-filter-flood.cpp +++ b/src/display/nr-filter-flood.cpp @@ -9,8 +9,14 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "display/nr-filter-flood.h" #include "display/nr-filter-utils.h" +#include "svg/svg-icc-color.h" +#include "svg/svg-color.h" namespace Inkscape { namespace Filters { @@ -26,6 +32,7 @@ FilterFlood::~FilterFlood() {} int FilterFlood::render(FilterSlot &slot, FilterUnits const &/*units*/) { +g_message("rendering feflood"); NRPixBlock *in = slot.get(_input); if (!in) { g_warning("Missing source image for feFlood (in=%d)", _input); @@ -43,12 +50,18 @@ int FilterFlood::render(FilterSlot &slot, FilterUnits const &/*units*/) { true); unsigned char *out_data = NR_PIXBLOCK_PX(out); - unsigned char r,g,b,a; - r = CLAMP_D_TO_U8((color >> 24) % 256); - g = CLAMP_D_TO_U8((color >> 16) % 256); - b = CLAMP_D_TO_U8((color >> 8) % 256); - a = CLAMP_D_TO_U8(opacity*255); + + + r = CLAMP_D_TO_U8((color >> 24) % 256); + g = CLAMP_D_TO_U8((color >> 16) % 256); + b = CLAMP_D_TO_U8((color >> 8) % 256); + a = CLAMP_D_TO_U8(opacity*255); + +#if ENABLE_LCMS + icc_color_to_sRGB(icc, &r, &g, &b); +g_message("result: r:%d g:%d b:%d", r, g, b); +#endif //ENABLE_LCMS for(i=0; i < 4*in_h*in_w; i+=4){ out_data[i]=r; @@ -70,6 +83,10 @@ void FilterFlood::set_opacity(double o) { opacity = o; } +void FilterFlood::set_icc(SVGICCColor *icc_color) { + icc = icc_color; +} + void FilterFlood::area_enlarge(NRRectL &/*area*/, Geom::Matrix const &/*trans*/) { } diff --git a/src/display/nr-filter-flood.h b/src/display/nr-filter-flood.h index 9e6a53abb..d38c0d4f5 100644 --- a/src/display/nr-filter-flood.h +++ b/src/display/nr-filter-flood.h @@ -15,6 +15,7 @@ #include "display/nr-filter-primitive.h" #include "display/nr-filter-slot.h" #include "display/nr-filter-units.h" +#include "svg/svg-color.h" namespace Inkscape { namespace Filters { @@ -27,11 +28,13 @@ public: virtual void set_opacity(double o); virtual void set_color(guint32 c); + virtual void set_icc(SVGICCColor *icc_color); virtual int render(FilterSlot &slot, FilterUnits const &units); virtual void area_enlarge(NRRectL &area, Geom::Matrix const &trans); private: double opacity; guint32 color; + SVGICCColor *icc; }; } /* namespace Filters */ diff --git a/src/filters/flood.cpp b/src/filters/flood.cpp index 625e35d42..221b0daf2 100644 --- a/src/filters/flood.cpp +++ b/src/filters/flood.cpp @@ -17,12 +17,13 @@ # include "config.h" #endif +#include "strneq.h" + #include "attributes.h" #include "svg/svg.h" #include "flood.h" #include "xml/repr.h" #include "helper-fns.h" -#include "svg/svg-color.h" /* FeFlood base class */ @@ -79,6 +80,7 @@ static void sp_feFlood_init(SPFeFlood *feFlood) { feFlood->opacity = 1; + feFlood->icc = NULL; } /** @@ -120,16 +122,34 @@ sp_feFlood_set(SPObject *object, unsigned int key, gchar const *value) gchar *end_ptr = NULL; guint32 read_color; double read_num; + bool dirty = false; switch(key) { /*DEAL WITH SETTING ATTRIBUTES HERE*/ case SP_PROP_FLOOD_COLOR: cend_ptr = NULL; read_color = sp_svg_read_color(value, &cend_ptr, 0xffffffff); + if (cend_ptr && read_color != feFlood->color){ feFlood->color = read_color; - object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG); + dirty=true; + } + + if (cend_ptr){ + while (g_ascii_isspace(*cend_ptr)) { + ++cend_ptr; + } + if (strneq(cend_ptr, "icc-color(", 10)) { + if (!feFlood->icc) feFlood->icc = new SVGICCColor(); + if ( ! sp_svg_read_icc_color( cend_ptr, feFlood->icc ) ) { + delete feFlood->icc; + feFlood->icc = NULL; + } + dirty = true; + } } + if (dirty) + object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG); break; case SP_PROP_FLOOD_OPACITY: if (value) { @@ -208,6 +228,7 @@ static void sp_feFlood_build_renderer(SPFilterPrimitive *primitive, Inkscape::Fi nr_flood->set_opacity(sp_flood->opacity); nr_flood->set_color(sp_flood->color); + nr_flood->set_icc(sp_flood->icc); } diff --git a/src/filters/flood.h b/src/filters/flood.h index 046c0e868..f386e2cd4 100644 --- a/src/filters/flood.h +++ b/src/filters/flood.h @@ -15,6 +15,7 @@ #include "sp-filter.h" #include "flood-fns.h" +#include "svg/svg-icc-color.h" #include "display/nr-filter.h" #include "display/nr-filter-flood.h" @@ -25,6 +26,7 @@ class SPFeFloodClass; struct SPFeFlood : public SPFilterPrimitive { /** FLOOD ATTRIBUTES HERE */ guint32 color; + SVGICCColor *icc; double opacity; }; diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp index 743d2bbc8..fcfbbdbd8 100644 --- a/src/svg/svg-color.cpp +++ b/src/svg/svg-color.cpp @@ -36,6 +36,15 @@ #include "svg-color.h" #include "svg-icc-color.h" +#if ENABLE_LCMS +#include +#include "color.h" +#include "color-profile.h" +#include "document.h" +#include "inkscape.h" +#include "profile-manager.h" +#endif // ENABLE_LCMS + using std::sprintf; struct SPSVGColor { @@ -454,6 +463,39 @@ sp_svg_create_color_hash() return colors; } +//helper function borrowed from src/widgets/sp-color-icc-selector.cpp: +void getThings( DWORD space, gchar const**& namers, gchar const**& tippies, guint const*& scalies ); + +void icc_color_to_sRGB(SVGICCColor* icc, guchar* r, guchar* g, guchar* b){ + guchar color_out[4]; + guchar color_in[4]; + if (icc){ +g_message("profile name: %s", icc->colorProfile.c_str()); + Inkscape::ColorProfile* prof = SP_ACTIVE_DOCUMENT->profileManager->find(icc->colorProfile.c_str()); + if ( prof ) { + cmsHTRANSFORM trans = prof->getTransfToSRGB8(); + if ( trans ) { + gchar const** names = 0; + gchar const** tips = 0; + guint const* scales = 0; + getThings( prof->getColorSpace(), names, tips, scales ); + + guint count = _cmsChannelsOf( prof->getColorSpace() ); + if (count>4) count=4; //do we need it? Should we allow an arbitrary number of color values? Or should we limit to a maximum? (max==4?) + for (guint i=0;icolors[i])*256.0) * (gdouble)scales[i]); +g_message("input[%d]: %d",i, color_in[i]); + } + + cmsDoTransform( trans, color_in, color_out, 1 ); +g_message("transform to sRGB done"); + } + *r = color_out[0]; + *g = color_out[1]; + *b = color_out[2]; + } + } +} bool sp_svg_read_icc_color( gchar const *str, gchar const **end_ptr, SVGICCColor* dest ) { @@ -508,6 +550,7 @@ bool sp_svg_read_icc_color( gchar const *str, gchar const **end_ptr, SVGICCColor if ( !errno ) { if ( dest ) { dest->colors.push_back( dbl ); +g_message("color: %f", dbl); } str = endPtr; } else { @@ -529,7 +572,7 @@ bool sp_svg_read_icc_color( gchar const *str, gchar const **end_ptr, SVGICCColor while ( g_ascii_isspace(*str) ) { str++; } - good &= *str == ')'; + good &= (*str == ')'); } } @@ -550,7 +593,7 @@ bool sp_svg_read_icc_color( gchar const *str, gchar const **end_ptr, SVGICCColor bool sp_svg_read_icc_color( gchar const *str, SVGICCColor* dest ) { - sp_svg_read_icc_color(str, NULL, dest); + return sp_svg_read_icc_color(str, NULL, dest); } /* diff --git a/src/svg/svg-color.h b/src/svg/svg-color.h index d1238dcab..a3868c149 100644 --- a/src/svg/svg-color.h +++ b/src/svg/svg-color.h @@ -11,5 +11,6 @@ void sp_svg_write_color(char *buf, unsigned int buflen, unsigned int rgba32); bool sp_svg_read_icc_color( gchar const *str, gchar const **end_ptr, SVGICCColor* dest ); bool sp_svg_read_icc_color( gchar const *str, SVGICCColor* dest ); +void icc_color_to_sRGB(SVGICCColor* dest, guchar* r, guchar* g, guchar* b); #endif /* !SVG_SVG_COLOR_H_SEEN */ diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index 144e42aa2..ae837117a 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -22,15 +22,15 @@ #if ENABLE_LCMS #include "color-profile-fns.h" #include "color-profile.h" -//#define DEBUG_LCMS -#if 1 //DEBUG_LCMS +#define DEBUG_LCMS +#ifdef DEBUG_LCMS #include "preferences.h" #include #endif // DEBUG_LCMS #endif // ENABLE_LCMS -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS extern guint update_in_progress; #define DEBUG_MESSAGE(key, ...) \ {\ @@ -475,11 +475,11 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) if ( name ) { if ( tmp.icc && tmp.icc->colorProfile == name ) { -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("Already at name [%s]", name ); #endif // DEBUG_LCMS } else { -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("Need to switch to profile [%s]", name ); #endif // DEBUG_LCMS if ( tmp.icc ) { @@ -498,12 +498,12 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) SP_RGBA32_G_U(val), SP_RGBA32_B_U(val), 255}; -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("Shoving in [%02x] [%02x] [%02x]", pre[0], pre[1], pre[2]); #endif // DEBUG_LCMS icUInt16Number post[4] = {0,0,0,0}; cmsDoTransform( trans, pre, post, 1 ); -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("got on out [%04x] [%04x] [%04x] [%04x]", post[0], post[1], post[2], post[3]); #endif // DEBUG_LCMS guint count = _cmsChannelsOf( newProf->getColorSpace() ); @@ -515,7 +515,7 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) for ( guint i = 0; i < count; i++ ) { gdouble val = (((gdouble)post[i])/65535.0) * (gdouble)scales[i]; -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message(" scaled %d by %d to be %f", i, scales[i], val); #endif // DEBUG_LCMS tmp.icc->colors.push_back(val); @@ -523,7 +523,7 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) cmsHTRANSFORM retrans = newProf->getTransfToSRGB8(); if ( retrans ) { cmsDoTransform( retrans, post, pre, 1 ); -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message(" back out [%02x] [%02x] [%02x]", pre[0], pre[1], pre[2]); #endif // DEBUG_LCMS tmp.set(SP_RGBA32_U_COMPOSE(pre[0], pre[1], pre[2], 0xff)); @@ -533,7 +533,7 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) dirty = true; } } else { -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("NUKE THE ICC"); #endif // DEBUG_LCMS if ( tmp.icc ) { @@ -542,21 +542,21 @@ void ColorICCSelector::_switchToProfile( gchar const* name ) dirty = true; _fixupHit( 0, this ); } else { -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("No icc to nuke"); #endif // DEBUG_LCMS } } if ( dirty ) { -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("+----------------"); g_message("+ new color is [%s]", tmp.toString().c_str()); #endif // DEBUG_LCMS _setProfile( tmp.icc ); //_adjustmentChanged( _fooAdj[0], SP_COLOR_ICC_SELECTOR(_csel) ); setColorAlpha( tmp, _alpha, true ); -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("+_________________"); #endif // DEBUG_LCMS } @@ -605,13 +605,13 @@ void ColorICCSelector::_colorChanged() _updating = TRUE; //sp_color_icc_set_color( SP_COLOR_ICC( _icc ), &color ); -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message( "/^^^^^^^^^ %p::_colorChanged(%08x:%s)", this, _color.toRGBA32(_alpha), ( (_color.icc) ? _color.icc->colorProfile.c_str(): "" ) ); #endif // DEBUG_LCMS -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("FLIPPIES!!!! %p '%s'", _color.icc, (_color.icc ? _color.icc->colorProfile.c_str():"")); #endif // DEBUG_LCMS @@ -642,7 +642,7 @@ void ColorICCSelector::_colorChanged() if ( other != _color.toRGBA32(255) ) { _fixupNeeded = other; gtk_widget_set_sensitive( _fixupBtn, TRUE ); -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("Color needs to change 0x%06x to 0x%06x", _color.toRGBA32(255) >> 8, other >> 8 ); #endif // DEBUG_LCMS } @@ -654,7 +654,7 @@ void ColorICCSelector::_colorChanged() _updating = FALSE; -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message( "\\_________ %p::_colorChanged()", this ); #endif // DEBUG_LCMS } @@ -662,7 +662,7 @@ void ColorICCSelector::_colorChanged() #if ENABLE_LCMS void ColorICCSelector::_setProfile( SVGICCColor* profile ) { -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message( "/^^^^^^^^^ %p::_setProfile(%s)", this, ( (profile) ? profile->colorProfile.c_str() : "") ); @@ -730,7 +730,7 @@ void ColorICCSelector::_setProfile( SVGICCColor* profile ) } } -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message( "\\_________ %p::_setProfile()", this ); #endif // DEBUG_LCMS } @@ -800,7 +800,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC // gtk_adjustment_set_value( adjustment, floor ((adjustment->value) * adjustment->upper + 0.5) ); // } -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message( "/^^^^^^^^^ %p::_adjustmentChanged()", cs ); #endif // DEBUG_LCMS @@ -816,7 +816,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC SPColor newColor( iccSelector->_color ); gfloat scaled = ColorScales::getScaled( iccSelector->_adj ); if ( iccSelector->_adj == adjustment ) { -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("ALPHA"); #endif // DEBUG_LCMS } else { @@ -828,7 +828,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC } } if ( match >= 0 ) { -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message(" channel %d", match ); #endif // DEBUG_LCMS } @@ -852,7 +852,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC guint32 newer = other.toRGBA32(255); if ( prior != newer ) { -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("Transformed color from 0x%08x to 0x%08x", prior, newer ); g_message(" ~~~~ FLIP"); #endif // DEBUG_LCMS @@ -875,7 +875,7 @@ void ColorICCSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorICC iccSelector->_updateSliders( match ); iccSelector->_updating = FALSE; -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message( "\\_________ %p::_adjustmentChanged()", cs ); #endif // DEBUG_LCMS } @@ -900,13 +900,13 @@ void ColorICCSelector::_sliderReleased( SPColorSlider */*slider*/, SPColorICCSel // } } -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS void ColorICCSelector::_sliderChanged( SPColorSlider *slider, SPColorICCSelector *cs ) #else void ColorICCSelector::_sliderChanged( SPColorSlider */*slider*/, SPColorICCSelector */*cs*/ ) #endif // DEBUG_LCMS { -#if 1 //DEBUG_LCMS +#ifdef DEBUG_LCMS g_message("Changed %p and %p", slider, cs ); #endif // DEBUG_LCMS // ColorICCSelector* iccSelector = (ColorICCSelector*)(SP_COLOR_SELECTOR(cs)->base); -- cgit v1.2.3 From 8ef2626fa8bbdf13da2c9fccd9d7b45e4bb0247a Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Sat, 1 Aug 2009 04:01:00 +0000 Subject: enabling all icc-color related debug messages (bzr r8050.1.5) --- src/color-profile.cpp | 11 +++++++++-- src/dropper-context.cpp | 8 ++++++++ src/sp-image.cpp | 11 +++++++++-- src/widgets/sp-color-icc-selector.cpp | 4 ++-- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 20e870242..de9dc6959 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -1,6 +1,6 @@ -//#define DEBUG_LCMS +#define DEBUG_LCMS #include #include @@ -36,7 +36,7 @@ static cmsHPROFILE colorprofile_get_proof_profile_handle(); #ifdef DEBUG_LCMS extern guint update_in_progress; -#define DEBUG_MESSAGE(key, ...) \ +#define DEBUG_MESSAGE_SCISLAC(key, ...) \ {\ Inkscape::Preferences *prefs = Inkscape::Preferences::get();\ bool dump = prefs->getBool(Glib::ustring("/options/scislac/") + #key);\ @@ -62,6 +62,13 @@ extern guint update_in_progress; gtk_widget_show_all( dialog );\ }\ } + + +#define DEBUG_MESSAGE(key, ...)\ +{\ + g_message( __VA_ARGS__ );\ +} + #endif // DEBUG_LCMS static SPObjectClass *cprof_parent_class; diff --git a/src/dropper-context.cpp b/src/dropper-context.cpp index 985e3ac51..5c66eca46 100644 --- a/src/dropper-context.cpp +++ b/src/dropper-context.cpp @@ -137,6 +137,14 @@ static void sp_dropper_context_finish(SPEventContext *ec) } +/** + * Returns the current dropper context icc-color. + */ +SPColor* sp_dropper_context_get_icc_color(SPEventContext *ec) +{ + //TODO: implement-me! +} + /** * Returns the current dropper context color. */ diff --git a/src/sp-image.cpp b/src/sp-image.cpp index 65aad1e2d..f4ab3d9ef 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -51,8 +51,15 @@ #if ENABLE_LCMS #include "color-profile-fns.h" #include "color-profile.h" -//#define DEBUG_LCMS +#define DEBUG_LCMS #ifdef DEBUG_LCMS + + +#define DEBUG_MESSAGE(key, ...)\ +{\ + g_message( __VA_ARGS__ );\ +} + #include "preferences.h" #include #endif // DEBUG_LCMS @@ -105,7 +112,7 @@ extern "C" #ifdef DEBUG_LCMS extern guint update_in_progress; -#define DEBUG_MESSAGE(key, ...) \ +#define DEBUG_MESSAGE_SCISLAC(key, ...) \ {\ Inkscape::Preferences *prefs = Inkscape::Preferences::get();\ bool dump = prefs->getBool("/options/scislac/" #key);\ diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index ae837117a..2872dace0 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -17,12 +17,12 @@ #include "inkscape.h" #include "profile-manager.h" -#define noDEBUG_LCMS +#define DEBUG_LCMS #if ENABLE_LCMS #include "color-profile-fns.h" #include "color-profile.h" -#define DEBUG_LCMS + #ifdef DEBUG_LCMS #include "preferences.h" #include -- cgit v1.2.3 From 21636a2ac8416297222ccb2d11005d4571582d41 Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Tue, 11 Aug 2009 04:22:47 +0000 Subject: adding color management icons to fill&stroke dialog (bzr r8050.1.6) --- share/icons/Makefile.am | 3 +++ share/icons/color-management-icon.png | Bin 0 -> 2720 bytes share/icons/out-of-gamut-icon.png | Bin 0 -> 1016 bytes share/icons/out-of-gamut-icon.svg | 22 ++++++++++++++++++++++ src/widgets/sp-color-notebook.cpp | 18 +++++++++++++++++- 5 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 share/icons/color-management-icon.png create mode 100644 share/icons/out-of-gamut-icon.png create mode 100644 share/icons/out-of-gamut-icon.svg diff --git a/share/icons/Makefile.am b/share/icons/Makefile.am index e39174833..4356365b8 100644 --- a/share/icons/Makefile.am +++ b/share/icons/Makefile.am @@ -1,6 +1,9 @@ iconsdir = $(datadir)/inkscape/icons pixmaps = \ + out-of-gamut-icon.png \ + out-of-gamut-icon.svg \ + color-management-icon.png \ remove-color.png \ remove-color.svg \ ticotico.jpg \ diff --git a/share/icons/color-management-icon.png b/share/icons/color-management-icon.png new file mode 100644 index 000000000..469ccd72a Binary files /dev/null and b/share/icons/color-management-icon.png differ diff --git a/share/icons/out-of-gamut-icon.png b/share/icons/out-of-gamut-icon.png new file mode 100644 index 000000000..1e96a9563 Binary files /dev/null and b/share/icons/out-of-gamut-icon.png differ diff --git a/share/icons/out-of-gamut-icon.svg b/share/icons/out-of-gamut-icon.svg new file mode 100644 index 000000000..4fb171139 --- /dev/null +++ b/share/icons/out-of-gamut-icon.svg @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index 779895de4..58974131e 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -324,9 +324,25 @@ void ColorNotebook::init() row++; - /* Create RGBA entry and color preview */ GtkWidget *rgbabox = gtk_hbox_new (FALSE, 0); + /* Create color management icons */ + GtkWidget *box_colormanaged = gtk_event_box_new (); + GtkWidget *colormanaged = gtk_image_new_from_icon_name ("color-management-icon", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_container_add (GTK_CONTAINER (box_colormanaged), colormanaged); + GtkTooltips *tooltips_colormanaged = gtk_tooltips_new (); + gtk_tooltips_set_tip (tooltips_colormanaged, box_colormanaged, _("Color Managed"), ""); + //gtk_widget_hide (GTK_WIDGET (box_colormanaged)); + gtk_box_pack_start(GTK_BOX(rgbabox), box_colormanaged, TRUE, FALSE, 2); + + GtkWidget *box_outofgamut = gtk_event_box_new (); + GtkWidget *outofgamut = gtk_image_new_from_icon_name ("out-of-gamut-icon", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_container_add (GTK_CONTAINER (box_outofgamut), outofgamut); + GtkTooltips *tooltips_outofgamut = gtk_tooltips_new (); + gtk_tooltips_set_tip (tooltips_outofgamut, box_outofgamut, _("Out of gamut!"), ""); + //gtk_widget_hide (GTK_WIDGET (box_outofgamut)); + gtk_box_pack_start(GTK_BOX(rgbabox), box_outofgamut, TRUE, FALSE, 2); + /* Create RGBA entry and color preview */ _rgbal = gtk_label_new_with_mnemonic (_("RGBA_:")); gtk_misc_set_alignment (GTK_MISC (_rgbal), 1.0, 0.5); gtk_box_pack_start(GTK_BOX(rgbabox), _rgbal, TRUE, TRUE, 2); -- cgit v1.2.3 From 6391c5291f744ab260ad3d2f661eab6d101f6b23 Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Tue, 11 Aug 2009 04:58:32 +0000 Subject: setting sensibility of "color management icon" depending on icc-color usage (bzr r8050.1.7) --- src/widgets/sp-color-notebook.cpp | 23 +++++++++++++---------- src/widgets/sp-color-notebook.h | 1 + 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index 58974131e..44de40115 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -326,21 +326,21 @@ void ColorNotebook::init() GtkWidget *rgbabox = gtk_hbox_new (FALSE, 0); /* Create color management icons */ - GtkWidget *box_colormanaged = gtk_event_box_new (); + _box_colormanaged = gtk_event_box_new (); GtkWidget *colormanaged = gtk_image_new_from_icon_name ("color-management-icon", GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_container_add (GTK_CONTAINER (box_colormanaged), colormanaged); + gtk_container_add (GTK_CONTAINER (_box_colormanaged), colormanaged); GtkTooltips *tooltips_colormanaged = gtk_tooltips_new (); - gtk_tooltips_set_tip (tooltips_colormanaged, box_colormanaged, _("Color Managed"), ""); - //gtk_widget_hide (GTK_WIDGET (box_colormanaged)); - gtk_box_pack_start(GTK_BOX(rgbabox), box_colormanaged, TRUE, FALSE, 2); + gtk_tooltips_set_tip (tooltips_colormanaged, _box_colormanaged, _("Color Managed"), ""); + gtk_widget_set_sensitive (_box_colormanaged, false); + gtk_box_pack_start(GTK_BOX(rgbabox), _box_colormanaged, TRUE, FALSE, 2); - GtkWidget *box_outofgamut = gtk_event_box_new (); + _box_outofgamut = gtk_event_box_new (); GtkWidget *outofgamut = gtk_image_new_from_icon_name ("out-of-gamut-icon", GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_container_add (GTK_CONTAINER (box_outofgamut), outofgamut); + gtk_container_add (GTK_CONTAINER (_box_outofgamut), outofgamut); GtkTooltips *tooltips_outofgamut = gtk_tooltips_new (); - gtk_tooltips_set_tip (tooltips_outofgamut, box_outofgamut, _("Out of gamut!"), ""); - //gtk_widget_hide (GTK_WIDGET (box_outofgamut)); - gtk_box_pack_start(GTK_BOX(rgbabox), box_outofgamut, TRUE, FALSE, 2); + gtk_tooltips_set_tip (tooltips_outofgamut, _box_outofgamut, _("Out of gamut!"), ""); + gtk_widget_set_sensitive (_box_outofgamut, false); + gtk_box_pack_start(GTK_BOX(rgbabox), _box_outofgamut, TRUE, FALSE, 2); /* Create RGBA entry and color preview */ _rgbal = gtk_label_new_with_mnemonic (_("RGBA_:")); @@ -500,6 +500,9 @@ void ColorNotebook::_rgbaEntryChanged(GtkEntry* entry) void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha ) { g_return_if_fail( ( 0.0 <= alpha ) && ( alpha <= 1.0 ) ); + + /* update color management icon*/ + gtk_widget_set_sensitive (_box_colormanaged, color.icc != NULL); if ( !_updatingrgba ) { diff --git a/src/widgets/sp-color-notebook.h b/src/widgets/sp-color-notebook.h index bf6fb1002..c9ab29798 100644 --- a/src/widgets/sp-color-notebook.h +++ b/src/widgets/sp-color-notebook.h @@ -61,6 +61,7 @@ protected: gulong _entryId; GtkWidget *_book; GtkWidget *_rgbal, *_rgbae; /* RGBA entry */ + GtkWidget *_box_outofgamut, *_box_colormanaged; GtkWidget *_p; /* Color preview */ GtkWidget *_btn; GtkWidget *_popup; -- cgit v1.2.3 From b7477cae10caca6d9a7ee8156f5e194a1458d3a2 Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Thu, 13 Aug 2009 04:03:19 +0000 Subject: preserve icc on color wheel selector (bzr r8050.1.8) --- src/widgets/sp-color-wheel-selector.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/widgets/sp-color-wheel-selector.cpp b/src/widgets/sp-color-wheel-selector.cpp index 174b071f9..bc8c4763b 100644 --- a/src/widgets/sp-color-wheel-selector.cpp +++ b/src/widgets/sp-color-wheel-selector.cpp @@ -10,7 +10,8 @@ #include "../dialogs/dialog-events.h" #include "sp-color-wheel-selector.h" #include "sp-color-scales.h" - +#include "sp-color-icc-selector.h" +#include "../svg/svg-icc-color.h" G_BEGIN_DECLS @@ -237,6 +238,10 @@ void ColorWheelSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorW wheelSelector->_updating = TRUE; + /* Preserve ICC color */ + ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); + wheelSelector->_color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; + wheelSelector->_updateInternals( wheelSelector->_color, ColorScales::getScaled( wheelSelector->_adj ), wheelSelector->_dragging ); wheelSelector->_updating = FALSE; @@ -249,6 +254,11 @@ void ColorWheelSelector::_sliderGrabbed( SPColorSlider *slider, SPColorWheelSele if (!wheelSelector->_dragging) { wheelSelector->_dragging = TRUE; wheelSelector->_grabbed(); + + /* Preserve ICC color */ + ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); + wheelSelector->_color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; + wheelSelector->_updateInternals( wheelSelector->_color, ColorScales::getScaled( wheelSelector->_adj ), wheelSelector->_dragging ); } } @@ -260,6 +270,11 @@ void ColorWheelSelector::_sliderReleased( SPColorSlider *slider, SPColorWheelSel if (wheelSelector->_dragging) { wheelSelector->_dragging = FALSE; wheelSelector->_released(); + + /* Preserve ICC color */ + ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); + wheelSelector->_color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; + wheelSelector->_updateInternals( wheelSelector->_color, ColorScales::getScaled( wheelSelector->_adj ), wheelSelector->_dragging ); } } @@ -269,6 +284,10 @@ void ColorWheelSelector::_sliderChanged( SPColorSlider *slider, SPColorWheelSele (void)slider; ColorWheelSelector* wheelSelector = (ColorWheelSelector*)(SP_COLOR_SELECTOR(cs)->base); + /* Preserve ICC color */ + ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); + wheelSelector->_color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; + wheelSelector->_updateInternals( wheelSelector->_color, ColorScales::getScaled( wheelSelector->_adj ), wheelSelector->_dragging ); } @@ -285,6 +304,10 @@ void ColorWheelSelector::_wheelChanged( SPColorWheel *wheel, SPColorWheelSelecto sp_color_slider_set_colors (SP_COLOR_SLIDER(wheelSelector->_slider), start, mid, end); + /* Preserve ICC color */ + ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); + color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; + wheelSelector->_updateInternals( color, wheelSelector->_alpha, sp_color_wheel_is_adjusting( wheel ) ); } -- cgit v1.2.3 From c8840f1663769367b52c25af12df2cd7032a69d9 Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Fri, 14 Aug 2009 03:33:33 +0000 Subject: use a function instead of copy-pasting code (bzr r8050.1.9) --- src/widgets/sp-color-wheel-selector.cpp | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/src/widgets/sp-color-wheel-selector.cpp b/src/widgets/sp-color-wheel-selector.cpp index bc8c4763b..6012f4e20 100644 --- a/src/widgets/sp-color-wheel-selector.cpp +++ b/src/widgets/sp-color-wheel-selector.cpp @@ -206,6 +206,11 @@ sp_color_wheel_selector_new (void) /* Helpers for setting color value */ +static void preserve_icc(SPColor *color, SPColorWheelSelector *cs){ + ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); + color->icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; +} + void ColorWheelSelector::_colorChanged() { #ifdef DUMP_CHANGE_INFO @@ -238,10 +243,7 @@ void ColorWheelSelector::_adjustmentChanged( GtkAdjustment *adjustment, SPColorW wheelSelector->_updating = TRUE; - /* Preserve ICC color */ - ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); - wheelSelector->_color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; - + preserve_icc(&wheelSelector->_color, cs); wheelSelector->_updateInternals( wheelSelector->_color, ColorScales::getScaled( wheelSelector->_adj ), wheelSelector->_dragging ); wheelSelector->_updating = FALSE; @@ -255,10 +257,7 @@ void ColorWheelSelector::_sliderGrabbed( SPColorSlider *slider, SPColorWheelSele wheelSelector->_dragging = TRUE; wheelSelector->_grabbed(); - /* Preserve ICC color */ - ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); - wheelSelector->_color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; - + preserve_icc(&wheelSelector->_color, cs); wheelSelector->_updateInternals( wheelSelector->_color, ColorScales::getScaled( wheelSelector->_adj ), wheelSelector->_dragging ); } } @@ -271,10 +270,7 @@ void ColorWheelSelector::_sliderReleased( SPColorSlider *slider, SPColorWheelSel wheelSelector->_dragging = FALSE; wheelSelector->_released(); - /* Preserve ICC color */ - ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); - wheelSelector->_color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; - + preserve_icc(&wheelSelector->_color, cs); wheelSelector->_updateInternals( wheelSelector->_color, ColorScales::getScaled( wheelSelector->_adj ), wheelSelector->_dragging ); } } @@ -284,10 +280,7 @@ void ColorWheelSelector::_sliderChanged( SPColorSlider *slider, SPColorWheelSele (void)slider; ColorWheelSelector* wheelSelector = (ColorWheelSelector*)(SP_COLOR_SELECTOR(cs)->base); - /* Preserve ICC color */ - ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); - wheelSelector->_color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; - + preserve_icc(&wheelSelector->_color, cs); wheelSelector->_updateInternals( wheelSelector->_color, ColorScales::getScaled( wheelSelector->_adj ), wheelSelector->_dragging ); } @@ -304,10 +297,7 @@ void ColorWheelSelector::_wheelChanged( SPColorWheel *wheel, SPColorWheelSelecto sp_color_slider_set_colors (SP_COLOR_SLIDER(wheelSelector->_slider), start, mid, end); - /* Preserve ICC color */ - ColorSelector* selector = (ColorSelector*)(SP_COLOR_SELECTOR(cs)->base); - color.icc = selector->getColor().icc ? new SVGICCColor(*selector->getColor().icc) : 0; - + preserve_icc(&color, cs); wheelSelector->_updateInternals( color, wheelSelector->_alpha, sp_color_wheel_is_adjusting( wheel ) ); } -- cgit v1.2.3 From 048b095b6031adf91a6dc2fb300270f78ca44cbf Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Fri, 14 Aug 2009 03:52:51 +0000 Subject: a quick workaround in order to avoid some invalid names for icc profiles. A complete sanitizer should be implemented later. (bzr r8050.1.10) --- src/ui/dialog/document-properties.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index bb9ab4d02..c21f64629 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -381,6 +381,17 @@ DocumentProperties::populate_available_profiles(){ _menu.show_all(); } +//this is a quick workaround: +static gchar* sanitize_name(gchar* name){ + gchar* c=name; + while (*c != '\0'){ + if (*c == ' ') *c = '-'; + if (*c == '_') *c = '-'; + c++; + } + return name; +} + void DocumentProperties::linkSelectedProfile() { @@ -396,7 +407,8 @@ DocumentProperties::linkSelectedProfile() } Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc()); Inkscape::XML::Node *cprofRepr = xml_doc->createElement("svg:color-profile"); - cprofRepr->setAttribute("name", (gchar*) _menu.get_active()->get_data("name")); +// cprofRepr->setAttribute("inkscape:name", (gchar*) _menu.get_active()->get_data("name")); + cprofRepr->setAttribute("name", sanitize_name((gchar*) _menu.get_active()->get_data("name"))); cprofRepr->setAttribute("xlink:href", (gchar*) _menu.get_active()->get_data("filepath")); // Checks whether there is a defs element. Creates it when needed -- cgit v1.2.3 From 61ed908098ec4a07eae3308920111522a555c60a Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Fri, 14 Aug 2009 04:21:17 +0000 Subject: preserving icc colors in all tabs of fill&stroke (bzr r8050.1.11) --- src/widgets/sp-color-scales.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/widgets/sp-color-scales.cpp b/src/widgets/sp-color-scales.cpp index cf06247e7..a09a3a2ed 100644 --- a/src/widgets/sp-color-scales.cpp +++ b/src/widgets/sp-color-scales.cpp @@ -10,6 +10,7 @@ #include #include "../dialogs/dialog-events.h" #include "sp-color-scales.h" +#include "svg/svg-icc-color.h" #define CSC_CHANNEL_R (1 << 0) #define CSC_CHANNEL_G (1 << 1) @@ -241,6 +242,10 @@ void ColorScales::_recalcColor( gboolean changing ) g_warning ("file %s: line %d: Illegal color selector mode %d", __FILE__, __LINE__, _mode); break; } + + /* Preserve ICC */ + color.icc = _color.icc ? new SVGICCColor(*_color.icc) : 0; + _updateInternals( color, alpha, _dragging ); } else -- cgit v1.2.3 From dd9b154edc3ee479a3932ae051498389e331812e Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Fri, 14 Aug 2009 06:34:14 +0000 Subject: Initial draft of the out-of-gamut check. It is not working yet. I will continue work on it tomorrow. (bzr r8050.1.12) --- src/widgets/sp-color-notebook.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index 44de40115..5eb44c2cb 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -32,6 +32,10 @@ #include "sp-color-scales.h" #include "sp-color-icc-selector.h" #include "sp-color-wheel-selector.h" +#include "svg/svg-icc-color.h" +#include "../inkscape.h" +#include "../document.h" +#include "../profile-manager.h" struct SPColorNotebookTracker { const gchar* name; @@ -504,6 +508,35 @@ void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha ) /* update color management icon*/ gtk_widget_set_sensitive (_box_colormanaged, color.icc != NULL); + /* update out-of-gamut icon */ + gtk_widget_set_sensitive (_box_outofgamut, false); + if (color.icc){ + BYTE outofgamut; + cmsSetAlarmCodes(255, 255, 255); + static cmsHPROFILE hNULL = cmsCreateNULLProfile(); + static cmsHPROFILE hsRGB = cmsCreate_sRGBProfile(); + + cmsHTRANSFORM trans; + Inkscape::ColorProfile* target_profile = SP_ACTIVE_DOCUMENT->profileManager->find(color.icc->colorProfile.c_str()); + if ( target_profile ) { + trans = cmsCreateProofingTransform(hsRGB, TYPE_RGB_DBL, hNULL, TYPE_GRAY_8, target_profile->profHandle, + INTENT_RELATIVE_COLORIMETRIC, INTENT_RELATIVE_COLORIMETRIC, (cmsFLAGS_GAMUTCHECK|cmsFLAGS_SOFTPROOFING)); + + if ( trans ) { + guint32 val = color.toRGBA32(0); + guchar check_color[4] = { + SP_RGBA32_R_U(val), + SP_RGBA32_G_U(val), + SP_RGBA32_B_U(val), + 255}; + + cmsDoTransform(trans, &check_color, &outofgamut, 1); + gtk_widget_set_sensitive (_box_outofgamut, outofgamut == 255); + } + } + } + + if ( !_updatingrgba ) { gchar s[32]; -- cgit v1.2.3 From ffbf2cca9e54383050bf9bdfbef82ec4b8ccd0ad Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Sat, 15 Aug 2009 05:25:49 +0000 Subject: refactoring ICC out-of-gamut check (bzr r8050.1.13) --- src/widgets/sp-color-notebook.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index 5eb44c2cb..52c78ba42 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -511,15 +511,13 @@ void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha ) /* update out-of-gamut icon */ gtk_widget_set_sensitive (_box_outofgamut, false); if (color.icc){ - BYTE outofgamut; - cmsSetAlarmCodes(255, 255, 255); + BYTE outofgamut = 0; static cmsHPROFILE hNULL = cmsCreateNULLProfile(); static cmsHPROFILE hsRGB = cmsCreate_sRGBProfile(); - cmsHTRANSFORM trans; Inkscape::ColorProfile* target_profile = SP_ACTIVE_DOCUMENT->profileManager->find(color.icc->colorProfile.c_str()); if ( target_profile ) { - trans = cmsCreateProofingTransform(hsRGB, TYPE_RGB_DBL, hNULL, TYPE_GRAY_8, target_profile->profHandle, + cmsHTRANSFORM trans = cmsCreateProofingTransform(hsRGB, TYPE_RGBA_8, hNULL, TYPE_GRAY_8, target_profile->profHandle, INTENT_RELATIVE_COLORIMETRIC, INTENT_RELATIVE_COLORIMETRIC, (cmsFLAGS_GAMUTCHECK|cmsFLAGS_SOFTPROOFING)); if ( trans ) { @@ -530,7 +528,11 @@ void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha ) SP_RGBA32_B_U(val), 255}; + int alarm_r, alarm_g, alarm_b; + cmsGetAlarmCodes(&alarm_r, &alarm_g, &alarm_b); + cmsSetAlarmCodes(255, 255, 255); cmsDoTransform(trans, &check_color, &outofgamut, 1); + cmsSetAlarmCodes(alarm_r, alarm_g, alarm_b); gtk_widget_set_sensitive (_box_outofgamut, outofgamut == 255); } } -- cgit v1.2.3 From db87667df0c9068024267a4de6137487904048f2 Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Sat, 15 Aug 2009 05:59:15 +0000 Subject: now gamut check works! (bzr r8050.1.14) --- src/color-profile.cpp | 41 +++++++++++++++++++++++++++++++++++++++ src/color-profile.h | 6 ++++++ src/widgets/sp-color-notebook.cpp | 26 ++----------------------- 3 files changed, 49 insertions(+), 24 deletions(-) diff --git a/src/color-profile.cpp b/src/color-profile.cpp index de9dc6959..5f2364449 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -13,6 +13,7 @@ #include #include #include "xml/repr.h" +#include "color.h" #include "color-profile.h" #include "color-profile-fns.h" #include "attributes.h" @@ -84,6 +85,15 @@ cmsHPROFILE ColorProfile::getSRGBProfile() { return _sRGBProf; } +cmsHPROFILE ColorProfile::_NullProf = 0; + +cmsHPROFILE ColorProfile::getNULLProfile() { + if ( !_NullProf ) { + _NullProf = cmsCreateNULLProfile(); + } + return _NullProf; +} + #endif // ENABLE_LCMS /** @@ -144,6 +154,7 @@ void ColorProfile::init( ColorProfile *cprof ) cprof->_profileSpace = icSigRgbData; cprof->_transf = 0; cprof->_revTransf = 0; + cprof->_gamutTransf = 0; #endif // ENABLE_LCMS } @@ -197,6 +208,10 @@ void ColorProfile::_clearProfile() cmsDeleteTransform( _revTransf ); _revTransf = 0; } + if ( _gamutTransf ) { + cmsDeleteTransform( _gamutTransf ); + _gamutTransf = 0; + } if ( profHandle ) { cmsCloseProfile( profHandle ); profHandle = 0; @@ -496,6 +511,32 @@ cmsHTRANSFORM ColorProfile::getTransfFromSRGB8() return _revTransf; } +cmsHTRANSFORM ColorProfile::getTransfGamutCheck() +{ + if ( !_gamutTransf ) { + _gamutTransf = cmsCreateProofingTransform(getSRGBProfile(), TYPE_RGBA_8, getNULLProfile(), TYPE_GRAY_8, profHandle, INTENT_RELATIVE_COLORIMETRIC, INTENT_RELATIVE_COLORIMETRIC, (cmsFLAGS_GAMUTCHECK|cmsFLAGS_SOFTPROOFING)); + } + return _gamutTransf; +} + +bool ColorProfile::GamutCheck(SPColor color){ + BYTE outofgamut = 0; + + guint32 val = color.toRGBA32(0); + guchar check_color[4] = { + SP_RGBA32_R_U(val), + SP_RGBA32_G_U(val), + SP_RGBA32_B_U(val), + 255}; + + int alarm_r, alarm_g, alarm_b; + cmsGetAlarmCodes(&alarm_r, &alarm_g, &alarm_b); + cmsSetAlarmCodes(255, 255, 255); + cmsDoTransform(ColorProfile::getTransfGamutCheck(), &check_color, &outofgamut, 1); + cmsSetAlarmCodes(alarm_r, alarm_g, alarm_b); + return (outofgamut == 255); +} + #include diff --git a/src/color-profile.h b/src/color-profile.h index 2e57e7ef0..40d0d7698 100644 --- a/src/color-profile.h +++ b/src/color-profile.h @@ -36,11 +36,15 @@ struct ColorProfile : public SPObject { static std::list getProfileDirs(); #if ENABLE_LCMS static cmsHPROFILE getSRGBProfile(); + static cmsHPROFILE getNULLProfile(); icColorSpaceSignature getColorSpace() const {return _profileSpace;} icProfileClassSignature getProfileClass() const {return _profileClass;} cmsHTRANSFORM getTransfToSRGB8(); cmsHTRANSFORM getTransfFromSRGB8(); + cmsHTRANSFORM getTransfGamutCheck(); + bool GamutCheck(SPColor color); + #endif // ENABLE_LCMS gchar* href; @@ -64,11 +68,13 @@ private: void _clearProfile(); static cmsHPROFILE _sRGBProf; + static cmsHPROFILE _NullProf; icProfileClassSignature _profileClass; icColorSpaceSignature _profileSpace; cmsHTRANSFORM _transf; cmsHTRANSFORM _revTransf; + cmsHTRANSFORM _gamutTransf; #endif // ENABLE_LCMS }; diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index 52c78ba42..04a35e4ad 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -511,31 +511,9 @@ void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha ) /* update out-of-gamut icon */ gtk_widget_set_sensitive (_box_outofgamut, false); if (color.icc){ - BYTE outofgamut = 0; - static cmsHPROFILE hNULL = cmsCreateNULLProfile(); - static cmsHPROFILE hsRGB = cmsCreate_sRGBProfile(); - Inkscape::ColorProfile* target_profile = SP_ACTIVE_DOCUMENT->profileManager->find(color.icc->colorProfile.c_str()); - if ( target_profile ) { - cmsHTRANSFORM trans = cmsCreateProofingTransform(hsRGB, TYPE_RGBA_8, hNULL, TYPE_GRAY_8, target_profile->profHandle, - INTENT_RELATIVE_COLORIMETRIC, INTENT_RELATIVE_COLORIMETRIC, (cmsFLAGS_GAMUTCHECK|cmsFLAGS_SOFTPROOFING)); - - if ( trans ) { - guint32 val = color.toRGBA32(0); - guchar check_color[4] = { - SP_RGBA32_R_U(val), - SP_RGBA32_G_U(val), - SP_RGBA32_B_U(val), - 255}; - - int alarm_r, alarm_g, alarm_b; - cmsGetAlarmCodes(&alarm_r, &alarm_g, &alarm_b); - cmsSetAlarmCodes(255, 255, 255); - cmsDoTransform(trans, &check_color, &outofgamut, 1); - cmsSetAlarmCodes(alarm_r, alarm_g, alarm_b); - gtk_widget_set_sensitive (_box_outofgamut, outofgamut == 255); - } - } + if ( target_profile ) + gtk_widget_set_sensitive (_box_outofgamut, target_profile->GamutCheck(color)); } -- cgit v1.2.3 From d27412532cd40717abd78e0b14e9cfc45dd0a4be Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Mon, 17 Aug 2009 20:56:03 +0000 Subject: adding iffdefs for LCMS and fixing layout of CMS icons (bzr r8050.1.15) --- src/widgets/sp-color-notebook.cpp | 15 ++++++++++----- src/widgets/sp-color-notebook.h | 2 ++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index 04a35e4ad..be41f5f0f 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -329,6 +329,8 @@ void ColorNotebook::init() row++; GtkWidget *rgbabox = gtk_hbox_new (FALSE, 0); + +#if ENABLE_LCMS /* Create color management icons */ _box_colormanaged = gtk_event_box_new (); GtkWidget *colormanaged = gtk_image_new_from_icon_name ("color-management-icon", GTK_ICON_SIZE_SMALL_TOOLBAR); @@ -336,7 +338,7 @@ void ColorNotebook::init() GtkTooltips *tooltips_colormanaged = gtk_tooltips_new (); gtk_tooltips_set_tip (tooltips_colormanaged, _box_colormanaged, _("Color Managed"), ""); gtk_widget_set_sensitive (_box_colormanaged, false); - gtk_box_pack_start(GTK_BOX(rgbabox), _box_colormanaged, TRUE, FALSE, 2); + gtk_box_pack_start(GTK_BOX(rgbabox), _box_colormanaged, FALSE, FALSE, 2); _box_outofgamut = gtk_event_box_new (); GtkWidget *outofgamut = gtk_image_new_from_icon_name ("out-of-gamut-icon", GTK_ICON_SIZE_SMALL_TOOLBAR); @@ -344,7 +346,9 @@ void ColorNotebook::init() GtkTooltips *tooltips_outofgamut = gtk_tooltips_new (); gtk_tooltips_set_tip (tooltips_outofgamut, _box_outofgamut, _("Out of gamut!"), ""); gtk_widget_set_sensitive (_box_outofgamut, false); - gtk_box_pack_start(GTK_BOX(rgbabox), _box_outofgamut, TRUE, FALSE, 2); + gtk_box_pack_start(GTK_BOX(rgbabox), _box_outofgamut, FALSE, FALSE, 2); + +#endif //ENABLE_LCMS /* Create RGBA entry and color preview */ _rgbal = gtk_label_new_with_mnemonic (_("RGBA_:")); @@ -361,7 +365,7 @@ void ColorNotebook::init() sp_set_font_size_smaller (rgbabox); gtk_widget_show_all (rgbabox); - gtk_table_attach (GTK_TABLE (table), rgbabox, 1, 2, row, row + 1, GTK_FILL, GTK_SHRINK, XPAD, YPAD); + gtk_table_attach (GTK_TABLE (table), rgbabox, 0, 2, row, row + 1, GTK_FILL, GTK_SHRINK, XPAD, YPAD); #ifdef SPCS_PREVIEW _p = sp_color_preview_new (0xffffffff); @@ -504,7 +508,8 @@ void ColorNotebook::_rgbaEntryChanged(GtkEntry* entry) void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha ) { g_return_if_fail( ( 0.0 <= alpha ) && ( alpha <= 1.0 ) ); - + +#if ENABLE_LCMS /* update color management icon*/ gtk_widget_set_sensitive (_box_colormanaged, color.icc != NULL); @@ -515,7 +520,7 @@ void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha ) if ( target_profile ) gtk_widget_set_sensitive (_box_outofgamut, target_profile->GamutCheck(color)); } - +#endif //ENABLE_LCMS if ( !_updatingrgba ) { diff --git a/src/widgets/sp-color-notebook.h b/src/widgets/sp-color-notebook.h index c9ab29798..b7cd8295f 100644 --- a/src/widgets/sp-color-notebook.h +++ b/src/widgets/sp-color-notebook.h @@ -61,7 +61,9 @@ protected: gulong _entryId; GtkWidget *_book; GtkWidget *_rgbal, *_rgbae; /* RGBA entry */ +#if ENABLE_LCMS GtkWidget *_box_outofgamut, *_box_colormanaged; +#endif //ENABLE_LCMS GtkWidget *_p; /* Color preview */ GtkWidget *_btn; GtkWidget *_popup; -- cgit v1.2.3 -- cgit v1.2.3 From db07b2c21c8558866713ff8c81629741955283d5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 16 Nov 2009 20:42:17 +0000 Subject: Marking the tests as failing. (bzr r8833.1.2) --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 63b27398a..30d1e5f42 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -266,7 +266,7 @@ check_PROGRAMS = cxxtests # List of all tests to be run. TESTS = $(check_PROGRAMS) ../share/extensions/test/run-all-extension-tests -# XFAIL_TESTS = $(check_PROGRAMS) ../share/extensions/test/run-all-extension-tests +XFAIL_TESTS = $(check_PROGRAMS) ../share/extensions/test/run-all-extension-tests # including the the testsuites here ensures that they get distributed cxxtests_SOURCES = cxxtests.cpp libnr/nr-compose-reference.cpp $(CXXTEST_TESTSUITES) -- cgit v1.2.3 From e24a9858ba3a9c1c5513003d4d6e323d494c5334 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 16 Nov 2009 20:45:08 +0000 Subject: Removing uninstalled .c files for distcheck to know that it doesn't need translations in them. (bzr r8833.1.3) --- po/POTFILES.skip | 2 ++ 1 file changed, 2 insertions(+) diff --git a/po/POTFILES.skip b/po/POTFILES.skip index 1aaf436dc..172578154 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -20,10 +20,12 @@ src/live_effects/lpe-path_length.cpp src/live_effects/lpe-perp_bisector.cpp src/live_effects/lpe-perspective_path.cpp src/live_effects/lpe-recursiveskeleton.cpp +src/live_effects/lpe-skeleton.cpp src/live_effects/lpe-tangent_to_curve.cpp src/live_effects/lpe-test-doEffect-stack.cpp src/live_effects/lpe-text_label.cpp src/lpe-tool-context.cpp +src/ui/dialog/session-player.cpp src/ui/dialog/whiteboard-connect.cpp src/ui/dialog/whiteboard-sharewithchat.cpp src/ui/dialog/whiteboard-sharewithuser.cpp -- cgit v1.2.3 From ea686ea84de176e51eacf663998c48be14d9f002 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 16 Nov 2009 20:46:22 +0000 Subject: Setting version number to 0.47 (bzr r8833.1.4) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fbfa2e5df..c5a7fc444 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ AC_PREREQ(2.53) # `dpkg --compare-versions'. (ii) We don't always know what the next # version is going to be called until about the time we release it # (whereas we always know what the previous version was called). -AC_INIT(inkscape, 0.46+devel) +AC_INIT(inkscape, 0.47) AC_CANONICAL_HOST AC_CONFIG_SRCDIR([src/main.cpp]) -- cgit v1.2.3 From f65a1879ca67c43e7c96efadbae3759218212a2a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 16 Nov 2009 20:49:57 +0000 Subject: Removing protable.7z as it's not in the archive. (bzr r8833.1.5) --- Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 2d3b8f004..930bfa48b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -185,7 +185,6 @@ EXTRA_DIST = \ packaging/win32/welcomefinish.bmp \ packaging/win32/welcomefinish.svg \ packaging/win32/portable/help.html \ - packaging/win32/portable/portable.7z \ packaging/win32/portable/readme.packaging.txt \ packaging/win32/portable/App/readme.txt \ packaging/win32/portable/App/AppInfo/appicon.ico \ -- cgit v1.2.3 From 51fe4c1b181c7e189dc5e5ea741ad793f42426a3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 17 Nov 2009 20:56:20 +0000 Subject: Patch from trunk (bzr r8833.1.6) --- share/extensions/gimp_xcf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/extensions/gimp_xcf.py b/share/extensions/gimp_xcf.py index 121cb360d..22e45006b 100755 --- a/share/extensions/gimp_xcf.py +++ b/share/extensions/gimp_xcf.py @@ -86,7 +86,7 @@ class MyEffect(inkex.Effect): gridSpacingFunc = '(gimp-image-grid-set-spacing img %s %s)' % (spacingX[:-2], spacingY[:-2]) gridOriginFunc = '(gimp-image-grid-set-offset img %s %s)'% (originX[:-2], originY[:-2]) - area = '--export-area-canvas' + area = '--export-area-page' pngs = [] names = [] path = "/svg:svg/*[name()='g' or @style][@id]" -- cgit v1.2.3 From 783e01c1a4cb7ff88720d7303e21cfca11852627 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sat, 21 Nov 2009 04:05:26 +0000 Subject: Grabbing news from the wiki (bzr r8833.1.7) --- NEWS | 1484 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1483 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index e919c7486..2b9cc5c3d 100644 --- a/NEWS +++ b/NEWS @@ -1 +1,1483 @@ -Inkscape 0.47 pre-release. More here later. +Inkscape 0.47 + +Inkscape 0.47 brings a host of important improvements all across the program: + + • Timed autosave: no more lost work + + • Spiro splines: an exciting new way to work with paths, fully supported in + Pen, Pencil, and Node tools + + • Auto smooth nodes: a new type of node that keeps the path as smooth as + possible as you move it or its neighbors + + • New modes in Tweak tool: pushing and jittering whole objects, scaling/ + rotating objects, deleting and duplicating using the "soft brush" + + • Reworked, much more usable snapping system and a Snapping toolbar + + • New path effects, including sketch, hatching, envelope deformation; effects + can be stacked and assigned to groups + + • A huge collection of preset filters in the new Filters menu + + • New cairo-based PS and EPS export: improved quality, more features + supported, fallback rasterization for filters and transparency + + • Spell checker for text objects in a document + + • Many new extensions: restacking, calendar, printing marks, cartesian and + polar grids, interpolating attributes + + • Optimized SVG code options, now with their own Preferences page + + • Many other improvements, usability tweaks, memleak stops, and misc bugfixes + +Refactoring effort + +The focus of the 0.47 release was to clean up legacy code and push forward the +migration to clean object-oriented C++. The goal of this effort was to increase +reliability and maintainability of Inkscape. In the long run, it will mean +fewer bugs and more new features, because it will be easier to develop and find +bugs in Inkscape. + +Migration to lib2geom + +Many parts of the code have been changed to use the 2geom library for +geometrical calculations instead of the old libnr and livarot libraries. + +Preferences + +Instead of global functions directly manipulating an XML document, the +preferences API is now exposed through the Inkscape::Preferences singleton. It +abstracts away the way the preferences are stored in memory. In the future it +may allow for different user settings storage backends (like GConf or the +upcoming dconf on GNOME desktops or .plist files on OS X). Previously, Inkscape +directly manipulated an internal XML document. + +The Preferences directory has been moved on Linux (and Mac OS X) from ~ +/.inkscape to ~/.config/inkscape to better conform to Linux desktop standards. + +Tools + +Node tool + + • In previous versions of Inkscape, no visual feedback was given back to the + user when hovering over paths when using the Node tool. In this update, + hovering over a path with the Node tool now results in a highlighted path + outline being displayed. Note: the duration and color of the new path + outline feature can be configured in the Tools > Node section of the + Inkscape Preferences dialog. + + • The Node tool can now edit clipping paths and masks of objects on canvas, + without releasing them. If the selected object has a clipping path and + mask, the corresponding buttons on the controls bar of the tool will be + enabled; pressing these buttons will display the editable paths or handles + of the clippath or mask. A clipping path is stroked green, a mask is + stroked blue (the same colors as those used for them in Outline mode). + + • Snapping has been improved (more details in Snapping below). + + • When dragging a node handle with Ctrl pressed, it now snaps not only to the + 15 degree increments starting from 0 and to the original handle direction, + but also to the direction of the opposite handle (if it exists) or of the + opposite line segment (if it is a straight line). + + • The behavior of the buttons/shortcuts that make a node smooth or cusp has + been improved: + □ If a node is already a cusp (diamond shaped), pressing Shift+C again on + it will retract both its handles. As this works for any number of + selected nodes, you can always retract all handles in all nodes by + selecting all nodes and pressing Shift+C twice. + □ If a non-smooth node is next to a straight line segment, pressing + Shift+S once makes it half-smooth: it now has one handle aligned with + that line segment. Another press of Shift+S will expand the second + handle as well turning it into a full smooth node. If a node is between + two curve segments, Shift+S will expand both handles as before. + + • Auto smooth nodes: this is a new node type, similar to the one Xara Xtreme + has. An auto node is a smooth node which automatically adjusts (rotates and + stretches) its handles when this node or its neighbors are moved. This + adjustment (same as what you get when you convert node type to Smooth, but + continuous) keeps the curve at this node as smooth as possible. It feels a + bit like Spiro paths (see below); although not as smooth as a Spiro, auto + nodes may often be preferable as they work without applying any path + effect. Whenever you manually adjust the handles of an auto node or drag + the adjacent curve, the node loses its auto state and becomes simply + smooth; for this reason, it is recommended to edit smooth nodes with the + node handles hidden via a toggle button on the Node tool controls bar. Auto + nodes are represented by little circles, as opposed to smooth/symmetric + nodes (squares) and cusp nodes (diamonds). To convert selected node(s) to + auto, press Shift+A or use the corresponding node type button on the + controls bar. + +Tweak tool + +Several new modes are added to the Tweak tool for transforming, duplicating, +and deleting selected objects using the same "soft brush" metaphor that the +path editing and coloring modes use. Using these new modes, it is easy to +"sculpt" scatterings of small objects, such as clone tilings, into complex and +naturalistic textures. + + • Push mode moves those selected objects that are under the brush in the + direction in which you move the brush. This is similar to the Push path + mode, except that the Move mode affects entire objects and not parts of the + paths under the brush. + + • Attract/Repel Objects mode moves those selected objects that are under the + brush towards the cursor (default) or away from cursor (with Shift + pressed). This is similar to the Attract/repel path mode, except that the + Move in/out mode affects entire objects and not parts of the paths under + cursor. + + • Jitter mode moves those selected objects that are under the brush in random + directions and by random amounts, but the overall amount of movement + depends on Force, pen pressure (if you're using a tablet pen), on the + closeness of the object to the center of brush, and on how long you apply + the brush. + + • Scale mode scales those selected objects that are under the brush down (by + default) or up (with Shift pressed). The speed of scaling depends on Force, + pen pressure (if you're using a tablet pen), on the closeness of the object + to the center of brush, and on how long you apply the brush. + + • Rotate mode rotates those selected objects that are under the brush + clockwise (by default) or counterclockwise (with Shift pressed). The speed + of rotation depends on Force, pen pressure (if you're using a tablet pen), + on the closeness of the object to the center of brush, and on how long you + apply the brush. + + • Duplicate/delete mode randomly duplicates those selected objects that are + under the brush (by default) or deletes them (with Shift pressed). The + chance of an object to be duplicated and deleted depends on Force, pen + pressure (if you're using a tablet pen), on the closeness of the object to + the center of brush, and on how long you apply the brush. Like with the + regular Duplicate command, duplicating with Tweak tool places the copies + right over the originals, and you may need to use the Jitter mode to ruffle + them apart. The duplicates created by the tool are automatically added to + selection if the originals objects were in selection (e.g. if you're + tweaking a group of objects, they are duplicated within that group and are + not by themselves selected). + + • Blur mode blurs the selected objects under the brush more (by default) or + less (with Shift pressed). The amount of blur added or removed depends on + Force, pen pressure (if you're using a tablet pen), on the closeness of the + object to the center of brush, and on how long you apply the brush. + +Also, the existing path editing modes of the tool have been rearranged: now +Shrink and Grow are one mode (shrinks by default, grows with Shift), and +Attract and Repel are one mode (attracts by default, repels with Shift). Here +is a complete list of modes and shortcuts of the Tweak tool: + +Shift+m, Shift+0 move mode +Shift+i, Shift+1 attract/repel objects mode +Shift+z, Shift+2 jitter mode +Shift+<, Shift+>, Shift+3 scale mode +Shift+[, Shift+], Shift+4 rotate mode +Shift+d, Shift+5 duplicate/delete mode +Shift+p, Shift+6 push path mode +Shift+s, Shift+7 shrink/grow path mode +Shift+a, Shift+8 attract/repel path mode +Shift+r, Shift+9 roughen mode +Shift+c paint mode +Shift+j color jitter mode +Shift+b blur mode + +In Paint mode, painting with Shift inverts the color you're applying (e.g. when +painting with yellow, Shift will switch the applied color to blue). + +Calligraphy tool + + • The tool's settings can now be set from a preset (see the drop-down list in + the controls bar). Several presets are provided that imitate various + drawing implements and styles. + + • When drawing with Alt pressed, Inkscape subtracts the new path you are + creating from the selected path. With Shift, it unions the new path with + the selected path. This allows you to quickly patch or erase defects in a + stroke you have drawn, without leaving the tool. + + • The behavior of the tool when tracking a guide (drawing with Ctrl) has been + improved: + + □ The initial "jerk" when you start drawing is suppressed. + + □ The undesired flipping of the stroke to the other side of the guide + path, when drawing along closed paths, is fixed. + + □ If you lose connection with your guide path, the tool tries to continue + moving in the same direction as if by inertia, so as to minimize the + tearoff jerk. + +Paint Bucket tool + + • Paint Bucket is now more tightly integrated with potrace. As a result, + memory and CPU usage on each fill operation have been reduced + significantly. + +Eraser Tool + +A new tool, Eraser, has been added to the main toolbox. Its shortcut is Shift+E +. It has two main modes, selectable by toggle buttons on its controls bar: + + • Delete Objects mode: any shape touched by dragging is deleted completely. + This is analogous to "touch selection" in Selector followed by Del. + • Cut mode: dragging subtracts, using a boolean Subtract operation, parts of + paths it touches. On the controls bar, you can adjust the Width of the + trace left by the tool. If nothing is selected, it acts on all objects in + the current layer, whether selected or not; if there's a selection, its + action is limited to selection. This mode is similar to Alt+drag in + Calligraphic tool. + +Pen and Pencil + +New modes + +Apart from the regular Bezier mode, these drawing tools now provide several new +modes: + + • Spiro mode: This mode automatically applies the new Spiro Splines path + effect (see the section on new effects) to any newly drawn path. As + mentioned below, it is not yet possible to preview a spiro before it is + finished. This mode is available in both Pen and Pencil tools. + + • Polyline mode (Pen only): This mode makes it easy to draw many straight + line segments by disallowing any curves, even when you accidentally drag + with the mouse instead of clicking. + + • Paraxial mode (Pen only): create straight line segments that are parallel + to one of the coordinate axes. This works similar to the Polyline mode with + Ctrl. Normally, each next line segment is drawn perpendicular to the + previous one, but the direction of the line segment being drawn can be + toggled by pressing Shift. If you click on the start anchor, the path gets + closed with an L-shaped segment (its direction of which can also be flipped + with Shift). + +Stroke shapes + +As a first step towards this blueprint, it is now possible to automatically +apply predefined vector shapes to path strokes in Pen and Pencil tools. The +choice of shapes in the drop-down list on the controls bar includes: + + • Triangle in and Triangle out: tapering out in both directions + + • Ellipse: smooth elliptic shape stretching along path + + • From clipboard: any path you had previously selected and copied to + clipboard + +To adjust the width of the stroke, open the Path Effect Editor, choose "Pattern +along path" effect, and edit its Width parameter. It is measured in units of +the original size of the applied shape; the triangles and ellipse are all 10px +in size, and the clipboard size can be any size. The default value of Width is +1.00, which means the triangle/elliptic strokes will be 10px wide and the +from-clipboard stroke will be as wide as the copied object was tall. + +Pencil smoothing + +In Pencil tool, the controls bar now provides the Smoothing parameter, +changeable in the range from 1 to 100, which controls how much smoothing is +applied to the freehand lines you draw. Small Smoothing values produce rough +lines with many nodes; large values give smooth lines with few nodes. +Previously, this control was only available in Inkscape Preferences. + +Pencil sketch mode + +The sketch mode is still experimental. In essence, it enables the artist to +draw many strokes, which Inkscape then averages into a single path. It tries to +mimic sketching with a real pencil and paper, taking the 'visual average' of +many strokes and condensing it into one stroke. + +Pick the pencil tool, press Alt, and sketch away; release Alt to finalize the +result. After each stroke (a stroke starts when the mouse button is pressed +down, and ends when it is released), the resulting path will be an average of +the old result and the newly drawn stroke. In Inkscape's Pencil tool +preferences, one can choose to either average between all drawn strokes (so +that all stroke have the same weight), or just the new stroke and the old +result (so that later strokes have greater weight). + +Currently, going back and forth between A and B in one stroke does not give the +expected result; it will result in a long path going back and forth, instead of +the visually expected path going from A to B just once. We are working on this +(difficult!) issue. For best results, draw strokes only from A to B (and not +from B to A). + +Text tool + + • When editing multiline or flowed text, the PgUp and PgDn keys now work to + move the cursor by one screen (i.e. by as many lines as fit into the screen + at current zoom). + + • The usability of the font family drop-down list in the Text tool controls + bar has been improved: it no longer steals focus, all keyboard shortcuts + work as designed (Alt+X to access the family control, Alt+down to open the + drop-down list with font previews, arrows to move in the list, Enter to set + chosen font) and the completion feature works (start typing a family name + and a pop-up list with possible completions appears). + + A remaining problem that may be fixed in a future version is that the first + opening of the drop-down list of family names may be slow (several seconds) + if you have many fonts installed (the delay is Inkscape generating the + previews for all fonts). Subsequent openings of the list are much faster. + +Connector tool + + • Connectors are now drawn to the edges of shapes, rather than to the + bounding box of shapes. + • The routing buffer around shapes is now altered in the correct direction + when the user changes this via the spacing control fon the connector + toolbar. + • A bug has been fixed where the spinboxes on the connector toolbar did not + properly respond to single clicks of their up and down arrows. + +Path effects + +Path Effects stacking + +More than one Path Effect can be assigned to an object. A new UI was created to +control the stack in the Path Effects Editor (Shift+Ctrl+7): the Effect list +shows the stack of effects for the selected object; below, buttons allow you to +move a selected effect in the stack up or down or remove it from stack. + +The stack works from top to bottom, i.e. the topmost listed effect is applied +first, the second one works on the result of the first, and so on until the +bottom effect which produces the final visible result. A new effect that you +choose in the "Apply new effect" list and created by the Add button gets added +to the end of the current stack. + +Path Effects for groups + +Path effects can now be assigned to a group. In most cases, the effect is +applied recursively to the member paths, but for Bend Path and Envelope +Deformation the result that the distortion applies to the group as a whole. + + • You can, as usual, enter the group by double-clicking on it, and edit the + paths there watching the transformed result update live. + + • Path effects can be assigned to groups of groups, applying recursively to + all grouped paths. + + • The Convert Object to Path command (Ctrl+Shift+C), when applied to a group + with effects applied, removes these effects from group and converts all its + member paths to effect-less paths looking exactly as before. + +Misc new features + + • The Paste Path Effect command in Path menu can now assign the path effect + of the clipboard's path to any number of paths, going recursively into + groups if necessary. + + • A new command, Remove Path Effect in Path menu, removes any path effects + from all selected objects, going recursively into groups if necessary. + + • Path effects can now be assigned to the sides of a 3D box (use Ctrl+click + to select individual sides) without breaking its 3D functionality. + + • The Pen and Pencil tools now correctly work with paths with effects: you + can continue such a path or add a new subpath to it by drawing with Shift, + while preserving the effects applied to it. + + • Path parameters of effects can now link to existing shapes or texts. For + example, now it is possible to use a text as the pattern for the Pattern + Along Path effect, or shape a path with the Envelope Deformation where one + of the envelope sides is text! Since the effect links to the text, not + copies it, the result will update live if you edit the text. + + • Lib2geom now has an implementation for EllipticalArc. For Inkscape, this + means that it is now possible to directly copy-paste ellipse shapes to path + parameters (e.g. 'pattern' in Pattern along Path), without the need to + convert the ellipse to path first. + + +New effects + + • Sketch: Simulates hand-drawn lines. A set of parameters lets you tune the + effect. They are all summarized in this picture. + + [300px-SketchExemple] + + • Hatches: Fills the shape with rough, randomized hatches, simulating a quick + hand drawing. It is configurable through numeric parameters as well as + on-screen handles visible in Node tool. + + [300px-Hatches-lpe]. + + • von Koch: This effect creates fractal pictures. A collection of + transformations (rotations, rescalings, etc...) is recursively applied to + the input path. The transforms are derived from a "reference" path (a line + segment) and a "generating" path (basically a collection of segments): the + transforms are those needed to move the reference segment onto each segment + of the generating path (components in the generating path having more than + one segment might be used to define shearing/mirroring transforms). A + famous example is the von Koch's snowflake. + + [300px-VonKochExample] + + Warning: the complexity of the output path grows exponentially fast with + the number of generations. As a guardrail, an editable complexity bound is + provided, above which the effect is disabled. + + • Knot: Creates a knot from a flat self-intersecting curve: at each crossing, + one strand is interrupted to make it look like it's going under the other. + The "sign" of each crossing (first strand interrupted, second interrupted, + or no interruptions) can be set independently by clicking the on-screen + handle which can be dragged from one crossing to the other. + + [300px-KnotExample] + + Warning: as far as possible, the lpe tries to keep the modifications of + crossing signs unchanged under small deformations. For large or topology + changing deformations however, some or all crossings might jump back to + their default orientation. + + • Spiro splines are a novel way of defining curvilinear paths developed by + Raph Levien. It takes some getting used to, but for certain tasks (such as + lettershape design) Spiros have a clear advantage over Bezier curves. + Recently, Spiro support was added to the FontForge font editor; now it is + available in Inkscape too, which means you can use all the convenient + Inkscape path tools (moving and transforming groups of nodes, node + sculpting, etc.) on Spiro paths. + + A Spiro path is defined by a sequence of points, but unlike a regular path + with Bezier curves, all Spiro points lie on the path and there are no + off-path handles. The curvature of the path is defined entirely by the + positions of the points and their types. The path behaves very similar to a + springy rod which is forced to pass through the given points and which uses + the minimum possible curvature to satisfy the requirement. As such, it + feels quite natural and the resulting path is very smooth - not just + superficially smooth (i.e. having no cusps), but smooth at a deeper level, + which you can achieve with Beziers only after a lot of laborious tweaking. + + To create a Spiro path, select any path and assign the "Spiro spline" path + effect to it. There are no parameters. Each node of your path becomes a + point of a Spiro path, depending on the type of node: + + □ Smooth nodes (those with two collinear Bezier handles; use Shift+S to + make a node smooth) become smooth curve points of the Spiro path. Note + that the length or direction of the Bezier handles of the source path + is ignored; the only thing that matters is their collinearity. + + □ Cusp nodes of the source path become corner points of the Spiro path, + like free hinges on the springy rod. Between two corner points, the + path is always a straight line. To make a node cusp, retract its Bezier + handles by Ctrl+click, or press Shift+C and move one of the handles so + they are no longer collinear. + + □ Half-smooth nodes - those with one Bezier handle collinear with a + straight line segment on the other hand - become "left" or "right" + points on the Spiro path which behave exactly the same: they sit + between a straight line and a curve and enforce that these two segments + join smoothly without a cusp. To create such a node, make sure one of + the segments is a line (select its ends and press Shift+L), then + Ctrl+drag the remaining handle to make it snap to the direction of the + straight line segment on the other side, or press Shift+S to lock it to + that direction. + + Note that what matters is the actual collinearity of a node's handles, + regardless of the node type that the node has in the Node tool; for + example, if a node designated as cusp (diamond-shaped) has collinear + handles, it will become a smooth curve point of the Spiro path. + + Some configurations of points do not converge and produce wild loops and + spirals instead of a smooth curve. According to Raph, "The spline solver in + this release is _not_ numerically robust. When you start drawing random + points, you'll quickly run into divergence. However, "sensible" plates + based on real fonts usually converge." Avoid too sharp changes in direction + between points to prevent divergence. Hopefully, the robustness of the + algorithm will be improved in future releases. + + For now, to edit Spiro paths viewing the result in real time, you have to + use the Node tool; it is recommended to turn off the red highlight of the + source path. The Pen tool does not yet allow you to preview a Spiro as you + draw, although you can paste the Spiro effect on the path and see the + result as soon as the path is finalized. + + You can always use the Node tool to continue a Spiro path by duplicating + and dragging away its end nodes. Also, when you have a Spiro path selected, + you can add a new subpath to it with Pen or Pencil if you start drawing + with Shift. + + • Construct Grid: Draws a grid using the first three nodes of a path. The + center node defines the origin. The other two nodes define the direction + and length of the two adjacent sides of the first cell. If a path has more + than three nodes, the other nodes are ignored. One can select the number of + cells in the two orthogonal directions. + + • Envelope Deformation: Allows you to deform an object (or a group of object) + by deforming its sides. Modifications are done by deforming the four path + parameters: Top, Bottom, Left and Right; for each, you can edit it with + Node tool, copy, paste, or link to an existing path in the document. + + • Ruler: Draws ruler marks along the path; you can set distance between the + marks, their length for major and minor marks, the major/minor ratio, and + other parameters. + + • Interpolate Subpaths: Creates a given number of interpolated paths between + the (first) two subpaths of a path (the subpaths after the second subpath + are ignored). The interpolations are spread along an editable trajectory + path. + + [InterpolateSubpathsExample] + + +Notable effect bugfixes and changes + +We try to refrain from changing the behavior of existing path effects, because +it will change appearance in old files when opened in a new version of Inkscape +(but not in any other SVG viewer or editor). However, when an effect is really +broken, we have to fix it: + + • Pattern Along Path: + □ The pattern used to be stretched across discontinuities (separate + subpaths). This has been fixed; now it treats a discontinuous path as a + group of continuous paths and applies the effect separately to each. + □ Successive copies of the pattern can now be fused into continuous paths + (using the new "fuse nearby ends" feature) so that "filling" the result + works as expected. + + • Bend Path: + □ Closed input paths would sometimes result in unclosed output paths. + This has been fixed. + +Import/Export + +PostScript and EPS import + +Inkscape's PS and EPS import now uses Ghostscript instead of pstoedit. If you +need to open files of these types, install Ghostscript and make sure the +directory with the ps2pdf utility from Ghostscript installation is in your +PATH. On importing a file, you will see a preferences dialog, similar to PDF +import; for multipage PS files, this dialog allows you to select which page to +open. + +PDF import + + • A new checkbox on the PDF import dialog, Replace PDF fonts with + closest-named installed fonts (on by default) attempts to replace all font + names in the imported PDF with the most similar names of those fonts + installed on your system. For example, if the PDF uses the font + "TimesNewRomanPSMT" and you have "Times New Roman" installed, that font + will be used, which will likely give you a more correct appearance than the + unknown font "TimesNewRomanPSMT" that will be displayed as the default sans + serif font. This is a temporary fix necessary because Inkscape cannot yet + extract the fonts from the PDF files it imports nor can it embed them into + SVG; when it gets these capabilities, such font name conversion will become + unnecessary because all fonts will be preserved. + + • Importing PDF files now works from the command line. For example, + +inkscape file.pdf --export-plain-svg=file.svg + + will take the first page of the PDF and use the default import options, and + save the result to SVG. If you try to import PDF without an --export + command, it will show the import options dialog as before and open the file + in the UI. + +PDF, PostScript, and EPS export + +The new Cairo-based PS and EPS exporter provides much better support for +various vector features, including clipping paths, patterns, and non-ASCII +characters. Those features that are not supported by the targeted format become +embedded bitmaps that preserve the appearance. In particular: + + • transparency is always rasterized in PS or EPS but not PDF, as PDF supports + vector transparency; + + • filters, such as blur, are by default rasterized in all three formats (PS, + EPS, PDF). This can be turned off by unchecking the "Rasterize filter + effects" option in the UI or adding the --export-ignore-filters option via + the command line. In this case, filtered objects are rendered as vectors + without filters and without rasterization. + + • The resolution for rasterizing the filters can be set in the UI in the + "Resolution for rasterization (dpi)" parameter or on the command line by + --export-dpi parameter (same as used for exporting SVG documents to + bitmaps). The default is 90 dpi. The rendering quality of filters for + rasterization, as well as for bitmap export, is always the best possible + regardless of what you have set in the Filters tab of Preferences (which + only affects on-screen rendering). For example, + +inkscape --export-pdf=out.pdf --export-dpi=300 file.svg + + will export file.svg to out.pdf, rasterizing any filtered objects in it at + 300 dpi. (If there are no filtered objects, the --export-dpi has no + effect.) + +All of PS, EPS, and PDF export formats uniformly support the export area +options (page or drawing) and the new export-id option: + + • You can now export a single object from a complex document (for example, a + single layer) if you specify the ID of that object in the "Limit export to + the object with ID" field in the GUI or via the --export-id=ID option on + the command line. The export will show only that object (all others will + not be exported). The BoundingBox (page size) of the exported PS/EPS/PDF + file will correspond to the bounding box of that object. You can override + this with "Export area is page" (GUI) or --export-area-page (command line) + option which forces the output to have the size of the SVG document's page + (this may not be possible with EPS, see below). + + • The "Export area is page" (GUI) or --export-area-page (command line) option + forces the output to have the size of the SVG document's page. This is the + default for PS and PDF but not for EPS. + + □ Note, the specification of the EPS format does not allow a bounding box + to extend beyond the content. This is enforced by the Cairo graphics + library which means that when --export-area-page is used with EPS + export, the page bounding box will be trimmed inwards (but never + expanded outwards) to the bounding box of the content if it is smaller. + If you want a file which has a %BoundingBox different from the bounding + box of its content, you can use PS or PDF export formats instead of + EPS, or add a white background rectangle with the required size to + source document before exporting to EPS. + + □ The --export-bbox-page command line parameter has been removed; use + --export-area-page instead. + + □ The --export-area-page option was renamed from --export-area-canvas for + consistency with the use of the terms page and canvas in the GUI. + + • The "Export area is drawing" (GUI) or --export-area-drawing (command line) + option forces the output to have the size of the exported objects' bounding + box, regardless of page size. If no --export-id is specified, this means + the bounding box of the entire drawing; with --export-id, this means the + bounding box of the exported object only. This is the default for EPS. Note + that checking "Export area is page" or using --export-area-page overrides + this setting for PS and PDF output. + + • The --export-embed-fonts option is removed. Inkscape now always embeds and + subsets all fonts used in the document when exporting PS, EPS, or PDF. + +UniConvertor-based import and export + +Inkscape can now use UniConvertor to import files of the following types: + + • Corel DRAW versions 7 to X4 document files (CDR) + • Corel DRAW versions 7 to X4 Template files (CDT) + • Corel DRAW Presentation Exchange files (CMX) + • Corel DRAW Compressed Exchange files (CCX) + • sK1 files (SK1) + • Computer Graphics Metafiles (CGM) + • Windows Metafiles (WMF) + • HPGL (AutoCAD) Plot files (PLT) (requires UniConvertor 1.1.4) + +Inkscape can now use UniConvertor to export files of the following types: + + • Windows Metafiles (WMF) + • sK1 files (SK1) + • HPGL (AutoCAD) Plot files (PLT) (requires UniConvertor 1.1.4) + +Text objects are not supported as of UniConvertor 1.1.4. + +On Windows, UniConvertor is included with Inkscape distribution and does not +require separate installation. + +HPGL export + +In addition to the HPGL export via UniConvertor listed above, Inkscape can now +export to HPGL (Hewlett-Packard Graphics Language) via an internal routine that +is geared towards various cutters/plotters. + +JavaFX export + +Inkscape can export drawings to JavaFX format (.fx file extension). + +DXF import and export + + • DXF export for desktop cutting plotters is much faster than in previous + versions. A new option was added to provide support for RoboMaster desktop + cutting software. Also, polylines and polysplines are now supported. + + • DXF import is new. It supports a number of the simpler DXF shapes: line, + Bezier spline, ellipse, circular arc, text. + +PNG export + + • PNG export has been updated to include metadata if present in the source + SVG. This includes the Author, Copyright, Creation Time, Description, and + Title fields. PNG metadata can be viewed using the ImageMagick identify + command. + + • Export filenames that are relative (e.g. ../file.png or simply file.png) + are now resolved relative to the document's location. This applies to the + filenames you type in the Export dialog as well as those stored in export + hints in the document itself (and used by the "Batch export" checkbutton as + well as in command line export with --export-use-hints). However, export + filenames specified directly on the command line are not resolved, which in + effect means they work, as before, from the current working directory from + which you run the export command. + +OCAL (Open Clip Art Library) Export + + • Export to Openclipart.org has been disabled for 0.47 as it had become + non-functional and needs to be re-written. + +Autosave + +The new autosave feature allow for automatic timed backups as work goes on. +Saved versions are put in a designated directory and do not overwrite the +original SVG file nor each other. + +In Inkscape Preferences (Ctrl+Shift+P), Save tab, you can enable this feature +and specify various options: + + • the time interval between backups, in minutes; + + • the directory where you want the backups to be stored; + + • and the maximum number of saved backups (if this number is exceeded, old + backups will start to be deleted). + +Extensions + + • The former Effects menu is renamed to Extensions. This is less confusing + and better reflects the content of the menu: a collection of extensions, + written mostly in Python, which perform various tasks with or without + selection. + +New and improved extensions + + • The new Arrange > Restack extension restacks (changes the z-order of) + selected objects, with options including: left to right, top to bottom (or + vice versa), radial outward or inward, or at an arbitrary angle. You can + also specify what point of an object is used to calculate its position for + restacking. + + • The new Generate from Path > Extrude extension is similar to the old + Extrude effect, which has been renamed Motion. The new effect requires two + paths and draws connection lines or polygons between their nodes. If you + want more dense extrusion, add more nodes to the paths. All the extrusion + polygons are separate (grouped) objects, so they can be easily painted by + the Tweak tool to get nicely shaded ribbons, 3D letters, and the like. + + • The new Generate from Path > Scatter extension spreads copies of pattern + along arbitrary "skeleton" paths. The pattern must be the topmost object in + the selection. Groups of paths, shapes, clones are allowed. + + • The improved Modify Path > Add Nodes extension now allows segments to be + divided into a given number of subsegments. + + • The new Modify Path > Convert to Dashes extension takes the dash pattern of + the stroke and explicitly cuts the curve to duplicate this pattern. This + can be used to allow desktop cutting plotters, which don't understand + dashed stroke style, to cut dashed paths. You can also achieve interesting + effects with smoothly varying dash length if you edit the resulting path + with Node Sculpting technique (Alt+drag with Node tool). + + • The new Render > Add printing marks extension adds printing marks and color + bars required by print bureaus. You can either manually define margins by + which cut marks are created. + + • The new Render > 3D Polyhedron extension draws 2D projections of 3D + polyhedrons and other 3D shapes. You can choose one of a number of + predefined shapes (cube, octahedron, truncated dodecahedron and others) or + load a shape definition from an OBJ file. The shape can be rotated around + any of the three axes by arbitrary amount; you can also define various + style options such as color of the faces and stroke width, and enable + shading with adjustable light source position. + + • The new Render > Alphabet Soup extension is a vector rework of Matt + Chrisholm's script. Alphabet Soup randomly mashes glyph elements together + to make exotic-looking text. + + • The new Render > Cartesian Grid extension plots Cartesian (square) grids + that do not fill the page, but offer three levels of division, logarithmic + scales (with clutter-reduction and arbitrary base) and customizable line + width. All like elements (e.g. x-axis subminor divisions) are put into + subgroups together. A proper border is also drawn, with an independent line + width. + + • The new Render > Polar Grid extension plots a polar coordinate grid, with + options for arbitrary-base logarithmic subdivisions, clutter-reduction + around the origin, circumferential labels and custom line widths. + + • The new Render > Draw from Triangle extension takes a triangle drawn as a + path (only the first three nodes of a path are counted) and allows to draw + many triangle-related geometrical objects such as circumcircles, excentral + triangles, etc. It also lets you specify custom trilinear coordinates and + triangle centre functions, as well as compute basic triangle properties + such as area and semiperimeter. + + • The new Render > Guides Creator extension quickly creates horizontal and + vertical guides for subdividing the canvas. You can choose the divisions + from None, 1/2, 1/3 ... to 1/10. + + • The new Render > Calendar extension draws a calendar for a given year with + localizable month/weekday names, colors, and many other options. + + • The new Render > Foldable Box extension creates foldouts for paper boxes. + + • The new Text > Convert to Braille extension recodes English (or just Latin + letters) text to Braille code. It is not intended to create a real Braille + text for visually impaired people, just an accurate graphical + representation of Braille text to be used in illustrations. + + • The new Modify Path > Interpolate Attribute in a Group extension takes a + group of objects and assigns to its members interpolated values of an + attribute of your choice, such as width, height, opacity, etc. + + • The new Web > JavaScript extensions allow you to set various interactive + JavaScript attributes, such as onclick or onfocus, on SVG elements. + Inkscape does not support them on rendering but you might need them for + other SVG viewers such as Firefox. + +Extension API changes + + • While the "Live preview" checkbox is useful for most effects, for some it + just does not make sense. Now, you can add the attribute needs-live-preview + ="false" in the effect element in the .inx file of the effect to suppress + this checkbox for your effect. + + • Parameters passed to extensions (via the element) now can have a + boolean attribute, gui-hidden, to indicate that the parameter should not be + represented in the GUI. If all parameters are marked as hidden, no GUI is + presented for such extension. + + • All .inx files are now properly formatted XML files with their own + namespace of: http://www.inkscape.org/namespace/inkscape/extension and a + Relax NG schema to define it. More information can be found on the + Extensions page. + +Filters + +The Filter Editor (former Filter Effects) and Remove Filters commands are moved +from the Object menu to the new Filters top-level menu, which also contains a +collection of preset filters. + +Preset filters + +The Filter Editor is powerful, but can be quite cumbersome. You can now apply +complex preset filters to selected objects with a single command by choosing it +from the new Filters top-level menu. Submenus categorize the filters by +function or appearance. To view a sampler of all preset filters, open +filters.svg document from Inkscape's examples (share/examples in the Inkscape +tree). + +Most filters apply immediately after selecting the command; some present a +dialog where you can adjust some of the parameters before applying the filter +(such filters have "..." at the end of the command in the menu). + +By default, if the selected object already has some filter applied, the chosen +filter will be merged with the existing filter for combined effect. However you +can also overlay several filters to an object while keeping them separated: +simply press Ctrl+G after applying any filter and then apply another one; the +filters will then display separately in the Filters Editor. + +You can easily add your own filters to these menus. Simply place any SVG file +with the filters to the filters subdirectory of your config directory (~ +/.config/Inkscape/ on Linux) and the filters will be picked up from it when you +start Inkscape. By default, they will be placed in the Personal submenu under +Effects > Filters. If you want to control this, add the following attributes to +the filter element: + +inkscape:label is the command label +inkscape:menu is the submenu to place the command into +inkscape:menu-tooltip is the tooltip (displayed in the statusbar + as you select the command) + +No Filters rendering mode + +In order to facilitate editing documents that use lots of SVG filter effects, +filter effects can now be disabled for a particular document window by +selecting View > Display mode > No Filters from the menu. This provides an +intermediate step between Normal and Outline view modes. + +The Toggle View command in the Display Mode submenu (Ctrl+keypad 5) toggles +between all 3 modes in a loop: Normal, No filters, Outline. + +Filter quality setting + +In addition to the Blur Quality setting, Inkscape now has a general Filter +Effects Quality setting on the Filters tab of Inkscape Preferences. It affects +all filters and gives you an opportunity to seek optimum balance between speed +and accuracy when rendering filters. + + • Best quality is the quality used when exporting. + • Better quality uses fast methods for transforming images, which + occasionally shows up as jagged edges. Full rendering resolution is used. + • Anything below that also uses low resolution rendering for filters. + +For exporting images, the best quality is used regardless of this setting. + +SVG support + +Optimized CSS properties + + • As a file size optimization, Inkscape does not write into SVG some of the + stroke properties if the object has stroke:none and some of the fill + properties when it has fill:none. The only situation where this might + affect you is if you remove stroke from an object and then turn it back on + - the object will get the default stroke instead of the same it had before. + + Also, in manually-edited SVG where a parent group has no stroke but sets + some stroke properties to be inherited by its descendants, you will need to + set stroke property to other than none on the group, and suppress + inheritance with stroke:none on those children that don't need it. + + Specifically, if stroke:none, the following properties do not get written + to SVG: + +stroke-width +stroke-linecap +stroke-linejoin +stroke-miterlimit +stroke-opacity +stroke-dasharray +stroke-dashoffset + + Note that this does not include marker properties, which means you can + still have markers on a path without visible stroke. + + If fill:none, the following properties do not get written to SVG: + +fill-opacity +fill-rule + + • The opacity property is not written if it has the default value of 1 (this + property is not inherited, so the change should have no side effects). + + • The marker-start, marker-mid, and marker-end properties are not written if + the marker property is already present with the same value. + +Optimized path data + +In this version, the size of the path data written in the d= attribute of path +elements is reduced by about 10%. Inkscape generates the shortest possible path +strings by avoiding repeated operators and using relative coordinates (when it +helps). + +This is controlled by the options on the SVG output page of Inkscape +Preferences dialog. Also, you can change the following attributes in group id= +"svgoutput" in your preferences.xml file: + + • allowrelativecoordinates (default 1) to switch relative coordinates on (1) + or off (0) + • forcerepeatcommands (default 0) to force repeating operators (1) or allow + use of the more compact representation without repeated operators (0) + + +Horizontal and vertical path segments + +If an SVG contains paths with shorthands for horizontal and vertical path +segments ('H' or 'V'), then Inkscape will try to maintain those shorthands if +possible, so the saved file will also contain them. + +