LADSPA_PATH env var processing
[goodguy/history.git] / cinelerra-5.0 / cinelerra / cwindowtool.C
index fceac56fe0ac04cddd200ed1e03387656a7898ea..fee67009104da46e923614613818ff5120cf7672 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "automation.h"
+#include "cicolors.h"
 #include "clip.h"
 #include "condition.h"
 #include "cpanel.h"
@@ -366,7 +367,7 @@ int CWindowCropOK::keypress_event()
 CWindowCropGUI::CWindowCropGUI(MWindow *mwindow, CWindowTool *thread)
  : CWindowToolGUI(mwindow, 
        thread,
-       PROGRAM_NAME ": Crop",
+       _(PROGRAM_NAME ": Crop"),
        330,
        100)
 {
@@ -478,9 +479,9 @@ void CWindowCropGUI::update()
 CWindowEyedropGUI::CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread)
  : CWindowToolGUI(mwindow, 
        thread,
-       PROGRAM_NAME ": Color",
+       _(PROGRAM_NAME ": Color"),
        200,
-       200)
+       250)
 {
 }
 
@@ -495,20 +496,27 @@ void CWindowEyedropGUI::create_objects()
        int y = margin;
        int x2 = 70;
        lock_window("CWindowEyedropGUI::create_objects");
-       BC_Title *title1, *title2, *title3, *title4;
-       add_subwindow(title4 = new BC_Title(x, y, "Radius:"));
+       BC_Title *title1, *title2, *title3, *title4, *title5, *title6, *title7;
+       add_subwindow(title7 = new BC_Title(x, y, _("Radius:")));
        y += BC_TextBox::calculate_h(this, MEDIUMFONT, 1, 1) + margin;
        
-       add_subwindow(title1 = new BC_Title(x, y, "Red:"));
+       add_subwindow(title1 = new BC_Title(x, y, _("Red:")));
        y += title1->get_h() + margin;
-       add_subwindow(title2 = new BC_Title(x, y, "Green:"));
+       add_subwindow(title2 = new BC_Title(x, y, _("Green:")));
        y += title2->get_h() + margin;
-       add_subwindow(title3 = new BC_Title(x, y, "Blue:"));
+       add_subwindow(title3 = new BC_Title(x, y, _("Blue:")));
+       y += title3->get_h() + margin;
+
+       add_subwindow(title4 = new BC_Title(x, y, "Y:"));
+       y += title4->get_h() + margin;
+       add_subwindow(title5 = new BC_Title(x, y, "U:"));
+       y += title5->get_h() + margin;
+       add_subwindow(title6 = new BC_Title(x, y, "V:"));
 
 
        radius = new CWindowCoord(this,
                x2,
-               title4->get_y(),
+               title7->get_y(),
                mwindow->edl->session->eyedrop_radius);
        radius->create_objects();
        radius->set_boundaries((int64_t)0, (int64_t)255);
@@ -518,7 +526,11 @@ void CWindowEyedropGUI::create_objects()
        add_subwindow(green = new BC_Title(x2, title2->get_y(), "0"));
        add_subwindow(blue = new BC_Title(x2, title3->get_y(), "0"));
 
-       y = blue->get_y() + blue->get_h() + margin;
+       add_subwindow(this->y = new BC_Title(x2, title4->get_y(), "0"));
+       add_subwindow(this->u = new BC_Title(x2, title5->get_y(), "0"));
+       add_subwindow(this->v = new BC_Title(x2, title6->get_y(), "0"));
+
+       y = title6->get_y() + this->v->get_h() + margin;
        add_subwindow(sample = new BC_SubWindow(x, y, 50, 50));
        update();
        unlock_window();
@@ -532,6 +544,17 @@ void CWindowEyedropGUI::update()
        green->update(mwindow->edl->local_session->green);
        blue->update(mwindow->edl->local_session->blue);
 
