GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_stats.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2/*
3 * Copyright (C) 2009-2015 Cyril Hrubis <metan@ucw.cz>
4 */
5
6/*
7
8 Statistic filters.
9
10 */
11
12#ifndef FILTERS_GP_STATS_H
13#define FILTERS_GP_STATS_H
14
15#include <filters/gp_filter.h>
16
17typedef struct gp_histogram_channel {
18 const char *chan_name;
19 gp_pixel min;
20 gp_pixel max;
21 uint32_t len;
22 uint32_t hist[];
23} gp_histogram_channel;
24
25typedef struct gp_histogram {
26 gp_pixel_type pixel_type;
27 gp_histogram_channel *channels[];
28} gp_histogram;
29
30gp_histogram *gp_histogram_alloc(gp_pixel_type pixel_type);
31
32void gp_histogram_free(gp_histogram *self);
33
34gp_histogram_channel *gp_histogram_channel_by_name(gp_histogram *self,
35 const char *name);
36
37/*
38 * Computes histogram. Returns non-zero on failure (i.e. canceled by callback).
39 */
40int gp_filter_histogram(gp_histogram *self, const gp_pixmap *src,
41 gp_progress_cb *callback);
42
43#endif /* FILTERS_GP_STATS_H */
uint32_t gp_pixel
Pixel integer value.
Definition gp_types.h:33
Common filter includes.
gp_pixel_type
List of all pixel types.
A pixmap buffer.
Definition gp_pixmap.h:33
Progress callback.