public
Description: Re-write of Agave Colorscheme Designer
Homepage:
Clone URL: git://github.com/jonner/agave2.git
agave2 / test / test-all.cc
100644 93 lines (82 sloc) 3.229 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*******************************************************************************
* PROJECT: Agave
*
* AUTHOR: Jonathon Jongsma
*
* Copyright (c) 2007 Jonathon Jongsma
*
* License:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
*******************************************************************************/
 
#include <gtkmm.h>
#include "color-scale.h"
#include "color-model.h"
#include "swatch.h"
 
using namespace agave;
 
class TestWindow : public Gtk::Window
{
    public:
        TestWindow () :
            m_model (new ColorModel (Color (0.8, 0.1, 0.1, 0.8))),
            m_rscale (m_model, ColorScale::CHANNEL_RED),
            m_gscale (m_model, ColorScale::CHANNEL_GREEN),
            m_bscale (m_model, ColorScale::CHANNEL_BLUE),
            m_ascale_rgb (m_model, ColorScale::CHANNEL_ALPHA),
            m_hscale (m_model, ColorScale::CHANNEL_HUE),
            m_sscale (m_model, ColorScale::CHANNEL_SATURATION),
            m_vscale (m_model, ColorScale::CHANNEL_VALUE),
            m_ascale_hsv (m_model, ColorScale::CHANNEL_ALPHA),
            m_swatch (m_model)
        {
            set_title ("Agave Widget Test");
            m_hbox.pack_start (m_box_selection);
            m_hbox.pack_start (m_box_rgb);
            m_hbox.pack_start (m_box_hsv);
            //m_hbox.pack_start (m_box_scheme);
 
            m_box_selection.pack_start (m_swatch.get_widget ());
 
            m_box_rgb.pack_start (m_rscale.get_widget ());
            m_box_rgb.pack_start (m_gscale.get_widget ());
            m_box_rgb.pack_start (m_bscale.get_widget ());
            m_box_rgb.pack_start (m_ascale_rgb.get_widget ());
 
            m_box_hsv.pack_start (m_hscale.get_widget ());
            m_box_hsv.pack_start (m_sscale.get_widget ());
            m_box_hsv.pack_start (m_vscale.get_widget ());
            m_box_hsv.pack_start (m_ascale_hsv.get_widget ());
 
            set_default_size (750, 150);
 
            add (m_hbox);
            show_all ();
        }
 
    private:
        Gtk::HBox m_hbox;
        Gtk::VBox m_box_selection, m_box_rgb, m_box_hsv, m_box_scheme;
        boost::shared_ptr<ColorModel> m_model;
        ColorScale m_rscale;
        ColorScale m_gscale;
        ColorScale m_bscale;
        ColorScale m_ascale_rgb;
        ColorScale m_hscale;
        ColorScale m_sscale;
        ColorScale m_vscale;
        ColorScale m_ascale_hsv;
        Swatch m_swatch;
};
 
int main (int argc, char** argv)
{
    Gtk::Main kit (argc, argv);
    TestWindow win;
    Gtk::Main::run (win);
}