gulong g[HISTMAP_SIZE];
gulong b[HISTMAP_SIZE];
gulong max[HISTMAP_SIZE];
-
+
guint idle_id; /* event source id */
GdkPixbuf *pixbuf;
gint y;
const gchar *histogram_label(Histogram *histogram)
{
const gchar *t1 = "";
-
+
if (!histogram) return NULL;
if (histogram->histogram_mode)
gint w, h, i, j, srs, has_alpha, step, end_line;
guchar *s_pix;
GdkPixbuf *imgpixbuf = histmap->pixbuf;
-
+
w = gdk_pixbuf_get_width(imgpixbuf);
h = gdk_pixbuf_get_height(imgpixbuf);
srs = gdk_pixbuf_get_rowstride(imgpixbuf);
s_pix = gdk_pixbuf_get_pixels(imgpixbuf);
has_alpha = gdk_pixbuf_get_has_alpha(imgpixbuf);
-
+
if (whole)
{
end_line = h;
guint max = sp[0];
if (sp[1] > max) max = sp[1];
if (sp[2] > max) max = sp[2];
-
+
histmap->r[sp[0]]++;
histmap->g[sp[1]]++;
histmap->b[sp[2]]++;
const HistMap *histmap_get(FileData *fd)
{
if (fd->histmap && !fd->histmap->idle_id) return fd->histmap; /* histmap exists and is finished */
-
+
return NULL;
}
{
guint i;
float add;
-
+
if (histogram->vgrid == 0) return;
add = width / (float)histogram->vgrid;
{
guint i;
float add;
-
+
if (histogram->hgrid == 0) return;
add = height / (float)histogram->hgrid;
for (i = 1; i < histogram->hgrid; i++)
{
gint ypos = y + (int)(i * add + 0.5);
-
+
pixbuf_draw_line(pixbuf, x, y, width, height, x, ypos, x + width, ypos,
histogram->grid_color.R,
histogram->grid_color.G,
gdouble logmax;
gint combine = (HISTMAP_SIZE - 1) / width + 1;
gint ypos = y + height;
-
+
if (!histogram || !histmap) return FALSE;
-
+
/* Draw the grid */
histogram_vgrid(histogram, pixbuf, x, y, width, height);
histogram_hgrid(histogram, pixbuf, x, y, width, height);
v[2] += histmap->b[p];
v[3] += histmap->max[p];
}
-
+
for (j = 0; combine > 1 && j < 4; j++)
v[j] /= combine;
-
+
num_chan = (histogram->histogram_channel == HCHAN_RGB) ? 3 : 1;
for (j = 0; j < num_chan; j++)
{
{
chanmax = histogram->histogram_channel;
}
-
+
{
gulong pt;
gint r = rplus;
case HCHAN_B: r = 0; g = 0; break;
case HCHAN_MAX: r = 0; b = 0; g = 0; break;
}
-
+
if (v[chanmax] == 0)
pt = 0;
else if (histogram->histogram_mode)