summaryrefslogtreecommitdiffstats
path: root/plug-ins/lighting/lighting-main.h
blob: f547b2d7aaa4d4235c7466c65568897152ca5194 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef __LIGHTING_MAIN_H__
#define __LIGHTING_MAIN_H__

/* Defines and stuff */
/* ================= */

#define PLUG_IN_PROC   "plug-in-lighting"
#define PLUG_IN_BINARY "lighting"
#define PLUG_IN_ROLE   "gimp-lighting"

#define TILE_CACHE_SIZE 16
#define NUM_LIGHTS      6

/* Typedefs */
/* ======== */

typedef enum
{
  POINT_LIGHT,
  DIRECTIONAL_LIGHT,
  SPOT_LIGHT,
  NO_LIGHT
} LightType;

enum
{
  LINEAR_MAP,
  LOGARITHMIC_MAP,
  SINUSOIDAL_MAP,
  SPHERICAL_MAP
};

enum
{
  IMAGE_BUMP,
  WAVES_BUMP
};

typedef struct
{
  gdouble     ambient_int;
  gdouble     diffuse_int;
  gdouble     diffuse_ref;
  gdouble     specular_ref;
  gdouble     highlight;
  gboolean    metallic;
  GimpRGB     color;
} MaterialSettings;

typedef struct
{
  LightType    type;
  GimpVector3  position;
  GimpVector3  direction;
  GimpRGB      color;
  gdouble      intensity;
  gboolean     active;
} LightSettings;

typedef struct
{
  gint32       drawable_id;
  gint32       bumpmap_id;
  gint32       envmap_id;

  /* Render variables */
  /* ================ */

  GimpVector3      viewpoint;
  GimpVector3      planenormal;
  LightSettings    lightsource[NUM_LIGHTS];
  MaterialSettings material;
  MaterialSettings ref_material;

  gdouble      pixel_threshold;
  gdouble      bumpmax,bumpmin;
  gint         max_depth;
  gint         bumpmaptype;

  /* Flags */
  gint         antialiasing;
  gint         create_new_image;
  gint         transparent_background;
  gint         bump_mapped;
  gint         env_mapped;
  gint         ref_mapped;
  gint         bumpstretch;
  gint         previewquality;
  gboolean     symbols;
  gboolean     interactive_preview;

  /* Misc */
  gboolean     update_enabled;
  gint         light_selected;
  gboolean     light_isolated;
  gdouble      preview_zoom_factor;
} LightingValues;

/* Externally visible variables */
/* ============================ */

extern LightingValues mapvals;

#endif  /* __LIGHTING_MAIN_H__ */