mirror of https://github.com/GNOME/gimp.git
plug-ins: tabs to spaces in map-object
This commit is contained in:
parent
0f1da6677c
commit
87750d993e
|
@ -96,7 +96,7 @@ ArcBall_Init (void)
|
|||
|
||||
void
|
||||
ArcBall_Place (HVect Center,
|
||||
double Radius)
|
||||
double Radius)
|
||||
{
|
||||
center = Center;
|
||||
radius = Radius;
|
||||
|
@ -134,10 +134,10 @@ ArcBall_Update (void)
|
|||
if (dragging)
|
||||
{
|
||||
if (axisSet!=NoAxes)
|
||||
{
|
||||
vFrom = ConstrainToAxis(vFrom, set[axisIndex]);
|
||||
vTo = ConstrainToAxis(vTo, set[axisIndex]);
|
||||
}
|
||||
{
|
||||
vFrom = ConstrainToAxis(vFrom, set[axisIndex]);
|
||||
vTo = ConstrainToAxis(vTo, set[axisIndex]);
|
||||
}
|
||||
qDrag = Qt_FromBallPoints(vFrom, vTo);
|
||||
qNow = Qt_Mul(qDrag, qDown);
|
||||
}
|
||||
|
@ -163,8 +163,8 @@ ArcBall_Value (HMatrix m_Now)
|
|||
|
||||
void
|
||||
ArcBall_Values (double *alpha,
|
||||
double *beta,
|
||||
double *gamma)
|
||||
double *beta,
|
||||
double *gamma)
|
||||
{
|
||||
if ((*beta=asin(-mNow[0][2]))!=0.0)
|
||||
{
|
||||
|
@ -211,7 +211,7 @@ ArcBall_EndDrag (void)
|
|||
|
||||
static Quat
|
||||
Qt_Mul (Quat qL,
|
||||
Quat qR)
|
||||
Quat qR)
|
||||
{
|
||||
Quat qq;
|
||||
qq.w = qL.w*qR.w - qL.x*qR.x - qL.y*qR.y - qL.z*qR.z;
|
||||
|
@ -229,14 +229,14 @@ Qt_Mul (Quat qL,
|
|||
|
||||
static void
|
||||
Qt_ToMatrix (Quat q,
|
||||
HMatrix out)
|
||||
HMatrix out)
|
||||
{
|
||||
double Nq = q.x*q.x + q.y*q.y + q.z*q.z + q.w*q.w;
|
||||
double s = (Nq > 0.0) ? (2.0 / Nq) : 0.0;
|
||||
double xs = q.x*s, ys = q.y*s, zs = q.z*s;
|
||||
double wx = q.w*xs, wy = q.w*ys, wz = q.w*zs;
|
||||
double xx = q.x*xs, xy = q.x*ys, xz = q.x*zs;
|
||||
double yy = q.y*ys, yz = q.y*zs, zz = q.z*zs;
|
||||
double xs = q.x*s, ys = q.y*s, zs = q.z*s;
|
||||
double wx = q.w*xs, wy = q.w*ys, wz = q.w*zs;
|
||||
double xx = q.x*xs, xy = q.x*ys, xz = q.x*zs;
|
||||
double yy = q.y*ys, yz = q.y*zs, zz = q.z*zs;
|
||||
out[X][X] = 1.0 - (yy + zz); out[Y][X] = xy + wz; out[Z][X] = xz - wy;
|
||||
out[X][Y] = xy - wz; out[Y][Y] = 1.0 - (xx + zz); out[Z][Y] = yz + wx;
|
||||
out[X][Z] = xz + wy; out[Y][Z] = yz - wx; out[Z][Z] = 1.0 - (xx + yy);
|
||||
|
@ -295,7 +295,7 @@ V3_Unit (HVect v)
|
|||
|
||||
static HVect
|
||||
V3_Scale (HVect v,
|
||||
double s)
|
||||
double s)
|
||||
{
|
||||
HVect u;
|
||||
u.x = s*v.x; u.y = s*v.y; u.z = s*v.z; u.w = v.w;
|
||||
|
@ -318,7 +318,7 @@ V3_Negate (HVect v)
|
|||
/*
|
||||
static HVect
|
||||
V3_Add (HVect v1,
|
||||
HVect v2)
|
||||
HVect v2)
|
||||
{
|
||||
static HVect v = {0, 0, 0, 0};
|
||||
v.x = v1.x+v2.x; v.y = v1.y+v2.y; v.z = v1.z+v2.z;
|
||||
|
@ -330,7 +330,7 @@ V3_Add (HVect v1,
|
|||
|
||||
static HVect
|
||||
V3_Sub (HVect v1,
|
||||
HVect v2)
|
||||
HVect v2)
|
||||
{
|
||||
static HVect v = {0, 0, 0, 0};
|
||||
v.x = v1.x-v2.x; v.y = v1.y-v2.y; v.z = v1.z-v2.z;
|
||||
|
@ -342,7 +342,7 @@ V3_Sub (HVect v1,
|
|||
/*
|
||||
static HVect
|
||||
V3_Bisect (HVect v0,
|
||||
HVect v1)
|
||||
HVect v1)
|
||||
{
|
||||
HVect v = {0, 0, 0, 0};
|
||||
double Nv;
|
||||
|
@ -360,7 +360,7 @@ V3_Bisect (HVect v0,
|
|||
|
||||
static double
|
||||
V3_Dot (HVect v1,
|
||||
HVect v2)
|
||||
HVect v2)
|
||||
{
|
||||
return (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z);
|
||||
}
|
||||
|
@ -371,7 +371,7 @@ V3_Dot (HVect v1,
|
|||
/*
|
||||
static HVect
|
||||
V3_Cross (HVect v1,
|
||||
HVect v2)
|
||||
HVect v2)
|
||||
{
|
||||
static HVect v = {0, 0, 0, 0};
|
||||
v.x = v1.y*v2.z-v1.z*v2.y;
|
||||
|
@ -383,16 +383,16 @@ V3_Cross (HVect v1,
|
|||
|
||||
void
|
||||
ArcBall_CopyMat (HMatrix inm,
|
||||
HMatrix outm)
|
||||
HMatrix outm)
|
||||
{
|
||||
int x=0,y=0;
|
||||
|
||||
for (x=0;x<4;x++)
|
||||
{
|
||||
for (y=0;y<4;y++)
|
||||
{
|
||||
outm[y][x]=inm[y][x];
|
||||
}
|
||||
{
|
||||
outm[y][x]=inm[y][x];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -405,8 +405,8 @@ ArcBall_CopyMat (HMatrix inm,
|
|||
|
||||
static HVect
|
||||
MouseOnSphere (HVect mouse,
|
||||
HVect ballCenter,
|
||||
double ballRadius)
|
||||
HVect ballCenter,
|
||||
double ballRadius)
|
||||
{
|
||||
HVect ballMouse;
|
||||
register double mag;
|
||||
|
@ -430,7 +430,7 @@ MouseOnSphere (HVect mouse,
|
|||
|
||||
static Quat
|
||||
Qt_FromBallPoints (HVect from,
|
||||
HVect to)
|
||||
HVect to)
|
||||
{
|
||||
Quat qu;
|
||||
qu.x = from.y*to.z - from.z*to.y;
|
||||
|
@ -445,8 +445,8 @@ Qt_FromBallPoints (HVect from,
|
|||
|
||||
static void
|
||||
Qt_ToBallPoints (Quat q,
|
||||
HVect *arcFrom,
|
||||
HVect *arcTo)
|
||||
HVect *arcFrom,
|
||||
HVect *arcTo)
|
||||
{
|
||||
double s;
|
||||
|
||||
|
@ -464,7 +464,7 @@ Qt_ToBallPoints (Quat q,
|
|||
|
||||
static HVect
|
||||
ConstrainToAxis (HVect loose,
|
||||
HVect axis)
|
||||
HVect axis)
|
||||
{
|
||||
HVect onPlane;
|
||||
register double norm;
|
||||
|
@ -489,8 +489,8 @@ ConstrainToAxis (HVect loose,
|
|||
|
||||
static int
|
||||
NearestConstraintAxis (HVect loose,
|
||||
HVect *axes,
|
||||
int nAxes)
|
||||
HVect *axes,
|
||||
int nAxes)
|
||||
{
|
||||
HVect onPlane;
|
||||
register double max, dot;
|
||||
|
@ -502,9 +502,9 @@ NearestConstraintAxis (HVect loose,
|
|||
onPlane = ConstrainToAxis(loose, axes[i]);
|
||||
dot = V3_Dot(onPlane, loose);
|
||||
if (dot>max)
|
||||
{
|
||||
max = dot; nearest = i;
|
||||
}
|
||||
{
|
||||
max = dot; nearest = i;
|
||||
}
|
||||
}
|
||||
return (nearest);
|
||||
}
|
||||
|
|
|
@ -34,17 +34,17 @@ extern Quat qOne;
|
|||
|
||||
void ArcBall_Init (void);
|
||||
void ArcBall_Place (HVect Center,
|
||||
double Radius);
|
||||
double Radius);
|
||||
void ArcBall_UseSet (AxisSet axis_Set);
|
||||
void ArcBall_Update (void);
|
||||
void ArcBall_Value (HMatrix m_Now);
|
||||
void ArcBall_Values (double *alpha,
|
||||
double *beta,
|
||||
double *gamma);
|
||||
double *beta,
|
||||
double *gamma);
|
||||
void ArcBall_BeginDrag (void);
|
||||
void ArcBall_EndDrag (void);
|
||||
void ArcBall_Mouse (HVect v_Now);
|
||||
void ArcBall_CopyMat (HMatrix inm,
|
||||
HMatrix outm);
|
||||
HMatrix outm);
|
||||
|
||||
#endif /* __ARCBALL_H__ */
|
||||
|
|
|
@ -43,13 +43,13 @@ init_compute (void)
|
|||
gimp_vector3_set (&mapvals.secondaxis, 0.0, 1.0, 0.0);
|
||||
|
||||
gimp_vector3_rotate (&mapvals.firstaxis,
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_vector3_rotate (&mapvals.secondaxis,
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
|
||||
/* Compute the 2D bounding box of the sphere spanned by the axis */
|
||||
/* ============================================================= */
|
||||
|
@ -70,16 +70,16 @@ init_compute (void)
|
|||
gimp_vector3_set (&mapvals.normal, 0.0, 0.0, 1.0);
|
||||
|
||||
gimp_vector3_rotate (&mapvals.firstaxis,
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_vector3_rotate (&mapvals.secondaxis,
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
|
||||
mapvals.normal = gimp_vector3_cross_product (&mapvals.firstaxis,
|
||||
&mapvals.secondaxis);
|
||||
&mapvals.secondaxis);
|
||||
|
||||
if (mapvals.normal.z < 0.0)
|
||||
gimp_vector3_mul (&mapvals.normal, -1.0);
|
||||
|
@ -133,12 +133,12 @@ init_compute (void)
|
|||
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
box_drawables[i] = gimp_drawable_get (mapvals.boxmap_id[i]);
|
||||
box_drawables[i] = gimp_drawable_get (mapvals.boxmap_id[i]);
|
||||
|
||||
gimp_pixel_rgn_init (&box_regions[i], box_drawables[i],
|
||||
gimp_pixel_rgn_init (&box_regions[i], box_drawables[i],
|
||||
0, 0,
|
||||
box_drawables[i]->width,
|
||||
box_drawables[i]->height,
|
||||
box_drawables[i]->height,
|
||||
FALSE, FALSE);
|
||||
}
|
||||
|
||||
|
@ -174,13 +174,13 @@ init_compute (void)
|
|||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
cylinder_drawables[i] =
|
||||
gimp_drawable_get (mapvals.cylindermap_id[i]);
|
||||
cylinder_drawables[i] =
|
||||
gimp_drawable_get (mapvals.cylindermap_id[i]);
|
||||
|
||||
gimp_pixel_rgn_init (&cylinder_regions[i], cylinder_drawables[i],
|
||||
gimp_pixel_rgn_init (&cylinder_regions[i], cylinder_drawables[i],
|
||||
0, 0,
|
||||
cylinder_drawables[i]->width,
|
||||
cylinder_drawables[i]->height,
|
||||
cylinder_drawables[i]->height,
|
||||
FALSE, FALSE);
|
||||
}
|
||||
|
||||
|
@ -192,9 +192,9 @@ init_compute (void)
|
|||
|
||||
static void
|
||||
render (gdouble x,
|
||||
gdouble y,
|
||||
GimpRGB *col,
|
||||
gpointer data)
|
||||
gdouble y,
|
||||
GimpRGB *col,
|
||||
gpointer data)
|
||||
{
|
||||
GimpVector3 pos;
|
||||
|
||||
|
@ -207,9 +207,9 @@ render (gdouble x,
|
|||
|
||||
static void
|
||||
show_progress (gint min,
|
||||
gint max,
|
||||
gint curr,
|
||||
gpointer data)
|
||||
gint max,
|
||||
gint curr,
|
||||
gpointer data)
|
||||
{
|
||||
gimp_progress_update ((gdouble) curr / (gdouble) max);
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ compute_image (void)
|
|||
}
|
||||
|
||||
gimp_pixel_rgn_init (&dest_region, output_drawable,
|
||||
0, 0, width, height, TRUE, TRUE);
|
||||
0, 0, width, height, TRUE, TRUE);
|
||||
|
||||
switch (mapvals.maptype)
|
||||
{
|
||||
|
@ -294,22 +294,22 @@ compute_image (void)
|
|||
|
||||
if ((progress_counter++ % width) == 0)
|
||||
gimp_progress_update ((gdouble) progress_counter /
|
||||
(gdouble) maxcounter);
|
||||
(gdouble) maxcounter);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gimp_adaptive_supersample_area (0, 0,
|
||||
width - 1, height - 1,
|
||||
max_depth,
|
||||
mapvals.pixeltreshold,
|
||||
render,
|
||||
NULL,
|
||||
poke,
|
||||
NULL,
|
||||
show_progress,
|
||||
NULL);
|
||||
width - 1, height - 1,
|
||||
max_depth,
|
||||
mapvals.pixeltreshold,
|
||||
render,
|
||||
NULL,
|
||||
poke,
|
||||
NULL,
|
||||
show_progress,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* Update the region */
|
||||
|
|
|
@ -78,8 +78,8 @@ peek (gint x,
|
|||
|
||||
static GimpRGB
|
||||
peek_box_image (gint image,
|
||||
gint x,
|
||||
gint y)
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
static guchar data[4];
|
||||
|
||||
|
@ -108,8 +108,8 @@ peek_box_image (gint image,
|
|||
|
||||
static GimpRGB
|
||||
peek_cylinder_image (gint image,
|
||||
gint x,
|
||||
gint y)
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
static guchar data[4];
|
||||
|
||||
|
@ -151,7 +151,7 @@ poke (gint x,
|
|||
|
||||
gint
|
||||
checkbounds (gint x,
|
||||
gint y)
|
||||
gint y)
|
||||
{
|
||||
if (x < border_x1 || y < border_y1 || x >= border_x2 || y >= border_y2)
|
||||
return FALSE;
|
||||
|
@ -161,8 +161,8 @@ checkbounds (gint x,
|
|||
|
||||
static gint
|
||||
checkbounds_box_image (gint image,
|
||||
gint x,
|
||||
gint y)
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
gint w, h;
|
||||
|
||||
|
@ -177,8 +177,8 @@ checkbounds_box_image (gint image,
|
|||
|
||||
static gint
|
||||
checkbounds_cylinder_image (gint image,
|
||||
gint x,
|
||||
gint y)
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
gint w, h;
|
||||
|
||||
|
@ -193,7 +193,7 @@ checkbounds_cylinder_image (gint image,
|
|||
|
||||
GimpVector3
|
||||
int_to_pos (gint x,
|
||||
gint y)
|
||||
gint y)
|
||||
{
|
||||
GimpVector3 pos;
|
||||
|
||||
|
@ -206,9 +206,9 @@ int_to_pos (gint x,
|
|||
|
||||
void
|
||||
pos_to_int (gdouble x,
|
||||
gdouble y,
|
||||
gint *scr_x,
|
||||
gint *scr_y)
|
||||
gdouble y,
|
||||
gint *scr_x,
|
||||
gint *scr_y)
|
||||
{
|
||||
*scr_x = (gint) ((x * (gdouble) width));
|
||||
*scr_y = (gint) ((y * (gdouble) height));
|
||||
|
@ -221,8 +221,8 @@ pos_to_int (gdouble x,
|
|||
|
||||
GimpRGB
|
||||
get_image_color (gdouble u,
|
||||
gdouble v,
|
||||
gint *inside)
|
||||
gdouble v,
|
||||
gint *inside)
|
||||
{
|
||||
gint x1, y1, x2, y2;
|
||||
GimpRGB p[4];
|
||||
|
@ -279,8 +279,8 @@ get_image_color (gdouble u,
|
|||
|
||||
GimpRGB
|
||||
get_box_image_color (gint image,
|
||||
gdouble u,
|
||||
gdouble v)
|
||||
gdouble u,
|
||||
gdouble v)
|
||||
{
|
||||
gint w, h;
|
||||
gint x1, y1, x2, y2;
|
||||
|
@ -311,8 +311,8 @@ get_box_image_color (gint image,
|
|||
|
||||
GimpRGB
|
||||
get_cylinder_image_color (gint image,
|
||||
gdouble u,
|
||||
gdouble v)
|
||||
gdouble u,
|
||||
gdouble v)
|
||||
{
|
||||
gint w, h;
|
||||
gint x1, y1, x2, y2;
|
||||
|
@ -347,13 +347,13 @@ get_cylinder_image_color (gint image,
|
|||
|
||||
gint
|
||||
image_setup (GimpDrawable *drawable,
|
||||
gint interactive)
|
||||
gint interactive)
|
||||
{
|
||||
/* Set the tile cache size */
|
||||
/* ======================= */
|
||||
|
||||
gimp_tile_cache_ntiles ((drawable->width + gimp_tile_width() - 1) /
|
||||
gimp_tile_width ());
|
||||
gimp_tile_width ());
|
||||
|
||||
/* Get some useful info on the input drawable */
|
||||
/* ========================================== */
|
||||
|
@ -362,13 +362,13 @@ image_setup (GimpDrawable *drawable,
|
|||
output_drawable = drawable;
|
||||
|
||||
gimp_drawable_mask_bounds (drawable->drawable_id,
|
||||
&border_x1, &border_y1, &border_x2, &border_y2);
|
||||
&border_x1, &border_y1, &border_x2, &border_y2);
|
||||
|
||||
width = input_drawable->width;
|
||||
height = input_drawable->height;
|
||||
|
||||
gimp_pixel_rgn_init (&source_region, input_drawable,
|
||||
0, 0, width, height, FALSE, FALSE);
|
||||
0, 0, width, height, FALSE, FALSE);
|
||||
|
||||
maxcounter = (glong) width * (glong) height;
|
||||
|
||||
|
|
|
@ -30,34 +30,34 @@ extern GimpTile *current_in_tile, *current_out_tile;
|
|||
/* ============================ */
|
||||
|
||||
extern gint image_setup (GimpDrawable *drawable,
|
||||
gint interactive);
|
||||
gint interactive);
|
||||
extern glong in_xy_to_index (gint x,
|
||||
gint y);
|
||||
gint y);
|
||||
extern glong out_xy_to_index (gint x,
|
||||
gint y);
|
||||
gint y);
|
||||
extern gint checkbounds (gint x,
|
||||
gint y);
|
||||
gint y);
|
||||
extern GimpRGB peek (gint x,
|
||||
gint y);
|
||||
gint y);
|
||||
extern void poke (gint x,
|
||||
gint y,
|
||||
GimpRGB *color,
|
||||
gpointer data);
|
||||
gint y,
|
||||
GimpRGB *color,
|
||||
gpointer data);
|
||||
extern GimpVector3 int_to_pos (gint x,
|
||||
gint y);
|
||||
gint y);
|
||||
extern void pos_to_int (gdouble x,
|
||||
gdouble y,
|
||||
gint *scr_x,
|
||||
gint *scr_y);
|
||||
gdouble y,
|
||||
gint *scr_x,
|
||||
gint *scr_y);
|
||||
|
||||
extern GimpRGB get_image_color (gdouble u,
|
||||
gdouble v,
|
||||
gint *inside);
|
||||
gdouble v,
|
||||
gint *inside);
|
||||
extern GimpRGB get_box_image_color (gint image,
|
||||
gdouble u,
|
||||
gdouble v);
|
||||
gdouble u,
|
||||
gdouble v);
|
||||
extern GimpRGB get_cylinder_image_color (gint image,
|
||||
gdouble u,
|
||||
gdouble v);
|
||||
gdouble u,
|
||||
gdouble v);
|
||||
|
||||
#endif /* __MAPOBJECT_IMAGE_H__ */
|
||||
|
|
|
@ -111,7 +111,7 @@ check_drawables (GimpDrawable *drawable)
|
|||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
if (mapvals.boxmap_id[i] == -1 ||
|
||||
!gimp_item_is_valid (mapvals.boxmap_id[i]) ||
|
||||
!gimp_item_is_valid (mapvals.boxmap_id[i]) ||
|
||||
gimp_drawable_is_gray (mapvals.boxmap_id[i]))
|
||||
mapvals.boxmap_id[i] = drawable->drawable_id;
|
||||
}
|
||||
|
@ -185,16 +185,16 @@ query (void)
|
|||
};
|
||||
|
||||
gimp_install_procedure (PLUG_IN_PROC,
|
||||
N_("Map the image to an object (plane, sphere, box or cylinder)"),
|
||||
"No help yet",
|
||||
"Tom Bech & Federico Mena Quintero",
|
||||
"Tom Bech & Federico Mena Quintero",
|
||||
"Version 1.2.0, July 16 1998",
|
||||
N_("Map _Object..."),
|
||||
"RGB*",
|
||||
GIMP_PLUGIN,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
N_("Map the image to an object (plane, sphere, box or cylinder)"),
|
||||
"No help yet",
|
||||
"Tom Bech & Federico Mena Quintero",
|
||||
"Tom Bech & Federico Mena Quintero",
|
||||
"Version 1.2.0, July 16 1998",
|
||||
N_("Map _Object..."),
|
||||
"RGB*",
|
||||
GIMP_PLUGIN,
|
||||
G_N_ELEMENTS (args), 0,
|
||||
args, NULL);
|
||||
|
||||
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Map");
|
||||
}
|
||||
|
@ -243,11 +243,11 @@ run (const gchar *name,
|
|||
gimp_get_data ("plug_in_map_object", &mapvals);
|
||||
check_drawables (drawable);
|
||||
if (main_dialog (drawable))
|
||||
{
|
||||
compute_image ();
|
||||
{
|
||||
compute_image ();
|
||||
|
||||
gimp_set_data (PLUG_IN_PROC, &mapvals, sizeof (MapObjectValues));
|
||||
}
|
||||
gimp_set_data (PLUG_IN_PROC, &mapvals, sizeof (MapObjectValues));
|
||||
}
|
||||
break;
|
||||
|
||||
case GIMP_RUN_WITH_LAST_VALS:
|
||||
|
@ -259,9 +259,9 @@ run (const gchar *name,
|
|||
|
||||
case GIMP_RUN_NONINTERACTIVE:
|
||||
if (nparams != 50)
|
||||
{
|
||||
status = GIMP_PDB_CALLING_ERROR;
|
||||
}
|
||||
{
|
||||
status = GIMP_PDB_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
mapvals.maptype = (MapType) param[3].data.d_int32;
|
||||
|
@ -281,7 +281,7 @@ run (const gchar *name,
|
|||
mapvals.beta = param[17].data.d_float;
|
||||
mapvals.gamma = param[18].data.d_float;
|
||||
mapvals.lightsource.type = (LightType) param[19].data.d_int32;
|
||||
mapvals.lightsource.color = param[20].data.d_color;
|
||||
mapvals.lightsource.color = param[20].data.d_color;
|
||||
mapvals.lightsource.position.x = param[21].data.d_float;
|
||||
mapvals.lightsource.position.y = param[22].data.d_float;
|
||||
mapvals.lightsource.position.z = param[23].data.d_float;
|
||||
|
|
|
@ -31,18 +31,18 @@ static void compute_preview (gint x,
|
|||
gint ph);
|
||||
static void draw_light_marker (cairo_t *cr,
|
||||
gint xpos,
|
||||
gint ypos);
|
||||
gint ypos);
|
||||
static void draw_line (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph,
|
||||
gdouble cx1,
|
||||
gdouble cy1,
|
||||
gdouble cx2,
|
||||
gdouble cy2,
|
||||
GimpVector3 a,
|
||||
GimpVector3 b);
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph,
|
||||
gdouble cx1,
|
||||
gdouble cy1,
|
||||
gdouble cx2,
|
||||
gdouble cy2,
|
||||
GimpVector3 a,
|
||||
GimpVector3 b);
|
||||
static void draw_wireframe (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
|
@ -51,24 +51,24 @@ static void draw_wireframe (cairo_t *cr,
|
|||
static void draw_preview_wireframe (cairo_t *cr);
|
||||
static void draw_wireframe_plane (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph);
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph);
|
||||
static void draw_wireframe_sphere (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph);
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph);
|
||||
static void draw_wireframe_box (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph);
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph);
|
||||
static void draw_wireframe_cylinder (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph);
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph);
|
||||
|
||||
/**************************************************************/
|
||||
/* Computes a preview of the rectangle starting at (x,y) with */
|
||||
|
@ -77,11 +77,11 @@ static void draw_wireframe_cylinder (cairo_t *cr,
|
|||
|
||||
static void
|
||||
compute_preview (gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
gint h,
|
||||
gint pw,
|
||||
gint ph)
|
||||
gint y,
|
||||
gint w,
|
||||
gint h,
|
||||
gint pw,
|
||||
gint ph)
|
||||
{
|
||||
gdouble xpostab[PREVIEW_WIDTH];
|
||||
gdouble ypostab[PREVIEW_HEIGHT];
|
||||
|
@ -125,9 +125,9 @@ compute_preview (gint x,
|
|||
}
|
||||
|
||||
gimp_rgba_set (&lightcheck,
|
||||
GIMP_CHECK_LIGHT, GIMP_CHECK_LIGHT, GIMP_CHECK_LIGHT, 1.0);
|
||||
GIMP_CHECK_LIGHT, GIMP_CHECK_LIGHT, GIMP_CHECK_LIGHT, 1.0);
|
||||
gimp_rgba_set (&darkcheck,
|
||||
GIMP_CHECK_DARK, GIMP_CHECK_DARK, GIMP_CHECK_DARK, 1.0);
|
||||
GIMP_CHECK_DARK, GIMP_CHECK_DARK, GIMP_CHECK_DARK, 1.0);
|
||||
gimp_vector3_set (&p2, -1.0, -1.0, 0.0);
|
||||
|
||||
cairo_surface_flush (preview_surface);
|
||||
|
@ -152,22 +152,22 @@ compute_preview (gint x,
|
|||
if (f1)
|
||||
{
|
||||
if (color.a == 0.0)
|
||||
color = lightcheck;
|
||||
color = lightcheck;
|
||||
else
|
||||
gimp_rgb_composite (&color, &lightcheck,
|
||||
GIMP_RGB_COMPOSITE_BEHIND);
|
||||
gimp_rgb_composite (&color, &lightcheck,
|
||||
GIMP_RGB_COMPOSITE_BEHIND);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (color.a == 0.0)
|
||||
color = darkcheck;
|
||||
color = darkcheck;
|
||||
else
|
||||
gimp_rgb_composite (&color, &darkcheck,
|
||||
GIMP_RGB_COMPOSITE_BEHIND);
|
||||
gimp_rgb_composite (&color, &darkcheck,
|
||||
GIMP_RGB_COMPOSITE_BEHIND);
|
||||
}
|
||||
}
|
||||
|
||||
gimp_rgb_get_uchar (&color, &r, &g, &b);
|
||||
gimp_rgb_get_uchar (&color, &r, &g, &b);
|
||||
GIMP_CAIRO_RGB24_SET_PIXEL((preview_rgb_data + index), r, g, b);
|
||||
index += 4;
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ compute_preview (gint x,
|
|||
|
||||
gint
|
||||
check_light_hit (gint xpos,
|
||||
gint ypos)
|
||||
gint ypos)
|
||||
{
|
||||
gdouble dx, dy, r;
|
||||
|
||||
|
@ -208,7 +208,7 @@ check_light_hit (gint xpos,
|
|||
static void
|
||||
draw_light_marker (cairo_t *cr,
|
||||
gint xpos,
|
||||
gint ypos)
|
||||
gint ypos)
|
||||
{
|
||||
GdkColor color;
|
||||
gint pw, ph, startx, starty;
|
||||
|
@ -238,16 +238,16 @@ draw_light_marker (cairo_t *cr,
|
|||
static void
|
||||
draw_lights (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph)
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph)
|
||||
{
|
||||
gdouble dxpos, dypos;
|
||||
gint xpos, ypos;
|
||||
|
||||
gimp_vector_3d_to_2d (startx, starty, pw, ph,
|
||||
&dxpos, &dypos, &mapvals.viewpoint,
|
||||
&mapvals.lightsource.position);
|
||||
&dxpos, &dypos, &mapvals.viewpoint,
|
||||
&mapvals.lightsource.position);
|
||||
xpos = RINT (dxpos);
|
||||
ypos = RINT (dypos);
|
||||
|
||||
|
@ -264,7 +264,7 @@ draw_lights (cairo_t *cr,
|
|||
|
||||
void
|
||||
update_light (gint xpos,
|
||||
gint ypos)
|
||||
gint ypos)
|
||||
{
|
||||
gint startx, starty, pw, ph;
|
||||
|
||||
|
@ -274,7 +274,7 @@ update_light (gint xpos,
|
|||
starty = (PREVIEW_HEIGHT - ph) / 2;
|
||||
|
||||
gimp_vector_2d_to_3d (startx, starty, pw, ph, xpos, ypos,
|
||||
&mapvals.viewpoint, &mapvals.lightsource.position);
|
||||
&mapvals.viewpoint, &mapvals.lightsource.position);
|
||||
|
||||
gtk_widget_queue_draw (previewarea);
|
||||
}
|
||||
|
@ -363,9 +363,9 @@ draw_preview_wireframe (cairo_t *cr)
|
|||
void
|
||||
draw_wireframe (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph)
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph)
|
||||
{
|
||||
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
|
||||
switch (mapvals.maptype)
|
||||
|
@ -388,9 +388,9 @@ draw_wireframe (cairo_t *cr,
|
|||
static void
|
||||
draw_wireframe_plane (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph)
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph)
|
||||
{
|
||||
GimpVector3 v1, v2, a, b, c, d, dir1, dir2;
|
||||
gint cnt;
|
||||
|
@ -406,14 +406,14 @@ draw_wireframe_plane (cairo_t *cr,
|
|||
gimp_vector3_set (&v2, 0.0, 0.5, 0.0);
|
||||
|
||||
gimp_vector3_rotate (&v1,
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
|
||||
gimp_vector3_rotate (&v2,
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
|
||||
dir1 = v1; gimp_vector3_normalize (&dir1);
|
||||
dir2 = v2; gimp_vector3_normalize (&dir2);
|
||||
|
@ -439,17 +439,17 @@ draw_wireframe_plane (cairo_t *cr,
|
|||
for (cnt = 0; cnt <= WIRESIZE; cnt++)
|
||||
{
|
||||
gimp_vector_3d_to_2d (startx, starty, pw, ph,
|
||||
&x1, &y1, &mapvals.viewpoint, &a);
|
||||
&x1, &y1, &mapvals.viewpoint, &a);
|
||||
gimp_vector_3d_to_2d (startx, starty, pw, ph,
|
||||
&x2, &y2, &mapvals.viewpoint, &b);
|
||||
&x2, &y2, &mapvals.viewpoint, &b);
|
||||
|
||||
cairo_move_to (cr, RINT (x1), RINT (y1));
|
||||
cairo_line_to (cr, RINT (x2), RINT (y2));
|
||||
|
||||
gimp_vector_3d_to_2d (startx, starty, pw, ph,
|
||||
&x1, &y1, &mapvals.viewpoint, &c);
|
||||
&x1, &y1, &mapvals.viewpoint, &c);
|
||||
gimp_vector_3d_to_2d (startx, starty, pw, ph,
|
||||
&x2, &y2, &mapvals.viewpoint, &d);
|
||||
&x2, &y2, &mapvals.viewpoint, &d);
|
||||
|
||||
cairo_move_to (cr, RINT (x1), RINT (y1));
|
||||
cairo_line_to (cr, RINT (x2), RINT (y2));
|
||||
|
@ -470,9 +470,9 @@ draw_wireframe_plane (cairo_t *cr,
|
|||
static void
|
||||
draw_wireframe_sphere (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph)
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph)
|
||||
{
|
||||
GimpVector3 p[2 * (WIRESIZE + 5)];
|
||||
gint cnt, cnt2;
|
||||
|
@ -492,9 +492,9 @@ draw_wireframe_sphere (cairo_t *cr,
|
|||
p[cnt].y = 0.0;
|
||||
p[cnt].z = mapvals.radius * sin ((gdouble) cnt * twopifac);
|
||||
gimp_vector3_rotate (&p[cnt],
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_vector3_add (&p[cnt], &p[cnt], &mapvals.position);
|
||||
}
|
||||
|
||||
|
@ -506,9 +506,9 @@ draw_wireframe_sphere (cairo_t *cr,
|
|||
p[cnt].y = mapvals.radius * sin ((gdouble) (cnt-(WIRESIZE+1))*twopifac);
|
||||
p[cnt].z = 0.0;
|
||||
gimp_vector3_rotate (&p[cnt],
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_vector3_add (&p[cnt], &p[cnt], &mapvals.position);
|
||||
}
|
||||
|
||||
|
@ -521,16 +521,16 @@ draw_wireframe_sphere (cairo_t *cr,
|
|||
|
||||
gimp_vector3_set (&p[cnt], 0.0, -0.35, 0.0);
|
||||
gimp_vector3_rotate (&p[cnt],
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
p[cnt+1] = mapvals.position;
|
||||
|
||||
gimp_vector3_set (&p[cnt+2], 0.0, 0.0, -0.35);
|
||||
gimp_vector3_rotate (&p[cnt+2],
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
gimp_deg_to_rad (mapvals.alpha),
|
||||
gimp_deg_to_rad (mapvals.beta),
|
||||
gimp_deg_to_rad (mapvals.gamma));
|
||||
p[cnt+3] = mapvals.position;
|
||||
|
||||
p[cnt + 4] = p[cnt];
|
||||
|
@ -554,9 +554,9 @@ draw_wireframe_sphere (cairo_t *cr,
|
|||
if (p[cnt].z > mapvals.position.z && p[cnt + 1].z > mapvals.position.z)
|
||||
{
|
||||
gimp_vector_3d_to_2d (startx, starty, pw, ph,
|
||||
&x1, &y1, &mapvals.viewpoint, &p[cnt]);
|
||||
&x1, &y1, &mapvals.viewpoint, &p[cnt]);
|
||||
gimp_vector_3d_to_2d (startx, starty, pw, ph,
|
||||
&x2, &y2, &mapvals.viewpoint, &p[cnt + 1]);
|
||||
&x2, &y2, &mapvals.viewpoint, &p[cnt + 1]);
|
||||
|
||||
cairo_move_to (cr, (gint) (x1 + 0.5), (gint) (y1 + 0.5));
|
||||
cairo_line_to (cr, (gint) (x2 + 0.5), (gint) (y2 + 0.5));
|
||||
|
@ -569,9 +569,9 @@ draw_wireframe_sphere (cairo_t *cr,
|
|||
for (cnt = 0; cnt < 3; cnt++)
|
||||
{
|
||||
gimp_vector_3d_to_2d (startx, starty, pw, ph,
|
||||
&x1, &y1, &mapvals.viewpoint, &p[cnt2]);
|
||||
&x1, &y1, &mapvals.viewpoint, &p[cnt2]);
|
||||
gimp_vector_3d_to_2d (startx, starty, pw, ph,
|
||||
&x2, &y2, &mapvals.viewpoint, &p[cnt2 + 1]);
|
||||
&x2, &y2, &mapvals.viewpoint, &p[cnt2 + 1]);
|
||||
|
||||
cairo_move_to (cr, RINT (x1), RINT (y1));
|
||||
cairo_line_to (cr, RINT (x2), RINT (y2));
|
||||
|
@ -588,23 +588,23 @@ draw_wireframe_sphere (cairo_t *cr,
|
|||
|
||||
static void
|
||||
draw_line (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph,
|
||||
gdouble cx1,
|
||||
gdouble cy1,
|
||||
gdouble cx2,
|
||||
gdouble cy2,
|
||||
GimpVector3 a,
|
||||
GimpVector3 b)
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph,
|
||||
gdouble cx1,
|
||||
gdouble cy1,
|
||||
gdouble cx2,
|
||||
gdouble cy2,
|
||||
GimpVector3 a,
|
||||
GimpVector3 b)
|
||||
{
|
||||
gdouble x1, y1, x2, y2;
|
||||
|
||||
gimp_vector_3d_to_2d (startx, starty, pw, ph,
|
||||
&x1, &y1, &mapvals.viewpoint, &a);
|
||||
&x1, &y1, &mapvals.viewpoint, &a);
|
||||
gimp_vector_3d_to_2d (startx, starty, pw, ph,
|
||||
&x2, &y2, &mapvals.viewpoint, &b);
|
||||
&x2, &y2, &mapvals.viewpoint, &b);
|
||||
|
||||
cairo_move_to (cr, RINT (x1), RINT (y1));
|
||||
cairo_line_to (cr, RINT (x2), RINT (y2));
|
||||
|
@ -613,9 +613,9 @@ draw_line (cairo_t *cr,
|
|||
static void
|
||||
draw_wireframe_box (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph)
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph)
|
||||
{
|
||||
GimpVector3 p[8], tmp, scale;
|
||||
gint i;
|
||||
|
@ -684,9 +684,9 @@ draw_wireframe_box (cairo_t *cr,
|
|||
static void
|
||||
draw_wireframe_cylinder (cairo_t *cr,
|
||||
gint startx,
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph)
|
||||
gint starty,
|
||||
gint pw,
|
||||
gint ph)
|
||||
{
|
||||
GimpVector3 p[2*8], a, axis, scale;
|
||||
gint i;
|
||||
|
|
|
@ -33,11 +33,11 @@ typedef struct
|
|||
|
||||
static GimpRGB
|
||||
phong_shade (GimpVector3 *pos,
|
||||
GimpVector3 *viewpoint,
|
||||
GimpVector3 *normal,
|
||||
GimpRGB *diff_col,
|
||||
GimpRGB *spec_col,
|
||||
LightType type)
|
||||
GimpVector3 *viewpoint,
|
||||
GimpVector3 *normal,
|
||||
GimpRGB *diff_col,
|
||||
GimpRGB *spec_col,
|
||||
LightType type)
|
||||
{
|
||||
GimpRGB ambientcolor, diffusecolor, specularcolor;
|
||||
gdouble NL, RV, dist;
|
||||
|
@ -106,10 +106,10 @@ phong_shade (GimpVector3 *pos,
|
|||
|
||||
static gint
|
||||
plane_intersect (GimpVector3 *dir,
|
||||
GimpVector3 *viewp,
|
||||
GimpVector3 *ipos,
|
||||
gdouble *u,
|
||||
gdouble *v)
|
||||
GimpVector3 *viewp,
|
||||
GimpVector3 *ipos,
|
||||
gdouble *u,
|
||||
gdouble *v)
|
||||
{
|
||||
static gdouble det, det1, det2, det3, t;
|
||||
|
||||
|
@ -121,11 +121,11 @@ plane_intersect (GimpVector3 *dir,
|
|||
/* ============================================================= */
|
||||
|
||||
det = (imat[0][0] * imat[1][1] * imat[2][2] +
|
||||
imat[0][1] * imat[1][2] * imat[2][0] +
|
||||
imat[0][2] * imat[1][0] * imat[2][1] -
|
||||
imat[0][2] * imat[1][1] * imat[2][0] -
|
||||
imat[0][0] * imat[1][2] * imat[2][1] -
|
||||
imat[2][2] * imat[0][1] * imat[1][0]);
|
||||
imat[0][1] * imat[1][2] * imat[2][0] +
|
||||
imat[0][2] * imat[1][0] * imat[2][1] -
|
||||
imat[0][2] * imat[1][1] * imat[2][0] -
|
||||
imat[0][0] * imat[1][2] * imat[2][1] -
|
||||
imat[2][2] * imat[0][1] * imat[1][0]);
|
||||
|
||||
/* If the determinant is non-zero, a intersection point exists */
|
||||
/* =========================================================== */
|
||||
|
@ -136,25 +136,25 @@ plane_intersect (GimpVector3 *dir,
|
|||
/* ==================================================== */
|
||||
|
||||
det1 = (imat[0][3] * imat[1][1] * imat[2][2] +
|
||||
imat[0][1] * imat[1][2] * imat[2][3] +
|
||||
imat[0][2] * imat[1][3] * imat[2][1] -
|
||||
imat[0][2] * imat[1][1] * imat[2][3] -
|
||||
imat[1][2] * imat[2][1] * imat[0][3] -
|
||||
imat[2][2] * imat[0][1] * imat[1][3]);
|
||||
imat[0][1] * imat[1][2] * imat[2][3] +
|
||||
imat[0][2] * imat[1][3] * imat[2][1] -
|
||||
imat[0][2] * imat[1][1] * imat[2][3] -
|
||||
imat[1][2] * imat[2][1] * imat[0][3] -
|
||||
imat[2][2] * imat[0][1] * imat[1][3]);
|
||||
|
||||
det2 = (imat[0][0] * imat[1][3] * imat[2][2] +
|
||||
imat[0][3] * imat[1][2] * imat[2][0] +
|
||||
imat[0][2] * imat[1][0] * imat[2][3] -
|
||||
imat[0][2] * imat[1][3] * imat[2][0] -
|
||||
imat[1][2] * imat[2][3] * imat[0][0] -
|
||||
imat[2][2] * imat[0][3] * imat[1][0]);
|
||||
imat[0][3] * imat[1][2] * imat[2][0] +
|
||||
imat[0][2] * imat[1][0] * imat[2][3] -
|
||||
imat[0][2] * imat[1][3] * imat[2][0] -
|
||||
imat[1][2] * imat[2][3] * imat[0][0] -
|
||||
imat[2][2] * imat[0][3] * imat[1][0]);
|
||||
|
||||
det3 = (imat[0][0] * imat[1][1] * imat[2][3] +
|
||||
imat[0][1] * imat[1][3] * imat[2][0] +
|
||||
imat[0][3] * imat[1][0] * imat[2][1] -
|
||||
imat[0][3] * imat[1][1] * imat[2][0] -
|
||||
imat[1][3] * imat[2][1] * imat[0][0] -
|
||||
imat[2][3] * imat[0][1] * imat[1][0]);
|
||||
imat[0][1] * imat[1][3] * imat[2][0] +
|
||||
imat[0][3] * imat[1][0] * imat[2][1] -
|
||||
imat[0][3] * imat[1][1] * imat[2][0] -
|
||||
imat[1][3] * imat[2][1] * imat[0][0] -
|
||||
imat[2][3] * imat[0][1] * imat[1][0]);
|
||||
|
||||
/* Now we have the simultanous solutions. Lets compute the unknowns */
|
||||
/* (skip u&v if t is <0, this means the intersection is behind us) */
|
||||
|
@ -167,7 +167,7 @@ plane_intersect (GimpVector3 *dir,
|
|||
*u = 1.0 + ((det2 / det) - 0.5);
|
||||
*v = 1.0 + ((det3 / det) - 0.5);
|
||||
|
||||
ipos->x = viewp->x + t * dir->x;
|
||||
ipos->x = viewp->x + t * dir->x;
|
||||
ipos->y = viewp->y + t * dir->y;
|
||||
ipos->z = viewp->z + t * dir->z;
|
||||
|
||||
|
@ -206,17 +206,17 @@ get_ray_color_plane (GimpVector3 *pos)
|
|||
color = get_image_color (vx, vy, &inside);
|
||||
|
||||
if (color.a != 0.0 && inside == TRUE &&
|
||||
mapvals.lightsource.type != NO_LIGHT)
|
||||
mapvals.lightsource.type != NO_LIGHT)
|
||||
{
|
||||
/* Compute shading at this point */
|
||||
/* ============================= */
|
||||
|
||||
color = phong_shade (&spos,
|
||||
&mapvals.viewpoint,
|
||||
&mapvals.normal,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
&mapvals.viewpoint,
|
||||
&mapvals.normal,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
|
||||
gimp_rgb_clamp (&color);
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ get_ray_color_plane (GimpVector3 *pos)
|
|||
if (mapvals.transparent_background == FALSE && color.a < 1.0)
|
||||
{
|
||||
gimp_rgb_composite (&color, &background,
|
||||
GIMP_RGB_COMPOSITE_BEHIND);
|
||||
GIMP_RGB_COMPOSITE_BEHIND);
|
||||
}
|
||||
|
||||
return color;
|
||||
|
@ -238,8 +238,8 @@ get_ray_color_plane (GimpVector3 *pos)
|
|||
|
||||
static void
|
||||
sphere_to_image (GimpVector3 *normal,
|
||||
gdouble *u,
|
||||
gdouble *v)
|
||||
gdouble *u,
|
||||
gdouble *v)
|
||||
{
|
||||
static gdouble alpha, fac;
|
||||
static GimpVector3 cross_prod;
|
||||
|
@ -255,7 +255,7 @@ sphere_to_image (GimpVector3 *normal,
|
|||
else
|
||||
{
|
||||
fac = (gimp_vector3_inner_product (&mapvals.firstaxis, normal) /
|
||||
sin (alpha));
|
||||
sin (alpha));
|
||||
|
||||
/* Make sure that we map to -1.0..1.0 (take care of rounding errors) */
|
||||
/* ================================================================= */
|
||||
|
@ -265,7 +265,7 @@ sphere_to_image (GimpVector3 *normal,
|
|||
*u = acos (fac) / (2.0 * G_PI);
|
||||
|
||||
cross_prod = gimp_vector3_cross_product (&mapvals.secondaxis,
|
||||
&mapvals.firstaxis);
|
||||
&mapvals.firstaxis);
|
||||
|
||||
if (gimp_vector3_inner_product (&cross_prod, normal) < 0.0)
|
||||
*u = 1.0 - *u;
|
||||
|
@ -278,9 +278,9 @@ sphere_to_image (GimpVector3 *normal,
|
|||
|
||||
static gint
|
||||
sphere_intersect (GimpVector3 *dir,
|
||||
GimpVector3 *viewp,
|
||||
GimpVector3 *spos1,
|
||||
GimpVector3 *spos2)
|
||||
GimpVector3 *viewp,
|
||||
GimpVector3 *spos1,
|
||||
GimpVector3 *spos2)
|
||||
{
|
||||
static gdouble alpha, beta, tau, s1, s2, tmp;
|
||||
static GimpVector3 t;
|
||||
|
@ -368,11 +368,11 @@ get_ray_color_sphere (GimpVector3 *pos)
|
|||
/* =================================== */
|
||||
|
||||
color = phong_shade (&spos1,
|
||||
&mapvals.viewpoint,
|
||||
&normal,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
&mapvals.viewpoint,
|
||||
&normal,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
|
||||
gimp_rgb_clamp (&color);
|
||||
|
||||
|
@ -387,33 +387,33 @@ get_ray_color_sphere (GimpVector3 *pos)
|
|||
gimp_vector3_mul (&normal, -1.0);
|
||||
|
||||
color2 = phong_shade (&spos2,
|
||||
&mapvals.viewpoint,
|
||||
&normal,
|
||||
&color2,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
&mapvals.viewpoint,
|
||||
&normal,
|
||||
&color2,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
|
||||
gimp_rgb_clamp (&color2);
|
||||
|
||||
/* Compute a mix of the first and second colors */
|
||||
/* ============================================ */
|
||||
|
||||
gimp_rgb_composite (&color, &color2, GIMP_RGB_COMPOSITE_NORMAL);
|
||||
gimp_rgb_composite (&color, &color2, GIMP_RGB_COMPOSITE_NORMAL);
|
||||
gimp_rgb_clamp (&color);
|
||||
}
|
||||
else if (color.a != 0.0 &&
|
||||
inside == TRUE &&
|
||||
mapvals.lightsource.type != NO_LIGHT)
|
||||
inside == TRUE &&
|
||||
mapvals.lightsource.type != NO_LIGHT)
|
||||
{
|
||||
/* Compute shading at this point */
|
||||
/* ============================= */
|
||||
|
||||
color = phong_shade (&spos1,
|
||||
&mapvals.viewpoint,
|
||||
&normal,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
&mapvals.viewpoint,
|
||||
&normal,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
|
||||
gimp_rgb_clamp (&color);
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ get_ray_color_sphere (GimpVector3 *pos)
|
|||
if (mapvals.transparent_background == FALSE && color.a < 1.0)
|
||||
{
|
||||
gimp_rgb_composite (&color, &background,
|
||||
GIMP_RGB_COMPOSITE_BEHIND);
|
||||
GIMP_RGB_COMPOSITE_BEHIND);
|
||||
}
|
||||
|
||||
return color;
|
||||
|
@ -482,8 +482,8 @@ compute_bounding_box (void)
|
|||
|
||||
void
|
||||
vecmulmat (GimpVector3 *u,
|
||||
GimpVector3 *v,
|
||||
gfloat m[16])
|
||||
GimpVector3 *v,
|
||||
gfloat m[16])
|
||||
{
|
||||
gfloat v0=v->x, v1=v->y, v2=v->z;
|
||||
#define M(row,col) m[col*4+row]
|
||||
|
@ -495,8 +495,8 @@ vecmulmat (GimpVector3 *u,
|
|||
|
||||
void
|
||||
rotatemat (gfloat angle,
|
||||
GimpVector3 *v,
|
||||
gfloat m[16])
|
||||
GimpVector3 *v,
|
||||
gfloat m[16])
|
||||
{
|
||||
/* This function contributed by Erich Boleyn (erich@uruk.org) */
|
||||
gfloat mag, s, c;
|
||||
|
@ -591,8 +591,8 @@ transpose_mat (gfloat m[16])
|
|||
|
||||
void
|
||||
matmul (gfloat a[16],
|
||||
gfloat b[16],
|
||||
gfloat c[16])
|
||||
gfloat b[16],
|
||||
gfloat c[16])
|
||||
{
|
||||
gint i, j, k;
|
||||
gfloat value;
|
||||
|
@ -605,10 +605,10 @@ matmul (gfloat a[16],
|
|||
{
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
value = 0.0;
|
||||
value = 0.0;
|
||||
|
||||
for (k = 0; k < 4; k++)
|
||||
value += A(i,k) * B(k,j);
|
||||
for (k = 0; k < 4; k++)
|
||||
value += A(i,k) * B(k,j);
|
||||
|
||||
C(i,j) = value;
|
||||
}
|
||||
|
@ -642,11 +642,11 @@ ident_mat (gfloat m[16])
|
|||
|
||||
static gboolean
|
||||
intersect_rect (gdouble u,
|
||||
gdouble v,
|
||||
gdouble w,
|
||||
GimpVector3 viewp,
|
||||
GimpVector3 dir,
|
||||
FaceIntersectInfo *face_info)
|
||||
gdouble v,
|
||||
gdouble w,
|
||||
GimpVector3 viewp,
|
||||
GimpVector3 dir,
|
||||
FaceIntersectInfo *face_info)
|
||||
{
|
||||
gboolean result = FALSE;
|
||||
gdouble u2, v2;
|
||||
|
@ -675,9 +675,9 @@ intersect_rect (gdouble u,
|
|||
|
||||
static gboolean
|
||||
intersect_box (GimpVector3 scale,
|
||||
GimpVector3 viewp,
|
||||
GimpVector3 dir,
|
||||
FaceIntersectInfo *face_intersect)
|
||||
GimpVector3 viewp,
|
||||
GimpVector3 dir,
|
||||
FaceIntersectInfo *face_intersect)
|
||||
{
|
||||
GimpVector3 v, d, tmp, axis[3];
|
||||
FaceIntersectInfo face_tmp;
|
||||
|
@ -693,7 +693,7 @@ intersect_box (GimpVector3 scale,
|
|||
/* ========== */
|
||||
|
||||
if (intersect_rect (scale.x, scale.y, scale.z / 2.0,
|
||||
viewp, dir, &face_intersect[i]) == TRUE)
|
||||
viewp, dir, &face_intersect[i]) == TRUE)
|
||||
{
|
||||
face_intersect[i].face = 0;
|
||||
gimp_vector3_set (&face_intersect[i++].n, 0.0, 0.0, 1.0);
|
||||
|
@ -704,7 +704,7 @@ intersect_box (GimpVector3 scale,
|
|||
/* ========= */
|
||||
|
||||
if (intersect_rect (scale.x, scale.y, -scale.z / 2.0,
|
||||
viewp, dir, &face_intersect[i]) == TRUE)
|
||||
viewp, dir, &face_intersect[i]) == TRUE)
|
||||
{
|
||||
face_intersect[i].face = 1;
|
||||
face_intersect[i].u = 1.0 - face_intersect[i].u;
|
||||
|
@ -725,7 +725,7 @@ intersect_box (GimpVector3 scale,
|
|||
vecmulmat (&d, &dir, m);
|
||||
|
||||
if (intersect_rect (scale.x, scale.z, scale.y / 2.0,
|
||||
v, d, &face_intersect[i]) == TRUE)
|
||||
v, d, &face_intersect[i]) == TRUE)
|
||||
{
|
||||
face_intersect[i].face = 2;
|
||||
|
||||
|
@ -751,7 +751,7 @@ intersect_box (GimpVector3 scale,
|
|||
vecmulmat (&d, &dir, m);
|
||||
|
||||
if (intersect_rect (scale.x, scale.z, -scale.y / 2.0,
|
||||
v, d, &face_intersect[i]) == TRUE)
|
||||
v, d, &face_intersect[i]) == TRUE)
|
||||
{
|
||||
face_intersect[i].face = 3;
|
||||
|
||||
|
@ -781,7 +781,7 @@ intersect_box (GimpVector3 scale,
|
|||
vecmulmat (&d, &dir, m);
|
||||
|
||||
if (intersect_rect (scale.z, scale.y, scale.x / 2.0,
|
||||
v, d, &face_intersect[i]) == TRUE)
|
||||
v, d, &face_intersect[i]) == TRUE)
|
||||
{
|
||||
face_intersect[i].face = 4;
|
||||
|
||||
|
@ -807,7 +807,7 @@ intersect_box (GimpVector3 scale,
|
|||
vecmulmat (&d, &dir, m);
|
||||
|
||||
if (intersect_rect (scale.z, scale.y, -scale.x / 2.0,
|
||||
v, d, &face_intersect[i]) == TRUE)
|
||||
v, d, &face_intersect[i]) == TRUE)
|
||||
{
|
||||
face_intersect[i].face = 5;
|
||||
|
||||
|
@ -905,8 +905,8 @@ get_ray_color_box (GimpVector3 *pos)
|
|||
}
|
||||
|
||||
color = get_box_image_color (face_intersect[0].face,
|
||||
face_intersect[0].u,
|
||||
face_intersect[0].v);
|
||||
face_intersect[0].u,
|
||||
face_intersect[0].v);
|
||||
|
||||
/* Check for total transparency... */
|
||||
/* =============================== */
|
||||
|
@ -918,17 +918,17 @@ get_ray_color_box (GimpVector3 *pos)
|
|||
/* =================================== */
|
||||
|
||||
color = phong_shade (&face_intersect[0].s,
|
||||
&mapvals.viewpoint,
|
||||
&face_intersect[0].n,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
&mapvals.viewpoint,
|
||||
&face_intersect[0].n,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
|
||||
gimp_rgb_clamp (&color);
|
||||
|
||||
color2 = get_box_image_color (face_intersect[1].face,
|
||||
face_intersect[1].u,
|
||||
face_intersect[1].v);
|
||||
face_intersect[1].u,
|
||||
face_intersect[1].v);
|
||||
|
||||
/* Make the normal point inwards */
|
||||
/* ============================= */
|
||||
|
@ -936,42 +936,42 @@ get_ray_color_box (GimpVector3 *pos)
|
|||
gimp_vector3_mul (&face_intersect[1].n, -1.0);
|
||||
|
||||
color2 = phong_shade (&face_intersect[1].s,
|
||||
&mapvals.viewpoint,
|
||||
&face_intersect[1].n,
|
||||
&color2,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
&mapvals.viewpoint,
|
||||
&face_intersect[1].n,
|
||||
&color2,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
|
||||
gimp_rgb_clamp (&color2);
|
||||
|
||||
if (mapvals.transparent_background == FALSE && color2.a < 1.0)
|
||||
{
|
||||
gimp_rgb_composite (&color2, &background,
|
||||
GIMP_RGB_COMPOSITE_BEHIND);
|
||||
}
|
||||
gimp_rgb_composite (&color2, &background,
|
||||
GIMP_RGB_COMPOSITE_BEHIND);
|
||||
}
|
||||
|
||||
/* Compute a mix of the first and second colors */
|
||||
/* ============================================ */
|
||||
|
||||
gimp_rgb_composite (&color, &color2, GIMP_RGB_COMPOSITE_NORMAL);
|
||||
gimp_rgb_composite (&color, &color2, GIMP_RGB_COMPOSITE_NORMAL);
|
||||
gimp_rgb_clamp (&color);
|
||||
}
|
||||
else if (color.a != 0.0 && mapvals.lightsource.type != NO_LIGHT)
|
||||
{
|
||||
color = phong_shade (&face_intersect[0].s,
|
||||
&mapvals.viewpoint,
|
||||
&face_intersect[0].n,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
color = phong_shade (&face_intersect[0].s,
|
||||
&mapvals.viewpoint,
|
||||
&face_intersect[0].n,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
|
||||
gimp_rgb_clamp (&color);
|
||||
gimp_rgb_clamp (&color);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mapvals.transparent_background == TRUE)
|
||||
gimp_rgb_set_alpha (&color, 0.0);
|
||||
gimp_rgb_set_alpha (&color, 0.0);
|
||||
}
|
||||
|
||||
return color;
|
||||
|
@ -979,9 +979,9 @@ get_ray_color_box (GimpVector3 *pos)
|
|||
|
||||
static gboolean
|
||||
intersect_circle (GimpVector3 vp,
|
||||
GimpVector3 dir,
|
||||
gdouble w,
|
||||
FaceIntersectInfo *face_info)
|
||||
GimpVector3 dir,
|
||||
gdouble w,
|
||||
FaceIntersectInfo *face_info)
|
||||
{
|
||||
gboolean result = FALSE;
|
||||
gdouble r, d;
|
||||
|
@ -1013,8 +1013,8 @@ intersect_circle (GimpVector3 vp,
|
|||
|
||||
static gboolean
|
||||
intersect_cylinder (GimpVector3 vp,
|
||||
GimpVector3 dir,
|
||||
FaceIntersectInfo *face_intersect)
|
||||
GimpVector3 dir,
|
||||
FaceIntersectInfo *face_intersect)
|
||||
{
|
||||
gdouble a, b, c, d, e, f, tmp, l;
|
||||
gboolean result = FALSE;
|
||||
|
@ -1108,8 +1108,8 @@ intersect_cylinder (GimpVector3 vp,
|
|||
|
||||
static GimpRGB
|
||||
get_cylinder_color (gint face,
|
||||
gdouble u,
|
||||
gdouble v)
|
||||
gdouble u,
|
||||
gdouble v)
|
||||
{
|
||||
GimpRGB color;
|
||||
gint inside;
|
||||
|
@ -1181,8 +1181,8 @@ get_ray_color_cylinder (GimpVector3 *pos)
|
|||
}
|
||||
|
||||
color = get_cylinder_color (face_intersect[0].face,
|
||||
face_intersect[0].u,
|
||||
face_intersect[0].v);
|
||||
face_intersect[0].u,
|
||||
face_intersect[0].v);
|
||||
|
||||
/* Check for transparency... */
|
||||
/* ========================= */
|
||||
|
@ -1194,17 +1194,17 @@ get_ray_color_cylinder (GimpVector3 *pos)
|
|||
/* =================================== */
|
||||
|
||||
color = phong_shade (&face_intersect[0].s,
|
||||
&mapvals.viewpoint,
|
||||
&face_intersect[0].n,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
&mapvals.viewpoint,
|
||||
&face_intersect[0].n,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
|
||||
gimp_rgb_clamp (&color);
|
||||
|
||||
color2 = get_cylinder_color (face_intersect[1].face,
|
||||
face_intersect[1].u,
|
||||
face_intersect[1].v);
|
||||
face_intersect[1].u,
|
||||
face_intersect[1].v);
|
||||
|
||||
/* Make the normal point inwards */
|
||||
/* ============================= */
|
||||
|
@ -1212,42 +1212,42 @@ get_ray_color_cylinder (GimpVector3 *pos)
|
|||
gimp_vector3_mul (&face_intersect[1].n, -1.0);
|
||||
|
||||
color2 = phong_shade (&face_intersect[1].s,
|
||||
&mapvals.viewpoint,
|
||||
&face_intersect[1].n,
|
||||
&color2,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
&mapvals.viewpoint,
|
||||
&face_intersect[1].n,
|
||||
&color2,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
|
||||
gimp_rgb_clamp (&color2);
|
||||
|
||||
if (mapvals.transparent_background == FALSE && color2.a < 1.0)
|
||||
{
|
||||
gimp_rgb_composite (&color2, &background,
|
||||
GIMP_RGB_COMPOSITE_BEHIND);
|
||||
gimp_rgb_composite (&color2, &background,
|
||||
GIMP_RGB_COMPOSITE_BEHIND);
|
||||
}
|
||||
|
||||
/* Compute a mix of the first and second colors */
|
||||
/* ============================================ */
|
||||
|
||||
gimp_rgb_composite (&color, &color2, GIMP_RGB_COMPOSITE_NORMAL);
|
||||
gimp_rgb_composite (&color, &color2, GIMP_RGB_COMPOSITE_NORMAL);
|
||||
gimp_rgb_clamp (&color);
|
||||
}
|
||||
else if (color.a != 0.0 && mapvals.lightsource.type != NO_LIGHT)
|
||||
{
|
||||
color = phong_shade (&face_intersect[0].s,
|
||||
&mapvals.viewpoint,
|
||||
&face_intersect[0].n,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
color = phong_shade (&face_intersect[0].s,
|
||||
&mapvals.viewpoint,
|
||||
&face_intersect[0].n,
|
||||
&color,
|
||||
&mapvals.lightsource.color,
|
||||
mapvals.lightsource.type);
|
||||
|
||||
gimp_rgb_clamp (&color);
|
||||
gimp_rgb_clamp (&color);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mapvals.transparent_background == TRUE)
|
||||
gimp_rgb_set_alpha (&color, 0.0);
|
||||
gimp_rgb_set_alpha (&color, 0.0);
|
||||
}
|
||||
|
||||
return color;
|
||||
|
|
|
@ -12,15 +12,15 @@ GimpRGB get_ray_color_cylinder (GimpVector3 *pos);
|
|||
void compute_bounding_box (void);
|
||||
|
||||
void vecmulmat (GimpVector3 *u,
|
||||
GimpVector3 *v,
|
||||
gfloat m[16]);
|
||||
GimpVector3 *v,
|
||||
gfloat m[16]);
|
||||
void rotatemat (gfloat angle,
|
||||
GimpVector3 *v,
|
||||
gfloat m[16]);
|
||||
GimpVector3 *v,
|
||||
gfloat m[16]);
|
||||
void transpose_mat (gfloat m[16]);
|
||||
void matmul (gfloat a[16],
|
||||
gfloat b[16],
|
||||
gfloat c[16]);
|
||||
gfloat b[16],
|
||||
gfloat c[16]);
|
||||
void ident_mat (gfloat m[16]);
|
||||
|
||||
#endif /* __MAPOBJECT_SHADE_H__ */
|
||||
|
|
|
@ -38,28 +38,28 @@ static guint light_hit = FALSE;
|
|||
static void create_main_notebook (GtkWidget *container);
|
||||
|
||||
static gint preview_events (GtkWidget *area,
|
||||
GdkEvent *event);
|
||||
GdkEvent *event);
|
||||
|
||||
static void update_light_pos_entries (void);
|
||||
|
||||
static void double_adjustment_update (GtkAdjustment *adjustment,
|
||||
gpointer data);
|
||||
gpointer data);
|
||||
|
||||
static void toggle_update (GtkWidget *widget,
|
||||
gpointer data);
|
||||
gpointer data);
|
||||
|
||||
static void lightmenu_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
gpointer data);
|
||||
|
||||
static void preview_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
gpointer data);
|
||||
|
||||
static gint box_constrain (gint32 image_id,
|
||||
gint32 drawable_id,
|
||||
gpointer data);
|
||||
gint32 drawable_id,
|
||||
gpointer data);
|
||||
static gint cylinder_constrain (gint32 image_id,
|
||||
gint32 drawable_id,
|
||||
gpointer data);
|
||||
gint32 drawable_id,
|
||||
gpointer data);
|
||||
|
||||
static GtkWidget * create_options_page (void);
|
||||
static GtkWidget * create_light_page (void);
|
||||
|
@ -75,7 +75,7 @@ static GtkWidget * create_cylinder_page (void);
|
|||
|
||||
static void
|
||||
double_adjustment_update (GtkAdjustment *adjustment,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
gimp_double_adjustment_update (adjustment, data);
|
||||
|
||||
|
@ -92,7 +92,7 @@ update_light_pos_entries (void)
|
|||
double_adjustment_update,
|
||||
&mapvals.lightsource.position.x);
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (xadj),
|
||||
mapvals.lightsource.position.x);
|
||||
mapvals.lightsource.position.x);
|
||||
g_signal_handlers_unblock_by_func (xadj,
|
||||
double_adjustment_update,
|
||||
&mapvals.lightsource.position.x);
|
||||
|
@ -101,7 +101,7 @@ update_light_pos_entries (void)
|
|||
double_adjustment_update,
|
||||
&mapvals.lightsource.position.y);
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (yadj),
|
||||
mapvals.lightsource.position.y);
|
||||
mapvals.lightsource.position.y);
|
||||
g_signal_handlers_unblock_by_func (yadj,
|
||||
double_adjustment_update,
|
||||
&mapvals.lightsource.position.y);
|
||||
|
@ -110,7 +110,7 @@ update_light_pos_entries (void)
|
|||
double_adjustment_update,
|
||||
&mapvals.lightsource.position.z);
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (zadj),
|
||||
mapvals.lightsource.position.z);
|
||||
mapvals.lightsource.position.z);
|
||||
g_signal_handlers_unblock_by_func (zadj,
|
||||
double_adjustment_update,
|
||||
&mapvals.lightsource.position.z);
|
||||
|
@ -122,7 +122,7 @@ update_light_pos_entries (void)
|
|||
|
||||
static void
|
||||
toggle_update (GtkWidget *widget,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
gimp_toggle_button_update (widget, data);
|
||||
|
||||
|
@ -136,7 +136,7 @@ toggle_update (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
lightmenu_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget),
|
||||
(gint *) &mapvals.lightsource.type);
|
||||
|
@ -170,7 +170,7 @@ lightmenu_callback (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
mapmenu_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget),
|
||||
(gint *) &mapvals.maptype);
|
||||
|
@ -207,10 +207,10 @@ mapmenu_callback (GtkWidget *widget,
|
|||
}
|
||||
|
||||
if (!cylinder_page)
|
||||
{
|
||||
cylinder_page = create_cylinder_page ();
|
||||
{
|
||||
cylinder_page = create_cylinder_page ();
|
||||
g_object_ref (cylinder_page);
|
||||
}
|
||||
}
|
||||
gtk_notebook_append_page (options_note_book,
|
||||
cylinder_page,
|
||||
gtk_label_new_with_mnemonic (_("C_ylinder")));
|
||||
|
@ -237,7 +237,7 @@ mapmenu_callback (GtkWidget *widget,
|
|||
|
||||
static void
|
||||
preview_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
gpointer data)
|
||||
{
|
||||
compute_preview_image ();
|
||||
|
||||
|
@ -261,26 +261,26 @@ zoomed_callback (GimpZoomModel *model)
|
|||
|
||||
static gint
|
||||
box_constrain (gint32 image_id,
|
||||
gint32 drawable_id,
|
||||
gpointer data)
|
||||
gint32 drawable_id,
|
||||
gpointer data)
|
||||
{
|
||||
if (drawable_id == -1)
|
||||
return TRUE;
|
||||
|
||||
return (gimp_drawable_is_rgb (drawable_id) &&
|
||||
!gimp_drawable_is_indexed (drawable_id));
|
||||
!gimp_drawable_is_indexed (drawable_id));
|
||||
}
|
||||
|
||||
static gint
|
||||
cylinder_constrain (gint32 image_id,
|
||||
gint32 drawable_id,
|
||||
gpointer data)
|
||||
gint32 drawable_id,
|
||||
gpointer data)
|
||||
{
|
||||
if (drawable_id == -1)
|
||||
return TRUE;
|
||||
|
||||
return (gimp_drawable_is_rgb (drawable_id) &&
|
||||
!gimp_drawable_is_indexed (drawable_id));
|
||||
!gimp_drawable_is_indexed (drawable_id));
|
||||
}
|
||||
|
||||
/******************************/
|
||||
|
@ -289,7 +289,7 @@ cylinder_constrain (gint32 image_id,
|
|||
|
||||
static gint
|
||||
preview_events (GtkWidget *area,
|
||||
GdkEvent *event)
|
||||
GdkEvent *event)
|
||||
{
|
||||
HVect pos;
|
||||
/* HMatrix RotMat;
|
||||
|
@ -308,9 +308,9 @@ preview_events (GtkWidget *area,
|
|||
if (light_hit == FALSE)
|
||||
{
|
||||
pos.x = -(2.0 * (gdouble) event->button.x /
|
||||
(gdouble) PREVIEW_WIDTH - 1.0);
|
||||
(gdouble) PREVIEW_WIDTH - 1.0);
|
||||
pos.y = (2.0 * (gdouble) event->button.y /
|
||||
(gdouble) PREVIEW_HEIGHT - 1.0);
|
||||
(gdouble) PREVIEW_HEIGHT - 1.0);
|
||||
/*ArcBall_Mouse(pos);
|
||||
ArcBall_BeginDrag(); */
|
||||
}
|
||||
|
@ -319,17 +319,17 @@ preview_events (GtkWidget *area,
|
|||
|
||||
case GDK_BUTTON_RELEASE:
|
||||
if (light_hit == TRUE)
|
||||
{
|
||||
{
|
||||
compute_preview_image ();
|
||||
|
||||
gtk_widget_queue_draw (previewarea);
|
||||
}
|
||||
gtk_widget_queue_draw (previewarea);
|
||||
}
|
||||
else
|
||||
{
|
||||
pos.x = -(2.0 * (gdouble) event->button.x /
|
||||
(gdouble) PREVIEW_WIDTH - 1.0);
|
||||
(gdouble) PREVIEW_WIDTH - 1.0);
|
||||
pos.y = (2.0 * (gdouble) event->button.y /
|
||||
(gdouble) PREVIEW_HEIGHT - 1.0);
|
||||
(gdouble) PREVIEW_HEIGHT - 1.0);
|
||||
/*ArcBall_Mouse(pos);
|
||||
ArcBall_EndDrag(); */
|
||||
}
|
||||
|
@ -350,10 +350,10 @@ preview_events (GtkWidget *area,
|
|||
}
|
||||
else
|
||||
{
|
||||
pos.x = -(2.0 * (gdouble) event->motion.x /
|
||||
(gdouble) PREVIEW_WIDTH - 1.0);
|
||||
pos.x = -(2.0 * (gdouble) event->motion.x /
|
||||
(gdouble) PREVIEW_WIDTH - 1.0);
|
||||
pos.y = (2.0 * (gdouble) event->motion.y /
|
||||
(gdouble) PREVIEW_HEIGHT - 1.0);
|
||||
(gdouble) PREVIEW_HEIGHT - 1.0);
|
||||
/* ArcBall_Mouse(pos);
|
||||
ArcBall_Update();
|
||||
ArcBall_Values(&a,&b,&c);
|
||||
|
@ -366,7 +366,7 @@ preview_events (GtkWidget *area,
|
|||
if (Beta<-180) Beta+=360;
|
||||
if (Gamma>180) Gamma-=360;
|
||||
if (Gamma<-180) Gamma+=360;
|
||||
UpdateAngleSliders(); */
|
||||
UpdateAngleSliders(); */
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -434,7 +434,7 @@ create_options_page (void)
|
|||
|
||||
toggle = gtk_check_button_new_with_label (_("Transparent background"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
||||
mapvals.transparent_background);
|
||||
mapvals.transparent_background);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
|
||||
gtk_widget_show (toggle);
|
||||
|
||||
|
@ -443,11 +443,11 @@ create_options_page (void)
|
|||
&mapvals.transparent_background);
|
||||
|
||||
gimp_help_set_help_data (toggle,
|
||||
_("Make image transparent outside object"), NULL);
|
||||
_("Make image transparent outside object"), NULL);
|
||||
|
||||
toggle = gtk_check_button_new_with_label (_("Tile source image"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
||||
mapvals.tiled);
|
||||
mapvals.tiled);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
|
||||
gtk_widget_show (toggle);
|
||||
|
||||
|
@ -456,12 +456,12 @@ create_options_page (void)
|
|||
&mapvals.tiled);
|
||||
|
||||
gimp_help_set_help_data (toggle,
|
||||
_("Tile source image: useful for infinite planes"),
|
||||
NULL);
|
||||
_("Tile source image: useful for infinite planes"),
|
||||
NULL);
|
||||
|
||||
toggle = gtk_check_button_new_with_label (_("Create new image"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
||||
mapvals.create_new_image);
|
||||
mapvals.create_new_image);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
|
||||
gtk_widget_show (toggle);
|
||||
|
||||
|
@ -470,11 +470,11 @@ create_options_page (void)
|
|||
&mapvals.create_new_image);
|
||||
|
||||
gimp_help_set_help_data (toggle,
|
||||
_("Create a new image when applying filter"), NULL);
|
||||
_("Create a new image when applying filter"), NULL);
|
||||
|
||||
toggle = gtk_check_button_new_with_label (_("Create new layer"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
||||
mapvals.create_new_layer);
|
||||
mapvals.create_new_layer);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
|
||||
gtk_widget_show (toggle);
|
||||
|
||||
|
@ -483,7 +483,7 @@ create_options_page (void)
|
|||
&mapvals.create_new_layer);
|
||||
|
||||
gimp_help_set_help_data (toggle,
|
||||
_("Create a new layer when applying filter"), NULL);
|
||||
_("Create a new layer when applying filter"), NULL);
|
||||
|
||||
/* Antialiasing options */
|
||||
|
||||
|
@ -493,7 +493,7 @@ create_options_page (void)
|
|||
|
||||
toggle = gtk_check_button_new_with_mnemonic (_("Enable _antialiasing"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
||||
mapvals.antialiasing);
|
||||
mapvals.antialiasing);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame), toggle);
|
||||
gtk_widget_show (toggle);
|
||||
|
||||
|
@ -502,8 +502,8 @@ create_options_page (void)
|
|||
&mapvals.antialiasing);
|
||||
|
||||
gimp_help_set_help_data (toggle,
|
||||
_("Enable/disable jagged edges removal "
|
||||
"(antialiasing)"), NULL);
|
||||
_("Enable/disable jagged edges removal "
|
||||
"(antialiasing)"), NULL);
|
||||
|
||||
table = gtk_table_new (2, 3, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
|
||||
|
@ -515,28 +515,28 @@ create_options_page (void)
|
|||
g_object_set_data (G_OBJECT (toggle), "set_sensitive", table);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("_Depth:"), 0, 0,
|
||||
mapvals.maxdepth, 1.0, 5.0, 0.1, 1.0,
|
||||
1, TRUE, 0, 0,
|
||||
_("Antialiasing quality. Higher is better, "
|
||||
"but slower"), NULL);
|
||||
_("_Depth:"), 0, 0,
|
||||
mapvals.maxdepth, 1.0, 5.0, 0.1, 1.0,
|
||||
1, TRUE, 0, 0,
|
||||
_("Antialiasing quality. Higher is better, "
|
||||
"but slower"), NULL);
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (gimp_double_adjustment_update),
|
||||
&mapvals.maxdepth);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adj, mapvals.pixeltreshold,
|
||||
0.001, 1000, 0.1, 1, 0, 0, 3);
|
||||
0.001, 1000, 0.1, 1, 0, 0, 3);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
||||
_("_Threshold:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
_("_Threshold:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
&mapvals.pixeltreshold);
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("Stop when pixel differences are smaller than "
|
||||
"this value"), NULL);
|
||||
_("Stop when pixel differences are smaller than "
|
||||
"this value"), NULL);
|
||||
|
||||
gtk_widget_show (page);
|
||||
|
||||
|
@ -577,8 +577,8 @@ create_light_page (void)
|
|||
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo),
|
||||
mapvals.lightsource.type);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Lightsource type:"), 0.0, 0.5,
|
||||
combo, 1, FALSE);
|
||||
_("Lightsource type:"), 0.0, 0.5,
|
||||
combo, 1, FALSE);
|
||||
|
||||
g_signal_connect (combo, "changed",
|
||||
G_CALLBACK (lightmenu_callback),
|
||||
|
@ -587,19 +587,19 @@ create_light_page (void)
|
|||
gimp_help_set_help_data (combo, _("Type of light source to apply"), NULL);
|
||||
|
||||
colorbutton = gimp_color_button_new (_("Select lightsource color"),
|
||||
64, 16,
|
||||
&mapvals.lightsource.color,
|
||||
GIMP_COLOR_AREA_FLAT);
|
||||
64, 16,
|
||||
&mapvals.lightsource.color,
|
||||
GIMP_COLOR_AREA_FLAT);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
||||
_("Lightsource color:"), 0.0, 0.5,
|
||||
colorbutton, 1, FALSE);
|
||||
_("Lightsource color:"), 0.0, 0.5,
|
||||
colorbutton, 1, FALSE);
|
||||
|
||||
g_signal_connect (colorbutton, "color-changed",
|
||||
G_CALLBACK (gimp_color_button_get_color),
|
||||
&mapvals.lightsource.color);
|
||||
|
||||
gimp_help_set_help_data (colorbutton,
|
||||
_("Set light source color"), NULL);
|
||||
_("Set light source color"), NULL);
|
||||
|
||||
pointlightwid = gimp_frame_new (_("Position"));
|
||||
gtk_box_pack_start (GTK_BOX (page), pointlightwid, FALSE, FALSE, 0);
|
||||
|
@ -614,46 +614,46 @@ create_light_page (void)
|
|||
gtk_widget_show (table);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&xadj, mapvals.lightsource.position.x,
|
||||
-G_MAXFLOAT, G_MAXFLOAT,
|
||||
0.1, 1.0, 0.0, 0.0, 2);
|
||||
-G_MAXFLOAT, G_MAXFLOAT,
|
||||
0.1, 1.0, 0.0, 0.0, 2);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("X:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
_("X:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
|
||||
g_signal_connect (xadj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
&mapvals.lightsource.position.x);
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("Light source X position in XYZ space"), NULL);
|
||||
_("Light source X position in XYZ space"), NULL);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&yadj, mapvals.lightsource.position.y,
|
||||
-G_MAXFLOAT, G_MAXFLOAT,
|
||||
0.1, 1.0, 0.0, 0.0, 2);
|
||||
-G_MAXFLOAT, G_MAXFLOAT,
|
||||
0.1, 1.0, 0.0, 0.0, 2);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
||||
_("Y:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
_("Y:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
|
||||
g_signal_connect (yadj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
&mapvals.lightsource.position.y);
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("Light source Y position in XYZ space"), NULL);
|
||||
_("Light source Y position in XYZ space"), NULL);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&zadj, mapvals.lightsource.position.z,
|
||||
-G_MAXFLOAT, G_MAXFLOAT,
|
||||
0.1, 1.0, 0.0, 0.0, 2);
|
||||
-G_MAXFLOAT, G_MAXFLOAT,
|
||||
0.1, 1.0, 0.0, 0.0, 2);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
|
||||
_("Z:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
_("Z:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
|
||||
g_signal_connect (zadj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
&mapvals.lightsource.position.z);
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("Light source Z position in XYZ space"), NULL);
|
||||
_("Light source Z position in XYZ space"), NULL);
|
||||
|
||||
|
||||
dirlightwid = gimp_frame_new (_("Direction Vector"));
|
||||
|
@ -669,43 +669,43 @@ create_light_page (void)
|
|||
gtk_widget_show (table);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adj, mapvals.lightsource.direction.x,
|
||||
-1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
|
||||
-1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("X:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
_("X:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
&mapvals.lightsource.direction.x);
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("Light source X direction in XYZ space"), NULL);
|
||||
_("Light source X direction in XYZ space"), NULL);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adj, mapvals.lightsource.direction.y,
|
||||
-1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
|
||||
-1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
||||
_("Y:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
_("Y:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
&mapvals.lightsource.direction.y);
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("Light source Y direction in XYZ space"), NULL);
|
||||
_("Light source Y direction in XYZ space"), NULL);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adj, mapvals.lightsource.direction.z,
|
||||
-1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
|
||||
-1.0, 1.0, 0.01, 0.1, 0.0, 0.0, 2);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
|
||||
_("Z:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
_("Z:"), 0.0, 0.5,
|
||||
spinbutton, 1, TRUE);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
&mapvals.lightsource.direction.z);
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("Light source Z direction in XYZ space"), NULL);
|
||||
_("Light source Z direction in XYZ space"), NULL);
|
||||
|
||||
gtk_widget_show (page);
|
||||
|
||||
|
@ -756,9 +756,9 @@ create_material_page (void)
|
|||
gtk_size_group_add_widget (group, label);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adj, mapvals.material.ambient_int,
|
||||
0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
|
||||
0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
|
||||
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 0, 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (spinbutton);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
|
@ -766,13 +766,13 @@ create_material_page (void)
|
|||
&mapvals.material.ambient_int);
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("Amount of original color to show where no "
|
||||
"direct light falls"), NULL);
|
||||
_("Amount of original color to show where no "
|
||||
"direct light falls"), NULL);
|
||||
|
||||
image = gtk_image_new_from_stock (STOCK_INTENSITY_AMBIENT_HIGH,
|
||||
GTK_ICON_SIZE_BUTTON);
|
||||
gtk_table_attach (GTK_TABLE (table), image, 3, 4, 0, 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (image);
|
||||
|
||||
/* Diffuse intensity */
|
||||
|
@ -785,9 +785,9 @@ create_material_page (void)
|
|||
gtk_size_group_add_widget (group, label);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adj, mapvals.material.diffuse_int,
|
||||
0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
|
||||
0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
|
||||
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 1, 2,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (spinbutton);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
|
@ -795,13 +795,13 @@ create_material_page (void)
|
|||
&mapvals.material.diffuse_int);
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("Intensity of original color when lit by a light "
|
||||
"source"), NULL);
|
||||
_("Intensity of original color when lit by a light "
|
||||
"source"), NULL);
|
||||
|
||||
image = gtk_image_new_from_stock (STOCK_INTENSITY_DIFFUSE_HIGH,
|
||||
GTK_ICON_SIZE_BUTTON);
|
||||
gtk_table_attach (GTK_TABLE (table), image, 3, 4, 1, 2,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (image);
|
||||
|
||||
frame = gimp_frame_new (_("Reflectivity"));
|
||||
|
@ -828,9 +828,9 @@ create_material_page (void)
|
|||
gtk_size_group_add_widget (group, label);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adj, mapvals.material.diffuse_ref,
|
||||
0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
|
||||
0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
|
||||
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 0, 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (spinbutton);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
|
@ -838,13 +838,13 @@ create_material_page (void)
|
|||
&mapvals.material.diffuse_ref);
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("Higher values makes the object reflect more "
|
||||
"light (appear lighter)"), NULL);
|
||||
_("Higher values makes the object reflect more "
|
||||
"light (appear lighter)"), NULL);
|
||||
|
||||
image = gtk_image_new_from_stock (STOCK_REFLECTIVITY_DIFFUSE_HIGH,
|
||||
GTK_ICON_SIZE_BUTTON);
|
||||
gtk_table_attach (GTK_TABLE (table), image, 3, 4, 0, 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (image);
|
||||
|
||||
/* Specular reflection */
|
||||
|
@ -857,9 +857,9 @@ create_material_page (void)
|
|||
gtk_size_group_add_widget (group, label);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adj, mapvals.material.specular_ref,
|
||||
0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
|
||||
0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
|
||||
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 1, 2,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (spinbutton);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
|
@ -867,13 +867,13 @@ create_material_page (void)
|
|||
&mapvals.material.specular_ref);
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("Controls how intense the highlights will be"),
|
||||
NULL);
|
||||
_("Controls how intense the highlights will be"),
|
||||
NULL);
|
||||
|
||||
image = gtk_image_new_from_stock (STOCK_REFLECTIVITY_SPECULAR_HIGH,
|
||||
GTK_ICON_SIZE_BUTTON);
|
||||
gtk_table_attach (GTK_TABLE (table), image, 3, 4, 1, 2,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (image);
|
||||
|
||||
/* Highlight */
|
||||
|
@ -886,9 +886,9 @@ create_material_page (void)
|
|||
gtk_size_group_add_widget (group, label);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adj, mapvals.material.highlight,
|
||||
0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
|
||||
0, G_MAXFLOAT, 0.1, 1.0, 0.0, 0.0, 2);
|
||||
gtk_table_attach (GTK_TABLE (table), spinbutton, 2, 3, 2, 3,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (spinbutton);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
|
@ -896,13 +896,13 @@ create_material_page (void)
|
|||
&mapvals.material.highlight);
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("Higher values makes the highlights more focused"),
|
||||
NULL);
|
||||
_("Higher values makes the highlights more focused"),
|
||||
NULL);
|
||||
|
||||
image = gtk_image_new_from_stock (STOCK_REFLECTIVITY_HIGHLIGHT_HIGH,
|
||||
GTK_ICON_SIZE_BUTTON);
|
||||
gtk_table_attach (GTK_TABLE (table), image, 3, 4, 2, 3,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (image);
|
||||
|
||||
gtk_widget_show (page);
|
||||
|
@ -939,39 +939,39 @@ create_orientation_page (void)
|
|||
gtk_widget_show (table);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("X:"), 0, 0,
|
||||
mapvals.position.x, -1.0, 2.0, 0.01, 0.1, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Object X position in XYZ space"), NULL);
|
||||
_("X:"), 0, 0,
|
||||
mapvals.position.x, -1.0, 2.0, 0.01, 0.1, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Object X position in XYZ space"), NULL);
|
||||
gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_SPINBUTTON (adj));
|
||||
gtk_spin_button_configure (GIMP_SCALE_ENTRY_SPINBUTTON (adj),
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.01, 5);
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.01, 5);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
&mapvals.position.x);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Y:"), 0, 0,
|
||||
mapvals.position.y, -1.0, 2.0, 0.01, 0.1, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Object Y position in XYZ space"), NULL);
|
||||
_("Y:"), 0, 0,
|
||||
mapvals.position.y, -1.0, 2.0, 0.01, 0.1, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Object Y position in XYZ space"), NULL);
|
||||
gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_SPINBUTTON (adj));
|
||||
gtk_spin_button_configure (GIMP_SCALE_ENTRY_SPINBUTTON (adj),
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.01, 5);
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.01, 5);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
&mapvals.position.y);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Z:"), 0, 0,
|
||||
mapvals.position.z, -1.0, 2.0, 0.01, 0.1, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Object Z position in XYZ space"), NULL);
|
||||
_("Z:"), 0, 0,
|
||||
mapvals.position.z, -1.0, 2.0, 0.01, 0.1, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Object Z position in XYZ space"), NULL);
|
||||
gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_SPINBUTTON (adj));
|
||||
gtk_spin_button_configure (GIMP_SCALE_ENTRY_SPINBUTTON (adj),
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.01, 5);
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.01, 5);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
|
@ -988,10 +988,10 @@ create_orientation_page (void)
|
|||
gtk_widget_show (table);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("X:"), 0, 0,
|
||||
mapvals.alpha, -180.0, 180.0, 1.0, 15.0, 1,
|
||||
TRUE, 0, 0,
|
||||
_("Rotation angle about X axis"), NULL);
|
||||
_("X:"), 0, 0,
|
||||
mapvals.alpha, -180.0, 180.0, 1.0, 15.0, 1,
|
||||
TRUE, 0, 0,
|
||||
_("Rotation angle about X axis"), NULL);
|
||||
gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_SPINBUTTON (adj));
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
|
@ -999,10 +999,10 @@ create_orientation_page (void)
|
|||
&mapvals.alpha);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Y:"), 0, 0,
|
||||
mapvals.beta, -180.0, 180.0, 1.0, 15.0, 1,
|
||||
TRUE, 0, 0,
|
||||
_("Rotation angle about Y axis"), NULL);
|
||||
_("Y:"), 0, 0,
|
||||
mapvals.beta, -180.0, 180.0, 1.0, 15.0, 1,
|
||||
TRUE, 0, 0,
|
||||
_("Rotation angle about Y axis"), NULL);
|
||||
gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_SPINBUTTON (adj));
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
|
@ -1010,10 +1010,10 @@ create_orientation_page (void)
|
|||
&mapvals.beta);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Z:"), 0, 0,
|
||||
mapvals.gamma, -180.0, 180.0, 1.0, 15.0, 1,
|
||||
TRUE, 0, 0,
|
||||
_("Rotation angle about Z axis"), NULL);
|
||||
_("Z:"), 0, 0,
|
||||
mapvals.gamma, -180.0, 180.0, 1.0, 15.0, 1,
|
||||
TRUE, 0, 0,
|
||||
_("Rotation angle about Z axis"), NULL);
|
||||
gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_SPINBUTTON (adj));
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
|
@ -1072,8 +1072,8 @@ create_box_page (void)
|
|||
&mapvals.boxmap_id[i]);
|
||||
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, i,
|
||||
gettext (labels[i]), 0.0, 0.5,
|
||||
combo, 1, FALSE);
|
||||
gettext (labels[i]), 0.0, 0.5,
|
||||
combo, 1, FALSE);
|
||||
}
|
||||
|
||||
/* Scale scales */
|
||||
|
@ -1085,36 +1085,36 @@ create_box_page (void)
|
|||
gtk_widget_show (table);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Scale X:"), 0, 0,
|
||||
mapvals.scale.x, 0.0, 5.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("X scale (size)"), NULL);
|
||||
_("Scale X:"), 0, 0,
|
||||
mapvals.scale.x, 0.0, 5.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("X scale (size)"), NULL);
|
||||
gtk_spin_button_configure (GIMP_SCALE_ENTRY_SPINBUTTON (adj),
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.1, 2);
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.1, 2);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
&mapvals.scale.x);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Y:"), 0, 0,
|
||||
mapvals.scale.y, 0.0, 5.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Y scale (size)"), NULL);
|
||||
_("Y:"), 0, 0,
|
||||
mapvals.scale.y, 0.0, 5.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Y scale (size)"), NULL);
|
||||
gtk_spin_button_configure (GIMP_SCALE_ENTRY_SPINBUTTON (adj),
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.1, 2);
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.1, 2);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
&mapvals.scale.y);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Z:"), 0, 0,
|
||||
mapvals.scale.z, 0.0, 5.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Z scale (size)"), NULL);
|
||||
_("Z:"), 0, 0,
|
||||
mapvals.scale.z, 0.0, 5.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Z scale (size)"), NULL);
|
||||
gtk_spin_button_configure (GIMP_SCALE_ENTRY_SPINBUTTON (adj),
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.1, 2);
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.1, 2);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
|
@ -1180,28 +1180,28 @@ create_cylinder_page (void)
|
|||
gtk_widget_show (table);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("R_adius:"), 0, 0,
|
||||
mapvals.cylinder_radius,
|
||||
0.0, 2.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Cylinder radius"), NULL);
|
||||
_("R_adius:"), 0, 0,
|
||||
mapvals.cylinder_radius,
|
||||
0.0, 2.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Cylinder radius"), NULL);
|
||||
gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_LABEL (adj));
|
||||
gtk_spin_button_configure (GIMP_SCALE_ENTRY_SPINBUTTON (adj),
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.1, 2);
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.1, 2);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
&mapvals.cylinder_radius);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("L_ength:"), 0, 0,
|
||||
mapvals.cylinder_length,
|
||||
0.0, 2.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Cylinder length"), NULL);
|
||||
_("L_ength:"), 0, 0,
|
||||
mapvals.cylinder_length,
|
||||
0.0, 2.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Cylinder length"), NULL);
|
||||
gtk_size_group_add_widget (group, GIMP_SCALE_ENTRY_LABEL (adj));
|
||||
gtk_spin_button_configure (GIMP_SCALE_ENTRY_SPINBUTTON (adj),
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.1, 2);
|
||||
GIMP_SCALE_ENTRY_SPINBUTTON_ADJ (adj), 0.1, 2);
|
||||
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (double_adjustment_update),
|
||||
|
@ -1229,33 +1229,33 @@ create_main_notebook (GtkWidget *container)
|
|||
|
||||
page = create_options_page ();
|
||||
gtk_notebook_append_page (options_note_book, page,
|
||||
gtk_label_new_with_mnemonic (_("O_ptions")));
|
||||
gtk_label_new_with_mnemonic (_("O_ptions")));
|
||||
|
||||
page = create_light_page ();
|
||||
gtk_notebook_append_page (options_note_book, page,
|
||||
gtk_label_new_with_mnemonic (_("_Light")));
|
||||
gtk_label_new_with_mnemonic (_("_Light")));
|
||||
|
||||
page = create_material_page ();
|
||||
gtk_notebook_append_page (options_note_book, page,
|
||||
gtk_label_new_with_mnemonic (_("_Material")));
|
||||
gtk_label_new_with_mnemonic (_("_Material")));
|
||||
|
||||
page = create_orientation_page ();
|
||||
gtk_notebook_append_page (options_note_book, page,
|
||||
gtk_label_new_with_mnemonic (_("O_rientation")));
|
||||
gtk_label_new_with_mnemonic (_("O_rientation")));
|
||||
|
||||
if (mapvals.maptype == MAP_BOX)
|
||||
{
|
||||
box_page = create_box_page ();
|
||||
g_object_ref (box_page);
|
||||
gtk_notebook_append_page (options_note_book, box_page,
|
||||
gtk_label_new_with_mnemonic (_("_Box")));
|
||||
gtk_label_new_with_mnemonic (_("_Box")));
|
||||
}
|
||||
else if (mapvals.maptype == MAP_CYLINDER)
|
||||
{
|
||||
cylinder_page = create_cylinder_page ();
|
||||
g_object_ref (cylinder_page);
|
||||
gtk_notebook_append_page (options_note_book, cylinder_page,
|
||||
gtk_label_new_with_mnemonic (_("C_ylinder")));
|
||||
gtk_label_new_with_mnemonic (_("C_ylinder")));
|
||||
}
|
||||
|
||||
gtk_widget_show (GTK_WIDGET (options_note_book));
|
||||
|
@ -1281,12 +1281,12 @@ main_dialog (GimpDrawable *drawable)
|
|||
|
||||
appwin = gimp_dialog_new (_("Map to Object"), PLUG_IN_BINARY,
|
||||
NULL, 0,
|
||||
gimp_standard_help_func, PLUG_IN_PROC,
|
||||
gimp_standard_help_func, PLUG_IN_PROC,
|
||||
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_OK, GTK_RESPONSE_OK,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_OK, GTK_RESPONSE_OK,
|
||||
|
||||
NULL);
|
||||
NULL);
|
||||
|
||||
gtk_dialog_set_alternative_button_order (GTK_DIALOG (appwin),
|
||||
GTK_RESPONSE_OK,
|
||||
|
@ -1318,9 +1318,9 @@ main_dialog (GimpDrawable *drawable)
|
|||
previewarea = gtk_drawing_area_new ();
|
||||
gtk_widget_set_size_request (previewarea, PREVIEW_WIDTH, PREVIEW_HEIGHT);
|
||||
gtk_widget_set_events (previewarea, (GDK_EXPOSURE_MASK |
|
||||
GDK_BUTTON1_MOTION_MASK |
|
||||
GDK_BUTTON_PRESS_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK));
|
||||
GDK_BUTTON1_MOTION_MASK |
|
||||
GDK_BUTTON_PRESS_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK));
|
||||
gtk_container_add (GTK_CONTAINER (frame), previewarea);
|
||||
gtk_widget_show (previewarea);
|
||||
|
||||
|
|
Loading…
Reference in New Issue