Phonon

Phonon::Experimental::VideoFrame2 Struct Reference

#include <videoframe2.h>

Public Types

enum  Format {
  Format_Invalid = QImage::Format_Invalid , Format_RGB888 = QImage::Format_RGB888 , Format_RGB32 = QImage::Format_RGB32 , Format_YCbCr420 = 0x10000 ,
  Format_YV12 = Format_YCbCr420 , Format_YCbCr422 = 0x10001 , Format_YUY2 = Format_YCbCr422
}
 

Public Member Functions

int aspectCorrectedHeight () const
 
int aspectCorrectedWidth () const
 
QImage qImage () const
 

Public Attributes

double aspectRatio
 
QByteArray data0
 
QByteArray data1
 
QByteArray data2
 
Format format
 
int height
 
int width
 

Detailed Description

A single video frame.

This simple class contains the data of a frame and metadata describing how to interpret the data.

Author
Matthias Kretz kretz.nosp@m.@kde.nosp@m..org

Definition at line 42 of file videoframe2.h.

Member Enumeration Documentation

◆ Format

Video frames come in a variety of formats.

Depending on the format you have to process it differently to convert it for displaying or encoding.

Enumerator
Format_Invalid 

The frame is invalid.

Format_RGB888 

The frame is stored in data0 using a 24-bit RGB format (8-8-8).

Format_YCbCr420 

The frame is stored in data0, data1 and data2 using data0 for the Y data, data1 for the Cb data and data2 for the Cr data.

data1 and data2 contain one byte per for adjacent pixels whereas data0 has one byte per pixel.

Format_YCbCr422 

The frame is stored in data0 using a 32-bit Y0-Cb-Y1-Cr format (8-8-8-8).

Definition at line 49 of file videoframe2.h.

Member Function Documentation

◆ aspectCorrectedHeight()

int Phonon::Experimental::VideoFrame2::aspectCorrectedHeight ( ) const
inline

Convenience function to calculate the aspect corrected height from the aspectRatio and width values.

It is recommended to display video frames with aspectCorrectedWidth x height

Definition at line 106 of file videoframe2.h.

◆ aspectCorrectedWidth()

int Phonon::Experimental::VideoFrame2::aspectCorrectedWidth ( ) const
inline

Convenience function to calculate the aspect corrected width from the aspectRatio and height values.

It is recommended to display video frames with aspectCorrectedWidth x height

Definition at line 98 of file videoframe2.h.

◆ qImage()

QImage Phonon::Experimental::VideoFrame2::qImage ( ) const
inline

Definition at line 145 of file videoframe2.h.

Member Data Documentation

◆ aspectRatio

double Phonon::Experimental::VideoFrame2::aspectRatio

The aspect ratio the frame should be displayed with.

Common values are 4/3, 16/9.

Definition at line 90 of file videoframe2.h.

◆ data0

QByteArray Phonon::Experimental::VideoFrame2::data0

RGB8, YUY2 or Y-plane.

If format is Format_RGB888 then the data contains each pixel as three consecutive bytes for red, green and blue.

If format is Format_YUY2 the data contains every two pixels as four consecutive bytes for Y0, Cb, Y1, Cr

If format is Format_YV12 the data contains one byte per pixel with the Y value.

Definition at line 127 of file videoframe2.h.

◆ data1

QByteArray Phonon::Experimental::VideoFrame2::data1

YV12 U-plane.

If format is Format_YV12 the data contains one byte per four adjacent pixels with the Cb value.

Definition at line 135 of file videoframe2.h.

◆ data2

QByteArray Phonon::Experimental::VideoFrame2::data2

YV12 V-plane.

If format is Format_YV12 the data contains one byte per four adjacent pixels with the Cr value.

Definition at line 143 of file videoframe2.h.

◆ format

Format Phonon::Experimental::VideoFrame2::format

Format of the frame.

See also
Format

Definition at line 113 of file videoframe2.h.

◆ height

int Phonon::Experimental::VideoFrame2::height

The height of the video frame in number of pixels.

Definition at line 83 of file videoframe2.h.

◆ width

int Phonon::Experimental::VideoFrame2::width

The width of the video frame in number of pixels.

Definition at line 78 of file videoframe2.h.


The documentation for this struct was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:46:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.