![]() |
University of Murcia, Spain ![]() |
Video and image input/storage groupClasses and functions to perform image an video input, and storage in image and video files. More...
Detailed DescriptionClasses and functions to perform image an video input, and storage in image and video files.
Function Documentation
Reads the content of a QVImage object from an image file.
Write the content of a QVImage object in an image file.
Write RGB image frames to a yuv4mpeg2 video file. This function stores a frame in a video file from the RGB format. The parameter of this function is an image containing the RGB image. For further information about its usage, see documentation for function writeYUV4MPEG2Header.
Write YUV image frames to a yuv4mpeg2 video file. This is an overloaded version of the function writeYUV4MPEG2Frame(QFile &, const QVImage<uChar,3>) provided for convenience. This version stores a frame in a video file from the YUV format. The parameters of this function must be three images containing the three chanels for the YUV image. For further information about its usage, see documentation for function writeYUV4MPEG2Header.
Definition at line 48 of file qvio.cpp. Referenced by QVVideoRecorder::iterate(), and writeYUV4MPEG2Frame().
Create a yuv4mpeg2 video file. This function stores the header for a video sequence in YUV4MPEG2 format in a newly created file. It can be used in conjunction with any of the versions of the writeYUV4MPEG2Frame functions to store a flow of images in a video file. The following code illustrates its usage. First the video file must be created and initializated with a header:
#include <QFile> [...] QFile videoFile("test.mpeg"); videoFile.open(QIODevice::WriteOnly|QIODevice::Truncate); writeYUV4MPEG2Header(videoFile, cols, rows, 24); [...] Then, each image frame must be stored in the video file, until a stop condition:
while(newImages) { // Read a new image in RGB format QVImage<uChar,3> rgbImage = getNewRGBImage(); // Write the RGB image to the file writeYUV4MPEG2Frame(videoFile, rgbImage); [...] } Alternatively, an overloaded version of the writeYUV4MPEG2Frame function can be used, to store an image in YUV format:
while(newImages) { // Read a new YUV image in 4:2:0 format QVImage<uChar,1> yImage = getNewYUVImageYChannel(); QVImage<uChar,1> UImage = getNewYUVImageUChannel(); QVImage<uChar,1> VImage = getNewYUVImageVChannel(); // Write the YUV image to the file writeYUV4MPEG2Frame(videoFile, yImage, uImage, vImage); [...] } when finished storing frames in the video file, it can be closed
videoFile.close();
Definition at line 41 of file qvio.cpp. Referenced by QVVideoRecorder::iterate().
|