Cleanup main.h header
[geeqie.git] / src / histogram.h
1 /*
2  * Copyright (C) 2008 - 2016 The Geeqie Team
3  *
4  * Author: Vladimir Nadvornik
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20
21 #ifndef HISTOGRAM_H
22 #define HISTOGRAM_H
23
24 #include <gdk-pixbuf/gdk-pixbuf.h>
25
26 #include "typedefs.h"
27
28 struct FileData;
29 struct HistMap;
30
31 /* Note: The order is important */
32 #define HCHAN_R 0
33 #define HCHAN_G 1
34 #define HCHAN_B 2
35 #define HCHAN_MAX 3
36 #define HCHAN_RGB 4
37 #define HCHAN_COUNT 5
38 #define HCHAN_DEFAULT HCHAN_RGB
39
40 struct Histogram {
41         gint histogram_channel; /**< drawing mode for histogram */
42         gint histogram_mode;     /**< logarithmical or not */
43         guint vgrid; /**< number of vertical divisions, 0 for none */
44         guint hgrid; /**< number of horizontal divisions, 0 for none */
45         struct {
46                 int R; /**< red */
47                 int G; /**< green */
48                 int B; /**< blue */
49                 int A; /**< alpha */
50         } grid_color;  /**< grid color */
51 };
52
53
54 Histogram *histogram_new();
55 void histogram_free(Histogram *histogram);
56 gint histogram_set_channel(Histogram *histogram, gint chan);
57 gint histogram_get_channel(Histogram *histogram);
58 gint histogram_set_mode(Histogram *histogram, gint mode);
59 gint histogram_get_mode(Histogram *histogram);
60 gint histogram_toggle_channel(Histogram *histogram);
61 gint histogram_toggle_mode(Histogram *histogram);
62 const gchar *histogram_label(Histogram *histogram);
63
64 void histmap_free(HistMap *histmap);
65
66 const HistMap *histmap_get(FileData *fd);
67 gboolean histmap_start_idle(FileData *fd);
68
69 gboolean histogram_draw(Histogram *histogram, const HistMap *histmap, GdkPixbuf *pixbuf, gint x, gint y, gint width, gint height);
70
71 void histogram_notify_cb(FileData *fd, NotifyType type, gpointer data);
72
73 #endif /* HISTOGRAM_H */
74 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */