|
|
|
@ -112,6 +112,11 @@ void cb_histogramda_draw(GtkWidget *area, cairo_t *cr, int w, int h, gpointer da
|
|
|
|
|
* test function
|
|
|
|
|
*/
|
|
|
|
|
void histogram_update(VideoFrame *vf) {
|
|
|
|
|
|
|
|
|
|
// save some time
|
|
|
|
|
static int to = 0;
|
|
|
|
|
if ((++to) % 8 == 0) to = 0;
|
|
|
|
|
|
|
|
|
|
int chan, i, x, y;
|
|
|
|
|
|
|
|
|
|
if (vf == NULL) return;
|
|
|
|
@ -123,7 +128,7 @@ void histogram_update(VideoFrame *vf) {
|
|
|
|
|
for (i = 0, x = 0; x < vf->w; x++) {
|
|
|
|
|
for (y = 0; y < vf->h; y++) {
|
|
|
|
|
for (chan = 0; chan < 3; chan++) {
|
|
|
|
|
histogram[chan][vf->data[3*(y*vf->w+x) + chan]]++;
|
|
|
|
|
histogram[chan][vf->data[i++]]++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|