Menu

CodeArchitecture

Anonymous

Main files

File
Description

main.cpp (code.google.com)
Creation of the Qt Application, testing of the OpenGL compatibility, instanciation of the 2 windows

glmixer.h (code.google.com) .cpp (code.google.com)
GLMixer class (Singleton, GUI Qt main window): manages menu and toolbars, actions, embed central view, reads & saves settings, creates all user interfaces and connects all signals and slots between them.

Source.h (code.google.com) .cpp (code.google.com)
Source class (base class for all source classes)

VideoFile.h (code.google.com) .cpp (code.google.com)
VideoFile class (QObject): implementation of ffmpeg decoder for all video formats.

RenderingManager.h (code.google.com) .cpp (code.google.com)
RenderingManager class (Singleton QObject): only object allowed to instanciate Sources, manages the list of sources, controls the GLSL rendering into an OpenGL framebuffer

View.h (code.google.com)
View class (base class for all View classes): specifies uniform behavior of all Views for user events (mouse and keyboard)

ViewRenderWidget.h (code.google.com) .cpp (code.google.com)
ViewRenderWidget class (subclass of glRenderWidget): container for the Views, holds the OpenGL display lists of the graphical objects, manages the views configuration.

OutputRenderWindow.h (code.google.com) .cpp (code.google.com)
OutputRenderWindow class (Singleton, subclass of glRenderWidget) Window for displaying the rendered frame buffer.

Source

A source is an object able to be drawn and manipulated in GLMixer.

The methods to implement in a Source subclass for defining its graphical behavior are:

    virtual RTTI rtti() const;
    virtual bool isPlayable() const;
    virtual bool isPlaying() const;
    virtual void play(bool on);

    virtual void update();

The properties accessible through the get and set methods are:

Property
Description
Type
Values

Y
Vertical coordinate of the center
double
visible range: [-1.0 1.0]

ScaleY
Vertical multiplying factor for height
double
100% of rendering window height with scaleY = 1.0

X
Horizontal coordinate of the center
double
visible range: [-1.0 1.0] * window aspect ratio

ScaleX
Horizontal multiplying factor for width
double
100% of rendering window width with scaleX = window aspect ratio

Alpha
Opacity (1 - transparency)
double
[0.0 1.0]

RotationAngle
Degrees of rotation
double
[0.0 360.0]

TextureCoordinates
4 UV coordinates for texture mapping
QRectf
(0.0, 0.0, 1.0, 1.0) is default

Color
RGB base color
QColor
white is default (255, 255, 255)

Brightness
Brightness filter
int
[-100 100]

Contrast
Contrast filter
int
[-100 100]

Saturation
Saturation filter
int
[-100 100]

HueShift
Shift in HUE color filter
int
[0 360]

LuminanceThreshold
Luminance intensity % for thresholding filter
int
[0 100]

NumberOfColor
Number of colors for posterizing filter
int
[0 255]

Pixelated
Whereas to use GL smoothing or not
bool
False is smooth rendering

Example:

double a = source->getRotationAngle();
source->setRotationAngle( a + 1.0 );

The exceptions are:

Property
Description
Type
Access to values

Gamma
Curve of gamma transfert filter
5 integers
READ : getGamma(), getGammaMinInput(), getGammaMaxInput(), getGammaMinOuput(), getGammaMaxOutput(), WRITE: setGamma(gamma, mininput, maxinput, minoutput, maxoutput);

Filter
Type of the post-processing filter
Source::filterType
Use getFilter and setFilter with one of those value : FILTER_NONE = 0, FILTER_BLUR_GAUSSIAN = 1, FILTER_BLUR_MEAN = 2, FILTER_SHARPEN = 3, FILTER_SHARPEN_MORE = 4, FILTER_EDGE_GAUSSIAN = 5, FILTER_EDGE_LAPLACE = 6, FILTER_EDGE_LAPLACE_2 = 7, FILTER_EMBOSS = 8, FILTER_EMBOSS_EDGE = 9, FILTER_EROSION_3X3 = 10, FILTER_EROSION_5X5 = 11, FILTER_EROSION_7X7 = 12, FILTER_DILATION_3X3 = 13, FILTER_DILATION_5X5 = 14, FILTER_DILATION_7X7 = 15

InvertMode
Type of color inversion mode filter
Source::invertModeType
Use getInvertMode and setInvertMode with one of those values: INVERT_NONE = 0, INVERT_COLOR = 1, INVERT_LUMINANCE = 2

Mask
Type of border masking
Source::maskType
Use getMark and setMask with one of those values : NO_MASK = 0, ROUNDCORNER_MASK, CIRCLE_MASK, GRADIENT_CIRCLE_MASK, GRADIENT_SQUARE_MASK, GRADIENT_LEFT_MASK, GRADIENT_RIGHT_MASK, GRADIENT_TOP_MASK, GRADIENT_BOTTOM_MASK, GRADIENT_HORIZONTAL_MASK, GRADIENT_VERTICAL_MASK, ANTIALIASING_MASK

Rendering Manager

The RenderingManager is a singleton.

The RenderingManager holds a list of sources in the current session. The list is of type SourceSet (defined in SourceSet.h (code.google.com) as a C++ std::set) and is automatically sorted by depth (first is forward). It has several methods for adding new sources to the list, removing them, browsing the list and going from beginning to the end.

The RenderingManager is also responsible for :

  • keeping a reference (iterator) on the current source
  • holding the FBO object in which the rendering is done, and managing the rendering global parameters (resolution and aspect ratio)
  • holding a reference to the RenderingEncoder which does the recording
  • loading and saving sessions

View

View Rendering Widget


MongoDB Logo MongoDB