projects
/
goodguy
/
cinelerra.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix outer color setup for yuv in gradient, fix last_xy update in sketcher grab_event
[goodguy/cinelerra.git]
/
cinelerra-5.1
/
plugins
/
sketcher
/
sketcher.C
diff --git
a/cinelerra-5.1/plugins/sketcher/sketcher.C
b/cinelerra-5.1/plugins/sketcher/sketcher.C
index 9bbdd675e22322929edad0a858d3391c2010f0b8..272bcf0458ec7f4618dac0eaf11080a2786f635e 100644
(file)
--- a/
cinelerra-5.1/plugins/sketcher/sketcher.C
+++ b/
cinelerra-5.1/plugins/sketcher/sketcher.C
@@
-27,6
+27,7
@@
#include "bccmodels.h"
#include "bccolors.h"
#include "clip.h"
#include "bccmodels.h"
#include "bccolors.h"
#include "clip.h"
+#include "edl.h"
#include "edlsession.h"
#include "filexml.h"
#include "overlayframe.h"
#include "edlsession.h"
#include "filexml.h"
#include "overlayframe.h"
@@
-100,7
+101,7
@@
void SketcherCurve::init(int id, int pen, int width, int color)
}
SketcherCurve::SketcherCurve(int id)
{
}
SketcherCurve::SketcherCurve(int id)
{
- init(id, 1,
ARC_LIN
E, CV_COLOR);
+ init(id, 1,
PEN_SQUAR
E, CV_COLOR);
}
SketcherCurve::SketcherCurve(int id, int pen, int width, int color)
{
}
SketcherCurve::SketcherCurve(int id, int pen, int width, int color)
{
@@
-201,7
+202,7
@@
int Sketcher::new_point(int idx, int arc)
if( ci < 0 || ci >= config.curves.size() )
return -1;
SketcherCurve *cv = config.curves[ci];
if( ci < 0 || ci >= config.curves.size() )
return -1;
SketcherCurve *cv = config.curves[ci];
- EDLSession *session = get_edl
session()
;
+ EDLSession *session = get_edl
()->session
;
coord x = !session ? 0.f : session->output_w / 2.f;
coord y = !session ? 0.f : session->output_h / 2.f;
return new_point(cv, arc, x, y, idx);
coord x = !session ? 0.f : session->output_w / 2.f;
coord y = !session ? 0.f : session->output_h / 2.f;
return new_point(cv, arc, x, y, idx);
@@
-346,6
+347,7
@@
Sketcher::~Sketcher()
const char* Sketcher::plugin_title() { return N_("Sketcher"); }
int Sketcher::is_realtime() { return 1; }
const char* Sketcher::plugin_title() { return N_("Sketcher"); }
int Sketcher::is_realtime() { return 1; }
+int Sketcher::is_synthesis() { return 1; }
NEW_WINDOW_MACRO(Sketcher, SketcherWindow);
LOAD_CONFIGURATION_MACRO(Sketcher, SketcherConfig)
NEW_WINDOW_MACRO(Sketcher, SketcherWindow);
LOAD_CONFIGURATION_MACRO(Sketcher, SketcherConfig)
@@
-526,7
+528,6
@@
static void smooth_dxy(float &dx, float &dy,
dx = xc - xd; dy = yc - yd;
}
dx = xc - xd; dy = yc - yd;
}
-#if 0
static int convex(float ax,float ay, float bx,float by,
float cx,float cy, float dx,float dy)
{
static int convex(float ax,float ay, float bx,float by,
float cx,float cy, float dx,float dy)
{
@@
-539,8
+540,6
@@
static int convex(float ax,float ay, float bx,float by,
float v = abc * bcd;
return !v ? 0 : v>0 ? 1 : -1;
}
float v = abc * bcd;
return !v ? 0 : v>0 ? 1 : -1;
}
-#endif
-
class FillRegion
{
class FillRegion
{
@@
-622,13
+621,12
@@
void FillRegion::run()
SketcherPoint *FillRegion::next()
{
while( nxt < points.size() ) {
SketcherPoint *FillRegion::next()
{
while( nxt < points.size() ) {
- SketcherPoint *pt = points[nxt];
+ SketcherPoint *pt = points[nxt
++
];
if( pt->arc == ARC_OFF ) continue;
if( pt->arc == ARC_OFF ) continue;
- if( pt->arc != ARC_FILL )
break
;
+ if( pt->arc != ARC_FILL )
return pt
;
start_at(pt->x, pt->y);
start_at(pt->x, pt->y);
- ++nxt;
}
}
- return
nxt < points.size() ? points[nxt++] :
0;
+ return 0;
}
}
@@
-651,14
+649,16
@@
void SketcherCurve::draw(VFrame *img)
while( pt2 ) {
dx = pt2->x; dy = pt2->y;
switch( pt0->arc ) {
while( pt2 ) {
dx = pt2->x; dy = pt2->y;
switch( pt0->arc ) {
+ case ARC_CURVE:
+ if( convex(ax,ay, bx,by, cx,cy, dx,dy) >= 0 ) {
+ // s = ac thru b x bd thru c
+ intersects_at(sx,sy, ax,ay,cx,cy,bx,by, bx,by,dx,dy,cx,cy,fmx);
+ vpen->draw_smooth(bx,by, sx,sy, cx,cy);
+ break;
+ } // fall thru
case ARC_LINE:
vpen->draw_line(bx, by, cx, cy);
break;
case ARC_LINE:
vpen->draw_line(bx, by, cx, cy);
break;
- case ARC_CURVE: {
- // s = ac thru b x bd thru c
- intersects_at(sx,sy, ax,ay,cx,cy,bx,by, bx,by,dx,dy,cx,cy,fmx);
- vpen->draw_smooth(bx,by, sx,sy, cx,cy);
- break; }
}
ax = bx; ay = by; pt0 = pt1;
bx = cx; by = cy; pt1 = pt2;
}
ax = bx; ay = by; pt0 = pt1;
bx = cx; by = cy; pt1 = pt2;