circular_buffer#
- class arte.utils.circular_buffer.GenericCircularBuffer(n_frames, shape, dtype, constructor)#
Bases:
objectGeneric circular buffer.
Implements a generic circular buffer using any class with a numpy-like interface (must define a constructor with shape and dtype parameters, and the constructed object must have a read/write [] operator)
Methods
counter()Returns the total number of stored frames
get(position)Returns a frame from the circular buffer
help([search, prefix])Interactive help
position()Returns the current position in the circular buffer
store(data[, position])Store a record in the circular buffer.
- counter()#
Returns the total number of stored frames
- get(position)#
Returns a frame from the circular buffer
- help(search='', prefix='')#
Interactive help
Prints on stdout a list of methods that match the search substring or all of them if search is left to the default value of an empty string, together with a one-line help taken from the first line of their docstring, if any.
The prefix argument is prepended to the method name and is used for recursive help of every class member.
- position()#
Returns the current position in the circular buffer
- store(data, position=None)#
Store a record in the circular buffer.
By default, the record is stored following an internal counter, which is then incremented.
- class arte.utils.circular_buffer.NumpyCircularBuffer(n_frames, shape, dtype)#
Bases:
GenericCircularBufferImplements a circular buffer on top of a numpy array
Methods
counter()Returns the total number of stored frames
get(position)Returns a frame from the circular buffer
help([search, prefix])Interactive help
position()Returns the current position in the circular buffer
store(data[, position])Store a record in the circular buffer.
Bases:
GenericCircularBufferImplements a circular buffer on top of a SharedArray
Warning
Since 3.8 the Python standard library provides a SharedMemory class that makes this implementation not working.
Warning
It does not work on Windows.
Methods
counter()Returns the total number of stored frames
get(position)Returns a frame from the circular buffer
help([search, prefix])Interactive help
position()Returns the current position in the circular buffer
store(data[, position])Store a record in the circular buffer.