Exemplo n.º 1
0
Save_Widget::Save_Widget() :
    _plugin      (0),
    _codec_widget(0)
{
    // Create widgets.

    Group_Box * codec_group = new Group_Box(label_codec_group);

    _codec_widget = new Radio_Button_Group(label_codec());

    // Layout.

    Layout_Item::create_group(List<Layout_Item *>() <<
        _codec_widget);

    Vertical_Layout * layout = new Vertical_Layout(this);
    layout->spacing(Style::global()->spacing_large());

    layout->add(codec_group);
    codec_group->layout()->add(_codec_widget);

    layout->add_stretch();

    // Initialize.

    plugin_update();
    widget_update();

    // Callbacks.

    _codec_widget->signal.set(this, codec_callback);
}
Exemplo n.º 2
0
Save_Widget::Save_Widget() :
    _plugin            (0),
    _compression_widget(0)
{
    //DJV_DEBUG("Save_Widget::Save_Widget");

    // Create widgets.

    Group_Box * group = new Group_Box(label_compression_group);

    _compression_widget = new Radio_Button_Group(label_compression());

    // Layout.

    Vertical_Layout * layout = new Vertical_Layout(this);
    layout->margin(Style::global()->margin_large());
    layout->spacing(Style::global()->spacing_large());

    layout->add(group);
    group->layout()->add(_compression_widget);

    layout->add_stretch();

    // Initialize.

    plugin_update();
    widget_update();

    // Callbacks.

    _compression_widget->signal.set(this, compression_callback);
}
Exemplo n.º 3
0
Save_Widget::Save_Widget() :
    _plugin              (0),
    _color_profile_widget(0),
    _black_widget        (0),
    _white_widget        (0),
    _gamma_widget        (0)
{
    // Create color profile widgets.

    Group_Box * color_profile_group =
        new Group_Box(label_color_profile_group);

    _color_profile_widget = new Radio_Button_Group(label_color_profile());

    Group_Box * film_print_group = new Group_Box(label_film_print_group);

    _black_widget = new Int_Edit_Slider(0, 1023);

    _white_widget = new Int_Edit_Slider(0, 1023);

    _gamma_widget = new Float_Edit_Slider(0.01, 4.0);

    // Layout.

    Vertical_Layout * layout = new Vertical_Layout(this);
    layout->margin(Style::global()->margin_large());
    layout->spacing(Style::global()->spacing_large());

    layout->add(color_profile_group);
    color_profile_group->layout()->add(_color_profile_widget);

    color_profile_group->layout()->add(film_print_group);
    Form_Widget * form_widget = new Form_Widget;
    film_print_group->layout()->add(form_widget);
    form_widget->add_row(label_film_print_black, _black_widget);
    form_widget->add_row(label_film_print_white, _white_widget);
    form_widget->add_row(label_film_print_gamma, _gamma_widget);

    layout->add_stretch();

    // Initialize.

    _black_widget->default_value(Save::Options().film_print.black);
    _white_widget->default_value(Save::Options().film_print.white);
    _gamma_widget->default_value(Save::Options().film_print.gamma);

    plugin_update();
    widget_update();

    // Callbacks.

    _color_profile_widget->signal.set(this, color_profile_callback);
    _black_widget->signal.set(this, black_callback);
    _white_widget->signal.set(this, white_callback);
    _gamma_widget->signal.set(this, gamma_callback);
}
Exemplo n.º 4
0
Application_Message_Dialog::Application_Message_Dialog() :
    Dialog("Messages"),
    _show        (true),
    _widget      (0),
    _show_widget (0),
    _clear_widget(0),
    _close_widget(0)
{
    // Create widgets.

    _widget = new Multiline_Text_Display;

    _show_widget = new Check_Button("&Show");

    _clear_widget = new Push_Button("&Clear");

    _close_widget = new Push_Button("Clos&e");

    // Layout.

    Vertical_Layout * layout = new Vertical_Layout(this);
    layout->add(_widget);
    layout->stretch(_widget);

    Horizontal_Layout * layout_h = new Horizontal_Layout(layout);
    layout_h->margin(0);
    layout_h->add(_show_widget);
    layout_h->add_stretch();
    layout_h->add(_clear_widget);
    layout_h->add(_close_widget);
    layout_h->add_spacer(Layout::window_handle_size());

    // Preferences.

    Prefs prefs(Prefs::prefs_global(), "application_message_dialog");
    Prefs::get_(&prefs, "show", &_show);

    // Initialize.

    widget_update();
    dialog_update();

    size(size_hint());

    // Callbacks.

    _show_widget->signal.set(this, show_callback);
    _clear_widget->signal.set(this, clear_callback);
    _close_widget->signal.set(this, close_callback);
}
Exemplo n.º 5
0
Magnify_Dialog::Magnify_Dialog() :
    Dialog("Magnify"),
    _view        (0),
    _zoom        (ZOOM_200),
    _widget      (0),
    _zoom_widget (0),
    _close_widget(0)
{
    // Create widgets.

    _widget = new Magnify_Widget;

    _zoom_widget = new Choice_Widget(label_zoom());

    _close_widget = new Push_Button(label_close);

    // Layout.

    Vertical_Layout * layout = new Vertical_Layout(this);

    layout->add(_widget);
    layout->stretch(_widget);

    Horizontal_Layout * layout_h = new Horizontal_Layout(layout);
    layout_h->margin(0);
    layout_h->add(_zoom_widget);
    layout_h->add_spacer(-1, true);
    layout_h->add(_close_widget);
    layout_h->add_spacer(Layout::window_handle_size());

    // Preferences.

    Prefs prefs(Prefs::prefs(), "magnify_dialog");
    Prefs::get_(&prefs, "zoom", &_zoom);

    // Initialize.

    widget_update();

    size(Vector_Util::max(size_hint(), V2i(300, 300)));

    // Callbacks.

    _zoom_widget->signal.set(this, zoom_callback);

    _close_widget->signal.set(this, close_callback);
}
Exemplo n.º 6
0
Application::Application(int argc, char ** argv) :
    djv::Application("djv_play2_test", argc, argv),
    _frame(0),
    _image0(0),
    _image1(0),
    _window(0)
{
    File::seq_extensions.add(List<String>() << ".ppm" << ".PPM");

    // Command line.

    if (argc != 2)
    {
        print("usage: test_image_play2 (input)");
        exit(EXIT_ERROR);
        return;
    }

    _file.set(argv[1]);

    if (_file.is_seq_valid())
    {
        _file.type(File::SEQ);
    }

    is_valid(true);

    // Widgets.

    _window = new djv::Window(name());

    _widget = new Widget;

    // Layout.

    Vertical_Layout * layout = new Vertical_Layout(_window);
    layout->margin(0);
    layout->add(_widget);
    layout->stretch(_widget);

    // Initialize.

    _image_buf.resize(20);
    List<Image_Ptr>::size_type i = 0;

    for (; i < _image_buf.size(); ++i)
    {
        _image_buf[i].p = new Image_Ppm;
    }

    i = 0;

    for (; i < _image_buf.size() - 1; ++i)
    {
        _image_buf[i].next = &_image_buf[i + 1];
    }

    _image_buf[i].next = &_image_buf[0];

    _image0 = &_image_buf[0];
    _image0->p->load(_file.get(_file.seq().list[_frame]));
    _image0->frame = _frame;

    _image1 = &_image_buf[0];

    //update();
    Fl::add_idle(update_callback, this);

    _window->size(_image0->p->info().size);
    _window->show();

    // Callbacks.

    _window->close_signal.set(this, exit_callback);
}
Exemplo n.º 7
0
Scale_Op::Scale_Op()
{
    // Widgets.

    Group_Box * size_group = new Group_Box("Size");
    Int_Edit_Slider * width = new Int_Edit_Slider;
    Int_Edit_Slider * height = new Int_Edit_Slider;

    Group_Box * type_group = new Group_Box("Type");
    Choice_Widget * type = new Choice_Widget(label_type());

    Group_Box * filter_default_group = new Group_Box("Default Filter");
    Choice_Widget * filter_default_min =
        new Choice_Widget(label_filter_default());
    Choice_Widget * filter_default_mag =
        new Choice_Widget(label_filter_default());

    Group_Box * filter_custom_group = new Group_Box("Custom Filter");
    Choice_Widget * filter_custom_min =
        new Choice_Widget(label_filter_custom());
    Choice_Widget * filter_custom_mag =
        new Choice_Widget(label_filter_custom());

    // Layout.

    Layout_Item::group(List<Layout_Item *>() <<
        width <<
        height);

    Vertical_Layout * layout = new Vertical_Layout(this);
    layout->add(size_group);
    Vertical_Layout * layout_v = new Vertical_Layout(size_group);
    Horizontal_Layout * layout_h = new Horizontal_Layout(layout_v);
    layout_v->add(width);
    layout_v->add(height);

    layout->add(type_group);
    layout_v = new Vertical_Layout(type_group);
    layout_v->add(type);

    layout->add(filter_default_group);
    layout_v = new Vertical_Layout(filter_default_group);
    layout_h = new Horizontal_Layout(layout_v);
    layout_h->margin(0);
    layout_h->add(filter_default_min);
    layout_h->add(filter_default_mag);

    layout->add(filter_custom_group);
    layout_v = new Vertical_Layout(filter_custom_group);
    layout_h = new Horizontal_Layout(layout_v);
    layout_h->margin(0);
    layout_h->add(filter_custom_min);
    layout_h->add(filter_custom_mag);

    layout->add_stretch();

    // Initialize.

    width->range(1, 2048);
    height->range(1, 2048);
    width->set(_value.size.x);
    height->set(_value.size.y);
    type->set(_value.type);
    filter_default_min->set(_value.default_min);
    filter_default_mag->set(_value.default_mag);
    filter_custom_min->set(_value.custom_min);
    filter_custom_mag->set(_value.custom_mag);

    // Callbacks.

    width->signal.set(this, width_callback);
    height->signal.set(this, height_callback);
    type->signal.set(this, type_callback);
    filter_default_min->signal.set(this, default_min_callback);
    filter_default_mag->signal.set(this, default_mag_callback);
    filter_custom_min->signal.set(this, custom_min_callback);
    filter_custom_mag->signal.set(this, custom_mag_callback);
}
Exemplo n.º 8
0
Application::Application(int argc, char ** argv) :
    djv::Application("djv_play_test", argc, argv),
    _load  (0),
    _window(0),
    _frame (0)
{
    // Command line.

    if (argc != 2)
    {
        print("usage: djv_play_test (input)");
        exit(EXIT_ERROR);
        return;
    }

    _file.set(argv[1]);

    if (_file.is_seq_valid())
    {
        _file.type(File::SEQ);
    }

    try
    {
        _load = Image_Load_Factory::global()->get(_file, &_info);
    }
    catch (Error error)
    {
        this->error(error);
        exit(EXIT_ERROR);
        return;
    }

    is_valid(true);

    // Widgets.

    _window = new djv::Window(name());

    _widget = new Widget;

    // Layout.

    Vertical_Layout * layout = new Vertical_Layout(_window);
    layout->margin(0);
    layout->add(_widget);
    layout->stretch(_widget);

    // Initialize.

    //update();
    Fl::add_idle(update_callback, this);

    //_widget->zoom(0.5);

    _window->size(_info.size);
    _window->show();

    // Callbacks.

    _window->close_signal.set(this, exit_callback);
}
Display_Profile_Dialog::Display_Profile_Dialog() :
    Dialog("Display Profile"),
    signal            (this),
    _view             (0),
    _lut_widget       (0),
    _brightness_widget(0),
    _contrast_widget  (0),
    _saturation_widget(0),
    _gamma_widget     (0),
    _soft_clip_widget (0),
    _close_widget     (0)
{
    // Create LUT widgets.

    Group_Box * lut_group = new Group_Box(label_lut);

    _lut_widget = new File_Edit;

    // Create color widgets.

    Group_Box * color_group = new Group_Box(label_color);

    _brightness_widget = new Float_Edit_Slider;
    _brightness_widget->default_value(_value.color.brightness);
    _brightness_widget->range(0.0, 4.0);

    _contrast_widget = new Float_Edit_Slider;
    _contrast_widget->default_value(_value.color.contrast);
    _contrast_widget->range(0.0, 4.0);

    _saturation_widget = new Float_Edit_Slider;
    _saturation_widget->default_value(_value.color.saturation);
    _saturation_widget->range(0.0, 4.0);

    // Create levels widgets.

    Group_Box * levels_group = new Group_Box(label_levels);

    _levels_in_widget[0] = new Float_Edit_Slider;
    _levels_in_widget[0]->default_value(_value.levels.in_low);
    _levels_in_widget[0]->range(0.0, 1.0);

    _levels_in_widget[1] = new Float_Edit_Slider;
    _levels_in_widget[1]->default_value(_value.levels.in_high);
    _levels_in_widget[1]->range(0.0, 1.0);

    _gamma_widget = new Float_Edit_Slider;
    _gamma_widget->default_value(_value.levels.gamma);
    _gamma_widget->range(0.0, 4.0);

    _levels_out_widget[0] = new Float_Edit_Slider;
    _levels_out_widget[0]->default_value(_value.levels.out_low);
    _levels_out_widget[0]->range(0.0, 1.0);

    _levels_out_widget[1] = new Float_Edit_Slider;
    _levels_out_widget[1]->default_value(_value.levels.out_high);
    _levels_out_widget[1]->range(0.0, 1.0);

    _soft_clip_widget = new Float_Edit_Slider;
    _soft_clip_widget->default_value(_value.soft_clip);
    _soft_clip_widget->range(0.0, 1.0);

    // Create dialog widgets.

    _close_widget = new Push_Button(label_close);

    // Layout.

    Vertical_Layout * layout = new Vertical_Layout(this);

    layout->add(lut_group);
    lut_group->layout()->add(_lut_widget);

    layout->add(color_group);
    Form_Widget * form_widget = new Form_Widget;
    color_group->layout()->add(form_widget);
    form_widget->add_row(label_brightness, _brightness_widget);
    form_widget->add_row(label_contrast, _contrast_widget);
    form_widget->add_row(label_saturation, _saturation_widget);
    
    layout->add(levels_group);
    form_widget = new Form_Widget;
    levels_group->layout()->add(form_widget);
    form_widget->add_row(label_levels_in, _levels_in_widget[0]);
    form_widget->add_row(String(), _levels_in_widget[1]);
    form_widget->add_row(label_gamma, _gamma_widget);
    form_widget->add_row(label_levels_out, _levels_out_widget[0]);
    form_widget->add_row(String(), _levels_out_widget[1]);
    form_widget->add_row(label_soft_clip, _soft_clip_widget);
    
    layout->add_spacer(-1, true);

    Horizontal_Layout * layout_h = new Horizontal_Layout(layout);
    layout_h->margin(0);
    layout_h->add_stretch();
    layout_h->add(_close_widget);
    layout_h->add_spacer(Layout::window_handle_size());

    // Initialize.

    widget_update();

    size(size_hint());

    // Callbacks.

    _lut_widget->signal.set(this, lut_callback);

    _brightness_widget->signal.set(this, brightness_callback);
    _contrast_widget->signal.set(this, contrast_callback);
    _saturation_widget->signal.set(this, saturation_callback);

    _levels_in_widget[0]->signal.set(this, levels_in0_callback);
    _levels_in_widget[1]->signal.set(this, levels_in1_callback);
    _gamma_widget->signal.set(this, gamma_callback);
    _levels_out_widget[0]->signal.set(this, levels_out0_callback);
    _levels_out_widget[1]->signal.set(this, levels_out1_callback);
    _soft_clip_widget->signal.set(this, soft_clip_callback);

    _close_widget->signal.set(this, close_callback);
}