mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-18 12:50:07 +01:00
added color maps still working on interface
This commit is contained in:
@@ -122,7 +122,7 @@ void AC_MainWindow::createControls() {
|
|||||||
connect(btn_moveup, SIGNAL(clicked()), this, SLOT(upClicked()));
|
connect(btn_moveup, SIGNAL(clicked()), this, SLOT(upClicked()));
|
||||||
connect(btn_movedown, SIGNAL(clicked()), this, SLOT(downClicked()));
|
connect(btn_movedown, SIGNAL(clicked()), this, SLOT(downClicked()));
|
||||||
|
|
||||||
QLabel *r_label = new QLabel("Red: ", this);
|
QLabel *r_label = new QLabel(tr("Red: "), this);
|
||||||
r_label->setGeometry(10, 255, 50, 20);
|
r_label->setGeometry(10, 255, 50, 20);
|
||||||
slide_r = new QSlider(Qt::Horizontal,this);
|
slide_r = new QSlider(Qt::Horizontal,this);
|
||||||
slide_r->setGeometry(40, 250, 100, 30);
|
slide_r->setGeometry(40, 250, 100, 30);
|
||||||
@@ -130,7 +130,7 @@ void AC_MainWindow::createControls() {
|
|||||||
slide_r->setMinimum(0);
|
slide_r->setMinimum(0);
|
||||||
slide_r->setTickInterval(0);
|
slide_r->setTickInterval(0);
|
||||||
|
|
||||||
QLabel *g_label = new QLabel("Green: ", this);
|
QLabel *g_label = new QLabel(tr("Green: "), this);
|
||||||
g_label->setGeometry(150, 255, 50, 20);
|
g_label->setGeometry(150, 255, 50, 20);
|
||||||
slide_g = new QSlider(Qt::Horizontal, this);
|
slide_g = new QSlider(Qt::Horizontal, this);
|
||||||
slide_g->setGeometry(190, 250, 100, 30);
|
slide_g->setGeometry(190, 250, 100, 30);
|
||||||
@@ -138,7 +138,7 @@ void AC_MainWindow::createControls() {
|
|||||||
slide_g->setMinimum(0);
|
slide_g->setMinimum(0);
|
||||||
slide_g->setTickInterval(0);
|
slide_g->setTickInterval(0);
|
||||||
|
|
||||||
QLabel *b_label = new QLabel("Blue: ", this);
|
QLabel *b_label = new QLabel(tr("Blue: "), this);
|
||||||
b_label->setGeometry(300, 255, 50, 20);
|
b_label->setGeometry(300, 255, 50, 20);
|
||||||
slide_b = new QSlider(Qt::Horizontal, this);
|
slide_b = new QSlider(Qt::Horizontal, this);
|
||||||
slide_b->setGeometry(330, 250, 100, 30);
|
slide_b->setGeometry(330, 250, 100, 30);
|
||||||
@@ -150,7 +150,7 @@ void AC_MainWindow::createControls() {
|
|||||||
connect(slide_g, SIGNAL(valueChanged(int)), this, SLOT(slideChanged(int)));
|
connect(slide_g, SIGNAL(valueChanged(int)), this, SLOT(slideChanged(int)));
|
||||||
connect(slide_b, SIGNAL(valueChanged(int)), this, SLOT(slideChanged(int)));
|
connect(slide_b, SIGNAL(valueChanged(int)), this, SLOT(slideChanged(int)));
|
||||||
|
|
||||||
QLabel *label_slide_bright = new QLabel("Brightness: ", this);
|
QLabel *label_slide_bright = new QLabel(tr("Brightness: "), this);
|
||||||
label_slide_bright->setGeometry(10, 280, 75, 20);
|
label_slide_bright->setGeometry(10, 280, 75, 20);
|
||||||
slide_bright = new QSlider(Qt::Horizontal, this);
|
slide_bright = new QSlider(Qt::Horizontal, this);
|
||||||
slide_bright->setGeometry(80, 275, 100, 30);
|
slide_bright->setGeometry(80, 275, 100, 30);
|
||||||
@@ -159,7 +159,7 @@ void AC_MainWindow::createControls() {
|
|||||||
slide_bright->setTickInterval(0);
|
slide_bright->setTickInterval(0);
|
||||||
|
|
||||||
|
|
||||||
QLabel *label_slide_gamma = new QLabel("Gamma: ", this);
|
QLabel *label_slide_gamma = new QLabel(tr("Gamma: "), this);
|
||||||
label_slide_gamma->setGeometry(190, 280, 65, 20);
|
label_slide_gamma->setGeometry(190, 280, 65, 20);
|
||||||
slide_gamma = new QSlider(Qt::Horizontal, this);
|
slide_gamma = new QSlider(Qt::Horizontal, this);
|
||||||
slide_gamma->setGeometry(245, 275, 100, 30);
|
slide_gamma->setGeometry(245, 275, 100, 30);
|
||||||
@@ -167,7 +167,7 @@ void AC_MainWindow::createControls() {
|
|||||||
slide_gamma->setMinimum(0);
|
slide_gamma->setMinimum(0);
|
||||||
slide_gamma->setTickInterval(0);
|
slide_gamma->setTickInterval(0);
|
||||||
|
|
||||||
QLabel *label_sat = new QLabel("Saturation: ", this);
|
QLabel *label_sat = new QLabel(tr("Saturation: "), this);
|
||||||
label_sat->setGeometry(350, 280, 100, 20);
|
label_sat->setGeometry(350, 280, 100, 20);
|
||||||
slide_saturation = new QSlider(Qt::Horizontal, this);
|
slide_saturation = new QSlider(Qt::Horizontal, this);
|
||||||
slide_saturation->setGeometry(420, 275, 100, 30);
|
slide_saturation->setGeometry(420, 275, 100, 30);
|
||||||
@@ -179,6 +179,27 @@ void AC_MainWindow::createControls() {
|
|||||||
connect(slide_gamma, SIGNAL(valueChanged(int)), this, SLOT(colorChanged(int)));
|
connect(slide_gamma, SIGNAL(valueChanged(int)), this, SLOT(colorChanged(int)));
|
||||||
connect(slide_saturation, SIGNAL(valueChanged(int)), this, SLOT(colorChanged(int)));
|
connect(slide_saturation, SIGNAL(valueChanged(int)), this, SLOT(colorChanged(int)));
|
||||||
|
|
||||||
|
QLabel *color_maps_label = new QLabel("<b>Color Maps</b>", this);
|
||||||
|
color_maps_label->setGeometry(545, 260, 75, 20);
|
||||||
|
|
||||||
|
color_maps = new QComboBox(this);
|
||||||
|
color_maps->setGeometry(540, 275, 250, 30);
|
||||||
|
color_maps->addItem("None");
|
||||||
|
color_maps->addItem("Autum");
|
||||||
|
color_maps->addItem("Bone");
|
||||||
|
color_maps->addItem("Jet");
|
||||||
|
color_maps->addItem("Winter");
|
||||||
|
color_maps->addItem("Rainbow");
|
||||||
|
color_maps->addItem("Ocean");
|
||||||
|
color_maps->addItem("Summer");
|
||||||
|
color_maps->addItem("Cool");
|
||||||
|
color_maps->addItem("HSV");
|
||||||
|
color_maps->addItem("Pink");
|
||||||
|
color_maps->addItem("Hot");
|
||||||
|
color_maps->addItem("Parula");
|
||||||
|
|
||||||
|
connect(color_maps, SIGNAL(currentIndexChanged(int)), this, SLOT(colorMapChanged(int)));
|
||||||
|
|
||||||
log_text = new QTextEdit(this);
|
log_text = new QTextEdit(this);
|
||||||
log_text->setGeometry(10, 450, 780,310);
|
log_text->setGeometry(10, 450, 780,310);
|
||||||
log_text->setReadOnly(true);
|
log_text->setReadOnly(true);
|
||||||
@@ -288,7 +309,6 @@ void AC_MainWindow::chk_Clicked() {
|
|||||||
}
|
}
|
||||||
void AC_MainWindow::cb_SetIndex(int index) {
|
void AC_MainWindow::cb_SetIndex(int index) {
|
||||||
playback->setOptions(chk_negate->isChecked(), index);
|
playback->setOptions(chk_negate->isChecked(), index);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AC_MainWindow::slideChanged(int) {
|
void AC_MainWindow::slideChanged(int) {
|
||||||
@@ -299,6 +319,10 @@ void AC_MainWindow::colorChanged(int) {
|
|||||||
playback->setColorOptions(slide_bright->sliderPosition(), slide_gamma->sliderPosition(), slide_saturation->sliderPosition());
|
playback->setColorOptions(slide_bright->sliderPosition(), slide_gamma->sliderPosition(), slide_saturation->sliderPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AC_MainWindow::colorMapChanged(int pos) {
|
||||||
|
playback->setColorMap(pos);
|
||||||
|
}
|
||||||
|
|
||||||
void AC_MainWindow::addClicked() {
|
void AC_MainWindow::addClicked() {
|
||||||
int row = filters->currentRow();
|
int row = filters->currentRow();
|
||||||
if(row != -1) {
|
if(row != -1) {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public:
|
|||||||
QComboBox *combo_rgb;
|
QComboBox *combo_rgb;
|
||||||
QSlider *slide_r, *slide_g, *slide_b, *slide_bright, *slide_gamma, *slide_saturation;
|
QSlider *slide_r, *slide_g, *slide_b, *slide_bright, *slide_gamma, *slide_saturation;
|
||||||
QProgressBar *progress_bar;
|
QProgressBar *progress_bar;
|
||||||
|
QComboBox *color_maps;
|
||||||
QMenu *file_menu, *controls_menu, *help_menu;
|
QMenu *file_menu, *controls_menu, *help_menu;
|
||||||
QAction *file_exit, *file_new_capture, *file_new_video;
|
QAction *file_exit, *file_new_capture, *file_new_video;
|
||||||
QAction *controls_snapshot, *controls_pause, *controls_step, *controls_stop, *controls_setimage, *controls_showvideo;
|
QAction *controls_snapshot, *controls_pause, *controls_step, *controls_stop, *controls_setimage, *controls_showvideo;
|
||||||
@@ -54,6 +55,7 @@ public slots:
|
|||||||
void frameInc();
|
void frameInc();
|
||||||
void slideChanged(int pos);
|
void slideChanged(int pos);
|
||||||
void colorChanged(int pos);
|
void colorChanged(int pos);
|
||||||
|
void colorMapChanged(int pos);
|
||||||
private:
|
private:
|
||||||
void createControls();
|
void createControls();
|
||||||
void createMenu();
|
void createMenu();
|
||||||
|
|||||||
@@ -117,6 +117,12 @@ void Playback::setRGB(int r, int g, int b) {
|
|||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Playback::setColorMap(int c) {
|
||||||
|
mutex.lock();
|
||||||
|
ac::set_color_map = c;
|
||||||
|
mutex.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
void Playback::setDisplayed(bool shown) {
|
void Playback::setDisplayed(bool shown) {
|
||||||
video_shown = shown;
|
video_shown = shown;
|
||||||
}
|
}
|
||||||
@@ -145,8 +151,6 @@ void Playback::run() {
|
|||||||
if(i == cur.size()-1)
|
if(i == cur.size()-1)
|
||||||
ac::in_custom = false;
|
ac::in_custom = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(cur[i].first == 0) {
|
if(cur[i].first == 0) {
|
||||||
ac::draw_func[cur[i].second](frame);
|
ac::draw_func[cur[i].second](frame);
|
||||||
} else if(cur[i].first == 1) {
|
} else if(cur[i].first == 1) {
|
||||||
@@ -155,6 +159,7 @@ void Playback::run() {
|
|||||||
} else if(cur[i].first == 2) {
|
} else if(cur[i].first == 2) {
|
||||||
draw_plugin(frame, cur[i].second);
|
draw_plugin(frame, cur[i].second);
|
||||||
}
|
}
|
||||||
|
ac::ApplyColorMap(frame);
|
||||||
if(bright_ > 0) {
|
if(bright_ > 0) {
|
||||||
ac::setBrightness(frame, 1.0, bright_);
|
ac::setBrightness(frame, 1.0, bright_);
|
||||||
}
|
}
|
||||||
@@ -167,6 +172,7 @@ void Playback::run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if(ac::set_color_map > 0) ac::ApplyColorMap(frame);
|
||||||
msleep(duration);
|
msleep(duration);
|
||||||
}
|
}
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public:
|
|||||||
~Playback();
|
~Playback();
|
||||||
void setRGB(int r, int g, int b);
|
void setRGB(int r, int g, int b);
|
||||||
void setColorOptions(int b, int g, int s);
|
void setColorOptions(int b, int g, int s);
|
||||||
|
void setColorMap(int c);
|
||||||
void Play();
|
void Play();
|
||||||
void Stop();
|
void Stop();
|
||||||
void Release();
|
void Release();
|
||||||
|
|||||||
Reference in New Issue
Block a user