-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpsharplib.h
39 lines (32 loc) · 1.43 KB
/
psharplib.h
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
32
33
34
35
36
37
//Header file for the Photo# Image editing functions
//Helper structure for the HSL function
struct HSL
{
float H;
float S;
float L;
};
//Helper functions
float Min(float a, float b);
float Max(float a, float b);
//Editing functions -- all malloc a new layer to return, and
//do not modify the original
struct ImageLayer* Contrast(struct ImageLayer* img, int level);
struct ImageLayer* Saturate(struct ImageLayer* img, int l);
struct ImageLayer* Rotate90(struct ImageLayer *img);
struct ImageLayer* ReflectY(struct ImageLayer *m);
struct ImageLayer* ReflectX(struct ImageLayer *m);
struct ImageLayer *addNoise(struct ImageLayer *Im, float var, float mean);
struct ImageLayer *Tint(struct ImageLayer *img, int level);
struct ImageLayer *Crop(struct ImageLayer *img, float pct);
struct ImageLayer *Kelvin(struct ImageLayer *img, float K);
struct ImageLayer *Brightness(struct ImageLayer *img, int amt);
struct ImageLayer *RGBImage(struct ImageLayer *img, int value);
void GradContrast(struct ImageGradient *grad, int level);
void GradHSL(struct ImageGradient *grad, int factor, int hsl, int channel);
void GradBrightness(struct ImageGradient *grad, int amt);
void GradToLayer(struct ImageStack *s, struct ImageGradient *grad);
struct HSL *RGBToHSL(struct pixel* rgb);
float HueToRGB(float v1, float v2, float vH);
struct pixel *HSLToRGB(struct HSL *hsl);
struct ImageLayer* HSL(struct ImageLayer *m, int factor, int hsl, int channel);