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

Re: [pygame] progress on camera module



Hmm, the comment for gWorld says its a pointer, but thats a static variable. Just an outdated comment?

But otherwise, cool progress. :) Good luck!

On Sat, Jun 27, 2009 at 3:38 PM, el lauwer <el.lauwer@xxxxxxxxx> wrote:
Hoi,

Nirav Patel asked me to post the info on my blog on this mailing list, so here is for those that who are interested:

The past two weeks I was busy studying for my examinations, so I didn't have much time to work on my GSOC project.
However I was able to do a lot of work to get the __PyCameraObject struct__ integrated in the existing code and implemented some additional functions.

Here is the definition of this struct, it isn't completed yet because some types I would like to put into it cause compile errors.

**PyCameraObject:**

   typedef struct {
       PyObject_HEAD
       char* device_name;              // unieke name of the device
       SeqGrabComponent component;     // A type used by the Sequence Grabber API
       SGChannel channel;              // Channel of the Sequence Grabber
       GWorldPtr gWorld;               // Pointer to the struct that holds the data of the captured image
       Rect boundsRect;                // bounds of the image frame
   } PyCameraObject;

In addition of implementing the __PyCameraObject struct__, I have writen the folowing functions.

* **mac_device_init():**
This function initializes the sequence grabber component and prepares it for capturing images.
* **mac_device_close():**
I have extended this function so it works with the __PyCameraObject struct__.
* **mac_start_capturing():**
At this moment this function
* **camera_start():**
This function just calls the above functions.
* **camera_get_size():**
Simple function that returns the size of the image frame.

###Schedule for this week
This week I am planning to finish the __mac_start_capturing__ function so that I can capture images from my camera an put then in a SDL_Surface object.




--
Visit my blog at http://oddco.ca/zeroth/zblog