Bug fix: Change all .desktop files to RDNS style
[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 struct FileData;
25 struct HistMap;
26
27 /* Note: The order is important */
28 #define HCHAN_R 0
29 #define HCHAN_G 1
30 #define HCHAN_B 2
31 #define HCHAN_MAX 3
32 #define HCHAN_RGB 4
33 #define HCHAN_COUNT 5
34 #define HCHAN_DEFAULT HCHAN_RGB
35
36 struct Histogram {
37         gint histogram_channel; /**< drawing mode for histogram */
38         gint histogram_mode;     /**< logarithmical or not */
39         guint vgrid; /**< number of vertical divisions, 0 for none */
40         guint hgrid; /**< number of horizontal divisions, 0 for none */
41         struct {
42                 int R; /**< red */
43                 int G; /**< green */
44                 int B; /**< blue */
45                 int A; /**< alpha */
46         } grid_color;  /**< grid color */
47 };
48
49
50 Histogram *histogram_new();
51 void histogram_free(Histogram *histogram);
52 gint histogram_set_channel(Histogram *histogram, gint chan);
53 gint histogram_get_channel(Histogram *histogram);
54 gint histogram_set_mode(Histogram *histogram, gint mode);
55 gint histogram_get_mode(Histogram *histogram);
56 gint histogram_toggle_channel(Histogram *histogram);
57 gint histogram_toggle_mode(Histogram *histogram);
58 const gchar *histogram_label(Histogram *histogram);
59
60 void histmap_free(HistMap *histmap);
61
62 const HistMap *histmap_get(FileData *fd);
63 gboolean histmap_start_idle(FileData *fd);
64
65 gboolean histogram_draw(Histogram *histogram, const HistMap *histmap, GdkPixbuf *pixbuf, gint x, gint y, gint width, gint height);
66
67 void histogram_notify_cb(FileData *fd, NotifyType type, gpointer data);
68
69 #endif /* HISTOGRAM_H */
70 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */