1
/***************************************************************************
2
Q_eq2.cpp - description
4
flyDialog for MPlayer EQ2 filter
5
copyright : (C) 2002/2007 by mean Fixounet@free.fr
6
***************************************************************************/
8
/***************************************************************************
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
15
***************************************************************************/
25
#include "ADM_toolkit/toolkit.hxx"
26
#include "ADM_image.h"
27
#include "ADM_video/ADM_genvideo.hxx"
28
#include "ADM_colorspace/ADM_rgb.h"
29
#include "ADM_assert.h"
30
#include "ADM_videoFilter/ADM_vidEq2.h"
32
#include "DIA_flyDialog.h"
33
#include "DIA_flyDialogQt4.h"
34
#include "ADM_videoFilter/ADM_vidEq2.h"
35
#include "DIA_flyEq2.h"
38
// Video is in YV12 Colorspace
41
class Ui_eq2Window : public QDialog
49
Ui_eq2Window(Eq2_Param *param,AVDMGenericVideoStream *in);
53
void gather(Eq2_Param *param);
56
void sliderUpdate(int foo);
57
void valueChanged(int foo);
62
Ui_eq2Window::Ui_eq2Window(Eq2_Param *param,AVDMGenericVideoStream *in)
64
uint32_t width,height;
67
// Allocate space for green-ised video
68
width=in->getInfo()->width;
69
height=in->getInfo()->height;
71
canvas=new ADM_QCanvas(ui.graphicsView,width,height);
73
myCrop=new flyEq2( width, height,in,canvas,ui.horizontalSlider);
74
memcpy(&(myCrop->param),param,sizeof(Eq2_Param));
77
myCrop->sliderChanged();
81
connect( ui.horizontalSlider,SIGNAL(valueChanged(int)),this,SLOT(sliderUpdate(int)));
82
#define SPINNER(x) connect( ui.horizontalSlider##x,SIGNAL(valueChanged(int)),this,SLOT(valueChanged(int)));
94
void Ui_eq2Window::sliderUpdate(int foo)
96
myCrop->sliderChanged();
98
void Ui_eq2Window::gather(Eq2_Param *param)
102
memcpy(param,&(myCrop->param),sizeof(Eq2_Param));
104
Ui_eq2Window::~Ui_eq2Window()
106
if(myCrop) delete myCrop;
108
if(canvas) delete canvas;
111
void Ui_eq2Window::valueChanged( int f )
119
#define sliderSet(x,y) w->horizontalSlider##x->setValue((int)(param.y*100));
120
#define sliderGet(x,y) param.y=w->horizontalSlider##x->value()/100.;
121
//************************
122
uint8_t flyEq2::upload(void)
124
Ui_DialogEq2 *w=(Ui_DialogEq2 *)_cookie;
127
sliderSet(Contrast,contrast);
128
sliderSet(Brightness,brightness);
129
sliderSet(Saturation,saturation);
131
sliderSet(Red,rgamma);
132
sliderSet(Green,ggamma);
133
sliderSet(Blue,bgamma);
135
sliderSet(Initial,gamma);
136
sliderSet(Weight,gamma_weight);
140
uint8_t flyEq2::download(void)
142
Ui_DialogEq2 *w=(Ui_DialogEq2 *)_cookie;
144
sliderGet(Contrast,contrast);
145
sliderGet(Brightness,brightness);
146
sliderGet(Saturation,saturation);
148
sliderGet(Red,rgamma);
149
sliderGet(Green,ggamma);
150
sliderGet(Blue,bgamma);
152
sliderGet(Initial,gamma);
153
sliderGet(Weight,gamma_weight);
159
\brief Handle MPlayer EQ2 flyDialog
161
uint8_t DIA_getEQ2Param(Eq2_Param *param, AVDMGenericVideoStream *in)
165
Ui_eq2Window dialog(param,in);
166
if(dialog.exec()==QDialog::Accepted)
168
dialog.gather(param);
173
//____________________________________