class V4L2::Frame

Overview

Represents an individual video frame.

Included Modules

Defined in:

v4l2/frame.cr

Constructors

Instance Method Summary

Constructor Detail

def self.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.


[View source]
def self.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.


[View source]

Instance Method Detail

def buffer : Buffer #

The underlying buffer of bytes.


[View source]
def bytes : Slice(UInt8) #

Returns the bytes of the video frame.


[View source]
def size : Int32 #

Returns the size of the video frame.


[View source]
def to_slice : Slice(UInt8) #

Converts the video frame to a slice.


[View source]
def to_unsafe : Pointer(UInt8) #

Converts the video frame to a raw pointer.


[View source]
def unsafe_fetch(index : Int) : UInt8 #

Fetches a byte within the video frame.


[View source]