X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Fblineconvert.cpp;h=71214c9055ac73964d4efe7033c5b801bcb917e2;hb=4c3c01b90796b1ac068f95cfc7227914cd5c3b33;hp=770f42c6a99eca8d2390faf7cb1c5c92813db296;hpb=f7610390c22c2908cb58f5abdb80edb018ad4fef;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/blineconvert.cpp b/synfig-studio/trunk/src/synfigapp/blineconvert.cpp index 770f42c..71214c9 100644 --- a/synfig-studio/trunk/src/synfigapp/blineconvert.cpp +++ b/synfig-studio/trunk/src/synfigapp/blineconvert.cpp @@ -39,6 +39,8 @@ #include #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -422,24 +424,17 @@ synfigapp::BLineConverter::operator () (std::list &out, cons if(in.size() == in_w.size()) { for(;i != end; ++i,++iw) - { - //eliminate duplicate points - if(*i != c) + if(*i != c) // eliminate duplicate points { f.push_back(c = *i); f_w.push_back(*iw); } - } - }else + } + else { for(;i != end; ++i) - { - //eliminate duplicate points - if(*i != c) - { + if(*i != c) // eliminate duplicate points f.push_back(c = *i); - } - } } } //initialprocess = timer(); @@ -499,7 +494,8 @@ synfigapp::BLineConverter::operator () (std::list &out, cons minc = cvt[i]; maxi = i; } - }else if(maxi >= 0) + } + else if(maxi >= 0) { if(maxi >= last + 8) { @@ -608,7 +604,22 @@ synfigapp::BLineConverter::operator () (std::list &out, cons gaussian_blur_3(ftemp.begin(),ftemp.end(),false); df.resize(size); + + // Wondering whether the modification of the df vector + // using a char* pointer and pointer arithmetric was safe, + // I looked it up... + // + // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2369.pdf tells me: + // + // 23.2.5 Class template vector [vector] + // + // [...] The elements of a vector are stored contiguously, + // meaning that if v is a vector where T is + // some type other than bool, then it obeys the identity + // &v[n] == &v[0] + n for all 0 <= n < v.size(). + // GetFirstDerivatives(ftemp,0,size,(char*)&df[0],sizeof(df[0])); + //GetSimpleDerivatives(ftemp,0,size,df,0,di); //< don't have to worry about indexing stuff as it is all being taken care of right now //preproceval += timer(); @@ -812,10 +823,6 @@ void synfigapp::BLineConverter::EnforceMinWidth(std::list &b end = bline.end(); for(i = bline.begin(); i != end; ++i) - { if(i->get_width() < min_pressure) - { i->set_width(min_pressure); - } - } }