~ubuntu-branches/ubuntu/trusty/etl/trusty-proposed

« back to all changes in this revision

Viewing changes to ETL/_bezier.h

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2012-05-12 16:24:53 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120512162453-gho4kely37m2t4xr
Tags: 0.04.15-1
* New maintainers (Closes: #665041)
* New upstream release.
* imported latest QA changes
* Packaging update
  + to straight debhelper + dh-autoreconf
  + compat & debhelper to version 9
  + corrected Vcs-Browser URL
  + allow dh_auto_test failure (fixes FTBFS)
  + Maintainer set to d-multimedia

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
        const time_type &get_s()const { return s; }
136
136
        time_type get_dt()const { return s-r; }
137
137
 
138
 
        bool intersect_hull(const bezier_base<value_type,time_type> &x)const
 
138
        bool intersect_hull(const bezier_base<value_type,time_type> &/*x*/)const
139
139
        {
140
140
                return 0;
141
141
        }
161
161
        **      For now, this function is BROKEN. (although it works
162
162
        **      for the floating-point specializations, using newton's method)
163
163
        */
164
 
        time_type intersect(const bezier_base<value_type,time_type> &x, time_type near=0.0)const
 
164
        time_type intersect(const bezier_base<value_type,time_type> &/*x*/, time_type /*near=0.0*/)const
165
165
        {
166
166
                return 0;
167
167
        }
563
563
                        for(;i;i--)
564
564
                        {
565
565
                                // compare 33% of the way between r and s with 67% of the way between r and s
566
 
                                if(dist(operator()((s-r)*(1.0/3.0)+r), x) <
567
 
                                   dist(operator()((s-r)*(2.0/3.0)+r), x))
 
566
                                if(dist(this->operator()((s-r)*(1.0/3.0)+r), x) <
 
567
                                   dist(this->operator()((s-r)*(2.0/3.0)+r), x))
568
568
                                        s=t;
569
569
                                else
570
570
                                        r=t;
579
579
                const time_type inc((s-r)/steps);
580
580
                if (!inc) return 0;
581
581
                distance_type ret(0);
582
 
                value_type last(operator()(r));
 
582
                value_type last(this->operator()(r));
583
583
 
584
584
                for(r+=inc;r<s;r+=inc)
585
585
                {
586
 
                        const value_type n(operator()(r));
 
586
                        const value_type n(this->operator()(r));
587
587
                        ret+=dist.uncook(dist(last,n));
588
588
                        last=n;
589
589
                }
590
 
                ret+=dist.uncook(dist(last,operator()(r)))*(s-(r-inc))/inc;
 
590
                ret+=dist.uncook(dist(last,this->operator()(r)))*(s-(r-inc))/inc;
591
591
 
592
592
                return ret;
593
593
        }
623
623
                rt[3] = d;
624
624
 
625
625
                //2nd stage calc
626
 
                lt[1] = affine_func(a,b,t);
627
 
                temp = affine_func(b,c,t);
628
 
                rt[2] = affine_func(c,d,t);
 
626
                lt[1] = this->affine_func(a,b,t);
 
627
                temp = this->affine_func(b,c,t);
 
628
                rt[2] = this->affine_func(c,d,t);
629
629
 
630
630
                //3rd stage calc
631
 
                lt[2] = affine_func(lt[1],temp,t);
632
 
                rt[1] = affine_func(temp,rt[2],t);
 
631
                lt[2] = this->affine_func(lt[1],temp,t);
 
632
                rt[1] = this->affine_func(temp,rt[2],t);
633
633
 
634
634
                //last stage calc
635
 
                lt[3] = rt[0] = affine_func(lt[2],rt[1],t);
 
635
                lt[3] = rt[0] = this->affine_func(lt[2],rt[1],t);
636
636
 
637
637
                //set the time range for l,r (the inside values should be 1, 0 respectively)
638
638
                lt.set_r(get_r());