summaryrefslogtreecommitdiff
path: root/rotord/src/nodes_drawing.h
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/nodes_drawing.h')
-rw-r--r--rotord/src/nodes_drawing.h11
1 files changed, 8 insertions, 3 deletions
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: