Re: Drawing bit mapped image in drawing area

2014-03-27 Thread Chris Angelico
On Fri, Mar 28, 2014 at 1:10 AM, Ken Bass daytoo...@gmail.com wrote:
 The image is a captured video frame that can be in one of several formats
 (eg, yuv420, rgb8/24/32, jpeg/mjpeg). That is, I can provide it in any of
 those formats. It is in memory - not a file. And it would need be updated
 periodically, and quickly. I also want to be able to draw on, or add text
 to, it.

I know how I'd do that in Pike with a GTK2.DrawingArea, but it's most
likely you're not using Pike. What language are you using, and how is
the image stored in memory?

ChrisA
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Drawing bit mapped image in drawing area

2014-03-27 Thread jcupitt
On 27 March 2014 14:10, Ken Bass daytoo...@gmail.com wrote:
 I have a bit mapped image (really a video frame) that I want to display. I
 am guessing that putting it into a user drawing box would be the way to go.
 If there is a better way, please point me in that direction.

I have a tiny program which displays a live video image with an
overlay. It's in Python for gtk2, but gtk3 is (almost) the same,
except for the drawing model for the overlay. It runs at about 50fps
with not too much CPU load on my laptop.

https://github.com/jcupitt/rtiacquire/blob/master/rtiacquire/preview.py

The overlay is a crop box you can drag about and resize.

Use GtkImage to display the image data. When a new frame comes in,
decode to a RGB buffer, wrap it up as a GdkPixbuf, and set that pixbuf
as the data for the GtkImage.

https://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-Image-Data-in-Memory.html#gdk-pixbuf-new-from-data

https://developer.gnome.org/gtk3/stable/GtkImage.html#gtk-image-set-from-pixbuf

To draw the overlay, attach to expose-event with connect_after and
just draw. Your code will run after the GtkImage has painted the image
background, so draw anything you like and it'll float on top of the
image.

John
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Drawing bit mapped image in drawing area

2014-03-27 Thread Ken Bass
I have a bit mapped image (really a video frame) that I want to display. I
am guessing that putting it into a user drawing box would be the way to go.
If there is a better way, please point me in that direction.

More detail:

The image is a captured video frame that can be in one of several formats
(eg, yuv420, rgb8/24/32, jpeg/mjpeg). That is, I can provide it in any of
those formats. It is in memory - not a file. And it would need be updated
periodically, and quickly. I also want to be able to draw on, or add text
to, it.

I know how to draw on this area, and write text. But I couldn't find any
references to blitting the image into the box. In particular, what pixel
format would be needed by the drawing area, or if that format could be set
somehow.

TIA

ken
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


concurrent GList

2014-03-27 Thread Joël Krähemann
Hi, is there a concurrent GList around? It should use of atomic
operations. My project probably has need for it.

Due to concurrency problems. I believe I get those errors cause of
unfinished operations. Since I'm working on performance.

Please visit my project:
http://sf.net/p/ags


regards
Joël


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list