summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2013-07-30 17:03:09 +0100
committerComment <tim@gray.(none)>2013-07-30 17:03:09 +0100
commit5df9741224eb4ac3c7a88cdc06e20ea62aacdd4d (patch)
tree6d19e27e43e251381e7b5a92616cd96f330223fe
parent01f53fe4485b3c96c0f553e1cade69f77081b078 (diff)
draw node functional
-rw-r--r--rotord/bin/settings.xml2
-rw-r--r--rotord/src/nodes_drawing.h11
2 files changed, 9 insertions, 4 deletions
diff --git a/rotord/bin/settings.xml b/rotord/bin/settings.xml
index c0b5781..f0d7c61 100644
--- a/rotord/bin/settings.xml
+++ b/rotord/bin/settings.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<Rotor port="9000" graph_dir="/home/tim/workspace/rotor/rotord/" media_dir="/home/tim/workspace/rotor/rotord/" output_dir="/home/tim/workspace/rotor/rotord/"/> \ No newline at end of file
+<Rotor port="9000" graph_dir="./" media_dir="./" output_dir="./"/> \ No newline at end of file
diff --git a/rotord/src/nodes_drawing.h b/rotord/src/nodes_drawing.h
index 05135d6..ff96d9e 100644
--- a/rotord/src/nodes_drawing.h
+++ b/rotord/src/nodes_drawing.h
@@ -34,10 +34,14 @@ namespace Rotor {
image->setup(frame.w,frame.h); //do this twice or use a goto
}
//draw onto new or input image
- image->convert32(); //pad frame out to 32 bits for cairo
+ //image->convert32(); //pad frame out to 32 bits for cairo
//turns out cairo doesn't draw at all if the stride definition is wrong
//crashes like this though
- cairo_surface_t * cs = cairo_image_surface_create_for_data (image->RGBdata,
+ cv::Mat chans;
+ cv::cvtColor(image->rgb, chans, CV_RGB2RGBA, 4);
+
+
+ cairo_surface_t * cs = cairo_image_surface_create_for_data (chans.data,
CAIRO_FORMAT_RGB24,
image->w,
image->h,
@@ -57,7 +61,8 @@ namespace Rotor {
cairo_show_text (cr, "hello world!");
cairo_fill(cr);
- image->convert24(); //convert frame back to 24 bits
+ //image->convert24(); //convert frame back to 24 bits
+ cv::cvtColor(chans,image->rgb,CV_RGBA2RGB,3);
return image;
}
private: