- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Slots | Public Member Functions | Protected Member Functions | Properties

# VideoWidget Class Reference

Search for all occurrences

## Detailed Description

Widget to display video.

This widget shows the video signal.

     MediaObject *media = new MediaObject(parent);
     VideoWidget *vwidget = new VideoWidget(parent);
     Phonon::createPath(media, vwidget);

Author:
  Matthias Kretz <kretz@kde.org>

Definition at line 56 of file videowidget.h.

`#include <Phonon/VideoWidget>`

Inheritance diagram for VideoWidget:
[legend]

List of all members.

## Public Types
enum | AspectRatio { AspectRatioAuto = 0, AspectRatioWidget = 1, AspectRatio4_3 = 2, AspectRatio16_9 = 3 }
| Defines the width:height to be used for the video. More...
enum | ScaleMode { FitInView = 0, ScaleAndCrop = 1 }
## Public Slots
void | setFullScreen (bool fullscreen)
void | exitFullScreen ()
| Convenience slot, calling setFullScreen(false)
void | enterFullScreen ()
| Convenience slot, calling setFullScreen(true)
void | setAspectRatio (AspectRatio)
void | setScaleMode (ScaleMode)
void | setBrightness (qreal value)
void | setContrast (qreal value)
void | setHue (qreal value)
void | setSaturation (qreal value)
## Public Member Functions
| VideoWidget (QWidget *parent=0)
| Constructs a new video widget with a `parent`.
AspectRatio | aspectRatio () const
ScaleMode | scaleMode () const
qreal | brightness () const
qreal | contrast () const
qreal | hue () const
qreal | saturation () const
QImage | snapshot () const
## Protected Member Functions
| VideoWidget (VideoWidgetPrivate &d, QWidget *parent)
void | mouseMoveEvent (QMouseEvent *)
bool | event (QEvent *)
## Properties
bool | fullScreen
| This property holds whether the video is shown using the complete screen.
AspectRatio | aspectRatio
| Defaults to AspectRatioAuto.
ScaleMode | scaleMode
| If the size of the widget and the size of the video are not equal.
qreal | brightness
| This property holds brightness of the video.
qreal | contrast
| This property holds the contrast of the video.
qreal | hue
| This property holds the hue of the video.
qreal | saturation
| This property holds saturation of the video.

## Member Enumeration Documentation

enum AspectRatio

Search for all occurrences

Defines the width:height to be used for the video.

Enumerator:

  AspectRatioAuto | Let the decoder find the aspect ratio automatically from the media file (this is the default). Search for all occurrences
  AspectRatioWidget | Fits the video into the widget making the aspect ratio depend solely on the size of the widget. This way the aspect ratio is freely resizeable by the user. Search for all occurrences
  AspectRatio4_3 | Make width/height == 4/3, which is the old TV size and monitor size (1024/768 == 4/3). (4:3) Search for all occurrences
  AspectRatio16_9 | Make width/height == 16/9, which is the size of most current media. (16:9) Search for all occurrences

Definition at line 127 of file videowidget.h.

                {
                    AspectRatioAuto = 0,
                    AspectRatioWidget = 1,
                    AspectRatio4_3 = 2,
                    AspectRatio16_9 = 3
    //X                 /**
    //X                  * Assume that every pixel of the video image needs to be displayed with the same
    //X                  * physical width and height. (1:1 image pixels, not imagewidth
    //X                  * = imageheight)
    //X                  */
    //X                 AspectRatioSquare = 4,
                };

enum ScaleMode

Search for all occurrences

Enumerator:

  FitInView | Search for all occurrences
  ScaleAndCrop | Search for all occurrences

Definition at line 158 of file videowidget.h.

                               {
                    FitInView = 0,
                    ScaleAndCrop = 1
                };

## Constructor & Destructor Documentation

VideoWidget | ( | QWidget * | parent = `0` | ) |

Constructs a new video widget with a `parent`.

VideoWidget | ( | VideoWidgetPrivate & | d,
|  | QWidget * | parent
| ) |  | `[protected]`

