summaryrefslogtreecommitdiff
path: root/rotord
diff options
context:
space:
mode:
Diffstat (limited to 'rotord')
-rw-r--r--rotord/Makefile2
-rw-r--r--rotord/src/nodes_drawing.h24
-rw-r--r--rotord/src/rotor.cpp1
3 files changed, 17 insertions, 10 deletions
diff --git a/rotord/Makefile b/rotord/Makefile
index b5b1a5a..16380c5 100644
--- a/rotord/Makefile
+++ b/rotord/Makefile
@@ -9,7 +9,7 @@ MY_CFLAGS = -Wswitch -fpermissive -std=c++11 -I /usr/include/librsvg-2.0/librsvg
# -I ../ffmpeg
# The linker options.libgstaasinklibgstaasink.so
-MY_LIBS = -lnoise -lffms2 -ljsoncpp -lcairo -lopencv_core -lopencv_video -lopencv_imgproc -lopencv_highgui -lPocoNet -lPocoXML -lPocoUtil -lPocoFoundation -lvamp-hostsdk -lsndfile -L /usr/local/lib -lswscale -lavcodec -lavformat -lavfilter -lavdevice -lavutil -lstdc++ -lm
+MY_LIBS = -lrsvg-2 -lnoise -lffms2 -ljsoncpp -lcairo -lopencv_core -lopencv_video -lopencv_imgproc -lopencv_highgui -lPocoNet -lPocoXML -lPocoUtil -lPocoFoundation -lvamp-hostsdk -lsndfile -L /usr/local/lib -lswscale -lavcodec -lavformat -lavfilter -lavdevice -lavutil -lstdc++ -lm
#-lopencv_highgui
#MY_LIBS = -lPocoNet -lPocoXML -lPocoUtil -lPocoFoundation -lvamp-hostsdk -lsndfile -L /usr/local/lib -lswscale -lavcodec -lavformat -lavfilter -lavdevice -lavutil $(shell pkg-config gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 --libs)
# -lgstreamer-0.10 -lgstreamer-video-0.10 -lgstreamer-base-0.10 -lglib-2.0 -lgstapp-0.10
diff --git a/rotord/src/nodes_drawing.h b/rotord/src/nodes_drawing.h
index 9a7e30f..79082cc 100644
--- a/rotord/src/nodes_drawing.h
+++ b/rotord/src/nodes_drawing.h
@@ -226,25 +226,31 @@ namespace Rotor {
create_parameter("rotation","number","Rotation","Rotation",0.0f);
create_attribute("filename","SVG file to draw","Filename","");
UID="88c30140-2d0b-11e3-8db2-679d596166c1";
+ rsvg=nullptr;
+ g_type_init(); //does this have to be done only once?
};
Svg(map<string,string> &settings):Svg() {
base_settings(settings);
+ rsvg=rsvg_handle_new_from_file((settings["media_path"]+attributes["filename"]->value).c_str(),nullptr);
};
~Svg(){};
Svg* clone(map<string,string> &_settings) { return new Svg(_settings);};
void vector_output(cairo_t * cr,const Frame_spec &frame){
- colour=Colour(attributes["colour"]->value);
- cairo_save(cr); //not really even necessary?
- cairo_translate(cr, frame.w/2, frame.h/2);
- cairo_translate(cr, parameters["x"]->value * frame.w, parameters["y"]->value * frame.h);
- cairo_scale(cr, parameters["scale"]->value , parameters["scale"]->value );
- cairo_rotate(cr,(parameters["rotation"]->value/180.0f)*M_PI);
-
+ if (rsvg){
+ cairo_save(cr); //not really even necessary?
+ cairo_translate(cr, frame.w/2, frame.h/2);
+ cairo_translate(cr, parameters["x"]->value * frame.w, parameters["y"]->value * frame.h);
+ cairo_scale(cr, parameters["scale"]->value , parameters["scale"]->value );
+ cairo_rotate(cr,(parameters["rotation"]->value/180.0f)*M_PI);
+
+ rsvg_handle_render_cairo(rsvg,cr);
- cairo_restore (cr); //not really even necessary?
- cairo_fill(cr);
+ cairo_restore (cr); //not really even necessary?
+ cairo_fill(cr);
+ }
}
private:
+ RsvgHandle * rsvg;
};
}
diff --git a/rotord/src/rotor.cpp b/rotord/src/rotor.cpp
index 848ac2b..d3a5486 100644
--- a/rotord/src/rotor.cpp
+++ b/rotord/src/rotor.cpp
@@ -45,6 +45,7 @@ Node_factory::Node_factory(){
add_type("waves",new Waves(),category["source"]);
add_type("still_image",new Still_image(),category["source"]);
add_type("video_loader",new Video_loader(),category["source"]);
+ add_type("svg",new Svg(),category["source"]);
category["distort"]=vector<Node*>();
add_type("mirror",new Mirror(),category["distort"]);