[GEM-dev] pix_buffer

B. Bogart ben at ekran.org
Tue Nov 29 22:52:05 CET 2005


hey all,

I'm playing with pix_buffer and realized the idea of a cyclic buffer as
implimented is not what I actually need.

Here is an example:

Say we have a buffer of 3 slots

First we capture a frame at t0 f0.

the buffer contains:

s0: f0
s1: empty
s2: empty

Then we capture a second frame at t1 f1

s0: f0
s1: f1
s2: empty

When once we have filled the butter by t2 then I want this to happen:

s0: f1
s1: f2
s2: f3

So we have lost frame f0 because it is the oldest, and shifteverything
to clear a new spot at s2 for a new image.

Obviously it would be inefficient to copy the buffers but if we would
just remap the indexes, clear the oldest image from memory then we
should be good. Of course i have no idea how to actually do this in C...

Basically I'm capturing a number of frames over time, and I'd like index
9 of the pix_buffer to always refer to the newest image once the buffer
is full... We could call this "append" mode [append 0/1<

Also it would be great if we could also have pix_buffer_open and
pix_buffer_save which would load and save TIF and JPG files into the
pix_buffer. This could probably use most of the code from pix_multiimage.

Also it would be useful to be able to test if a slot in the buffer is
empty, so I could always refer to the most recent image no matter how
full the buffer may be.

If there is a patch-level way to deal with this fifo type buffer for
images outside of writing it myself in C then please let me know...

I'd be interested in talking about a bounty for these features... any
interest?

Thanks all.

b.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20051129/975f2b1d/attachment.pgp>


More information about the GEM-dev mailing list