QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
VideoScreenshot Namespace Reference

Screenshots of the video on display, from a network stream or the USB camera. More...

Classes

struct  Exif

Functions

QImage displayedImage (const QVideoFrame &frame, QtVideo::Rotation outputRotation=QtVideo::Rotation::None, bool outputMirrored=false)
bool saveImage (const QImage &image, const QString &file, const Exif &exif={})
bool save (const QVideoFrame &frame, const QString &file, const Exif &exif={}, QtVideo::Rotation outputRotation=QtVideo::Rotation::None, bool outputMirrored=false)
 displayedImage() of frame, then saveImage().

Detailed Description

Screenshots of the video on display, from a network stream or the USB camera.

Function Documentation

◆ displayedImage()

QImage VideoScreenshot::displayedImage ( const QVideoFrame & frame,
QtVideo::Rotation outputRotation = QtVideo::Rotation::None,
bool outputMirrored = false )

frame as displayed: the format's viewport (crop), the frame's rotation and mirroring, then those of the VideoOutput showing it (outputRotation, outputMirrored), in the order Qt displays them. Null for an invalid frame. Convert a stream's frame on the GUI thread: its GPU buffers check the thread that maps them.

Definition at line 54 of file VideoScreenshot.cc.

Referenced by VideoReceiver::onTakeScreenshot(), and save().

◆ save()

bool VideoScreenshot::save ( const QVideoFrame & frame,
const QString & file,
const Exif & exif = {},
QtVideo::Rotation outputRotation = QtVideo::Rotation::None,
bool outputMirrored = false )

displayedImage() of frame, then saveImage().

Definition at line 124 of file VideoScreenshot.cc.

References displayedImage(), and saveImage().

◆ saveImage()

bool VideoScreenshot::saveImage ( const QImage & image,
const QString & file,
const Exif & exif = {} )

Encodes image and writes it to file, in the image format its suffix names, with exif for a JPEG. Any thread: encoding a full-resolution picture on the GUI thread would stall the UI. False, with a warning logged, for a null image or a file that can't be written.

Definition at line 87 of file VideoScreenshot.cc.

References VideoScreenshot::Exif::position, and VideoScreenshot::Exif::taken.

Referenced by VideoReceiver::onTakeScreenshot(), and save().