1 /* GIMP - The GNU Image Manipulation Program
2  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __GIMP_HISTOGRAM_VIEW_H__
19 #define __GIMP_HISTOGRAM_VIEW_H__
20 
21 
22 #define GIMP_TYPE_HISTOGRAM_VIEW            (gimp_histogram_view_get_type ())
23 #define GIMP_HISTOGRAM_VIEW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_HISTOGRAM_VIEW, GimpHistogramView))
24 #define GIMP_HISTOGRAM_VIEW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_HISTOGRAM_VIEW, GimpHistogramViewClass))
25 #define GIMP_IS_HISTOGRAM_VIEW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_HISTOGRAM_VIEW))
26 #define GIMP_IS_HISTOGRAM_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_HISTOGRAM_VIEW))
27 #define GIMP_HISTOGRAM_VIEW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_HISTOGRAM_VIEW, GimpHistogramViewClass))
28 
29 
30 typedef struct _GimpHistogramViewClass  GimpHistogramViewClass;
31 
32 struct _GimpHistogramView
33 {
34   GtkDrawingArea         parent_instance;
35 
36   GimpHistogram         *histogram;
37   GimpHistogram         *bg_histogram;
38   GimpHistogramChannel   channel;
39   GimpHistogramScale     scale;
40   gint                   n_bins;
41   gint                   start;
42   gint                   end;
43 
44   gint                   border_width;
45   gint                   subdivisions;
46 };
47 
48 struct _GimpHistogramViewClass
49 {
50   GtkDrawingAreaClass  parent_class;
51 
52   void (* range_changed) (GimpHistogramView *view,
53                           gint               start,
54                           gint               end);
55 };
56 
57 
58 GType           gimp_histogram_view_get_type       (void) G_GNUC_CONST;
59 
60 GtkWidget     * gimp_histogram_view_new            (gboolean             range);
61 
62 void            gimp_histogram_view_set_histogram  (GimpHistogramView   *view,
63                                                     GimpHistogram       *histogram);
64 GimpHistogram * gimp_histogram_view_get_histogram  (GimpHistogramView   *view);
65 
66 void            gimp_histogram_view_set_background (GimpHistogramView   *view,
67                                                     GimpHistogram       *histogram);
68 GimpHistogram * gimp_histogram_view_get_background (GimpHistogramView   *view);
69 
70 void            gimp_histogram_view_set_channel    (GimpHistogramView   *view,
71                                                     GimpHistogramChannel channel);
72 GimpHistogramChannel
73                 gimp_histogram_view_get_channel    (GimpHistogramView   *view);
74 
75 void            gimp_histogram_view_set_scale      (GimpHistogramView   *view,
76                                                     GimpHistogramScale   scale);
77 GimpHistogramScale
78                 gimp_histogram_view_get_scale      (GimpHistogramView   *view);
79 
80 void            gimp_histogram_view_set_range      (GimpHistogramView   *view,
81                                                     gint                 start,
82                                                     gint                 end);
83 void            gimp_histogram_view_get_range      (GimpHistogramView   *view,
84                                                     gint                *start,
85                                                     gint                *end);
86 
87 
88 #endif /* __GIMP_HISTOGRAM_VIEW_H__ */
89