-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolarize.h
More file actions
31 lines (24 loc) · 870 Bytes
/
Copy pathsolarize.h
File metadata and controls
31 lines (24 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _SOLARIZE_H__
#define _SOLARIZE_H__
#include <stdbool.h>
#include <stddef.h>
#define BIT_DEPTH 8
#define NCOLORS 256
void to_grayscale(const unsigned char *in, int n, unsigned char *out);
// out (and all histograms) must be of length 2^BIT_DEPTH
void build_histogram(const unsigned char *data,
int n,
int nchan,
int chan,
size_t histogram[NCOLORS]);
void smooth_histogram(const size_t histogram[NCOLORS],
int smooth_window,
size_t out[NCOLORS]);
void solarize_channel(const size_t histogram[NCOLORS],
unsigned char *data,
int n,
int nchan,
int chan,
int lin_threshold,
bool post_invert);
#endif