X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Ftracer%2Ftracer.C;h=a40d0c27e8bd4f161a0407bab8c95883e6b21897;hb=f7444a58936e4ab8fa7e7062281567cbc74e175f;hp=be58496d7c29d346acf22e79d42e457eb16de706;hpb=f06e8ed85bd5937d704d57b65e0fb26ed288996d;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/tracer/tracer.C b/cinelerra-5.1/plugins/tracer/tracer.C index be58496d..a40d0c27 100644 --- a/cinelerra-5.1/plugins/tracer/tracer.C +++ b/cinelerra-5.1/plugins/tracer/tracer.C @@ -56,9 +56,9 @@ TracerPoint::~TracerPoint() TracerConfig::TracerConfig() { - drag = draw = fill = 0; - radius = 0; scale = 1; - selected = 0; + drag = draw = 1; fill = 0; + feather = 0; radius = 1; + invert = 0; selected = -1; } TracerConfig::~TracerConfig() { @@ -69,8 +69,9 @@ int TracerConfig::equivalent(TracerConfig &that) if( this->drag != that.drag ) return 0; if( this->draw != that.draw ) return 0; if( this->fill != that.fill ) return 0; + if( this->feather != that.feather ) return 0; + if( this->invert != that.invert ) return 0; if( this->radius != that.radius ) return 0; - if( this->scale != that.scale ) return 0; if( this->points.size() != that.points.size() ) return 0; for( int i=0, n=points.size(); ipoints[i], *bp = that.points[i]; @@ -86,8 +87,9 @@ void TracerConfig::copy_from(TracerConfig &that) this->draw = that.draw; this->fill = that.fill; this->selected = that.selected; + this->feather = that.feather; + this->invert = that.invert; this->radius = that.radius; - this->scale = that.scale; points.remove_all_objects(); for( int i=0,n=that.points.size(); i=0 ? 0 : rr-1; - for( int i=0; i 0 ? 0xff : 0; + float p = powf(10.f, s/2); + for( int i=0; i 255 ) vv = 255; + psf[i] = vv; + } for( int i=0,n=points.size(); ix-r, xn=pt->x+r; @@ -557,12 +562,11 @@ void Tracer::feather(int r, double s) bclamp(yn, 0, h); for( int y=ys ; yx, dy = y-pt->y; int dd = dx*dx + dy*dy; if( dd >= rr ) continue; - int pix = msk_rows[y][x], v = psf[dd]; - msk_rows[y][x] = dir >= 0 ? pix+v-(pix*v)/255 : (pix*v)/255; + int v = psf[dd], px = msk_rows[y][x]; + if( dir < 0 ? pxv ) msk_rows[y][x] = v; } } } @@ -576,8 +580,7 @@ void Tracer::draw_mask() uint8_t *mp = msk_rows[y]; uint8_t *rp = frm_rows[y]; for( int x=0; x