2#ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_COLOR_H__
3#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_COLOR_H__
75 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
76 "<name>" N_(
"Brilliance")
"</name>\n"
77 "<id>org.inkscape.effect.filter.Brilliance</id>\n"
78 "<param name=\"brightness\" gui-text=\"" N_(
"Brightness")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"1\" max=\"10.00\">2</param>\n"
79 "<param name=\"sat\" gui-text=\"" N_(
"Over-saturation")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.0\" max=\"10.00\">0.5</param>\n"
80 "<param name=\"lightness\" gui-text=\"" N_(
"Lightness")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-10.00\" max=\"10.00\">0</param>\n"
81 "<param name=\"invert\" gui-text=\"" N_(
"Inverted")
"\" type=\"bool\">false</param>\n"
83 "<object-type>all</object-type>\n"
85 "<submenu name=\"" N_(
"Filters")
"\">\n"
86 "<submenu name=\"" N_(
"Color")
"\"/>\n"
89 "<menu-tip>" N_(
"Brightness filter")
"</menu-tip>\n"
91 "</inkscape-extension>\n", std::make_unique<Brilliance>());
101 std::ostringstream brightness;
102 std::ostringstream sat;
103 std::ostringstream lightness;
117 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Brilliance\">\n"
118 "<feColorMatrix values=\"%s %s %s 0 %s %s %s %s 0 %s %s %s %s 0 %s 0 0 0 1 0 \" />\n"
119 "</filter>\n", brightness.str().c_str(), sat.str().c_str(), sat.str().c_str(),
120 lightness.str().c_str(), sat.str().c_str(), brightness.str().c_str(),
121 sat.str().c_str(), lightness.str().c_str(), sat.str().c_str(),
122 sat.str().c_str(), brightness.str().c_str(), lightness.str().c_str() );
159 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
160 "<name>" N_(
"Channel Painting")
"</name>\n"
161 "<id>org.inkscape.effect.filter.ChannelPaint</id>\n"
162 "<param name=\"tab\" type=\"notebook\">\n"
163 "<page name=\"optionstab\" gui-text=\"Options\">\n"
164 "<param name=\"saturation\" gui-text=\"" N_(
"Saturation")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.\" max=\"1.\">1</param>\n"
165 "<param name=\"red\" gui-text=\"" N_(
"Red")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-10.\" max=\"10.\">-1</param>\n"
166 "<param name=\"green\" gui-text=\"" N_(
"Green")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-10.\" max=\"10.\">0.5</param>\n"
167 "<param name=\"blue\" gui-text=\"" N_(
"Blue")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-10.\" max=\"10.\">0.5</param>\n"
168 "<param name=\"alpha\" gui-text=\"" N_(
"Alpha")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-10.\" max=\"10.\">1</param>\n"
169 "<param name=\"invert\" gui-text=\"" N_(
"Inverted")
"\" type=\"bool\">false</param>\n"
171 "<page name=\"colortab\" gui-text=\"Color\">\n"
172 "<param name=\"color\" gui-text=\"" N_(
"Color")
"\" type=\"color\">16777215</param>\n"
176 "<object-type>all</object-type>\n"
178 "<submenu name=\"" N_(
"Filters")
"\">\n"
179 "<submenu name=\"" N_(
"Color")
"\"/>\n"
182 "<menu-tip>" N_(
"Replace RGB by any color")
"</menu-tip>\n"
184 "</inkscape-extension>\n", std::make_unique<ChannelPaint>());
194 std::ostringstream saturation;
195 std::ostringstream red;
196 std::ostringstream green;
197 std::ostringstream blue;
198 std::ostringstream alpha;
199 std::ostringstream
invert;
200 std::ostringstream floodRed;
201 std::ostringstream floodGreen;
202 std::ostringstream floodBlue;
203 std::ostringstream floodAlpha;
212 floodRed << ((color >> 24) & 0xff);
213 floodGreen << ((color >> 16) & 0xff);
214 floodBlue << ((color >> 8) & 0xff);
215 floodAlpha << (color & 0xff) / 255.0F;
225 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Channel Painting\">\n"
226 "<feColorMatrix values=\"%s\" type=\"saturate\" result=\"colormatrix1\" />\n"
227 "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 %s %s %s %s 0 \" in=\"SourceGraphic\" result=\"colormatrix2\" />\n"
228 "<feFlood flood-color=\"rgb(%s,%s,%s)\" flood-opacity=\"%s\" result=\"flood\" />\n"
229 "<feComposite in2=\"colormatrix2\" operator=\"%s\" result=\"composite1\" />\n"
230 "<feMerge result=\"merge\">\n"
231 "<feMergeNode in=\"colormatrix1\" />\n"
232 "<feMergeNode in=\"composite1\" />\n"
234 "<feComposite in=\"merge\" in2=\"SourceGraphic\" operator=\"in\" result=\"composite2\" />\n"
235 "</filter>\n", saturation.str().c_str(), red.str().c_str(), green.str().c_str(),
236 blue.str().c_str(), alpha.str().c_str(), floodRed.str().c_str(),
237 floodGreen.str().c_str(), floodBlue.str().c_str(), floodAlpha.str().c_str(),
264 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
265 "<name>" N_(
"Color Blindness")
"</name>\n"
266 "<id>org.inkscape.effect.filter.ColorBlindness</id>\n"
267 "<param name=\"tab\" type=\"notebook\">\n"
268 "<page name=\"optionstab\" gui-text=\"Options\">\n"
269 "<param name=\"type\" gui-text=\"" N_(
"Blindness type:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
270 "<option value=\"0.618 0.32 0.062 0 0 0.163 0.775 0.062 0 0 0.163 0.32 0.516 0 0 0 0 0 1 0 \">" N_(
"Rod monochromacy (atypical achromatopsia)")
"</option>\n"
271 "<option value=\"0.299 0.587 0.114 0 0 0.299 0.587 0.114 0 0 0.299 0.587 0.114 0 0 0 0 0 1 0 \">" N_(
"Cone monochromacy (typical achromatopsia)")
"</option>\n"
272 "<option value=\"0.8 0.2 0 0 0 0.2583 0.74167 0 0 0 0 0.14167 0.85833 0 0 0 0 0 1 0 \">" N_(
"Green weak (deuteranomaly)")
"</option>\n"
273 "<option value=\"0.625 0.375 0 0 0 0.7 0.3 0 0 0 0 0.3 0.7 0 0 0 0 0 1 0 \">" N_(
"Green blind (deuteranopia)")
"</option>\n"
274 "<option value=\"0.8166 0.1833 0 0 0 0.333 0.666 0 0 0 0 0.125 0.875 0 0 0 0 0 1 0 \">" N_(
"Red weak (protanomaly)")
"</option>\n"
275 "<option value=\"0.566 0.43333 0 0 0 0.55833 0.4416 0 0 0 0 0.24167 0.75833 0 0 0 0 0 1 0 \">" N_(
"Red blind (protanopia)")
"</option>\n"
276 "<option value=\"0.966 0.033 0 0 0 0 0.733 0.266 0 0 0 0.1833 0.816 0 0 0 0 0 1 0 \">" N_(
"Blue weak (tritanomaly)")
"</option>\n"
277 "<option value=\"0.95 0.05 0 0 0 0.2583 0.4333 0.5667 0 0 0 0.475 0.525 0 0 0 0 0 1 0 \">" N_(
"Blue blind (tritanopia)")
"</option>\n"
280 "<page name=\"helptab\" gui-text=\"Help\">\n"
281 "<label xml:space=\"preserve\">\n"
282"Filters based on https://openclipart.org/detail/22299/Color%20Blindness%20filters\n"
284"These filters don't correctly reflect actual color blindness for two main reasons:\n"
285" * Everyone is different, and is not affected exactly the same way.\n"
286" * The filters are in the RGB color space, and ignore confusion lines.\n"
291 "<object-type>all</object-type>\n"
293 "<submenu name=\"" N_(
"Filters")
"\">\n"
294 "<submenu name=\"" N_(
"Color")
"\"/>\n"
297 "<menu-tip>" N_(
"Simulate color blindness")
"</menu-tip>\n"
299 "</inkscape-extension>\n", std::make_unique<ColorBlindness>());
309 std::ostringstream type;
314 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" height=\"1\" width=\"1\" y=\"0\" x=\"0\" inkscape:label=\"Color Blindness\">\n"
315 "<feColorMatrix values=\"%s\" type=\"matrix\" result=\"colormatrix1\" />\n"
316 "</filter>\n", type.str().c_str());
343 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
344 "<name>" N_(
"Color Shift")
"</name>\n"
345 "<id>org.inkscape.effect.filter.ColorShift</id>\n"
346 "<param name=\"shift\" gui-text=\"" N_(
"Shift (°)")
"\" type=\"int\" appearance=\"full\" min=\"0\" max=\"360\">330</param>\n"
347 "<param name=\"sat\" gui-text=\"" N_(
"Saturation")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.\" max=\"1\">0.6</param>\n"
349 "<object-type>all</object-type>\n"
351 "<submenu name=\"" N_(
"Filters")
"\">\n"
352 "<submenu name=\"" N_(
"Color")
"\"/>\n"
355 "<menu-tip>" N_(
"Rotate and desaturate hue")
"</menu-tip>\n"
357 "</inkscape-extension>\n", std::make_unique<ColorShift>());
368 std::ostringstream
shift;
369 std::ostringstream sat;
376 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Color Shift\">\n"
377 "<feColorMatrix type=\"hueRotate\" values=\"%s\" result=\"color1\" />\n"
378 "<feColorMatrix type=\"saturate\" values=\"%s\" result=\"color2\" />\n"
379 "</filter>\n",
shift.str().c_str(), sat.str().c_str() );
410 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
411 "<name>" N_(
"Colorize")
"</name>\n"
412 "<id>org.inkscape.effect.filter.Colorize</id>\n"
413 "<param name=\"tab\" type=\"notebook\">\n"
414 "<page name=\"optionstab\" gui-text=\"Options\">\n"
415 "<param name=\"hlight\" gui-text=\"" N_(
"Harsh light")
"\" type=\"float\" appearance=\"full\" min=\"0\" max=\"10\">0</param>\n"
416 "<param name=\"nlight\" gui-text=\"" N_(
"Normal light")
"\" type=\"float\" appearance=\"full\" min=\"0\" max=\"10\">1</param>\n"
417 "<param name=\"duotone\" gui-text=\"" N_(
"Duotone")
"\" type=\"bool\" >false</param>\n"
418 "<param name=\"blend1\" gui-text=\"" N_(
"Blend 1:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
419 "<option value=\"multiply\">" N_(
"Multiply")
"</option>\n"
420 "<option value=\"normal\">" N_(
"Normal")
"</option>\n"
421 "<option value=\"screen\">" N_(
"Screen")
"</option>\n"
422 "<option value=\"lighten\">" N_(
"Lighten")
"</option>\n"
423 "<option value=\"darken\">" N_(
"Darken")
"</option>\n"
425 "<param name=\"blend2\" gui-text=\"" N_(
"Blend 2:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
426 "<option value=\"screen\">" N_(
"Screen")
"</option>\n"
427 "<option value=\"multiply\">" N_(
"Multiply")
"</option>\n"
428 "<option value=\"normal\">" N_(
"Normal")
"</option>\n"
429 "<option value=\"lighten\">" N_(
"Lighten")
"</option>\n"
430 "<option value=\"darken\">" N_(
"Darken")
"</option>\n"
433 "<page name=\"colortab\" gui-text=\"Color\">\n"
434 "<param name=\"color\" gui-text=\"" N_(
"Color")
"\" type=\"color\">-1639776001</param>\n"
438 "<object-type>all</object-type>\n"
440 "<submenu name=\"" N_(
"Filters")
"\">\n"
441 "<submenu name=\"" N_(
"Color")
"\"/>\n"
444 "<menu-tip>" N_(
"Blend image or object with a flood color")
"</menu-tip>\n"
446 "</inkscape-extension>\n", std::make_unique<Colorize>());
457 std::ostringstream a;
458 std::ostringstream r;
459 std::ostringstream g;
460 std::ostringstream b;
461 std::ostringstream hlight;
462 std::ostringstream nlight;
463 std::ostringstream duotone;
464 std::ostringstream blend1;
465 std::ostringstream blend2;
468 r << ((color >> 24) & 0xff);
469 g << ((color >> 16) & 0xff);
470 b << ((color >> 8) & 0xff);
471 a << (color & 0xff) / 255.0F;
485 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Colorize\">\n"
486 "<feComposite in2=\"SourceGraphic\" operator=\"arithmetic\" k1=\"%s\" k2=\"%s\" result=\"composite1\" />\n"
487 "<feColorMatrix in=\"composite1\" values=\"%s\" type=\"saturate\" result=\"colormatrix1\" />\n"
488 "<feFlood flood-opacity=\"%s\" flood-color=\"rgb(%s,%s,%s)\" result=\"flood1\" />\n"
489 "<feBlend in=\"flood1\" in2=\"colormatrix1\" mode=\"%s\" result=\"blend1\" />\n"
490 "<feBlend in2=\"blend1\" mode=\"%s\" result=\"blend2\" />\n"
491 "<feColorMatrix in=\"blend2\" values=\"1\" type=\"saturate\" result=\"colormatrix2\" />\n"
492 "<feComposite in=\"colormatrix2\" in2=\"SourceGraphic\" operator=\"in\" k2=\"1\" result=\"composite2\" />\n"
493 "</filter>\n", hlight.str().c_str(), nlight.str().c_str(), duotone.str().c_str(),
494 a.str().c_str(), r.str().c_str(), g.str().c_str(), b.str().c_str(),
495 blend1.str().c_str(), blend2.str().c_str() );
521 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
522 "<name>" N_(
"Component Transfer")
"</name>\n"
523 "<id>org.inkscape.effect.filter.ComponentTransfer</id>\n"
524 "<param name=\"type\" gui-text=\"" N_(
"Type:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
525 "<option value=\"identity\">" N_(
"Identity")
"</option>\n"
526 "<option value=\"table\">" N_(
"Table")
"</option>\n"
527 "<option value=\"discrete\">" N_(
"Discrete")
"</option>\n"
528 "<option value=\"linear\">" N_(
"Linear")
"</option>\n"
529 "<option value=\"gamma\">" N_(
"Gamma")
"</option>\n"
532 "<object-type>all</object-type>\n"
534 "<submenu name=\"" N_(
"Filters")
"\">\n"
535 "<submenu name=\"" N_(
"Color")
"\"/>\n"
538 "<menu-tip>" N_(
"Basic component transfer structure")
"</menu-tip>\n"
540 "</inkscape-extension>\n", std::make_unique<ComponentTransfer>());
550 std::ostringstream CTfunction;
553 if ((g_ascii_strcasecmp(
"identity", type) == 0)) {
554 CTfunction <<
"<feFuncR type=\"identity\" tableValues=\"1 0\" />\n"
555 <<
"<feFuncG type=\"identity\" tableValues=\"1 0\" />\n"
556 <<
"<feFuncB type=\"identity\" tableValues=\"1 0\" />\n"
557 <<
"<feFuncA type=\"identity\" tableValues=\"0 1\" />\n";
558 }
else if ((g_ascii_strcasecmp(
"table", type) == 0)) {
559 CTfunction <<
"<feFuncR type=\"table\" tableValues=\"0 1 0\" />\n"
560 <<
"<feFuncG type=\"table\" tableValues=\"0 1 0\" />\n"
561 <<
"<feFuncB type=\"table\" tableValues=\"0 1 0\" />\n";
562 }
else if ((g_ascii_strcasecmp(
"discrete", type) == 0)) {
563 CTfunction <<
"<feFuncR tableValues=\"0 0.2 0.4 0.6 0.8 1 1\" type=\"discrete\" />\n"
564 <<
"<feFuncG tableValues=\"0 0.2 0.4 0.6 0.8 1 1\" type=\"discrete\" />\n"
565 <<
"<feFuncB tableValues=\"0 0.2 0.4 0.6 0.8 1 1\" type=\"discrete\" />\n";
566 }
else if ((g_ascii_strcasecmp(
"linear", type) == 0)) {
567 CTfunction <<
"<feFuncR type=\"linear\" slope=\".5\" intercept=\".10\" />\n"
568 <<
"<feFuncG type=\"linear\" slope=\".5\" intercept=\".10\" />\n"
569 <<
"<feFuncB type=\"linear\" slope=\".5\" intercept=\".10\" />\n";
571 CTfunction <<
"<feFuncR type=\"gamma\" amplitude=\"3\" exponent=\"3\" offset=\"0.1\" />\n"
572 <<
"<feFuncG type=\"gamma\" amplitude=\"3\" exponent=\"3\" offset=\"0.1\" />\n"
573 <<
"<feFuncB type=\"gamma\" amplitude=\"3\" exponent=\"3\" offset=\"0.1\" />\n";
577 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Component Transfer\">\n"
578 "<feComponentTransfer>\n"
580 "</feComponentTransfer>\n"
581 "</filter>\n", CTfunction.str().c_str());
610 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
611 "<name>" N_(
"Duochrome")
"</name>\n"
612 "<id>org.inkscape.effect.filter.Duochrome</id>\n"
613 "<param name=\"tab\" type=\"notebook\">\n"
614 "<page name=\"optionstab\" gui-text=\"Options\">\n"
615 "<param name=\"fluo\" gui-text=\"" N_(
"Fluorescence level")
"\" type=\"float\" appearance=\"full\" min=\"0\" max=\"2\">0</param>\n"
616 "<param name=\"swap\" gui-text=\"" N_(
"Swap:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
617 "<option value=\"none\">" N_(
"No swap")
"</option>\n"
618 "<option value=\"full\">" N_(
"Color and alpha")
"</option>\n"
619 "<option value=\"color\">" N_(
"Color only")
"</option>\n"
620 "<option value=\"alpha\">" N_(
"Alpha only")
"</option>\n"
623 "<page name=\"co11tab\" gui-text=\"Color 1\">\n"
624 "<param name=\"color1\" gui-text=\"" N_(
"Color 1")
"\" type=\"color\">1364325887</param>\n"
626 "<page name=\"co12tab\" gui-text=\"Color 2\">\n"
627 "<param name=\"color2\" gui-text=\"" N_(
"Color 2")
"\" type=\"color\">-65281</param>\n"
631 "<object-type>all</object-type>\n"
633 "<submenu name=\"" N_(
"Filters")
"\">\n"
634 "<submenu name=\"" N_(
"Color")
"\"/>\n"
637 "<menu-tip>" N_(
"Convert luminance values to a duochrome palette")
"</menu-tip>\n"
639 "</inkscape-extension>\n", std::make_unique<Duochrome>());
650 std::ostringstream a1;
651 std::ostringstream r1;
652 std::ostringstream g1;
653 std::ostringstream b1;
654 std::ostringstream a2;
655 std::ostringstream r2;
656 std::ostringstream g2;
657 std::ostringstream b2;
658 std::ostringstream fluo;
659 std::ostringstream swap1;
660 std::ostringstream swap2;
666 r1 << ((color1 >> 24) & 0xff);
667 g1 << ((color1 >> 16) & 0xff);
668 b1 << ((color1 >> 8) & 0xff);
669 r2 << ((color2 >> 24) & 0xff);
670 g2 << ((color2 >> 16) & 0xff);
671 b2 << ((color2 >> 8) & 0xff);
672 fluo << fluorescence;
674 if ((g_ascii_strcasecmp(
"full", swaptype) == 0)) {
677 a1 << (color1 & 0xff) / 255.0F;
678 a2 << (color2 & 0xff) / 255.0F;
679 }
else if ((g_ascii_strcasecmp(
"color", swaptype) == 0)) {
682 a1 << (color2 & 0xff) / 255.0F;
683 a2 << (color1 & 0xff) / 255.0F;
684 }
else if ((g_ascii_strcasecmp(
"alpha", swaptype) == 0)) {
687 a1 << (color2 & 0xff) / 255.0F;
688 a2 << (color1 & 0xff) / 255.0F;
692 a1 << (color1 & 0xff) / 255.0F;
693 a2 << (color2 & 0xff) / 255.0F;
698 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Duochrome\">\n"
699 "<feColorMatrix type=\"luminanceToAlpha\" result=\"colormatrix1\" />\n"
700 "<feFlood flood-opacity=\"%s\" flood-color=\"rgb(%s,%s,%s)\" result=\"flood1\" />\n"
701 "<feComposite in2=\"colormatrix1\" operator=\"%s\" result=\"composite1\" />\n"
702 "<feFlood flood-opacity=\"%s\" flood-color=\"rgb(%s,%s,%s)\" result=\"flood2\" />\n"
703 "<feComposite in2=\"colormatrix1\" result=\"composite2\" operator=\"%s\" />\n"
704 "<feComposite in=\"composite2\" in2=\"composite1\" k2=\"1\" k3=\"1\" operator=\"arithmetic\" result=\"composite3\" />\n"
705 "<feColorMatrix in=\"composite3\" type=\"matrix\" values=\"2 -1 0 0 0 0 2 -1 0 0 -1 0 2 0 0 0 0 0 1 0 \" result=\"colormatrix2\" />\n"
706 "<feComposite in=\"colormatrix2\" in2=\"composite3\" operator=\"arithmetic\" k2=\"%s\" result=\"composite4\" />\n"
707 "<feBlend in=\"composite4\" in2=\"composite3\" mode=\"normal\" result=\"blend\" />\n"
708 "<feComposite in2=\"SourceGraphic\" operator=\"in\" />\n"
709 "</filter>\n", a1.str().c_str(), r1.str().c_str(), g1.str().c_str(), b1.str().c_str(), swap1.str().c_str(),
710 a2.str().c_str(), r2.str().c_str(), g2.str().c_str(), b2.str().c_str(), swap2.str().c_str(),
711 fluo.str().c_str() );
739 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
740 "<name>" N_(
"Extract Channel")
"</name>\n"
741 "<id>org.inkscape.effect.filter.ExtractChannel</id>\n"
742 "<param name=\"source\" gui-text=\"" N_(
"Channel:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
743 "<option value=\"r\">" N_(
"Red")
"</option>\n"
744 "<option value=\"g\">" N_(
"Green")
"</option>\n"
745 "<option value=\"b\">" N_(
"Blue")
"</option>\n"
746 "<option value=\"c\">" N_(
"Cyan")
"</option>\n"
747 "<option value=\"m\">" N_(
"Magenta")
"</option>\n"
748 "<option value=\"y\">" N_(
"Yellow")
"</option>\n"
750 "<param name=\"blend\" gui-text=\"" N_(
"Background blend mode:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
751 "<option value=\"multiply\">" N_(
"Multiply")
"</option>\n"
752 "<option value=\"normal\">" N_(
"Normal")
"</option>\n"
753 "<option value=\"screen\">" N_(
"Screen")
"</option>\n"
755 "<param name=\"alpha\" gui-text=\"" N_(
"Channel to alpha")
"\" type=\"bool\">false</param>\n"
757 "<object-type>all</object-type>\n"
759 "<submenu name=\"" N_(
"Filters")
"\">\n"
760 "<submenu name=\"" N_(
"Color")
"\"/>\n"
763 "<menu-tip>" N_(
"Extract color channel as a transparent image")
"</menu-tip>\n"
765 "</inkscape-extension>\n", std::make_unique<ExtractChannel>());
775 std::ostringstream blend;
776 std::ostringstream colors;
782 if ((g_ascii_strcasecmp(
"r", channel) == 0)) {
783 colors <<
"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0";
784 }
else if ((g_ascii_strcasecmp(
"g", channel) == 0)) {
785 colors <<
"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0";
786 }
else if ((g_ascii_strcasecmp(
"b", channel) == 0)) {
787 colors <<
"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0";
788 }
else if ((g_ascii_strcasecmp(
"c", channel) == 0)) {
789 colors <<
"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 1 0";
790 }
else if ((g_ascii_strcasecmp(
"m", channel) == 0)) {
791 colors <<
"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 1 0";
793 colors <<
"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 0";
796 if ((g_ascii_strcasecmp(
"r", channel) == 0)) {
797 colors <<
"0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0";
798 }
else if ((g_ascii_strcasecmp(
"g", channel) == 0)) {
799 colors <<
"0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0";
800 }
else if ((g_ascii_strcasecmp(
"b", channel) == 0)) {
801 colors <<
"0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0";
802 }
else if ((g_ascii_strcasecmp(
"c", channel) == 0)) {
803 colors <<
"0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 -1 0 0 1 0";
804 }
else if ((g_ascii_strcasecmp(
"m", channel) == 0)) {
805 colors <<
"0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 -1 0 1 0";
807 colors <<
"0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 -1 1 0";
813 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Extract Channel\">\n"
814 "<feColorMatrix in=\"SourceGraphic\" values=\"%s 0 \" result=\"colormatrix\" />\n"
815 "<feBlend in2=\"BackgroundImage\" mode=\"%s\" result=\"blend\" />\n"
816 "</filter>\n", colors.str().c_str(), blend.str().c_str() );
849 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
850 "<name>" N_(
"Fade to Black or White")
"</name>\n"
851 "<id>org.inkscape.effect.filter.FadeToBW</id>\n"
852 "<param name=\"level\" gui-text=\"" N_(
"Level")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0\" max=\"1\">1</param>\n"
853 "<param name=\"fadeto\" gui-text=\"" N_(
"Fade to:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
854 "<option value=\"black\">" N_(
"Black")
"</option>\n"
855 "<option value=\"white\">" N_(
"White")
"</option>\n"
858 "<object-type>all</object-type>\n"
860 "<submenu name=\"" N_(
"Filters")
"\">\n"
861 "<submenu name=\"" N_(
"Color")
"\"/>\n"
864 "<menu-tip>" N_(
"Fade to black or white")
"</menu-tip>\n"
866 "</inkscape-extension>\n", std::make_unique<FadeToBW>());
876 std::ostringstream level;
877 std::ostringstream wlevel;
882 if ((g_ascii_strcasecmp(
"white", fadeto) == 0)) {
892 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Fade to Black or White\">\n"
893 "<feColorMatrix values=\"%s 0 0 0 %s 0 %s 0 0 %s 0 0 %s 0 %s 0 0 0 1 0\" />\n"
894 "</filter>\n", level.str().c_str(), wlevel.str().c_str(),
895 level.str().c_str(), wlevel.str().c_str(),
896 level.str().c_str(), wlevel.str().c_str() );
932 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
933 "<name>" N_(
"Greyscale")
"</name>\n"
934 "<id>org.inkscape.effect.filter.Greyscale</id>\n"
935 "<param name=\"red\" gui-text=\"" N_(
"Red")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-10.00\" max=\"10.00\">0.21</param>\n"
936 "<param name=\"green\" gui-text=\"" N_(
"Green")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-10.00\" max=\"10.00\">0.72</param>\n"
937 "<param name=\"blue\" gui-text=\"" N_(
"Blue")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-10.00\" max=\"10.00\">0.072</param>\n"
938 "<param name=\"strength\" gui-text=\"" N_(
"Lightness")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-10.00\" max=\"10.00\">0</param>\n"
939 "<param name=\"transparent\" gui-text=\"" N_(
"Transparent")
"\" type=\"bool\" >false</param>\n"
941 "<object-type>all</object-type>\n"
943 "<submenu name=\"" N_(
"Filters")
"\">\n"
944 "<submenu name=\"" N_(
"Color")
"\"/>\n"
947 "<menu-tip>" N_(
"Customize greyscale components")
"</menu-tip>\n"
949 "</inkscape-extension>\n", std::make_unique<Greyscale>());
959 std::ostringstream red;
960 std::ostringstream green;
961 std::ostringstream blue;
962 std::ostringstream strength;
963 std::ostringstream redt;
964 std::ostringstream greent;
965 std::ostringstream bluet;
966 std::ostringstream strengtht;
967 std::ostringstream transparency;
968 std::ostringstream line;
982 transparency << redt.str().c_str() <<
" " << greent.str().c_str() <<
" " << bluet.str().c_str() <<
" " << strengtht.str().c_str();
984 line << red.str().c_str() <<
" " << green.str().c_str() <<
" " << blue.str().c_str() <<
" " << strength.str().c_str();
985 transparency <<
"0 0 0 1";
990 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Greyscale\">\n"
991 "<feColorMatrix values=\"%s 0 %s 0 %s 0 %s 0 \" />\n"
992 "</filter>\n", line.str().c_str(), line.str().c_str(), line.str().c_str(), transparency.str().c_str() );
1023 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
1024 "<name>" N_(
"Invert")
"</name>\n"
1025 "<id>org.inkscape.effect.filter.Invert</id>\n"
1026 "<param name=\"channels\" gui-text=\"" N_(
"Invert channels:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
1027 "<option value=\"0\">" N_(
"No inversion")
"</option>\n"
1028 "<option value=\"1\">" N_(
"Red and blue")
"</option>\n"
1029 "<option value=\"2\">" N_(
"Red and green")
"</option>\n"
1030 "<option value=\"3\">" N_(
"Green and blue")
"</option>\n"
1032 "<param name=\"opacify\" gui-text=\"" N_(
"Light transparency")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.\" max=\"1\">0</param>\n"
1033 "<param name=\"hue\" gui-text=\"" N_(
"Invert hue")
"\" type=\"bool\" >false</param>\n"
1034 "<param name=\"lightness\" gui-text=\"" N_(
"Invert lightness")
"\" type=\"bool\" >false</param>\n"
1035 "<param name=\"transparency\" gui-text=\"" N_(
"Invert transparency")
"\" type=\"bool\" >false</param>\n"
1037 "<object-type>all</object-type>\n"
1039 "<submenu name=\"" N_(
"Filters")
"\">\n"
1040 "<submenu name=\"" N_(
"Color")
"\"/>\n"
1043 "<menu-tip>" N_(
"Manage hue, lightness and transparency inversions")
"</menu-tip>\n"
1045 "</inkscape-extension>\n", std::make_unique<Invert>());
1056 std::ostringstream line1;
1057 std::ostringstream line2;
1058 std::ostringstream line3;
1060 std::ostringstream col5;
1061 std::ostringstream transparency;
1062 std::ostringstream hue;
1065 hue <<
"<feColorMatrix type=\"hueRotate\" values=\"180\" result=\"color1\" />\n";
1071 transparency <<
"0.21 0.72 0.07 " << 1 - ext->
get_param_float(
"opacify");
1073 transparency <<
"-0.21 -0.72 -0.07 " << 2 - ext->
get_param_float(
"opacify");
1128 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Invert\">\n"
1130 "<feColorMatrix values=\"%s 0 %s %s 0 %s %s 0 %s %s 0 \" result=\"color2\" />\n"
1131 "</filter>\n", hue.str().c_str(),
1132 line1.str().c_str(), col5.str().c_str(),
1133 line2.str().c_str(), col5.str().c_str(),
1134 line3.str().c_str(), col5.str().c_str(),
1135 transparency.str().c_str() );
1162 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
1163 "<name>" N_(
"Lighting")
"</name>\n"
1164 "<id>org.inkscape.effect.filter.Lighting</id>\n"
1165 "<param name=\"amplitude\" gui-text=\"" N_(
"Lights")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.00\" max=\"20.00\">1</param>\n"
1166 "<param name=\"exponent\" gui-text=\"" N_(
"Shadows")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.00\" max=\"20.00\">1</param>\n"
1167 "<param name=\"offset\" gui-text=\"" N_(
"Offset")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-1.00\" max=\"1.00\">0</param>\n"
1169 "<object-type>all</object-type>\n"
1171 "<submenu name=\"" N_(
"Filters")
"\">\n"
1172 "<submenu name=\"" N_(
"Color")
"\"/>\n"
1175 "<menu-tip>" N_(
"Modify lights and shadows separately")
"</menu-tip>\n"
1177 "</inkscape-extension>\n", std::make_unique<Lighting>());
1187 std::ostringstream amplitude;
1188 std::ostringstream exponent;
1189 std::ostringstream
offset;
1197 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Lighting\">\n"
1198 "<feComponentTransfer in=\"blur\" result=\"component\" >\n"
1199 "<feFuncR type=\"gamma\" amplitude=\"%s\" exponent=\"%s\" offset=\"%s\" />\n"
1200 "<feFuncG type=\"gamma\" amplitude=\"%s\" exponent=\"%s\" offset=\"%s\" />\n"
1201 "<feFuncB type=\"gamma\" amplitude=\"%s\" exponent=\"%s\" offset=\"%s\" />\n"
1202 "</feComponentTransfer>\n"
1203 "</filter>\n", amplitude.str().c_str(), exponent.str().c_str(),
offset.str().c_str(),
1204 amplitude.str().c_str(), exponent.str().c_str(),
offset.str().c_str(),
1205 amplitude.str().c_str(), exponent.str().c_str(),
offset.str().c_str() );
1237 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
1238 "<name>" N_(
"Lightness-Contrast")
"</name>\n"
1239 "<id>org.inkscape.effect.filter.LightnessContrast</id>\n"
1240 "<param name=\"lightness\" gui-text=\"" N_(
"Lightness")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-100\" max=\"100\">0</param>\n"
1241 "<param name=\"contrast\" gui-text=\"" N_(
"Contrast")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-100\" max=\"100\">0</param>\n"
1243 "<object-type>all</object-type>\n"
1245 "<submenu name=\"" N_(
"Filters")
"\">\n"
1246 "<submenu name=\"" N_(
"Color")
"\"/>\n"
1249 "<menu-tip>" N_(
"Modify lightness and contrast separately")
"</menu-tip>\n"
1251 "</inkscape-extension>\n", std::make_unique<LightnessContrast>());
1261 std::ostringstream lightness;
1262 std::ostringstream contrast;
1263 std::ostringstream contrast5;
1279 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Lightness-Contrast\">\n"
1280 "<feColorMatrix values=\"%s 0 0 %s %s 0 %s 0 %s %s 0 0 %s %s %s 0 0 0 1 0\" />\n"
1281 "</filter>\n", contrast.str().c_str(), lightness.str().c_str(), contrast5.str().c_str(),
1282 contrast.str().c_str(), lightness.str().c_str(), contrast5.str().c_str(),
1283 contrast.str().c_str(), lightness.str().c_str(), contrast5.str().c_str() );
1320 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
1321 "<name>" N_(
"Nudge RGB")
"</name>\n"
1322 "<id>org.inkscape.effect.filter.NudgeRGB</id>\n"
1323 "<param name=\"tab\" type=\"notebook\">\n"
1324 "<page name=\"offsettab\" gui-text=\"Offset\">\n"
1325 "<label appearance=\"header\">" N_(
"Red offset")
"</label>\n"
1326 "<param name=\"rx\" gui-text=\"" N_(
"X")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"-100.\" max=\"100.\">-6</param>\n"
1327 "<param name=\"ry\" gui-text=\"" N_(
"Y")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"-100.\" max=\"100.\">-6</param>\n"
1328 "<label appearance=\"header\">" N_(
"Green offset")
"</label>\n"
1329 "<param name=\"gx\" gui-text=\"" N_(
"X")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"-100.\" max=\"100.\">6</param>\n"
1330 "<param name=\"gy\" gui-text=\"" N_(
"Y")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"-100.\" max=\"100.\">7</param>\n"
1331 "<label appearance=\"header\">" N_(
"Blue offset")
"</label>\n"
1332 "<param name=\"bx\" gui-text=\"" N_(
"X")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"-100.\" max=\"100.\">1</param>\n"
1333 "<param name=\"by\" gui-text=\"" N_(
"Y")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"-100.\" max=\"100.\">-16</param>\n"
1335 "<page name=\"coltab\" gui-text=\"Color\">\n"
1336 "<param name=\"color\" gui-text=\"" N_(
"Background color")
"\" type=\"color\">255</param>\n"
1340 "<object-type>all</object-type>\n"
1342 "<submenu name=\"" N_(
"Filters")
"\">\n"
1343 "<submenu name=\"" N_(
"Color")
"\"/>\n"
1346 "<menu-tip>" N_(
"Nudge RGB channels separately and blend them to different types of backgrounds")
"</menu-tip>\n"
1348 "</inkscape-extension>\n", std::make_unique<NudgeRGB>());
1358 std::ostringstream rx;
1359 std::ostringstream ry;
1360 std::ostringstream gx;
1361 std::ostringstream gy;
1362 std::ostringstream bx;
1363 std::ostringstream by;
1365 std::ostringstream a;
1366 std::ostringstream r;
1367 std::ostringstream g;
1368 std::ostringstream b;
1378 r << ((color >> 24) & 0xff);
1379 g << ((color >> 16) & 0xff);
1380 b << ((color >> 8) & 0xff);
1381 a << (color & 0xff) / 255.0F;
1385 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Nudge RGB\">\n"
1386 "<feFlood flood-opacity=\"%s\" flood-color=\"rgb(%s,%s,%s)\" result=\"flood\" />\n"
1387 "<feColorMatrix in=\"SourceGraphic\" values=\"0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 \" result=\"colormatrix1\" />\n"
1388 "<feOffset dy=\"%s\" dx=\"%s\" result=\"offset1\" />\n"
1389 "<feBlend in2=\"flood\" mode=\"screen\" result=\"blend1\" />\n"
1390 "<feColorMatrix in=\"SourceGraphic\" values=\"0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 \" result=\"colormatrix2\" />\n"
1391 "<feOffset dy=\"%s\" dx=\"%s\" result=\"offset2\" />\n"
1392 "<feBlend in2=\"blend1\" mode=\"screen\" result=\"blend2\" />\n"
1393 "<feOffset dy=\"%s\" dx=\"%s\" result=\"offset3\" />\n"
1394 "<feColorMatrix in=\"SourceGraphic\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 \" result=\"colormatrix3\" />\n"
1395 "<feBlend in2=\"offset3\" mode=\"screen\" result=\"blend3\" />\n"
1396 "</filter>\n", a.str().c_str(), r.str().c_str(), g.str().c_str(), b.str().c_str(),
1397 rx.str().c_str(), ry.str().c_str(),
1398 gx.str().c_str(), gy.str().c_str(),
1399 bx.str().c_str(), by.str().c_str() );
1436 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
1437 "<name>" N_(
"Nudge CMY")
"</name>\n"
1438 "<id>org.inkscape.effect.filter.NudgeCMY</id>\n"
1439 "<param name=\"tab\" type=\"notebook\">\n"
1440 "<page name=\"offsettab\" gui-text=\"Offset\">\n"
1441 "<label appearance=\"header\">" N_(
"Cyan offset")
"</label>\n"
1442 "<param name=\"cx\" gui-text=\"" N_(
"X")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"-100.\" max=\"100.\">-6</param>\n"
1443 "<param name=\"cy\" gui-text=\"" N_(
"Y")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"-100.\" max=\"100.\">-6</param>\n"
1444 "<label appearance=\"header\">" N_(
"Magenta offset")
"</label>\n"
1445 "<param name=\"mx\" gui-text=\"" N_(
"X")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"-100.\" max=\"100.\">6</param>\n"
1446 "<param name=\"my\" gui-text=\"" N_(
"Y")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"-100.\" max=\"100.\">7</param>\n"
1447 "<label appearance=\"header\">" N_(
"Yellow offset")
"</label>\n"
1448 "<param name=\"yx\" gui-text=\"" N_(
"X")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"-100.\" max=\"100.\">1</param>\n"
1449 "<param name=\"yy\" gui-text=\"" N_(
"Y")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"-100.\" max=\"100.\">-16</param>\n"
1451 "<page name=\"coltab\" gui-text=\"Color\">\n"
1452 "<param name=\"color\" gui-text=\"" N_(
"Background color")
"\" type=\"color\">-1</param>\n"
1456 "<object-type>all</object-type>\n"
1458 "<submenu name=\"" N_(
"Filters")
"\">\n"
1459 "<submenu name=\"" N_(
"Color")
"\"/>\n"
1462 "<menu-tip>" N_(
"Nudge CMY channels separately and blend them to different types of backgrounds")
"</menu-tip>\n"
1464 "</inkscape-extension>\n", std::make_unique<NudgeCMY>());
1474 std::ostringstream cx;
1475 std::ostringstream cy;
1476 std::ostringstream mx;
1477 std::ostringstream my;
1478 std::ostringstream yx;
1479 std::ostringstream yy;
1481 std::ostringstream a;
1482 std::ostringstream r;
1483 std::ostringstream g;
1484 std::ostringstream b;
1494 r << ((color >> 24) & 0xff);
1495 g << ((color >> 16) & 0xff);
1496 b << ((color >> 8) & 0xff);
1497 a << (color & 0xff) / 255.0F;
1501 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Nudge CMY\">\n"
1502 "<feFlood flood-opacity=\"%s\" flood-color=\"rgb(%s,%s,%s)\" result=\"flood\" />\n"
1503 "<feColorMatrix in=\"SourceGraphic\" values=\"0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 -1 0 0 1 0 \" result=\"colormatrix1\" />\n"
1504 "<feOffset dy=\"%s\" dx=\"%s\" result=\"offset1\" />\n"
1505 "<feBlend in2=\"flood\" mode=\"multiply\" result=\"blend1\" />\n"
1506 "<feColorMatrix in=\"SourceGraphic\" values=\"0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 -1 0 1 0 \" result=\"colormatrix2\" />\n"
1507 "<feOffset dy=\"%s\" dx=\"%s\" result=\"offset2\" />\n"
1508 "<feBlend in2=\"blend1\" mode=\"multiply\" result=\"blend2\" />\n"
1509 "<feOffset dy=\"%s\" dx=\"%s\" result=\"offset3\" />\n"
1510 "<feColorMatrix in=\"SourceGraphic\" values=\"0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 -1 1 0 \" result=\"colormatrix3\" />\n"
1511 "<feBlend in2=\"offset3\" mode=\"multiply\" result=\"blend3\" />\n"
1512 "</filter>\n", a.str().c_str(), r.str().c_str(), g.str().c_str(), b.str().c_str(),
1513 cx.str().c_str(), cy.str().c_str(),
1514 mx.str().c_str(), my.str().c_str(),
1515 yx.str().c_str(), yy.str().c_str() );
1546 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
1547 "<name>" N_(
"Quadritone Fantasy")
"</name>\n"
1548 "<id>org.inkscape.effect.filter.Quadritone</id>\n"
1549 "<param name=\"dist\" gui-text=\"" N_(
"Hue distribution (°)")
"\" type=\"int\" appearance=\"full\" min=\"0\" max=\"360\">280</param>\n"
1550 "<param name=\"colors\" gui-text=\"" N_(
"Colors")
"\" type=\"int\" appearance=\"full\" min=\"0\" max=\"360\">100</param>\n"
1551 "<param name=\"blend1\" gui-text=\"" N_(
"Blend 1:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
1552 "<option value=\"normal\">" N_(
"Normal")
"</option>\n"
1553 "<option value=\"multiply\">" N_(
"Multiply")
"</option>\n"
1554 "<option value=\"screen\">" N_(
"Screen")
"</option>\n"
1556 "<param name=\"sat\" gui-text=\"" N_(
"Over-saturation")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.00\" max=\"1.00\">0</param>\n"
1557 "<param name=\"blend2\" gui-text=\"" N_(
"Blend 2:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
1558 "<option value=\"normal\">" N_(
"Normal")
"</option>\n"
1559 "<option value=\"screen\">" N_(
"Screen")
"</option>\n"
1560 "<option value=\"multiply\">" N_(
"Multiply")
"</option>\n"
1561 "<option value=\"lighten\">" N_(
"Lighten")
"</option>\n"
1562 "<option value=\"darken\">" N_(
"Darken")
"</option>\n"
1565 "<object-type>all</object-type>\n"
1567 "<submenu name=\"" N_(
"Filters")
"\">\n"
1568 "<submenu name=\"" N_(
"Color")
"\"/>\n"
1571 "<menu-tip>" N_(
"Replace hue by two colors")
"</menu-tip>\n"
1573 "</inkscape-extension>\n", std::make_unique<Quadritone>());
1584 std::ostringstream
dist;
1585 std::ostringstream colors;
1586 std::ostringstream blend1;
1587 std::ostringstream sat;
1588 std::ostringstream blend2;
1598 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Quadritone fantasy\">\n"
1599 "<feColorMatrix in=\"SourceGraphic\" type=\"hueRotate\" values=\"%s\" result=\"colormatrix1\" />\n"
1600 "<feColorMatrix type=\"matrix\" values=\"0.5 0 0.5 0 0 0 1 0 0 0 0.5 0 0.5 0 0 0 0 0 1 0 \" result=\"colormatrix2\" />\n"
1601 "<feColorMatrix type=\"hueRotate\" values=\"%s\" result=\"colormatrix3\" />\n"
1602 "<feBlend in2=\"colormatrix3\" mode=\"%s\" result=\"blend1\" />\n"
1603 "<feColorMatrix type=\"matrix\" values=\"2.5 -0.75 -0.75 0 0 -0.75 2.5 -0.75 0 0 -0.75 -0.75 2.5 0 0 0 0 0 1 0 \" result=\"colormatrix4\" />\n"
1604 "<feComposite in=\"colormatrix4\" in2=\"blend1\" operator=\"arithmetic\" k2=\"%s\" result=\"composite1\" />\n"
1605 "<feBlend in2=\"blend1\" mode=\"%s\" result=\"blend2\" />\n"
1606 "</filter>\n",
dist.str().c_str(), colors.str().c_str(), blend1.str().c_str(), sat.str().c_str(), blend2.str().c_str() );
1633 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
1634 "<name>" N_(
"Simple blend")
"</name>\n"
1635 "<id>org.inkscape.effect.filter.SimpleBlend</id>\n"
1636 "<param name=\"color\" gui-text=\"" N_(
"Color")
"\" type=\"color\">16777215</param>\n"
1637 "<param name=\"blendmode\" gui-text=\"" N_(
"Blend mode:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
1638 "<option value=\"normal\">" N_(
"Normal")
"</option>\n"
1639 "<option value=\"multiply\">" N_(
"Multiply")
"</option>\n"
1640 "<option value=\"screen\">" N_(
"Screen")
"</option>\n"
1641 "<option value=\"saturation\">" N_(
"Saturation")
"</option>\n"
1642 "<option value=\"darken\">" N_(
"Darken")
"</option>\n"
1643 "<option value=\"difference\">" N_(
"Difference")
"</option>\n"
1644 "<option value=\"lighten\">" N_(
"Lighten")
"</option>\n"
1645 "<option value=\"luminosity\">" N_(
"Luminosity")
"</option>\n"
1646 "<option value=\"overlay\">" N_(
"Overlay")
"</option>\n"
1647 "<option value=\"color-dodge\">" N_(
"Color Dodge")
"</option>\n"
1648 "<option value=\"color-burn\">" N_(
"Color Burn")
"</option>\n"
1649 "<option value=\"color\">" N_(
"Color")
"</option>\n"
1650 "<option value=\"hard-light\">" N_(
"Hard Light")
"</option>\n"
1651 "<option value=\"hue\">" N_(
"Hue")
"</option>\n"
1652 "<option value=\"exclusion\">" N_(
"Exclusion")
"</option>\n"
1655 "<object-type>all</object-type>\n"
1657 "<submenu name=\"" N_(
"Filters")
"\">\n"
1658 "<submenu name=\"" N_(
"Color")
"\"/>\n"
1661 "<menu-tip>" N_(
"Simple blend filter")
"</menu-tip>\n"
1663 "</inkscape-extension>\n", std::make_unique<SimpleBlend>());
1673 std::ostringstream a;
1674 std::ostringstream r;
1675 std::ostringstream g;
1676 std::ostringstream b;
1677 std::ostringstream blend;
1680 r << ((color >> 24) & 0xff);
1681 g << ((color >> 16) & 0xff);
1682 b << ((color >> 8) & 0xff);
1683 a << (color & 0xff) / 255.0F;
1688 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Simple blend\">\n"
1689 "<feFlood result=\"flood1\" flood-color=\"rgb(%s,%s,%s)\" flood-opacity=\"%s\" />\n"
1690 "<feBlend result=\"blend1\" in=\"flood1\" in2=\"SourceGraphic\" mode=\"%s\" />\n"
1691 "<feComposite operator=\"in\" in=\"blend1\" in2=\"SourceGraphic\" />\n"
1692 "</filter>\n", r.str().c_str(), g.str().c_str(), b.str().c_str(),
1693 a.str().c_str(), blend.str().c_str());
1723 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
1724 "<name>" N_(
"Solarize")
"</name>\n"
1725 "<id>org.inkscape.effect.filter.Solarize</id>\n"
1726 "<param name=\"rotate\" gui-text=\"" N_(
"Hue rotation (°)")
"\" type=\"int\" appearance=\"full\" min=\"0\" max=\"360\">0</param>\n"
1727 "<param name=\"type\" gui-text=\"" N_(
"Type:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
1728 "<option value=\"solarize\">" N_(
"Solarize")
"</option>\n"
1729 "<option value=\"moonarize\">" N_(
"Moonarize")
"</option>\n"
1732 "<object-type>all</object-type>\n"
1734 "<submenu name=\"" N_(
"Filters")
"\">\n"
1735 "<submenu name=\"" N_(
"Color")
"\"/>\n"
1738 "<menu-tip>" N_(
"Classic photographic solarization effect")
"</menu-tip>\n"
1740 "</inkscape-extension>\n", std::make_unique<Solarize>());
1751 std::ostringstream rotate;
1752 std::ostringstream blend1;
1753 std::ostringstream blend2;
1757 if ((g_ascii_strcasecmp(
"solarize", type) == 0)) {
1763 blend1 <<
"lighten";
1764 blend2 <<
"multiply";
1769 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Solarize\">\n"
1770 "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 \" />\n"
1771 "<feColorMatrix type=\"hueRotate\" values=\"%s\" result=\"colormatrix2\" />\n"
1772 "<feColorMatrix in=\"colormatrix2\" values=\"-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0 \" result=\"colormatrix3\" />\n"
1773 "<feBlend in=\"colormatrix3\" in2=\"colormatrix2\" mode=\"%s\" result=\"blend1\" />\n"
1774 "<feBlend in2=\"blend1\" mode=\"%s\" result=\"blend2\" />\n"
1775 "<feComposite in2=\"SourceGraphic\" operator=\"in\" />\n"
1776 "</filter>\n", rotate.str().c_str(), blend1.str().c_str(), blend2.str().c_str() );
1814 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
1815 "<name>" N_(
"Tritone")
"</name>\n"
1816 "<id>org.inkscape.effect.filter.Tritone</id>\n"
1817 "<param name=\"tab\" type=\"notebook\">\n"
1818 "<page name=\"optionstab\" gui-text=\"Options\">\n"
1819 "<param name=\"type\" gui-text=\"" N_(
"Type:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
1820 "<option value=\"normal\">" N_(
"Normal")
"</option>\n"
1821 "<option value=\"enhue\">" N_(
"Enhance hue")
"</option>\n"
1822 "<option value=\"phospho\">" N_(
"Phosphorescence")
"</option>\n"
1823 "<option value=\"phosphoB\">" N_(
"Colored nights")
"</option>\n"
1824 "<option value=\"htb\">" N_(
"Hue to background")
"</option>\n"
1826 "<param name=\"globalblend\" gui-text=\"" N_(
"Global blend:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
1827 "<option value=\"lighten\">" N_(
"Lighten")
"</option>\n"
1828 "<option value=\"screen\">" N_(
"Screen")
"</option>\n"
1829 "<option value=\"multiply\">" N_(
"Multiply")
"</option>\n"
1830 "<option value=\"darken\">" N_(
"Darken")
"</option>\n"
1832 "<param name=\"glow\" gui-text=\"" N_(
"Glow")
"\" type=\"float\" appearance=\"full\" min=\"0.01\" max=\"10\">0.01</param>\n"
1833 "<param name=\"glowblend\" gui-text=\"" N_(
"Glow blend:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
1834 "<option value=\"normal\">" N_(
"Normal")
"</option>\n"
1835 "<option value=\"multiply\">" N_(
"Multiply")
"</option>\n"
1836 "<option value=\"darken\">" N_(
"Darken")
"</option>\n"
1838 "<param name=\"llight\" gui-text=\"" N_(
"Local light")
"\" type=\"float\" appearance=\"full\" min=\"0\" max=\"10\">0</param>\n"
1839 "<param name=\"glight\" gui-text=\"" N_(
"Global light")
"\" type=\"float\" appearance=\"full\" min=\"0\" max=\"10\">1</param>\n"
1841 "<page name=\"co1tab\" gui-text=\"Color\">\n"
1842 "<param name=\"dist\" gui-text=\"" N_(
"Hue distribution (°):")
"\" type=\"int\" appearance=\"full\" min=\"0\" max=\"360\">0</param>\n"
1843 "<param name=\"color\" gui-text=\"" N_(
"Color")
"\" type=\"color\">-73203457</param>\n"
1847 "<object-type>all</object-type>\n"
1849 "<submenu name=\"" N_(
"Filters")
"\">\n"
1850 "<submenu name=\"" N_(
"Color")
"\"/>\n"
1853 "<menu-tip>" N_(
"Create a custom tritone palette with additional glow, blend modes and hue moving")
"</menu-tip>\n"
1855 "</inkscape-extension>\n", std::make_unique<Tritone>());
1866 std::ostringstream
dist;
1867 std::ostringstream a;
1868 std::ostringstream r;
1869 std::ostringstream g;
1870 std::ostringstream b;
1871 std::ostringstream globalblend;
1872 std::ostringstream glow;
1873 std::ostringstream glowblend;
1874 std::ostringstream llight;
1875 std::ostringstream glight;
1876 std::ostringstream c1in2;
1877 std::ostringstream c2in;
1878 std::ostringstream c2in2;
1879 std::ostringstream b6in2;
1882 r << ((color >> 24) & 0xff);
1883 g << ((color >> 16) & 0xff);
1884 b << ((color >> 8) & 0xff);
1885 a << (color & 0xff) / 255.0F;
1894 if ((g_ascii_strcasecmp(
"enhue", type) == 0)) {
1897 c2in <<
"SourceGraphic";
1899 b6in2 <<
"composite1";
1900 }
else if ((g_ascii_strcasecmp(
"phospho", type) == 0)) {
1904 c2in2 <<
"composite1";
1905 b6in2 <<
"SourceGraphic";
1906 }
else if ((g_ascii_strcasecmp(
"phosphoB", type) == 0)) {
1908 c1in2 <<
"SourceGraphic";
1910 c2in2 <<
"composite1";
1912 }
else if ((g_ascii_strcasecmp(
"htb", type) == 0)) {
1914 c1in2 <<
"BackgroundImage";
1917 b6in2 <<
"composite1";
1923 b6in2 <<
"composite";
1928 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Tritone\">\n"
1929 "<feColorMatrix type=\"hueRotate\" values=\"%s\" result=\"colormatrix1\" />\n"
1930 "<feColorMatrix in=\"colormatrix1\" type=\"matrix\" values=\"1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 \" result=\"colormatrix2\" />\n"
1931 "<feColorMatrix in=\"colormatrix1\" type=\"matrix\" values=\"0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 \" result=\"colormatrix3\" />\n"
1932 "<feColorMatrix in=\"colormatrix1\" type=\"matrix\" values=\"0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 \" result=\"colormatrix4\" />\n"
1933 "<feBlend in=\"colormatrix2\" in2=\"colormatrix3\" mode=\"darken\" result=\"blend1\" />\n"
1934 "<feBlend in=\"blend1\" in2=\"colormatrix4\" mode=\"darken\" result=\"blend2\" />\n"
1935 "<feBlend in=\"colormatrix2\" in2=\"colormatrix3\" mode=\"lighten\" result=\"blend3\" />\n"
1936 "<feBlend in=\"blend3\" in2=\"colormatrix4\" mode=\"lighten\" result=\"blend4\" />\n"
1937 "<feComponentTransfer in=\"blend4\" result=\"componentTransfer\">\n"
1938 "<feFuncR type=\"linear\" slope=\"0\" />\n"
1939 "</feComponentTransfer>\n"
1940 "<feBlend in=\"blend2\" in2=\"componentTransfer\" mode=\"%s\" result=\"blend5\" />\n"
1941 "<feColorMatrix in=\"blend5\" type=\"matrix\" values=\"-1 1 0 0 0 -1 1 0 0 0 -1 1 0 0 0 0 0 0 0 1 \" result=\"colormatrix5\" />\n"
1942 "<feFlood flood-opacity=\"%s\" flood-color=\"rgb(%s,%s,%s)\" result=\"flood\" />\n"
1943 "<feComposite in=\"colormatrix5\" in2=\"%s\" operator=\"arithmetic\" k1=\"1\" result=\"composite1\" />\n"
1944 "<feGaussianBlur stdDeviation=\"%s\" result=\"blur\" />\n"
1945 "<feBlend in2=\"%s\" mode=\"%s\" result=\"blend6\" />\n"
1946 "<feComposite in=\"%s\" in2=\"%s\" operator=\"arithmetic\" k1=\"%s\" k2=\"1\" k3=\"%s\" k4=\"0\" result=\"composite2\" />\n"
1947 "<feComposite in2=\"SourceGraphic\" operator=\"in\" result=\"composite3\" />\n"
1948 "</filter>\n",
dist.str().c_str(), globalblend.str().c_str(),
1949 a.str().c_str(), r.str().c_str(), g.str().c_str(), b.str().c_str(),
1950 c1in2.str().c_str(), glow.str().c_str(), b6in2.str().c_str(), glowblend.str().c_str(),
1951 c2in.str().c_str(), c2in2.str().c_str(), llight.str().c_str(), glight.str().c_str() );
The object that is the basis for the Extension system.
char const * get_param_optiongroup(char const *name, char const *alt) const
Like get_param_optiongroup but with a default on param_not_exist error.
int get_param_int(char const *name) const
Gets a parameter identified by name with the integer placed in value.
double get_param_float(char const *name) const
Gets a float parameter identified by name with the double placed in value.
std::uint32_t get_param_color(char const *name) const
Gets a parameter identified by name with the unsigned int placed in value.
bool get_param_bool(char const *name) const
Gets a parameter identified by name with the bool placed in value.
Custom predefined Brilliance filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Channel Painting filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Color Blindness filter.
~ColorBlindness() override
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Color shift filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Colorize filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined ComponentTransfer filter.
~ComponentTransfer() override
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Duochrome filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Fade to Black or White filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Greyscale filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Invert filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Lighting filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Lightness-Contrast filter.
~LightnessContrast() override
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Nudge CMY filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Nudge RGB filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Quadritone filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Simple blend filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Solarize filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Tritone filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
A way to clear the N_ macro, which is defined as an inline function.
Inkscape::Extension::Extension: Frontend to certain, possibly pluggable, actions.
double dist(const Point &a, const Point &b)
SBasisOf< T > shift(SBasisOf< T > const &a, int sh)
void build_from_mem(gchar const *buffer, std::unique_ptr< Implementation::Implementation > in_imp)
Create a module from a buffer holding an XML description.
CMYK to sRGB conversion routines.
void invert(const double v[16], double alpha[16])