Constructs a new video widget with private data pointer `d` and a `parent`.

## Member Function Documentation

AspectRatio aspectRatio | ( |  | ) | const

Search for all occurrences

ScaleMode scaleMode | ( |  | ) | const

Search for all occurrences

qreal brightness | ( |  | ) | const

Search for all occurrences

qreal contrast | ( |  | ) | const

Search for all occurrences

qreal hue | ( |  | ) | const

Search for all occurrences

qreal saturation | ( |  | ) | const

Search for all occurrences

QImage snapshot | ( |  | ) | const

Search for all occurrences

void setFullScreen | ( | bool | fullscreen | ) | `[slot]`

Search for all occurrences

void exitFullScreen | ( |  | ) | `[slot]`

Search for all occurrences

Convenience slot, calling setFullScreen(false)

void enterFullScreen | ( |  | ) | `[slot]`

Search for all occurrences

Convenience slot, calling setFullScreen(true)

void setAspectRatio | ( | AspectRatio |  | ) | `[slot]`

Search for all occurrences

void setScaleMode | ( | ScaleMode |  | ) | `[slot]`

Search for all occurrences

void setBrightness | ( | qreal | value | ) | `[slot]`

Search for all occurrences

void setContrast | ( | qreal | value | ) | `[slot]`

Search for all occurrences

void setHue | ( | qreal | value | ) | `[slot]`

Search for all occurrences

void setSaturation | ( | qreal | value | ) | `[slot]`

Search for all occurrences

void mouseMoveEvent | ( | QMouseEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

bool event | ( | QEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

## Property Documentation

bool fullScreen `[read, write]`

Search for all occurrences

This property holds whether the video is shown using the complete screen.

The property differs from QWidget::fullScreen in that it is writeable.

By default the widget is not shown in fullScreen.

Warning:
  When switching the video to fullscreen using setFullScreen your application loses control over the widget that actually shows the video (which is then shown as a toplevel window while your application still uses this widget). If you only need to capture key events the event forwarding done internally should suffice for your needs. If you need to map mouse coordinates or add widgets (that are not overlays) you should probably handle fullscreen yourself.

Reimplemented from QWidget.

Definition at line 78 of file videowidget.h.

AspectRatio aspectRatio `[read, write]`

Search for all occurrences

Defaults to AspectRatioAuto.

See also:
  AspectRatio

Definition at line 85 of file videowidget.h.

ScaleMode scaleMode `[read, write]`

Search for all occurrences

If the size of the widget and the size of the video are not equal.

The video will be zoomed to fit the widget. The smaller zoom (AddBarsScaleMode) adds black bars at the left/right or top/bottom to make all of the image visible (default). The bigger zoom (ExpandMode) fills the widget completely, keeping all information in one direction and leaving parts of the image outside of the widget in the other direction.

Definition at line 96 of file videowidget.h.

qreal brightness `[read, write]`

Search for all occurrences

This property holds brightness of the video.

Default is 0. Acceptable values are in range of -1, 1.

Definition at line 103 of file videowidget.h.

qreal contrast `[read, write]`

Search for all occurrences

This property holds the contrast of the video.

Default is 0. Acceptable values are in range of -1, 1.

Definition at line 109 of file videowidget.h.

qreal hue `[read, write]`

Search for all occurrences

This property holds the hue of the video.

Default is 0. Acceptable values are in range of -1, 1.

Definition at line 115 of file videowidget.h.

qreal saturation `[read, write]`

Search for all occurrences

This property holds saturation of the video.

Default is 0. Acceptable values are in range of -1, 1.

Definition at line 121 of file videowidget.h.

The documentation for this class was generated from the following file:

- phonon/videowidget.h

VideoWidget VideoWidget VideoWidget VideoWidget VideoWidget VideoWidget VideoWidget VideoWidget VideoWidget VideoWidget
VideoWidget VideoWidget VideoWidget VideoWidget VideoWidget VideoWidget VideoWidget VideoWidget VideoWidget VideoWidget