+       float y, u, v;
+       YUV::rgb_to_yuv_f(mwindow->edl->local_session->red, 
+               mwindow->edl->local_session->green, 
+               mwindow->edl->local_session->blue, 
+               y, 
+               u, 
+               v);
+       this->y->update(y);
+       this->u->update(u);
+       this->v->update(v);
+
        int red = (int)(CLIP(mwindow->edl->local_session->red, 0, 1) * 0xff);
        int green = (int)(CLIP(mwindow->edl->local_session->green, 0, 1) * 0xff);
        int blue = (int)(CLIP(mwindow->edl->local_session->blue, 0, 1) * 0xff);
@@ -579,7 +602,7 @@ void CWindowEyedropGUI::handle_event()
 CWindowCameraGUI::CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread)
  : CWindowToolGUI(mwindow, 
        thread,
-       PROGRAM_NAME ": Camera",
+       _(PROGRAM_NAME ": Camera"),
        170,
        170)
 {
@@ -1036,7 +1059,7 @@ int CWindowCameraBottom::handle_event()
 CWindowProjectorGUI::CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread)
  : CWindowToolGUI(mwindow, 
        thread,
-       PROGRAM_NAME ": Projector",
+       _(PROGRAM_NAME ": Projector"),
        170,
        170)
 {
@@ -1906,7 +1929,7 @@ int CWindowMaskValue::handle_event()
 CWindowMaskGUI::CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread)
  : CWindowToolGUI(mwindow, 
        thread,
-       PROGRAM_NAME ": Mask",
+       _(PROGRAM_NAME ": Mask"),
        330,
        280)
 {
@@ -2142,7 +2165,7 @@ void CWindowMaskGUI::update_preview()
 CWindowRulerGUI::CWindowRulerGUI(MWindow *mwindow, CWindowTool *thread)
  : CWindowToolGUI(mwindow, 
        thread,
-       PROGRAM_NAME ": Ruler",
+       _(PROGRAM_NAME ": Ruler"),
        320,
        240)
 {
@@ -2158,22 +2181,22 @@ void CWindowRulerGUI::create_objects()
        BC_Title *title;
 
        lock_window("CWindowRulerGUI::create_objects");
-       add_subwindow(title = new BC_Title(x, y, "Current:"));
+       add_subwindow(title = new BC_Title(x, y, _("Current:")));
        add_subwindow(current = new BC_Title(x + title->get_w() + 10, y, ""));
        y += title->get_h() + 5;
        
-       add_subwindow(title = new BC_Title(x, y, "Point 1:"));
+       add_subwindow(title = new BC_Title(x, y, _("Point 1:")));
        add_subwindow(point1 = new BC_Title(x + title->get_w() + 10, y, ""));
        y += title->get_h() + 5;
 
-       add_subwindow(title = new BC_Title(x, y, "Point 2:"));
+       add_subwindow(title = new BC_Title(x, y, _("Point 2:")));
        add_subwindow(point2 = new BC_Title(x + title->get_w() + 10, y, ""));
        y += title->get_h() + 5;
 
-       add_subwindow(title = new BC_Title(x, y, "Distance:"));
+       add_subwindow(title = new BC_Title(x, y, _("Distance:")));
        add_subwindow(distance = new BC_Title(x + title->get_w() + 10, y, ""));
        y += title->get_h() + 5;
-       add_subwindow(title = new BC_Title(x, y, "Angle:"));
+       add_subwindow(title = new BC_Title(x, y, _("Angle:")));
        add_subwindow(angle = new BC_Title(x + title->get_w() + 10, y, ""));
        y += title->get_h() + 10;
        char string[BCTEXTLEN];
@@ -2225,7 +2248,7 @@ void CWindowRulerGUI::update()
                mwindow->edl->session->ruler_y2);
        point2->update(string);
 
-       sprintf(string, "%0.01f pixels", distance_value);
+       sprintf(string, _("%0.01f pixels"), distance_value);
        distance->update(string);
        sprintf(string, "%0.02f %c", angle_value, 0xb0);
        angle->update(string);