Re: Need help with Image Aquisition code



On Wed, 31 Jan 2001, Jerry Mulchin wrote:

> I'm writing a GTk/Gnome application that will acquire images from a
> CCD camera. I'm at the point where I'm ready to acquire the image,
> but I don't know where to put the loop to process the acquisition.
> 
> I have a window that I open in preparation to displaying the image.
> The loop will run, just acquiring images until the user closes the 
> window the image is displayed in. The act of closing the window
> needs to destroy not only the window, but also terminate the loop
> grabing images from the camera.
> 
> I don't think I want to use the "idle" function to do the acquisition,
> but I don't know what else to use.

	I presume you're reading this stuff in from a file descriptor
somehow? (whether it be from a file, or a device, or... whatever)  If so,
you can use the gdk_input_add*() functions to call some callback function
that you specify every time data becomes available on the file descriptor. 
Since I presume the computer can process the data much faster than it can
grab the data from the CCD camera, this will be much less overhead than
adding an 'idle' function.

	However, if you don't want to display images immediately, one after
another, then you can use the 'timeout' functions to have one of your
functions called every <n> milliseconds.

	As for closing the window... well, if you continue running within
the main loop, you can simply tie a callback to the 'destroy' signal of the
object.

> I'm looking for suggestions to my dilemma.
> 
> Thanks in advance
> 
> Jerry Mulchin    Amateur Radio Call  -  N7EME

- Bibek





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]