mirror of https://github.com/odrling/Aegisub
Removed YUV colorspace from color picker. (Bug 28 note 155.)
Attempt at making karaoke splitter commit more often. Doesn't seem to work though...? (It should now commit on anything that before would cause it to discard splits, except for the Cancel button.) Originally committed to SVN as r228.
This commit is contained in:
parent
55bfefb2d8
commit
a20fb3519f
|
@ -481,7 +481,7 @@ void AudioBox::OnKaraoke(wxCommandEvent &event) {
|
||||||
audioDisplay->SetFocus();
|
audioDisplay->SetFocus();
|
||||||
if (karaokeMode) {
|
if (karaokeMode) {
|
||||||
if (audioKaraoke->splitting) {
|
if (audioKaraoke->splitting) {
|
||||||
audioKaraoke->EndSplit(false);
|
audioKaraoke->EndSplit(true);
|
||||||
}
|
}
|
||||||
karaokeMode = false;
|
karaokeMode = false;
|
||||||
audioKaraoke->enabled = false;
|
audioKaraoke->enabled = false;
|
||||||
|
|
|
@ -85,7 +85,9 @@ AudioKaraoke::~AudioKaraoke() {
|
||||||
bool AudioKaraoke::LoadFromDialogue(AssDialogue *_diag) {
|
bool AudioKaraoke::LoadFromDialogue(AssDialogue *_diag) {
|
||||||
// Make sure we're not in splitting-mode
|
// Make sure we're not in splitting-mode
|
||||||
if (splitting) {
|
if (splitting) {
|
||||||
EndSplit(false);
|
// Commit by default, discarding the splits requires explicitly cancelling
|
||||||
|
// This doesn't seem to work when changing line in the grid, WHY?
|
||||||
|
EndSplit(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set dialogue
|
// Set dialogue
|
||||||
|
|
|
@ -358,7 +358,7 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color)
|
||||||
rgb_spectrum[0] =
|
rgb_spectrum[0] =
|
||||||
rgb_spectrum[1] =
|
rgb_spectrum[1] =
|
||||||
rgb_spectrum[2] =
|
rgb_spectrum[2] =
|
||||||
yuv_spectrum =
|
//yuv_spectrum =
|
||||||
hsl_spectrum =
|
hsl_spectrum =
|
||||||
hsv_spectrum = 0;
|
hsv_spectrum = 0;
|
||||||
spectrum_dirty = true;
|
spectrum_dirty = true;
|
||||||
|
@ -417,7 +417,7 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color)
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
sliderimg.SetData(oslid);
|
sliderimg.SetData(oslid);
|
||||||
hsl_slider = yuv_slider = new wxBitmap(sliderimg);
|
hsl_slider = /*yuv_slider =*/ new wxBitmap(sliderimg);
|
||||||
|
|
||||||
oslid = slid = (unsigned char *)malloc(slider_width*256*3);
|
oslid = slid = (unsigned char *)malloc(slider_width*256*3);
|
||||||
for (int y = 0; y < 256; y++) {
|
for (int y = 0; y < 256; y++) {
|
||||||
|
@ -442,8 +442,8 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color)
|
||||||
slider = new ColorPickerSpectrum(this, SELECTOR_SLIDER, 0, -1, -1, ColorPickerSpectrum::Vert);
|
slider = new ColorPickerSpectrum(this, SELECTOR_SLIDER, 0, -1, -1, ColorPickerSpectrum::Vert);
|
||||||
slider->SetClientSize(wxSize(slider_width, 256));
|
slider->SetClientSize(wxSize(slider_width, 256));
|
||||||
slider->SetMinSize(slider->GetSize());
|
slider->SetMinSize(slider->GetSize());
|
||||||
wxString modes[] = { _("RGB/R"), _("RGB/G"), _("RGB/B"), _("YUV/Y"), _("HSL/L"), _("HSV/H") };
|
wxString modes[] = { _("RGB/R"), _("RGB/G"), _("RGB/B"), /*_("YUV/Y"),*/ _("HSL/L"), _("HSV/H") };
|
||||||
colorspace_choice = new wxChoice(this, SELECTOR_MODE, wxDefaultPosition, wxDefaultSize, 6, modes);
|
colorspace_choice = new wxChoice(this, SELECTOR_MODE, wxDefaultPosition, wxDefaultSize, 5, modes);
|
||||||
|
|
||||||
wxSize colorinput_size(70, -1);
|
wxSize colorinput_size(70, -1);
|
||||||
wxSize colorinput_labelsize(40, -1);
|
wxSize colorinput_labelsize(40, -1);
|
||||||
|
@ -453,10 +453,10 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color)
|
||||||
rgb_input[1] = new wxSpinCtrl(this, SELECTOR_RGB_G, _T(""), wxDefaultPosition, colorinput_size, wxSP_ARROW_KEYS, 0, 255);
|
rgb_input[1] = new wxSpinCtrl(this, SELECTOR_RGB_G, _T(""), wxDefaultPosition, colorinput_size, wxSP_ARROW_KEYS, 0, 255);
|
||||||
rgb_input[2] = new wxSpinCtrl(this, SELECTOR_RGB_B, _T(""), wxDefaultPosition, colorinput_size, wxSP_ARROW_KEYS, 0, 255);
|
rgb_input[2] = new wxSpinCtrl(this, SELECTOR_RGB_B, _T(""), wxDefaultPosition, colorinput_size, wxSP_ARROW_KEYS, 0, 255);
|
||||||
|
|
||||||
wxSizer *yuv_box = new wxStaticBoxSizer(wxVERTICAL, this, _("YUV color"));
|
//wxSizer *yuv_box = new wxStaticBoxSizer(wxVERTICAL, this, _("YUV color"));
|
||||||
yuv_input[0] = new wxSpinCtrl(this, SELECTOR_YUV_Y, _T(""), wxDefaultPosition, colorinput_size, wxSP_ARROW_KEYS, 0, 255);
|
//yuv_input[0] = new wxSpinCtrl(this, SELECTOR_YUV_Y, _T(""), wxDefaultPosition, colorinput_size, wxSP_ARROW_KEYS, 0, 255);
|
||||||
yuv_input[1] = new wxSpinCtrl(this, SELECTOR_YUV_U, _T(""), wxDefaultPosition, colorinput_size, wxSP_ARROW_KEYS, 0, 255);
|
//yuv_input[1] = new wxSpinCtrl(this, SELECTOR_YUV_U, _T(""), wxDefaultPosition, colorinput_size, wxSP_ARROW_KEYS, 0, 255);
|
||||||
yuv_input[2] = new wxSpinCtrl(this, SELECTOR_YUV_V, _T(""), wxDefaultPosition, colorinput_size, wxSP_ARROW_KEYS, 0, 255);
|
//yuv_input[2] = new wxSpinCtrl(this, SELECTOR_YUV_V, _T(""), wxDefaultPosition, colorinput_size, wxSP_ARROW_KEYS, 0, 255);
|
||||||
|
|
||||||
wxSizer *hsl_box = new wxStaticBoxSizer(wxVERTICAL, this, _("HSL color"));
|
wxSizer *hsl_box = new wxStaticBoxSizer(wxVERTICAL, this, _("HSL color"));
|
||||||
hsl_input[0] = new wxSpinCtrl(this, SELECTOR_HSL_H, _T(""), wxDefaultPosition, colorinput_size, wxSP_ARROW_KEYS, 0, 255);
|
hsl_input[0] = new wxSpinCtrl(this, SELECTOR_HSL_H, _T(""), wxDefaultPosition, colorinput_size, wxSP_ARROW_KEYS, 0, 255);
|
||||||
|
@ -508,14 +508,14 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color)
|
||||||
rgb_sizer->Add(rgb_input[2], 0);
|
rgb_sizer->Add(rgb_input[2], 0);
|
||||||
rgb_box->Add(rgb_sizer, 0, wxALL, 3);
|
rgb_box->Add(rgb_sizer, 0, wxALL, 3);
|
||||||
|
|
||||||
wxSizer *yuv_sizer = new wxFlexGridSizer(3, 2, 5, 5);
|
/*wxSizer *yuv_sizer = new wxFlexGridSizer(3, 2, 5, 5);
|
||||||
yuv_sizer->Add(new wxStaticText(this, -1, _("Y:"), wxDefaultPosition, colorinput_labelsize), 0, wxALIGN_CENTER_VERTICAL);
|
yuv_sizer->Add(new wxStaticText(this, -1, _("Y:"), wxDefaultPosition, colorinput_labelsize), 0, wxALIGN_CENTER_VERTICAL);
|
||||||
yuv_sizer->Add(yuv_input[0], 0);
|
yuv_sizer->Add(yuv_input[0], 0);
|
||||||
yuv_sizer->Add(new wxStaticText(this, -1, _("U:"), wxDefaultPosition, colorinput_labelsize), 0, wxALIGN_CENTER_VERTICAL);
|
yuv_sizer->Add(new wxStaticText(this, -1, _("U:"), wxDefaultPosition, colorinput_labelsize), 0, wxALIGN_CENTER_VERTICAL);
|
||||||
yuv_sizer->Add(yuv_input[1], 0);
|
yuv_sizer->Add(yuv_input[1], 0);
|
||||||
yuv_sizer->Add(new wxStaticText(this, -1, _("V:"), wxDefaultPosition, colorinput_labelsize), 0, wxALIGN_CENTER_VERTICAL);
|
yuv_sizer->Add(new wxStaticText(this, -1, _("V:"), wxDefaultPosition, colorinput_labelsize), 0, wxALIGN_CENTER_VERTICAL);
|
||||||
yuv_sizer->Add(yuv_input[2], 0);
|
yuv_sizer->Add(yuv_input[2], 0);
|
||||||
yuv_box->Add(yuv_sizer, 0, wxALL, 3);
|
yuv_box->Add(yuv_sizer, 0, wxALL, 3);*/
|
||||||
|
|
||||||
wxSizer *hsl_sizer = new wxFlexGridSizer(3, 2, 5, 5);
|
wxSizer *hsl_sizer = new wxFlexGridSizer(3, 2, 5, 5);
|
||||||
hsl_sizer->Add(new wxStaticText(this, -1, _("Hue:"), wxDefaultPosition, colorinput_labelsize), 0, wxALIGN_CENTER_VERTICAL);
|
hsl_sizer->Add(new wxStaticText(this, -1, _("Hue:"), wxDefaultPosition, colorinput_labelsize), 0, wxALIGN_CENTER_VERTICAL);
|
||||||
|
@ -548,7 +548,7 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color)
|
||||||
|
|
||||||
wxGridBagSizer *input_sizer = new wxGridBagSizer(5, 5);
|
wxGridBagSizer *input_sizer = new wxGridBagSizer(5, 5);
|
||||||
input_sizer->Add(rgb_box, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALIGN_CENTER);
|
input_sizer->Add(rgb_box, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALIGN_CENTER);
|
||||||
input_sizer->Add(yuv_box, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALIGN_CENTER);
|
//input_sizer->Add(yuv_box, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALIGN_CENTER);
|
||||||
input_sizer->Add(hsl_box, wxGBPosition(0, 2), wxGBSpan(1, 2), wxALIGN_CENTER);
|
input_sizer->Add(hsl_box, wxGBPosition(0, 2), wxGBSpan(1, 2), wxALIGN_CENTER);
|
||||||
input_sizer->Add(hsv_box, wxGBPosition(1, 2), wxGBSpan(1, 2), wxALIGN_CENTER);
|
input_sizer->Add(hsv_box, wxGBPosition(1, 2), wxGBSpan(1, 2), wxALIGN_CENTER);
|
||||||
input_sizer->Add(ass_input_sizer, wxGBPosition(2, 0), wxGBSpan(1, 4), wxALIGN_CENTER);
|
input_sizer->Add(ass_input_sizer, wxGBPosition(2, 0), wxGBSpan(1, 4), wxALIGN_CENTER);
|
||||||
|
@ -567,7 +567,7 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color)
|
||||||
// Fill the controls
|
// Fill the controls
|
||||||
updating_controls = false;
|
updating_controls = false;
|
||||||
int mode = Options.AsInt(_T("Color Picker Mode"));
|
int mode = Options.AsInt(_T("Color Picker Mode"));
|
||||||
if (mode < 0 || mode > 5) mode = 4; // HSL default
|
if (mode < 0 || mode > 4) mode = 3; // HSL default
|
||||||
colorspace_choice->SetSelection(mode);
|
colorspace_choice->SetSelection(mode);
|
||||||
SetColor(initial_color);
|
SetColor(initial_color);
|
||||||
recent_box->LoadFromString(Options.AsText(_T("Color Picker Recent")));
|
recent_box->LoadFromString(Options.AsText(_T("Color Picker Recent")));
|
||||||
|
@ -580,14 +580,13 @@ DialogColorPicker::~DialogColorPicker()
|
||||||
delete rgb_spectrum[0];
|
delete rgb_spectrum[0];
|
||||||
delete rgb_spectrum[1];
|
delete rgb_spectrum[1];
|
||||||
delete rgb_spectrum[2];
|
delete rgb_spectrum[2];
|
||||||
delete yuv_spectrum;
|
//delete yuv_spectrum;
|
||||||
delete hsl_spectrum;
|
delete hsl_spectrum;
|
||||||
delete hsv_spectrum;
|
delete hsv_spectrum;
|
||||||
delete rgb_slider[0];
|
delete rgb_slider[0];
|
||||||
delete rgb_slider[1];
|
delete rgb_slider[1];
|
||||||
delete rgb_slider[2];
|
delete rgb_slider[2];
|
||||||
delete yuv_slider;
|
delete hsl_slider;
|
||||||
// hsl_slider points to the same bitmap as yuv_slider, so don't try to delete
|
|
||||||
delete hsv_slider;
|
delete hsv_slider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,12 +623,12 @@ void DialogColorPicker::UpdateFromRGB()
|
||||||
r = rgb_input[0]->GetValue();
|
r = rgb_input[0]->GetValue();
|
||||||
g = rgb_input[1]->GetValue();
|
g = rgb_input[1]->GetValue();
|
||||||
b = rgb_input[2]->GetValue();
|
b = rgb_input[2]->GetValue();
|
||||||
rgb_to_yuv(r, g, b, &y, &u, &v);
|
//rgb_to_yuv(r, g, b, &y, &u, &v);
|
||||||
rgb_to_hsl(r, g, b, &h, &s, &l);
|
rgb_to_hsl(r, g, b, &h, &s, &l);
|
||||||
rgb_to_hsv(r, g, b, &h2, &s2, &v2);
|
rgb_to_hsv(r, g, b, &h2, &s2, &v2);
|
||||||
yuv_input[0]->SetValue(y);
|
//yuv_input[0]->SetValue(y);
|
||||||
yuv_input[1]->SetValue(u);
|
//yuv_input[1]->SetValue(u);
|
||||||
yuv_input[2]->SetValue(v);
|
//yuv_input[2]->SetValue(v);
|
||||||
hsl_input[0]->SetValue(h);
|
hsl_input[0]->SetValue(h);
|
||||||
hsl_input[1]->SetValue(s);
|
hsl_input[1]->SetValue(s);
|
||||||
hsl_input[2]->SetValue(l);
|
hsl_input[2]->SetValue(l);
|
||||||
|
@ -646,7 +645,7 @@ void DialogColorPicker::UpdateFromRGB()
|
||||||
|
|
||||||
|
|
||||||
// Use the values entered in the YUV controls to update the other controls
|
// Use the values entered in the YUV controls to update the other controls
|
||||||
void DialogColorPicker::UpdateFromYUV()
|
/*void DialogColorPicker::UpdateFromYUV()
|
||||||
{
|
{
|
||||||
if (updating_controls) return;
|
if (updating_controls) return;
|
||||||
updating_controls = true;
|
updating_controls = true;
|
||||||
|
@ -674,7 +673,7 @@ void DialogColorPicker::UpdateFromYUV()
|
||||||
UpdateSpectrumDisplay();
|
UpdateSpectrumDisplay();
|
||||||
|
|
||||||
updating_controls = false;
|
updating_controls = false;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
// Use the values entered in the HSL controls to update the other controls
|
// Use the values entered in the HSL controls to update the other controls
|
||||||
|
@ -689,14 +688,14 @@ void DialogColorPicker::UpdateFromHSL()
|
||||||
s = hsl_input[1]->GetValue();
|
s = hsl_input[1]->GetValue();
|
||||||
l = hsl_input[2]->GetValue();
|
l = hsl_input[2]->GetValue();
|
||||||
hsl_to_rgb(h, s, l, &r, &g, &b);
|
hsl_to_rgb(h, s, l, &r, &g, &b);
|
||||||
rgb_to_yuv(r, g, b, &y, &u, &v);
|
//rgb_to_yuv(r, g, b, &y, &u, &v);
|
||||||
rgb_to_hsv(r, g, b, &h2, &s2, &v2);
|
rgb_to_hsv(r, g, b, &h2, &s2, &v2);
|
||||||
rgb_input[0]->SetValue(r);
|
rgb_input[0]->SetValue(r);
|
||||||
rgb_input[1]->SetValue(g);
|
rgb_input[1]->SetValue(g);
|
||||||
rgb_input[2]->SetValue(b);
|
rgb_input[2]->SetValue(b);
|
||||||
yuv_input[0]->SetValue(y);
|
//yuv_input[0]->SetValue(y);
|
||||||
yuv_input[1]->SetValue(u);
|
//yuv_input[1]->SetValue(u);
|
||||||
yuv_input[2]->SetValue(v);
|
//yuv_input[2]->SetValue(v);
|
||||||
hsv_input[0]->SetValue(h2);
|
hsv_input[0]->SetValue(h2);
|
||||||
hsv_input[1]->SetValue(s2);
|
hsv_input[1]->SetValue(s2);
|
||||||
hsv_input[2]->SetValue(v2);
|
hsv_input[2]->SetValue(v2);
|
||||||
|
@ -720,14 +719,14 @@ void DialogColorPicker::UpdateFromHSV()
|
||||||
s2 = hsv_input[1]->GetValue();
|
s2 = hsv_input[1]->GetValue();
|
||||||
v2 = hsv_input[2]->GetValue();
|
v2 = hsv_input[2]->GetValue();
|
||||||
hsv_to_rgb(h2, s2, v2, &r, &g, &b);
|
hsv_to_rgb(h2, s2, v2, &r, &g, &b);
|
||||||
rgb_to_yuv(r, g, b, &y, &u, &v);
|
//rgb_to_yuv(r, g, b, &y, &u, &v);
|
||||||
rgb_to_hsl(r, g, b, &h, &s, &l);
|
rgb_to_hsl(r, g, b, &h, &s, &l);
|
||||||
rgb_input[0]->SetValue(r);
|
rgb_input[0]->SetValue(r);
|
||||||
rgb_input[1]->SetValue(g);
|
rgb_input[1]->SetValue(g);
|
||||||
rgb_input[2]->SetValue(b);
|
rgb_input[2]->SetValue(b);
|
||||||
yuv_input[0]->SetValue(y);
|
//yuv_input[0]->SetValue(y);
|
||||||
yuv_input[1]->SetValue(u);
|
//yuv_input[1]->SetValue(u);
|
||||||
yuv_input[2]->SetValue(v);
|
//yuv_input[2]->SetValue(v);
|
||||||
hsl_input[0]->SetValue(h);
|
hsl_input[0]->SetValue(h);
|
||||||
hsl_input[1]->SetValue(s);
|
hsl_input[1]->SetValue(s);
|
||||||
hsl_input[2]->SetValue(l);
|
hsl_input[2]->SetValue(l);
|
||||||
|
@ -753,15 +752,15 @@ void DialogColorPicker::UpdateFromASS()
|
||||||
r = ass.r;
|
r = ass.r;
|
||||||
g = ass.g;
|
g = ass.g;
|
||||||
b = ass.b;
|
b = ass.b;
|
||||||
rgb_to_yuv(r, g, b, &y, &u, &v);
|
//rgb_to_yuv(r, g, b, &y, &u, &v);
|
||||||
rgb_to_hsl(r, g, b, &h, &s, &l);
|
rgb_to_hsl(r, g, b, &h, &s, &l);
|
||||||
rgb_to_hsv(r, g, b, &h2, &s2, &v2);
|
rgb_to_hsv(r, g, b, &h2, &s2, &v2);
|
||||||
rgb_input[0]->SetValue(r);
|
rgb_input[0]->SetValue(r);
|
||||||
rgb_input[1]->SetValue(g);
|
rgb_input[1]->SetValue(g);
|
||||||
rgb_input[2]->SetValue(b);
|
rgb_input[2]->SetValue(b);
|
||||||
yuv_input[0]->SetValue(y);
|
//yuv_input[0]->SetValue(y);
|
||||||
yuv_input[1]->SetValue(u);
|
//yuv_input[1]->SetValue(u);
|
||||||
yuv_input[2]->SetValue(v);
|
//yuv_input[2]->SetValue(v);
|
||||||
hsl_input[0]->SetValue(h);
|
hsl_input[0]->SetValue(h);
|
||||||
hsl_input[1]->SetValue(s);
|
hsl_input[1]->SetValue(s);
|
||||||
hsl_input[2]->SetValue(l);
|
hsl_input[2]->SetValue(l);
|
||||||
|
@ -787,15 +786,15 @@ void DialogColorPicker::UpdateFromHTML()
|
||||||
r = cur_color.Red();
|
r = cur_color.Red();
|
||||||
g = cur_color.Green();
|
g = cur_color.Green();
|
||||||
b = cur_color.Blue();
|
b = cur_color.Blue();
|
||||||
rgb_to_yuv(r, g, b, &y, &u, &v);
|
//rgb_to_yuv(r, g, b, &y, &u, &v);
|
||||||
rgb_to_hsl(r, g, b, &h, &s, &l);
|
rgb_to_hsl(r, g, b, &h, &s, &l);
|
||||||
rgb_to_hsv(r, g, b, &h2, &s2, &v2);
|
rgb_to_hsv(r, g, b, &h2, &s2, &v2);
|
||||||
rgb_input[0]->SetValue(r);
|
rgb_input[0]->SetValue(r);
|
||||||
rgb_input[1]->SetValue(g);
|
rgb_input[1]->SetValue(g);
|
||||||
rgb_input[2]->SetValue(b);
|
rgb_input[2]->SetValue(b);
|
||||||
yuv_input[0]->SetValue(y);
|
//yuv_input[0]->SetValue(y);
|
||||||
yuv_input[1]->SetValue(u);
|
//yuv_input[1]->SetValue(u);
|
||||||
yuv_input[2]->SetValue(v);
|
//yuv_input[2]->SetValue(v);
|
||||||
hsl_input[0]->SetValue(h);
|
hsl_input[0]->SetValue(h);
|
||||||
hsl_input[1]->SetValue(s);
|
hsl_input[1]->SetValue(s);
|
||||||
hsl_input[2]->SetValue(l);
|
hsl_input[2]->SetValue(l);
|
||||||
|
@ -835,21 +834,21 @@ void DialogColorPicker::UpdateSpectrumDisplay()
|
||||||
slider->SetXY(0, rgb_input[2]->GetValue());
|
slider->SetXY(0, rgb_input[2]->GetValue());
|
||||||
spectrum->SetXY(rgb_input[1]->GetValue(), rgb_input[0]->GetValue());
|
spectrum->SetXY(rgb_input[1]->GetValue(), rgb_input[0]->GetValue());
|
||||||
break;
|
break;
|
||||||
case 3:
|
/*case 3:
|
||||||
if (spectrum_dirty)
|
if (spectrum_dirty)
|
||||||
spectrum->SetBackground(MakeUVSpectrum());
|
spectrum->SetBackground(MakeUVSpectrum());
|
||||||
slider->SetBackground(yuv_slider);
|
slider->SetBackground(yuv_slider);
|
||||||
slider->SetXY(0, yuv_input[0]->GetValue());
|
slider->SetXY(0, yuv_input[0]->GetValue());
|
||||||
spectrum->SetXY(yuv_input[2]->GetValue(), yuv_input[1]->GetValue());
|
spectrum->SetXY(yuv_input[2]->GetValue(), yuv_input[1]->GetValue());
|
||||||
break;
|
break;*/
|
||||||
case 4:
|
case 3:
|
||||||
if (spectrum_dirty)
|
if (spectrum_dirty)
|
||||||
spectrum->SetBackground(MakeHSSpectrum());
|
spectrum->SetBackground(MakeHSSpectrum());
|
||||||
slider->SetBackground(hsl_slider);
|
slider->SetBackground(hsl_slider);
|
||||||
slider->SetXY(0, hsl_input[2]->GetValue());
|
slider->SetXY(0, hsl_input[2]->GetValue());
|
||||||
spectrum->SetXY(hsl_input[1]->GetValue(), hsl_input[0]->GetValue());
|
spectrum->SetXY(hsl_input[1]->GetValue(), hsl_input[0]->GetValue());
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 4:
|
||||||
if (spectrum_dirty)
|
if (spectrum_dirty)
|
||||||
spectrum->SetBackground(MakeSVSpectrum());
|
spectrum->SetBackground(MakeSVSpectrum());
|
||||||
slider->SetBackground(hsv_slider);
|
slider->SetBackground(hsv_slider);
|
||||||
|
@ -936,7 +935,7 @@ wxBitmap *DialogColorPicker::MakeRGSpectrum()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxBitmap *DialogColorPicker::MakeUVSpectrum()
|
/*wxBitmap *DialogColorPicker::MakeUVSpectrum()
|
||||||
{
|
{
|
||||||
if (yuv_spectrum) delete yuv_spectrum;
|
if (yuv_spectrum) delete yuv_spectrum;
|
||||||
|
|
||||||
|
@ -964,7 +963,7 @@ wxBitmap *DialogColorPicker::MakeUVSpectrum()
|
||||||
yuv_spectrum = new wxBitmap(spectrum_image);
|
yuv_spectrum = new wxBitmap(spectrum_image);
|
||||||
|
|
||||||
return yuv_spectrum;
|
return yuv_spectrum;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
wxBitmap *DialogColorPicker::MakeHSSpectrum()
|
wxBitmap *DialogColorPicker::MakeHSSpectrum()
|
||||||
|
@ -1038,9 +1037,9 @@ BEGIN_EVENT_TABLE(DialogColorPicker, wxDialog)
|
||||||
EVT_SPINCTRL(SELECTOR_RGB_R, DialogColorPicker::OnSpinRGB)
|
EVT_SPINCTRL(SELECTOR_RGB_R, DialogColorPicker::OnSpinRGB)
|
||||||
EVT_SPINCTRL(SELECTOR_RGB_G, DialogColorPicker::OnSpinRGB)
|
EVT_SPINCTRL(SELECTOR_RGB_G, DialogColorPicker::OnSpinRGB)
|
||||||
EVT_SPINCTRL(SELECTOR_RGB_B, DialogColorPicker::OnSpinRGB)
|
EVT_SPINCTRL(SELECTOR_RGB_B, DialogColorPicker::OnSpinRGB)
|
||||||
EVT_SPINCTRL(SELECTOR_YUV_Y, DialogColorPicker::OnSpinYUV)
|
//EVT_SPINCTRL(SELECTOR_YUV_Y, DialogColorPicker::OnSpinYUV)
|
||||||
EVT_SPINCTRL(SELECTOR_YUV_U, DialogColorPicker::OnSpinYUV)
|
//EVT_SPINCTRL(SELECTOR_YUV_U, DialogColorPicker::OnSpinYUV)
|
||||||
EVT_SPINCTRL(SELECTOR_YUV_V, DialogColorPicker::OnSpinYUV)
|
//EVT_SPINCTRL(SELECTOR_YUV_V, DialogColorPicker::OnSpinYUV)
|
||||||
EVT_SPINCTRL(SELECTOR_HSL_H, DialogColorPicker::OnSpinHSL)
|
EVT_SPINCTRL(SELECTOR_HSL_H, DialogColorPicker::OnSpinHSL)
|
||||||
EVT_SPINCTRL(SELECTOR_HSL_S, DialogColorPicker::OnSpinHSL)
|
EVT_SPINCTRL(SELECTOR_HSL_S, DialogColorPicker::OnSpinHSL)
|
||||||
EVT_SPINCTRL(SELECTOR_HSL_L, DialogColorPicker::OnSpinHSL)
|
EVT_SPINCTRL(SELECTOR_HSL_L, DialogColorPicker::OnSpinHSL)
|
||||||
|
@ -1050,9 +1049,9 @@ BEGIN_EVENT_TABLE(DialogColorPicker, wxDialog)
|
||||||
EVT_TEXT(SELECTOR_RGB_R, DialogColorPicker::OnChangeRGB)
|
EVT_TEXT(SELECTOR_RGB_R, DialogColorPicker::OnChangeRGB)
|
||||||
EVT_TEXT(SELECTOR_RGB_G, DialogColorPicker::OnChangeRGB)
|
EVT_TEXT(SELECTOR_RGB_G, DialogColorPicker::OnChangeRGB)
|
||||||
EVT_TEXT(SELECTOR_RGB_B, DialogColorPicker::OnChangeRGB)
|
EVT_TEXT(SELECTOR_RGB_B, DialogColorPicker::OnChangeRGB)
|
||||||
EVT_TEXT(SELECTOR_YUV_Y, DialogColorPicker::OnChangeYUV)
|
//EVT_TEXT(SELECTOR_YUV_Y, DialogColorPicker::OnChangeYUV)
|
||||||
EVT_TEXT(SELECTOR_YUV_U, DialogColorPicker::OnChangeYUV)
|
//EVT_TEXT(SELECTOR_YUV_U, DialogColorPicker::OnChangeYUV)
|
||||||
EVT_TEXT(SELECTOR_YUV_V, DialogColorPicker::OnChangeYUV)
|
//EVT_TEXT(SELECTOR_YUV_V, DialogColorPicker::OnChangeYUV)
|
||||||
EVT_TEXT(SELECTOR_HSL_H, DialogColorPicker::OnChangeHSL)
|
EVT_TEXT(SELECTOR_HSL_H, DialogColorPicker::OnChangeHSL)
|
||||||
EVT_TEXT(SELECTOR_HSL_S, DialogColorPicker::OnChangeHSL)
|
EVT_TEXT(SELECTOR_HSL_S, DialogColorPicker::OnChangeHSL)
|
||||||
EVT_TEXT(SELECTOR_HSL_L, DialogColorPicker::OnChangeHSL)
|
EVT_TEXT(SELECTOR_HSL_L, DialogColorPicker::OnChangeHSL)
|
||||||
|
@ -1077,12 +1076,12 @@ void DialogColorPicker::OnSpinRGB(wxSpinEvent &evt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DialogColorPicker::OnSpinYUV(wxSpinEvent &evt)
|
/*void DialogColorPicker::OnSpinYUV(wxSpinEvent &evt)
|
||||||
{
|
{
|
||||||
if (!updating_controls)
|
if (!updating_controls)
|
||||||
spectrum_dirty = true;
|
spectrum_dirty = true;
|
||||||
UpdateFromYUV();
|
UpdateFromYUV();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
void DialogColorPicker::OnSpinHSL(wxSpinEvent &evt)
|
void DialogColorPicker::OnSpinHSL(wxSpinEvent &evt)
|
||||||
|
@ -1109,12 +1108,12 @@ void DialogColorPicker::OnChangeRGB(wxCommandEvent &evt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DialogColorPicker::OnChangeYUV(wxCommandEvent &evt)
|
/*void DialogColorPicker::OnChangeYUV(wxCommandEvent &evt)
|
||||||
{
|
{
|
||||||
if (!updating_controls)
|
if (!updating_controls)
|
||||||
spectrum_dirty = true;
|
spectrum_dirty = true;
|
||||||
UpdateFromYUV();
|
UpdateFromYUV();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
void DialogColorPicker::OnChangeHSL(wxCommandEvent &evt)
|
void DialogColorPicker::OnChangeHSL(wxCommandEvent &evt)
|
||||||
|
@ -1184,19 +1183,19 @@ void DialogColorPicker::OnSpectrumChange(wxCommandEvent &evt)
|
||||||
updating_controls = false;
|
updating_controls = false;
|
||||||
UpdateFromRGB();
|
UpdateFromRGB();
|
||||||
break;
|
break;
|
||||||
case 3:
|
/*case 3:
|
||||||
yuv_input[2]->SetValue(x);
|
yuv_input[2]->SetValue(x);
|
||||||
yuv_input[1]->SetValue(y);
|
yuv_input[1]->SetValue(y);
|
||||||
updating_controls = false;
|
updating_controls = false;
|
||||||
UpdateFromYUV();
|
UpdateFromYUV();
|
||||||
break;
|
break;*/
|
||||||
case 4:
|
case 3:
|
||||||
hsl_input[1]->SetValue(x);
|
hsl_input[1]->SetValue(x);
|
||||||
hsl_input[0]->SetValue(y);
|
hsl_input[0]->SetValue(y);
|
||||||
updating_controls = false;
|
updating_controls = false;
|
||||||
UpdateFromHSL();
|
UpdateFromHSL();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 4:
|
||||||
hsv_input[1]->SetValue(x);
|
hsv_input[1]->SetValue(x);
|
||||||
hsv_input[2]->SetValue(y);
|
hsv_input[2]->SetValue(y);
|
||||||
updating_controls = false;
|
updating_controls = false;
|
||||||
|
@ -1225,13 +1224,13 @@ void DialogColorPicker::OnSliderChange(wxCommandEvent &evt)
|
||||||
case 2:
|
case 2:
|
||||||
rgb_input[2]->SetValue(y);
|
rgb_input[2]->SetValue(y);
|
||||||
break;
|
break;
|
||||||
case 3:
|
/*case 3:
|
||||||
yuv_input[0]->SetValue(y);
|
yuv_input[0]->SetValue(y);
|
||||||
break;
|
break;*/
|
||||||
case 4:
|
case 3:
|
||||||
hsl_input[2]->SetValue(y);
|
hsl_input[2]->SetValue(y);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 4:
|
||||||
hsv_input[0]->SetValue(y);
|
hsv_input[0]->SetValue(y);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,9 +134,9 @@ private:
|
||||||
wxBitmap *rgb_slider[3]; // z spectrum for color "i"
|
wxBitmap *rgb_slider[3]; // z spectrum for color "i"
|
||||||
|
|
||||||
// 0 = Y, 1 = U, 2 = V (what does, Y, U and V mean?!? just metasyntactical coordinate axis names?)
|
// 0 = Y, 1 = U, 2 = V (what does, Y, U and V mean?!? just metasyntactical coordinate axis names?)
|
||||||
wxSpinCtrl *yuv_input[3];
|
//wxSpinCtrl *yuv_input[3];
|
||||||
wxBitmap *yuv_spectrum; // u/v spectrum
|
//wxBitmap *yuv_spectrum; // u/v spectrum
|
||||||
wxBitmap *yuv_slider; // y spectrum
|
//wxBitmap *yuv_slider; // y spectrum
|
||||||
|
|
||||||
// 0 = hue, 1 = saturation, 2 = luminance
|
// 0 = hue, 1 = saturation, 2 = luminance
|
||||||
wxSpinCtrl *hsl_input[3];
|
wxSpinCtrl *hsl_input[3];
|
||||||
|
@ -161,7 +161,7 @@ private:
|
||||||
wxButton *cancel_button;
|
wxButton *cancel_button;
|
||||||
|
|
||||||
void UpdateFromRGB(); // Update all other controls as a result of modifying an RGB control
|
void UpdateFromRGB(); // Update all other controls as a result of modifying an RGB control
|
||||||
void UpdateFromYUV(); // Update all other controls as a result of modifying a YUV control
|
//void UpdateFromYUV(); // Update all other controls as a result of modifying a YUV control
|
||||||
void UpdateFromHSL(); // Update all other controls as a result of modifying an HSL control
|
void UpdateFromHSL(); // Update all other controls as a result of modifying an HSL control
|
||||||
void UpdateFromHSV(); // Update all other controls as a result of modifying an HSV control
|
void UpdateFromHSV(); // Update all other controls as a result of modifying an HSV control
|
||||||
void UpdateFromASS(); // Update all other controls as a result of modifying the ASS format control
|
void UpdateFromASS(); // Update all other controls as a result of modifying the ASS format control
|
||||||
|
@ -171,16 +171,16 @@ private:
|
||||||
wxBitmap *MakeGBSpectrum();
|
wxBitmap *MakeGBSpectrum();
|
||||||
wxBitmap *MakeRBSpectrum();
|
wxBitmap *MakeRBSpectrum();
|
||||||
wxBitmap *MakeRGSpectrum();
|
wxBitmap *MakeRGSpectrum();
|
||||||
wxBitmap *MakeUVSpectrum();
|
//wxBitmap *MakeUVSpectrum();
|
||||||
wxBitmap *MakeHSSpectrum();
|
wxBitmap *MakeHSSpectrum();
|
||||||
wxBitmap *MakeSVSpectrum();
|
wxBitmap *MakeSVSpectrum();
|
||||||
|
|
||||||
void OnSpinRGB(wxSpinEvent &evt);
|
void OnSpinRGB(wxSpinEvent &evt);
|
||||||
void OnSpinYUV(wxSpinEvent &evt);
|
//void OnSpinYUV(wxSpinEvent &evt);
|
||||||
void OnSpinHSL(wxSpinEvent &evt);
|
void OnSpinHSL(wxSpinEvent &evt);
|
||||||
void OnSpinHSV(wxSpinEvent &evt);
|
void OnSpinHSV(wxSpinEvent &evt);
|
||||||
void OnChangeRGB(wxCommandEvent &evt);
|
void OnChangeRGB(wxCommandEvent &evt);
|
||||||
void OnChangeYUV(wxCommandEvent &evt);
|
//void OnChangeYUV(wxCommandEvent &evt);
|
||||||
void OnChangeHSL(wxCommandEvent &evt);
|
void OnChangeHSL(wxCommandEvent &evt);
|
||||||
void OnChangeHSV(wxCommandEvent &evt);
|
void OnChangeHSV(wxCommandEvent &evt);
|
||||||
void OnChangeASS(wxCommandEvent &evt);
|
void OnChangeASS(wxCommandEvent &evt);
|
||||||
|
@ -209,9 +209,9 @@ enum {
|
||||||
SELECTOR_RGB_R,
|
SELECTOR_RGB_R,
|
||||||
SELECTOR_RGB_G,
|
SELECTOR_RGB_G,
|
||||||
SELECTOR_RGB_B,
|
SELECTOR_RGB_B,
|
||||||
SELECTOR_YUV_Y,
|
//SELECTOR_YUV_Y,
|
||||||
SELECTOR_YUV_U,
|
//SELECTOR_YUV_U,
|
||||||
SELECTOR_YUV_V,
|
//SELECTOR_YUV_V,
|
||||||
SELECTOR_HSL_H,
|
SELECTOR_HSL_H,
|
||||||
SELECTOR_HSL_S,
|
SELECTOR_HSL_S,
|
||||||
SELECTOR_HSL_L,
|
SELECTOR_HSL_L,
|
||||||
|
|
Loading…
Reference in New Issue