Function caerFrameEventPacketAllocateNumPixels

Function Documentation

static inline caerFrameEventPacket caerFrameEventPacketAllocateNumPixels(int32_t eventCapacity, int16_t eventSource, int32_t tsOverflow, int32_t maxNumPixels, int16_t maxChannelNumber)

Allocate a new frame events packet, passing the total number of maximum pixels instead of the maximum X/Y dimensions expected. Use free() to reclaim this memory. The frame events allocate memory for a maximum sized pixels array, depending on the parameters passed to this function, so that every event occupies the same amount of memory (constant size). The actual frames inside of it might be smaller than that, for example when using ROI, and their actual size is stored inside the frame event and should always be queried from there. The unused part of a pixels array is guaranteed to be zeros.

Parameters:
  • eventCapacity – the maximum number of events this packet will hold.

  • eventSource – the unique ID representing the source/generator of this packet.

  • tsOverflow – the current timestamp overflow counter value for this packet.

  • maxNumPixels – the maximum number of pixels that can be held by a frame event.

  • maxChannelNumber – the maximum expected number of channels for frames in this packet.

Returns:

a valid FrameEventPacket handle or NULL on error.