class

V4L2::Frame

Inherits Indexable < Enumerable < Iterable < Reference < Object

Represents an individual video frame.

Constructors

new(buffer : Buffer, data : Slice(UInt8))

Initializes the video frame. The buffer represents the buffer metadata and the slice represents where the data was read into.

Source
new(buffer : Buffer, allocated_buffer : AllocatedBuffer)

Initializes the video frame, with the V4L2::Buffer, containing the buffer metadata, and the V4L2::AllocatedBuffer, containing the read data.

Source

Instance methods

buffer

The underlying buffer of bytes.

Source
bytes

Returns the bytes of the video frame.

Source
size

Returns the size of the video frame.

Source
to_slice

Converts the video frame to a slice.

Source
to_unsafe

Converts the video frame to a raw pointer.

Source
unsafe_fetch(index : Int) : UInt8

Fetches a byte within the video frame.

Source