fast::CameraStreamer class

Stream images from a (web)camera.

This streamer uses Qt 5 to connect a (web)camera and creates a stream of FAST images from it.

Default streaming mode is StreamingMode::NewestFrameOnly

Output ports

Base classes

class Streamer
Abstract base class for all Streamers.

Public functions

auto create(bool grayscale, uchar cameraIndex) -> std::shared_ptr<CameraStreamer>
Create instance.
void setFinished(bool finished)
void addNewImageFrame(const uchar* data, int width, int height)
auto getGrayscale() const -> bool
void setGrayscale(bool grayscale)
void loadAttributes() override
void setCamera(uchar index)

Protected functions

void execute() override
void generateStream() override

Protected variables

bool mGrayscale
bool m_finished
int m_framesAdded
std::chrono::high_resolution_clock::time_point m_startTime
QThread* thread
CameraWorker* worker
uint m_cameraIndex

Function documentation

std::shared_ptr<CameraStreamer> fast::CameraStreamer::create(bool grayscale, uchar cameraIndex)

Create instance.

grayscale Whether to convert to grayscale or not
cameraIndex index of camera to use
Returns instance

void fast::CameraStreamer::generateStream() override protected

The function producing the data stream