summaryrefslogtreecommitdiffstats
path: root/plug-ins/lighting/lighting-image.h
blob: 817c948bc9cabeee2020855f6526615b2e88bb88 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef __LIGHTING_IMAGE_H__
#define __LIGHTING_IMAGE_H__

#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>

extern gint32      input_drawable_id;
extern gint32      output_drawable_id;
extern GeglBuffer *source_buffer;
extern GeglBuffer *dest_buffer;

extern gint32      bump_drawable_id;
extern GeglBuffer *bump_buffer;
extern const Babl *bump_format;

extern gint32      env_drawable_id;
extern GeglBuffer *env_buffer;

extern guchar          *preview_rgb_data;
extern gint             preview_rgb_stride;
extern cairo_surface_t *preview_surface;

extern glong   maxcounter;
extern gint    width,height,env_width,env_height;
extern GimpRGB background;

extern gint   border_x1, border_y1, border_x2, border_y2;

extern guchar sinemap[256], spheremap[256], logmap[256];

guchar         peek_map        (GeglBuffer   *buffer,
                                const Babl   *format,
				gint          x,
				gint          y);
GimpRGB        peek            (gint          x,
				gint          y);
GimpRGB        peek_env_map    (gint          x,
				gint          y);
void           poke            (gint          x,
				gint          y,
				GimpRGB       *color);
gint           check_bounds    (gint          x,
				gint          y);
GimpVector3    int_to_pos      (gint          x,
				gint          y);
GimpVector3    int_to_posf     (gdouble       x,
				gdouble       y);
void           pos_to_int      (gdouble       x,
				gdouble       y,
				gint         *scr_x,
				gint         *scr_y);
void           pos_to_float    (gdouble       x,
				gdouble       y,
				gdouble      *xf,
				gdouble      *yf);
GimpRGB        get_image_color (gdouble       u,
				gdouble       v,
				gint         *inside);
gdouble        get_map_value   (GeglBuffer   *buffer,
                                const Babl   *format,
				gdouble       u,
				gdouble       v,
				gint         *inside);
gint           image_setup     (gint32        drawable_id,
				gint          interactive);
void           bumpmap_setup   (gint32        bumpmap_id);
void           envmap_setup    (gint32        envmap_id);

#endif  /* __LIGHTING_IMAGE_H__ */