2#ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_PAINT_H__
3#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_PAINT_H__
72 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
73 "<name>" N_(
"Chromolitho")
"</name>\n"
74 "<id>org.inkscape.effect.filter.Chromolitho</id>\n"
75 "<param name=\"tab\" type=\"notebook\">\n"
76 "<page name=\"optionstab\" gui-text=\"Options\">\n"
77 "<param name=\"drawing\" gui-text=\"" N_(
"Drawing mode")
"\" type=\"bool\" >true</param>\n"
78 "<param name=\"dblend\" gui-text=\"" N_(
"Drawing blend:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
79 "<option value=\"darken\">Darken</option>\n"
80 "<option value=\"normal\">Normal</option>\n"
81 "<option value=\"multiply\">Multiply</option>\n"
82 "<option value=\"screen\">Screen</option>\n"
83 "<option value=\"lighten\">Lighten</option>\n"
85 "<param name=\"transparent\" gui-text=\"" N_(
"Transparent")
"\" type=\"bool\" >false</param>\n"
86 "<param name=\"dented\" gui-text=\"" N_(
"Dented")
"\" type=\"bool\" >false</param>\n"
87 "<param name=\"inverted\" gui-text=\"" N_(
"Inverted")
"\" type=\"bool\" >false</param>\n"
88 "<param name=\"light\" gui-text=\"" N_(
"Lightness")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0\" max=\"10\">0</param>\n"
89 "<param name=\"saturation\" gui-text=\"" N_(
"Saturation")
"\" type=\"float\" precision=\"2\" appearance=\"full\" min=\"0\" max=\"1\">1</param>\n"
90 "<param name=\"noise\" gui-text=\"" N_(
"Noise reduction")
"\" type=\"int\" appearance=\"full\" min=\"1\" max=\"1000\">10</param>\n"
91 "<param name=\"smooth\" gui-text=\"" N_(
"Smoothness")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"10.00\">1</param>\n"
93 "<page name=\"graintab\" gui-text=\"" N_(
"Grain")
"\">\n"
94 "<param name=\"grain\" gui-text=\"" N_(
"Grain mode")
"\" type=\"bool\" >true</param>\n"
95 "<param name=\"grainxf\" gui-text=\"" N_(
"Horizontal frequency")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0\" max=\"1000\">1000</param>\n"
96 "<param name=\"grainyf\" gui-text=\"" N_(
"Vertical frequency")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0\" max=\"1000\">1000</param>\n"
97 "<param name=\"grainc\" gui-text=\"" N_(
"Complexity")
"\" type=\"int\" appearance=\"full\" min=\"1\" max=\"5\">1</param>\n"
98 "<param name=\"grainv\" gui-text=\"" N_(
"Variation")
"\" type=\"int\" appearance=\"full\" min=\"0\" max=\"1000\">0</param>\n"
99 "<param name=\"grainexp\" gui-text=\"" N_(
"Expansion")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"1\" max=\"50\">1</param>\n"
100 "<param name=\"grainero\" gui-text=\"" N_(
"Erosion")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0\" max=\"40\">0</param>\n"
101 "<param name=\"graincol\" gui-text=\"" N_(
"Color")
"\" type=\"bool\" >true</param>\n"
102 "<param name=\"gblend\" gui-text=\"" N_(
"Grain blend:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
103 "<option value=\"normal\">Normal</option>\n"
104 "<option value=\"multiply\">Multiply</option>\n"
105 "<option value=\"screen\">Screen</option>\n"
106 "<option value=\"lighten\">Lighten</option>\n"
107 "<option value=\"darken\">Darken</option>\n"
112 "<object-type>all</object-type>\n"
114 "<submenu name=\"" N_(
"Filters")
"\">\n"
115 "<submenu name=\"" N_(
"Image Paint and Draw")
"\"/>\n"
118 "<menu-tip>" N_(
"Chromo effect with customizable edge drawing and graininess")
"</menu-tip>\n"
120 "</inkscape-extension>\n", std::make_unique<Chromolitho>());
130 std::ostringstream b1in;
131 std::ostringstream b2in;
132 std::ostringstream col3in;
133 std::ostringstream transf;
134 std::ostringstream light;
135 std::ostringstream saturation;
136 std::ostringstream noise;
137 std::ostringstream dblend;
138 std::ostringstream
smooth;
139 std::ostringstream grainxf;
140 std::ostringstream grainyf;
141 std::ostringstream grainc;
142 std::ostringstream grainv;
143 std::ostringstream gblend;
144 std::ostringstream grainexp;
145 std::ostringstream grainero;
146 std::ostringstream graincol;
151 b1in <<
"composite1";
154 col3in <<
"colormatrix4";
156 col3in <<
"component1";
172 b2in <<
"colormatrix2";
189 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Chromolitho\">\n"
190 "<feComposite in=\"SourceGraphic\" in2=\"SourceGraphic\" operator=\"arithmetic\" k1=\"%s\" k2=\"1\" result=\"composite1\" />\n"
191 "<feConvolveMatrix in=\"composite1\" kernelMatrix=\"0 250 0 250 %s 250 0 250 0 \" order=\"3 3\" result=\"convolve1\" />\n"
192 "<feBlend in=\"%s\" in2=\"composite1\" mode=\"%s\" result=\"blend1\" />\n"
193 "<feGaussianBlur in=\"blend1\" stdDeviation=\"%s\" result=\"blur1\" />\n"
194 "<feTurbulence baseFrequency=\"%s %s\" numOctaves=\"%s\" seed=\"%s\" type=\"fractalNoise\" result=\"turbulence1\" />\n"
195 "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 %s %s \" result=\"colormatrix1\" />\n"
196 "<feColorMatrix type=\"saturate\" values=\"%s\" result=\"colormatrix2\" />\n"
197 "<feBlend in=\"%s\" in2=\"blur1\" mode=\"%s\" result=\"blend2\" />\n"
198 "<feColorMatrix in=\"blend2\" type=\"saturate\" values=\"%s\" result=\"colormatrix3\" />\n"
199 "<feComponentTransfer in=\"colormatrix3\" result=\"component1\">\n"
200 "<feFuncR type=\"discrete\" tableValues=\"%s\" />\n"
201 "<feFuncG type=\"discrete\" tableValues=\"%s\" />\n"
202 "<feFuncB type=\"discrete\" tableValues=\"%s\" />\n"
203 "</feComponentTransfer>\n"
204 "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 -0.2125 -0.7154 -0.0721 1 0 \" result=\"colormatrix4\" />\n"
205 "<feColorMatrix in=\"%s\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 15 0 \" result=\"colormatrix5\" />\n"
206 "<feComposite in2=\"SourceGraphic\" operator=\"in\" result=\"composite2\" />\n"
207 "</filter>\n", light.str().c_str(), noise.str().c_str(), b1in.str().c_str(), dblend.str().c_str(),
smooth.str().c_str(), grainxf.str().c_str(), grainyf.str().c_str(), grainc.str().c_str(), grainv.str().c_str(), grainexp.str().c_str(), grainero.str().c_str(), graincol.str().c_str(), b2in.str().c_str(), gblend.str().c_str(), saturation.str().c_str(), transf.str().c_str(), transf.str().c_str(), transf.str().c_str(), col3in.str().c_str());
237 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
238 "<name>" N_(
"Cross Engraving")
"</name>\n"
239 "<id>org.inkscape.effect.filter.CrossEngraving</id>\n"
240 "<param name=\"clean\" gui-text=\"" N_(
"Clean-up")
"\" type=\"int\" appearance=\"full\" min=\"1\" max=\"500\">30</param>\n"
241 "<param name=\"dilat\" gui-text=\"" N_(
"Dilatation")
"\" type=\"float\" appearance=\"full\" min=\"1\" max=\"50\">1</param>\n"
242 "<param name=\"erosion\" gui-text=\"" N_(
"Erosion")
"\" type=\"float\" appearance=\"full\" min=\"0\" max=\"50\">0</param>\n"
243 "<param name=\"strength\" gui-text=\"" N_(
"Strength")
"\" type=\"float\" appearance=\"full\" min=\"0.1\" max=\"10\">0.5</param>\n"
244 "<param name=\"length\" gui-text=\"" N_(
"Length")
"\" type=\"float\" appearance=\"full\" min=\"0.5\" max=\"20\">4</param>\n"
245 "<param name=\"trans\" gui-text=\"" N_(
"Transparent")
"\" type=\"bool\" >false</param>\n"
247 "<object-type>all</object-type>\n"
249 "<submenu name=\"" N_(
"Filters")
"\">\n"
250 "<submenu name=\"" N_(
"Image Paint and Draw")
"\"/>\n"
253 "<menu-tip>" N_(
"Convert image to an engraving made of vertical and horizontal lines")
"</menu-tip>\n"
255 "</inkscape-extension>\n", std::make_unique<CrossEngraving>());
265 std::ostringstream
clean;
266 std::ostringstream dilat;
267 std::ostringstream erosion;
268 std::ostringstream strength;
269 std::ostringstream
length;
270 std::ostringstream trans;
278 trans <<
"composite3";
284 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Cross Engraving\">\n"
285 "<feConvolveMatrix in=\"SourceGraphic\" targetY=\"1\" targetX=\"1\" kernelMatrix=\"0 250 0 250 %s 250 0 250 0 \" order=\"3 3\" result=\"convolve\" />\n"
286 "<feComposite in=\"convolve\" in2=\"convolve\" k1=\"1\" k2=\"1\" operator=\"arithmetic\" result=\"composite1\" />\n"
287 "<feColorMatrix in=\"composite1\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.2125 -0.7154 -0.0721 1 0 \" result=\"color1\" />\n"
288 "<feColorMatrix in=\"color1\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 %s %s \" result=\"color2\" />\n"
289 "<feComposite in=\"color2\" in2=\"color2\" operator=\"arithmetic\" k2=\"%s\" result=\"composite2\" />\n"
290 "<feGaussianBlur in=\"composite2\" stdDeviation=\"%s 0.01\" result=\"blur1\" />\n"
291 "<feGaussianBlur in=\"composite2\" stdDeviation=\"0.01 %s\" result=\"blur2\" />\n"
292 "<feComposite in=\"blur2\" in2=\"blur1\" k3=\"1\" k2=\"1\" operator=\"arithmetic\" result=\"composite3\" />\n"
293 "<feFlood flood-color=\"rgb(255,255,255)\" flood-opacity=\"1\" result=\"flood\" />\n"
294 "<feBlend in=\"flood\" in2=\"composite3\" mode=\"multiply\" result=\"blend\" />\n"
295 "<feComposite in=\"%s\" in2=\"SourceGraphic\" operator=\"in\" result=\"composite4\" />\n"
296 "</filter>\n",
clean.str().c_str(), dilat.str().c_str(), erosion.str().c_str(), strength.str().c_str(),
length.str().c_str(),
length.str().c_str(), trans.str().c_str());
340 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
341 "<name>" N_(
"Drawing")
"</name>\n"
342 "<id>org.inkscape.effect.filter.Drawing</id>\n"
343 "<param name=\"tab\" type=\"notebook\">\n"
344 "<page name=\"optionstab\" gui-text=\"Options\">\n"
345 "<label appearance=\"header\">" N_(
"Simplify")
"</label>\n"
346 "<param name=\"simply\" gui-text=\"" N_(
"Strength")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"20.00\">0.6</param>\n"
347 "<param name=\"clean\" gui-text=\"" N_(
"Clean-up")
"\" type=\"int\" indent=\"1\" appearance=\"full\" min=\"1\" max=\"500\">10</param>\n"
348 "<param name=\"erase\" gui-text=\"" N_(
"Erase")
"\" type=\"float\" indent=\"1\" appearance=\"full\" min=\"0\" max=\"60\">0</param>\n"
349 "<param name=\"translucent\" gui-text=\"" N_(
"Translucent")
"\" indent=\"1\" type=\"bool\" >false</param>\n"
350 "<label appearance=\"header\">" N_(
"Smoothness")
"</label>\n"
351 "<param name=\"smooth\" gui-text=\"" N_(
"Strength")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"20.00\">0.6</param>\n"
352 "<param name=\"dilat\" gui-text=\"" N_(
"Dilatation")
"\" type=\"float\" indent=\"1\" appearance=\"full\" min=\"1\" max=\"50\">6</param>\n"
353 "<param name=\"erosion\" gui-text=\"" N_(
"Erosion")
"\" type=\"float\" indent=\"1\" appearance=\"full\" min=\"0\" max=\"50\">2</param>\n"
354 "<label appearance=\"header\">" N_(
"Melt")
"</label>\n"
355 "<param name=\"blur\" gui-text=\"" N_(
"Level")
"\" type=\"float\" indent=\"1\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"20.00\">1</param>\n"
356 "<param name=\"bdilat\" gui-text=\"" N_(
"Dilatation")
"\" type=\"float\" indent=\"1\" appearance=\"full\" min=\"1\" max=\"50\">6</param>\n"
357 "<param name=\"berosion\" gui-text=\"" N_(
"Erosion")
"\" type=\"float\" indent=\"1\" appearance=\"full\" min=\"0\" max=\"50\">2</param>\n"
359 "<page name=\"co11tab\" gui-text=\"Fill color\">\n"
360 "<param name=\"fcolor\" gui-text=\"" N_(
"Fill color")
"\" type=\"color\">-1515870721</param>\n"
361 "<param name=\"iof\" gui-text=\"" N_(
"Image on fill")
"\" type=\"bool\" >false</param>\n"
363 "<page name=\"co12tab\" gui-text=\"Stroke color\">\n"
364 "<param name=\"scolor\" gui-text=\"" N_(
"Stroke color")
"\" type=\"color\">589505535</param>\n"
365 "<param name=\"ios\" gui-text=\"" N_(
"Image on stroke")
"\" type=\"bool\" >false</param>\n"
366 "<param name=\"offset\" gui-text=\"" N_(
"Offset")
"\" type=\"int\" appearance=\"full\" min=\"-100\" max=\"100\">0</param>\n"
370 "<object-type>all</object-type>\n"
372 "<submenu name=\"" N_(
"Filters")
"\">\n"
373 "<submenu name=\"" N_(
"Image Paint and Draw")
"\"/>\n"
376 "<menu-tip>" N_(
"Convert images to duochrome drawings")
"</menu-tip>\n"
378 "</inkscape-extension>\n", std::make_unique<Drawing>());
388 std::ostringstream simply;
389 std::ostringstream
clean;
390 std::ostringstream erase;
391 std::ostringstream
smooth;
392 std::ostringstream dilat;
393 std::ostringstream erosion;
394 std::ostringstream translucent;
395 std::ostringstream
offset;
396 std::ostringstream blur;
397 std::ostringstream bdilat;
398 std::ostringstream berosion;
399 std::ostringstream strokea;
400 std::ostringstream stroker;
401 std::ostringstream strokeg;
402 std::ostringstream strokeb;
403 std::ostringstream ios;
404 std::ostringstream filla;
405 std::ostringstream fillr;
406 std::ostringstream fillg;
407 std::ostringstream fillb;
408 std::ostringstream iof;
417 translucent <<
"merge1";
419 translucent <<
"color5";
427 fillr << ((fcolor >> 24) & 0xff);
428 fillg << ((fcolor >> 16) & 0xff);
429 fillb << ((fcolor >> 8) & 0xff);
430 filla << (fcolor & 0xff) / 255.0F;
432 iof <<
"SourceGraphic";
437 stroker << ((scolor >> 24) & 0xff);
438 strokeg << ((scolor >> 16) & 0xff);
439 strokeb << ((scolor >> 8) & 0xff);
440 strokea << (scolor & 0xff) / 255.0F;
442 ios <<
"SourceGraphic";
448 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Drawing\">\n"
449 "<feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"%s\" result=\"blur1\" />\n"
450 "<feConvolveMatrix in=\"blur1\" targetX=\"1\" targetY=\"1\" order=\"3 3\" kernelMatrix=\"0 250 0 250 %s 250 0 250 0 \" result=\"convolve1\" />\n"
451 "<feComposite in=\"convolve1\" in2=\"convolve1\" k1=\"1\" k2=\"1\" k4=\"%s\" operator=\"arithmetic\" result=\"composite1\" />\n"
452 "<feColorMatrix in=\"composite1\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.2125 -0.7154 -0.0721 1 0 \" result=\"color1\" />\n"
453 "<feGaussianBlur stdDeviation=\"%s\" result=\"blur2\" />\n"
454 "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 %s %s \" result=\"color2\" />\n"
455 "<feFlood flood-color=\"rgb(255,255,255)\" result=\"flood1\" />\n"
456 "<feBlend in2=\"color2\" mode=\"multiply\" result=\"blend1\" />\n"
457 "<feComponentTransfer in=\"blend1\" result=\"component1\">\n"
458 "<feFuncR type=\"discrete\" tableValues=\"0 1 1 1\" />\n"
459 "<feFuncG type=\"discrete\" tableValues=\"0 1 1 1\" />\n"
460 "<feFuncB type=\"discrete\" tableValues=\"0 1 1 1\" />\n"
461 "</feComponentTransfer>\n"
462 "<feGaussianBlur stdDeviation=\"%s\" result=\"blur3\" />\n"
463 "<feColorMatrix in=\"blur3\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.2125 -0.7154 -0.0721 1 0 \" result=\"color3\" />\n"
464 "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 %s %s \" result=\"color4\" />\n"
465 "<feFlood flood-color=\"rgb(%s,%s,%s)\" result=\"flood2\" />\n"
466 "<feComposite in=\"%s\" in2=\"color4\" operator=\"in\" result=\"composite2\" />\n"
467 "<feComposite in=\"composite2\" in2=\"composite2\" operator=\"arithmetic\" k2=\"%s\" result=\"composite3\" />\n"
468 "<feOffset dx=\"%s\" dy=\"%s\" result=\"offset1\" />\n"
469 "<feFlood in=\"color4\" flood-color=\"rgb(%s,%s,%s)\" result=\"flood3\" />\n"
470 "<feComposite in=\"%s\" in2=\"color4\" operator=\"out\" result=\"composite4\" />\n"
471 "<feComposite in=\"composite4\" in2=\"composite4\" operator=\"arithmetic\" k2=\"%s\" result=\"composite5\" />\n"
472 "<feMerge result=\"merge1\">\n"
473 "<feMergeNode in=\"composite5\" />\n"
474 "<feMergeNode in=\"offset1\" />\n"
476 "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1.3 0 \" result=\"color5\" flood-opacity=\"0.56\" />\n"
477 "<feComposite in=\"%s\" in2=\"SourceGraphic\" operator=\"in\" result=\"composite8\" />\n"
478 "</filter>\n", simply.str().c_str(),
clean.str().c_str(), erase.str().c_str(),
smooth.str().c_str(), dilat.str().c_str(), erosion.str().c_str(), blur.str().c_str(), bdilat.str().c_str(), berosion.str().c_str(), stroker.str().c_str(), strokeg.str().c_str(), strokeb.str().c_str(), ios.str().c_str(), strokea.str().c_str(),
offset.str().c_str(),
offset.str().c_str(), fillr.str().c_str(), fillg.str().c_str(), fillb.str().c_str(), iof.str().c_str(), filla.str().c_str(), translucent.str().c_str());
507 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
508 "<name>" N_(
"Electrize")
"</name>\n"
509 "<id>org.inkscape.effect.filter.Electrize</id>\n"
510 "<param name=\"blur\" gui-text=\"" N_(
"Simplify")
"\" type=\"float\" appearance=\"full\" min=\"0.01\" max=\"10.0\">2.0</param>\n"
511 "<param name=\"type\" gui-text=\"" N_(
"Effect type:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
512 "<option value=\"table\">" N_(
"Table")
"</option>\n"
513 "<option value=\"discrete\">" N_(
"Discrete")
"</option>\n"
515 "<param name=\"levels\" gui-text=\"" N_(
"Levels")
"\" type=\"int\" appearance=\"full\" min=\"0\" max=\"10\">3</param>\n"
516 "<param name=\"invert\" gui-text=\"" N_(
"Inverted")
"\" type=\"bool\">false</param>\n"
518 "<object-type>all</object-type>\n"
520 "<submenu name=\"" N_(
"Filters")
"\">\n"
521 "<submenu name=\"" N_(
"Image Paint and Draw")
"\"/>\n"
524 "<menu-tip>" N_(
"Electro solarization effects")
"</menu-tip>\n"
526 "</inkscape-extension>\n", std::make_unique<Electrize>());
536 std::ostringstream blur;
537 std::ostringstream type;
538 std::ostringstream values;
550 for (
int step = 1 ; step <= levels ; step++ ) {
557 values <<
" " << val;
562 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Electrize\">\n"
563 "<feGaussianBlur stdDeviation=\"%s\" result=\"blur\" />\n"
564 "<feComponentTransfer in=\"blur\" result=\"component\" >\n"
565 "<feFuncR type=\"%s\" tableValues=\"%s\" />\n"
566 "<feFuncG type=\"%s\" tableValues=\"%s\" />\n"
567 "<feFuncB type=\"%s\" tableValues=\"%s\" />\n"
568 "</feComponentTransfer>\n"
569 "</filter>\n", blur.str().c_str(), type.str().c_str(), values.str().c_str(), type.str().c_str(), values.str().c_str(), type.str().c_str(), values.str().c_str());
601 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
602 "<name>" N_(
"Neon Draw")
"</name>\n"
603 "<id>org.inkscape.effect.filter.NeonDraw</id>\n"
604 "<param name=\"type\" gui-text=\"" N_(
"Line type:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
605 "<option value=\"table\">" N_(
"Smoothed")
"</option>\n"
606 "<option value=\"discrete\">" N_(
"Contrasted")
"</option>\n"
608 "<param name=\"simply\" gui-text=\"" N_(
"Simplify")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"20.00\">3</param>\n"
609 "<param name=\"width\" gui-text=\"" N_(
"Line width")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"20.00\">3</param>\n"
610 "<param name=\"lightness\" gui-text=\"" N_(
"Lightness")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.00\" max=\"10.00\">1</param>\n"
611 "<param name=\"blend\" gui-text=\"" N_(
"Blend mode:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
612 "<option value=\"normal\">Normal</option>\n"
613 "<option value=\"multiply\">Multiply</option>\n"
614 "<option value=\"screen\">Screen</option>\n"
617 "<object-type>all</object-type>\n"
619 "<submenu name=\"" N_(
"Filters")
"\">\n"
620 "<submenu name=\"" N_(
"Image Paint and Draw")
"\"/>\n"
623 "<menu-tip>" N_(
"Posterize and draw smooth lines around color shapes")
"</menu-tip>\n"
625 "</inkscape-extension>\n", std::make_unique<NeonDraw>());
635 std::ostringstream blend;
636 std::ostringstream simply;
637 std::ostringstream
width;
638 std::ostringstream lightness;
639 std::ostringstream type;
649 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Neon Draw\">\n"
650 "<feBlend mode=\"%s\" result=\"blend\" />\n"
651 "<feGaussianBlur in=\"blend\" stdDeviation=\"%s\" result=\"blur1\" />\n"
652 "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 0\" result=\"color1\" />\n"
653 "<feComponentTransfer result=\"component1\">\n"
654 "<feFuncR type=\"discrete\" tableValues=\"0 0.3 0.3 0.3 0.3 0.6 0.6 0.6 0.6 1 1\" />\n"
655 "<feFuncG type=\"discrete\" tableValues=\"0 0.3 0.3 0.3 0.3 0.6 0.6 0.6 0.6 1 1\" />\n"
656 "<feFuncB type=\"discrete\" tableValues=\"0 0.3 0.3 0.3 0.3 0.6 0.6 0.6 0.6 1 1\" />\n"
657 "</feComponentTransfer>\n"
658 "<feGaussianBlur in=\"component1\" stdDeviation=\"%s\" result=\"blur2\" />\n"
659 "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 0\" result=\"color2\" />\n"
660 "<feComponentTransfer in=\"color2\" result=\"component2\">\n"
661 "<feFuncR type=\"%s\" tableValues=\"0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1\" />\n"
662 "<feFuncG type=\"%s\" tableValues=\"0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1\" />\n"
663 "<feFuncB type=\"%s\" tableValues=\"0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1\" />\n"
664 "</feComponentTransfer>\n"
665 "<feComposite in=\"component2\" in2=\"blur2\" k3=\"%s\" operator=\"arithmetic\" k2=\"1\" result=\"composite1\" />\n"
666 "<feComposite in=\"composite1\" in2=\"SourceGraphic\" operator=\"in\" result=\"composite2\" />\n"
667 "</filter>\n", blend.str().c_str(), simply.str().c_str(),
width.str().c_str(), type.str().c_str(), type.str().c_str(), type.str().c_str(), lightness.str().c_str());
708 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
709 "<name>" N_(
"Point Engraving")
"</name>\n"
710 "<id>org.inkscape.effect.filter.PointEngraving</id>\n"
711 "<param name=\"tab\" type=\"notebook\">\n"
712 "<page name=\"optionstab\" gui-text=\"" N_(
"Options")
"\">\n"
713 "<param name=\"type\" gui-text=\"" N_(
"Turbulence type:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
714 "<option value=\"fractalNoise\">" N_(
"Fractal noise")
"</option>\n"
715 "<option value=\"turbulence\">" N_(
"Turbulence")
"</option>\n"
717 "<param name=\"hfreq\" gui-text=\"" N_(
"Horizontal frequency")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.1\" max=\"100.00\">100</param>\n"
718 "<param name=\"vfreq\" gui-text=\"" N_(
"Vertical frequency")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.1\" max=\"100.00\">100</param>\n"
719 "<param name=\"complexity\" gui-text=\"" N_(
"Complexity")
"\" type=\"int\" appearance=\"full\" min=\"1\" max=\"5\">1</param>\n"
720 "<param name=\"variation\" gui-text=\"" N_(
"Variation")
"\" type=\"int\" appearance=\"full\" min=\"1\" max=\"100\">0</param>\n"
721 "<param name=\"reduction\" gui-text=\"" N_(
"Noise reduction")
"\" type=\"int\" appearance=\"full\" min=\"0\" max=\"500\">45</param>\n"
722 "<param name=\"blend\" gui-text=\"" N_(
"Noise blend:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
723 "<option value=\"multiply\">" N_(
"Multiply")
"</option>\n"
724 "<option value=\"normal\">" N_(
"Normal")
"</option>\n"
725 "<option value=\"screen\">" N_(
"Screen")
"</option>\n"
726 "<option value=\"lighten\">" N_(
"Lighten")
"</option>\n"
727 "<option value=\"darken\">" N_(
"Darken")
"</option>\n"
729 "<param name=\"lightness\" gui-text=\"" N_(
"Lightness")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0\" max=\"10\">2.5</param>\n"
730 "<param name=\"grain\" gui-text=\"" N_(
"Grain lightness")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0\" max=\"10\">1.3</param>\n"
731 "<param name=\"erase\" gui-text=\"" N_(
"Erase")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0\" max=\"1\">0</param>\n"
732 "<param name=\"blur\" gui-text=\"" N_(
"Blur")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"2\">0.5</param>\n"
734 "<page name=\"fcolortab\" gui-text=\"" N_(
"Fill color")
"\">\n"
735 "<param name=\"fcolor\" gui-text=\"" N_(
"Color")
"\" type=\"color\">-1</param>\n"
736 "<param name=\"iof\" gui-text=\"" N_(
"Image on fill")
"\" type=\"bool\" >false</param>\n"
738 "<page name=\"pcolortab\" gui-text=\"" N_(
"Points color")
"\">\n"
739 "<param name=\"pcolor\" gui-text=\"" N_(
"Color")
"\" type=\"color\">1666789119</param>\n"
740 "<param name=\"iop\" gui-text=\"" N_(
"Image on points")
"\" type=\"bool\" >false</param>\n"
744 "<object-type>all</object-type>\n"
746 "<submenu name=\"" N_(
"Filters")
"\">\n"
747 "<submenu name=\"" N_(
"Image Paint and Draw")
"\"/>\n"
750 "<menu-tip>" N_(
"Convert image to a transparent point engraving")
"</menu-tip>\n"
752 "</inkscape-extension>\n", std::make_unique<PointEngraving>());
763 std::ostringstream type;
764 std::ostringstream hfreq;
765 std::ostringstream vfreq;
766 std::ostringstream complexity;
767 std::ostringstream variation;
768 std::ostringstream reduction;
769 std::ostringstream blend;
770 std::ostringstream lightness;
771 std::ostringstream grain;
772 std::ostringstream erase;
773 std::ostringstream blur;
774 std::ostringstream r;
775 std::ostringstream g;
776 std::ostringstream b;
777 std::ostringstream a;
778 std::ostringstream br;
779 std::ostringstream bg;
780 std::ostringstream bb;
781 std::ostringstream ba;
782 std::ostringstream iof;
783 std::ostringstream iop;
798 r << ((fcolor >> 24) & 0xff);
799 g << ((fcolor >> 16) & 0xff);
800 b << ((fcolor >> 8) & 0xff);
801 a << (fcolor & 0xff) / 255.0F;
804 br << ((pcolor >> 24) & 0xff);
805 bg << ((pcolor >> 16) & 0xff);
806 bb << ((pcolor >> 8) & 0xff);
807 ba << (pcolor & 0xff) / 255.0F;
810 iof <<
"SourceGraphic";
815 iop <<
"SourceGraphic";
821 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" inkscape:label=\"Point Engraving\" style=\"color-interpolation-filters:sRGB;\">\n"
822 "<feConvolveMatrix in=\"SourceGraphic\" kernelMatrix=\"0 250 0 250 %s 250 0 250 0\" order=\"3 3\" result=\"convolve\" />\n"
823 "<feBlend in=\"convolve\" in2=\"SourceGraphic\" mode=\"%s\" result=\"blend\" />\n"
824 "<feTurbulence type=\"%s\" baseFrequency=\"%s %s\" numOctaves=\"%s\" seed=\"%s\" result=\"turbulence\" />\n"
825 "<feColorMatrix in=\"blend\" type=\"luminanceToAlpha\" result=\"colormatrix1\" />\n"
826 "<feComposite in=\"turbulence\" in2=\"colormatrix1\" k1=\"%s\" k2=\"%s\" k4=\"%s\" operator=\"arithmetic\" result=\"composite1\" />\n"
827 "<feColorMatrix in=\"composite1\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 10 -9 \" result=\"colormatrix2\" />\n"
828 "<feGaussianBlur stdDeviation=\"%s\" result=\"blur\" />\n"
829 "<feFlood flood-color=\"rgb(%s,%s,%s)\" flood-opacity=\"%s\" result=\"flood1\" />\n"
830 "<feComposite in=\"%s\" in2=\"blur\" operator=\"out\" result=\"composite2\" />\n"
831 "<feFlood flood-color=\"rgb(%s,%s,%s)\" flood-opacity=\"%s\" result=\"flood2\" />\n"
832 "<feComposite in=\"%s\" in2=\"blur\" operator=\"in\" result=\"composite3\" />\n"
833 "<feComposite in=\"composite3\" in2=\"composite2\" k2=\"%s\" k3=\"%s\" operator=\"arithmetic\" result=\"composite4\" />\n"
834 "<feComposite in2=\"SourceGraphic\" operator=\"in\" result=\"composite5\" />\n"
835 "</filter>\n", reduction.str().c_str(), blend.str().c_str(),
836 type.str().c_str(), hfreq.str().c_str(), vfreq.str().c_str(), complexity.str().c_str(), variation.str().c_str(),
837 lightness.str().c_str(), grain.str().c_str(), erase.str().c_str(), blur.str().c_str(),
838 br.str().c_str(), bg.str().c_str(), bb.str().c_str(), ba.str().c_str(), iop.str().c_str(),
839 r.str().c_str(), g.str().c_str(), b.str().c_str(), a.str().c_str(), iof.str().c_str(),
840 a.str().c_str(), ba.str().c_str() );
875 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
876 "<name>" N_(
"Poster Paint")
"</name>\n"
877 "<id>org.inkscape.effect.filter.Posterize</id>\n"
878 "<param name=\"type\" gui-text=\"" N_(
"Effect type:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
879 "<option value=\"normal\">Normal</option>\n"
880 "<option value=\"dented\">Dented</option>\n"
882 "<param name=\"table\" gui-text=\"" N_(
"Transfer type:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
883 "<option value=\"discrete\">" N_(
"Poster")
"</option>\n"
884 "<option value=\"table\">" N_(
"Painting")
"</option>\n"
886 "<param name=\"levels\" gui-text=\"" N_(
"Levels")
"\" type=\"int\" appearance=\"full\" min=\"0\" max=\"15\">5</param>\n"
887 "<param name=\"blend\" gui-text=\"" N_(
"Blend mode:")
"\" type=\"optiongroup\" appearance=\"combo\">\n"
888 "<option value=\"lighten\">Lighten</option>\n"
889 "<option value=\"normal\">Normal</option>\n"
890 "<option value=\"darken\">Darken</option>\n"
891 "<option value=\"multiply\">Multiply</option>\n"
892 "<option value=\"screen\">Screen</option>\n"
894 "<param name=\"blur1\" gui-text=\"" N_(
"Simplify (primary)")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"100.00\">4.0</param>\n"
895 "<param name=\"blur2\" gui-text=\"" N_(
"Simplify (secondary)")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"100.00\">0.5</param>\n"
896 "<param name=\"presaturation\" gui-text=\"" N_(
"Pre-saturation")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.00\" max=\"1.00\">1.00</param>\n"
897 "<param name=\"postsaturation\" gui-text=\"" N_(
"Post-saturation")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.00\" max=\"1.00\">1.00</param>\n"
898 "<param name=\"antialiasing\" gui-text=\"" N_(
"Simulate antialiasing")
"\" type=\"bool\">false</param>\n"
900 "<object-type>all</object-type>\n"
902 "<submenu name=\"" N_(
"Filters")
"\">\n"
903 "<submenu name=\"" N_(
"Image Paint and Draw")
"\"/>\n"
906 "<menu-tip>" N_(
"Poster and painting effects")
"</menu-tip>\n"
908 "</inkscape-extension>\n", std::make_unique<Posterize>());
918 std::ostringstream table;
919 std::ostringstream blendmode;
920 std::ostringstream blur1;
921 std::ostringstream blur2;
922 std::ostringstream presat;
923 std::ostringstream postsat;
924 std::ostringstream transf;
925 std::ostringstream antialias;
939 if ((g_ascii_strcasecmp(
"dented", effecttype) == 0)) {
945 for (
int step = 1 ; step <= levels ; step++ ) {
946 float val = (float) step / levels;
947 transf <<
" " << val;
948 if ((g_ascii_strcasecmp(
"dented", effecttype) == 0)) {
949 transf <<
" " << (val - ((float) 1 / (3 * levels))) <<
" " << (val + ((float) 1 / (2 * levels)));
962 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Poster Paint\">\n"
963 "<feComposite operator=\"arithmetic\" k2=\"1\" result=\"composite1\" />\n"
964 "<feGaussianBlur stdDeviation=\"%s\" result=\"blur1\" />\n"
965 "<feGaussianBlur in=\"composite1\" stdDeviation=\"%s\" result=\"blur2\" />\n"
966 "<feBlend in2=\"blur1\" mode=\"%s\" result=\"blend\"/>\n"
967 "<feColorMatrix type=\"saturate\" values=\"%s\" result=\"color1\" />\n"
968 "<feComponentTransfer result=\"component\">\n"
969 "<feFuncR type=\"%s\" tableValues=\"%s\" />\n"
970 "<feFuncG type=\"%s\" tableValues=\"%s\" />\n"
971 "<feFuncB type=\"%s\" tableValues=\"%s\" />\n"
972 "</feComponentTransfer>\n"
973 "<feColorMatrix type=\"saturate\" values=\"%s\" result=\"color2\" />\n"
974 "<feGaussianBlur stdDeviation=\"%s\" result=\"blur3\" />\n"
975 "<feComposite in2=\"SourceGraphic\" operator=\"in\" result=\"composite3\" />\n"
976 "</filter>\n", blur1.str().c_str(), blur2.str().c_str(), blendmode.str().c_str(), presat.str().c_str(), table.str().c_str(), transf.str().c_str(), table.str().c_str(), transf.str().c_str(), table.str().c_str(), transf.str().c_str(), postsat.str().c_str(), antialias.str().c_str());
1002 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
1003 "<name>" N_(
"Posterize Basic")
"</name>\n"
1004 "<id>org.inkscape.effect.filter.PosterizeBasic</id>\n"
1005 "<param name=\"levels\" gui-text=\"" N_(
"Levels")
"\" type=\"int\" appearance=\"full\" min=\"0\" max=\"20\">5</param>\n"
1006 "<param name=\"blur\" gui-text=\"" N_(
"Simplify")
"\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"20.00\">4.0</param>\n"
1008 "<object-type>all</object-type>\n"
1010 "<submenu name=\"" N_(
"Filters")
"\">\n"
1011 "<submenu name=\"" N_(
"Image Paint and Draw")
"\"/>\n"
1014 "<menu-tip>" N_(
"Simple posterizing effect")
"</menu-tip>\n"
1016 "</inkscape-extension>\n", std::make_unique<PosterizeBasic>());
1026 std::ostringstream blur;
1027 std::ostringstream transf;
1033 for (
int step = 1 ; step <= levels ; step++ ) {
1034 const float val = (float) step / levels;
1035 transf <<
" " << val;
1041 "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" style=\"color-interpolation-filters:sRGB;\" inkscape:label=\"Posterize Basic\">\n"
1042 "<feGaussianBlur stdDeviation=\"%s\" result=\"blur1\" />\n"
1043 "<feComponentTransfer in=\"blur1\" result=\"component1\">\n"
1044 "<feFuncR type=\"discrete\" tableValues=\"%s\" />\n"
1045 "<feFuncG type=\"discrete\" tableValues=\"%s\" />\n"
1046 "<feFuncB type=\"discrete\" tableValues=\"%s\" />\n"
1047 "</feComponentTransfer>\n"
1048 "<feComposite in=\"component1\" in2=\"SourceGraphic\" operator=\"in\" />\n"
1049 "</filter>\n", blur.str().c_str(), transf.str().c_str(), transf.str().c_str(), transf.str().c_str());
Cairo::RefPtr< Cairo::Region > clean
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 Chromolitho filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Cross engraving filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
~CrossEngraving() override
Custom predefined Drawing filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Electrize filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Neon draw filter.
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Point engraving filter.
~PointEngraving() override
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Posterize basic filter.
~PosterizeBasic() override
gchar const * get_filter_text(Inkscape::Extension::Extension *ext) override
Custom predefined Poster paint 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.
Coord length(LineSegment const &seg)
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.
Glib::RefPtr< Gtk::Adjustment > smooth