<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="font-family: &#39;DejaVu Sans&#39;; font-size: 9pt; font-weight: 400; font-style: normal;">


<div>
&gt; The first issue is toXML/toLegacyXML stuff. These functions are implemented<br>
&gt; in _different_ classes although they do the same things. More than that,<br>
&gt; both of them are called from different parts of krita: bookmark manager<br>
&gt; uses toXML, kis_kra_ uses toLegacyXML Why not have the only one? The only<br>
&gt; united interface?<br></div>
.kra file are expected to use the toLegacyXML because this functions saves to an XML formated for the 1.6 .kra files. While toXML use the OpenRaster style, described in <a href="http://create.freedesktop.org/wiki/index.php?title=OpenRaster/Layers_Stack_Specification" target="_blank">http://create.freedesktop.org/wiki/index.php?title=OpenRaster/Layers_Stack_Specification</a> .<br>



<p style="margin: 0px; text-indent: 0px;"></p></div></blockquote><div><br>Do you mean filter&#39;s configuration should look like that?<br><pre>&lt;filter name=&quot;perchannel&quot; type=&quot;applications:Krita:PerChannel&quot;&gt;<br>
     &lt;params version=1&gt;<br>       &lt;param name=&quot;CurvesNumber&quot;&gt;3&lt;/param&gt;<br>       &lt;param name=&quot;curve0&quot;&gt;0,0;0.5,0.5;1,1;&lt;/param&gt;<br>       &lt;param name=&quot;curve1&quot;&gt;0,0;1,1;&lt;/param&gt;<br>
       &lt;param name=&quot;curve2&quot;&gt;0,0;1,1;&lt;/param&gt;<br>     &lt;/params&gt;<br>&lt;/filter&gt;</pre><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div style="font-family: &#39;DejaVu Sans&#39;; font-size: 9pt; font-weight: 400; font-style: normal;"> even if it will be very inspired by the SVG spec.<div>
</div></div></blockquote><div><br>I&#39;m afraid we can&#39;t be inspired by SVGspec here at all. The point is they suggest us to use linear interpolation for the curve (i guess this type of the curve had been implemented in KCurve before my patch) . Maybe this type is a good idea for some ideal theoretical curve as it&#39;s quite simple and fast, but for real users (who are &quot;inspired&quot; by real professional instrumens, such as PS, PictureWindowPro, TheGimp) it&#39;s at least _strange_ curve and almost unusable, because they are used to cubic splines.<br>

<br>Of course, we can interpolate cubic spline, drawn by the user, to the linear one and write the latter to the file in SVG format. But the user won&#39;t be able to change the curve later.<br><br>And the last issue against SVG. SVG&#39;s feComponentTransferis is stuck to RGB. RGB is not the only colorspace in the world. ;)<br>

<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="font-family: &#39;DejaVu Sans&#39;; font-size: 9pt; font-weight: 400; font-style: normal;">

&gt; KisBaseProcessor::defaultConfiguration(const KisPaintDeviceSP pd)<br><br>
The documentation says all. </div></blockquote><div><br>Where can i take a look on this documentation?<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div style="font-family: &#39;DejaVu Sans&#39;; font-size: 9pt; font-weight: 400; font-style: normal;">It&#39;s the configuration that will be used in the filter dialog when the user start the dialog.<br>
<p style="margin: 0px; text-indent: 0px;"></p>You forgot that way as well:<br>
KisFilterConfiguration * KisBaseProcessor::factoryConfiguration(const KisPaintDeviceSP) const<br>
whose name sucks and is a bit confusing (if anyone has a better idea,</div></blockquote><div><br>createConfiguration?<br> </div><div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="font-family: &#39;DejaVu Sans&#39;; font-size: 9pt; font-weight: 400; font-style: normal;">Filter configurations are saved in KisBookmarkedConfigurationManager which is a generic class which can be used with all kind of KisSerializableConfiguration to store them, this can be filters/generators configuration, paintop settings, ... The only way KisBookmarkedConfigurationManager can create the correct subclass of KisSerializableConfiguration is by using the KisFilterConfigurationFactory.<br>



<p style="margin: 0px; text-indent: 0px;"></p></div></blockquote><div><br>The problem is that KisKraLoader::loadAdjustmentLayer calls KisBaseProcessor::defaultConfiguration(...). The latter one calls factoryConfiguration and (if factoryConfiguration isn&#39;t overridden in KisPerChannelFilter) creates KisFilterConfiguration instead of needed KisPerChannelFilterConfiguration. This causes adjustment layers not being loaded properly from .kra.<br>
<br>The easiest (and the most illogical) workaround is to change KisBookmarkedConfigurationManager::defaultConfiguration, that has access to filter&#39;s configurationFactory, to call factory&#39;s createDefault if nothing can be loaded from kritarc.<br>
KisSerializableConfiguration* KisBookmarkedConfigurationManager::defaultConfiguration() const<br>{<br>    if (exists(KisBookmarkedConfigurationManager::ConfigDefault.id())) {<br>        return load(KisBookmarkedConfigurationManager::ConfigDefault.id());<br>
    }<br>///skipped///<br>    return d-&gt;configFactory-&gt;createDefault();<br>}<br><br>In this case we won&#39;t need factoryDefault at all. But this change is _very bad idea_ as it&#39;s illogical.<br><br>In my opinion Factories should somehow call Filter&#39;s defaultConfiguration instead of having their own createDefault and create(...). In this case, maybe, we won&#39;t even be needed to override KisConfigurationFactory for every filter.<br>
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="font-family: &#39;DejaVu Sans&#39;; font-size: 9pt; font-weight: 400; font-style: normal;">
<p style="margin: 0px; text-indent: 0px;"></p>The difference between createDefault and create, is that create is used to unserialized configuration, and createDefault is used to create the first to use default configuration (now that I have said that, I note that there is a bug in the implementation, since it means KisBaseProcessor::factoryConfiguration is never called, and I think that KisFilterConfigurationFactory::createDefault should call KisBaseProcessor::factoryConfiguration).<br>



<p style="margin: 0px; text-indent: 0px;"></p></div></blockquote><div><br>I&#39;ve just said above that KisBaseProcessor::factoryConfiguration *IS called* in real life. And the result of such a call is dramatical.<br><br>
 </div></div>-- <br>Dmitry Kazakov<br>