diff options
| author | Comment <tim@gray.(none)> | 2013-07-30 17:03:09 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-07-30 17:03:09 +0100 |
| commit | 5df9741224eb4ac3c7a88cdc06e20ea62aacdd4d (patch) | |
| tree | 6d19e27e43e251381e7b5a92616cd96f330223fe /rotord/src/nodes_drawing.h | |
| parent | 01f53fe4485b3c96c0f553e1cade69f77081b078 (diff) | |
draw node functional
Diffstat (limited to 'rotord/src/nodes_drawing.h')
| -rw-r--r-- | rotord/src/nodes_drawing.h | 11 |
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: |
