Commit a68650f9 authored by Manish Singh's avatar Manish Singh

Yet more plugin moves.

-Yosh
parent 6ad4b662
......@@ -327,8 +327,6 @@ plug-ins/xpm/Makefile
plug-ins/AlienMap/Makefile
plug-ins/c_astretch/Makefile
plug-ins/bumpmap/Makefile
plug-ins/gflare/Makefile
plug-ins/gflare/gflares/Makefile
plug-ins/script-fu/Makefile
plug-ins/script-fu/scripts/Makefile
plug-ins/jpeg/Makefile
......@@ -337,17 +335,13 @@ plug-ins/png/Makefile
plug-ins/tiff/Makefile
plug-ins/xd/Makefile
plug-ins/bmp/Makefile
plug-ins/MapObject/Makefile
plug-ins/megawidget/Makefile
plug-ins/libgck/Makefile
plug-ins/libgck/gck/Makefile
plug-ins/blur/Makefile
plug-ins/gfig/Makefile
plug-ins/gfig/gfig-examples/Makefile
plug-ins/flame/Makefile
plug-ins/gimptcl/Makefile
plug-ins/gimptcl/scripts/Makefile
plug-ins/fuse/Makefile
plug-ins/struc/Makefile
plug-ins/user_filter/Makefile
plug-ins/zealouscrop/Makefile
......
......@@ -201,10 +201,4 @@
(transparency-type 1)
(transparency-size 2)
# gfig pattern directory
(gfig-path "${gimp_dir}/gfig:${gimp_data_dir}/gfig")
# path for gflare flares directory
(gflare-path "${gimp_dir}/gflares:${gimp_data_dir}/gflares")
# [end of file]
......@@ -201,10 +201,4 @@
(transparency-type 1)
(transparency-size 2)
# gfig pattern directory
(gfig-path "${gimp_dir}/gfig:${gimp_data_dir}/gfig")
# path for gflare flares directory
(gflare-path "${gimp_dir}/gflares:${gimp_data_dir}/gflares")
# [end of file]
......@@ -3,10 +3,8 @@
SUBDIRS = \
megawidget \
libgck \
MapObject \
AlienMap \
dbbrowser \
fuse \
gflare \
@GIMPTCL@ \
script-fu \
......
Makefile.in
Makefile
.deps
_libs
.libs
MapObject
Changes (post 0.31):
====================
-> 0.31 Merged MapPlane and MapSphere. Added support for non-interactive
execution (for script-fu).
-> 0.32 Fixed a bug in the bilinear interpolation function. Added "tile" option.
Added some icons to the material page to illustrate the effects of the
parameters. I'm not sure they help much.
## Process this file with automake to produce Makefile.in
pluginlibdir = $(gimpplugindir)/plug-ins
pluginlib_PROGRAMS = MapObject
MapObject_SOURCES = \
amb1.xpm amb2.xpm arcball.c arcball.h diffint1.xpm diffint2.xpm diffref1.xpm diffref2.xpm high1.xpm high2.xpm mapobject_apply.c mapobject_apply.h mapobject_image.c mapobject_image.h mapobject_main.c mapobject_main.h mapobject_pixmaps.h mapobject_preview.c mapobject_preview.h mapobject_shade.c mapobject_shade.h mapobject_ui.c mapobject_ui.h specref1.xpm specref2.xpm
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/plug-ins/libgck \
-I$(includedir) \
$(X_CFLAGS)
LDADD = \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(top_builddir)/plug-ins/libgck/gck/libgck.la \
$(X_LIBS) \
-lc
DEPS = \
$(top_builddir)/libgimp/libgimpui.la \
$(top_builddir)/libgimp/libgimp.la \
$(top_builddir)/plug-ins/libgck/gck/libgck.la
MapObject_DEPENDENCIES = $(DEPS)
.PHONY: files
files:
@files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \
echo $$p; \
done
@for subdir in $(SUBDIRS); do \
files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \
for file in $$files; do \
echo $$subdir/$$file; \
done; \
done
MapObject 0.32 -- image filter plug-in for The GIMP program
===========================================================
NOTE: this is still a beta release, expect bugs.
Copyright (C) 1996 Tom Bech
Copyright (C) 1996 Federico Mena Quintero
You can reach the author(s) via E-mail:
tomb@gimp.org (Tom) or quartic@gimp.org (Federico).
The GIMP was developed by Peter Mattis and Spencer Kimball.
You can contact them at gimp@xcf.berkeley.edu.
There's more GIMP stuff on our home pages:
http://www.ii.uib.no/~tomb/gimp.html (Tom's page)
http://www.nuclecu.unam.mx/~federico/gimp/index.html (Quartic's page)
Legal stuff
===========
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program (see "COPYING" file); if not, write to the Free Software Foundation,
Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
In other words, you can't sue us for whatever happens while using this ;)
Compiling
=========
To compile you'll need The GIMP (more precisely, GDK/GTK 0.99.13 or later).
You'll also need GCK (http://www.ii.uib.no/~tomb/gck.html)
1) Edit the Makefile to reflect your system setup.
2) Type "make" and then "make install"
You should now be ready to run. "make install" puts the executable "map_object"
in the standard plug-in directory.
Documentation
=============
Ahem.. right.. ;) ..I'll get around to it eventually.
Note that there's still some functionality missing/not working, read the
"TODO" file. Please send me a mail if you find any bugs in the code.
Have fun,
Tom
The MapObject plug-in "todo"-list:
=================================
* I'm apparently ref'ing some tiles without unref'ing them.
* Interactive positioning of directional light
* Rotation by mouse (doesn't work correctly yet and is disabled).
* Faster mapping code
* Multiple light-sources
* Presets (including save/load)
* Gray-scale/channels support
* Documentation
* Autoconf/automake stuff?
If there's anything you would like to add, feel free
to send me any suggestions for new stuff or improvements.
Tom
/* XPM */
static char * amb1_xpm[] = {
"32 32 53 1",
" c None",
". c #861786178617",
"X c #861782078617",
"o c #69A66DB669A6",
"O c #8E388E388E38",
"+ c #B6DAB2CAB6DA",
"@ c #BEFBBAEABEFB",
"# c #AEBAAEBAAEBA",
"$ c #9E799E799E79",
"% c #8E388A288E38",
"& c #618565956185",
"* c #30C234D330C2",
"= c #A699A699A699",
"- c #CF3CCF3CCF3C",
"; c #D75CD34CD75C",
": c #C71BC30BC71B",
"> c #DF7DDF7DDF7D",
", c #D75CD75CD75C",
"< c #CF3CCB2BCF3C",
"1 c #AEBAAAAAAEBA",
"2 c #965896589658",
"3 c #79E779E779E7",
"4 c #514455555144",
"5 c #18611C711861",
"6 c #E79DE38DE79D",
"7 c #E79DE79DE79D",
"8 c #DF7DDB6CDF7D",
"9 c #BEFBBEFBBEFB",
"0 c #9E799A699E79",
"q c #79E77DF779E7",
"w c #618561856185",
"e c #38E338E338E3",
"r c #000004100000",
"t c #EFBEEFBEEFBE",
"y c #FFFFFBEEFFFF",
"u c #410341034103",
"i c #08200C300820",
"p c #FFFFFFFFFFFF",
"a c #B6DAB6DAB6DA",
"s c #965892489658",
"d c #104014511040",
"f c #71C675D671C6",
"g c #596559655965",
"h c #104010401040",
"j c #000000000000",
"k c #514451445144",
"l c #30C230C230C2",
"z c #59655D755965",
"x c #410345144103",
"c c #208124922081",
"v c #49244D344924",
"b c #208120812081",
"n c #082008200820",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" .Xo ",
" O+@@#$%&* ",
" =-;;-:+$.&* ",
" =;>>>,<@12345 ",
" O->6778-9#0qwer ",
" +;>7tyt-910X&ui ",
" @;>7ypy-a=sqwud ",
" .@-,8ty6:#$Ofgehj ",
" X#:<---:+=2Xoklij ",
" o$+@99a#=2.fzxcrj ",
" %$1#1=$2.f&v*dj ",
" &.200sOXf&kebrj ",
" *&3qXqfozvecnjj ",
" *4w&wgkx*bnjj ",
" 5euuelcdrjj ",
" ridhirjjj ",
" jjj ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};
/* XPM */
static char * amb2_xpm[] = {
"32 32 23 1",
" c None",
". c #CF3CCF3CCF3C",
"X c #CF3CCB2BCF3C",
"o c #C71BC30BC71B",
"O c #D75CD75CD75C",
"+ c #DF7DDB6CDF7D",
"@ c #C71BC71BC71B",
"# c #AEBAAEBAAEBA",
"$ c #DF7DDF7DDF7D",
"% c #E79DE38DE79D",
"& c #D75CD34CD75C",
"* c #E79DE79DE79D",
"= c #AEBAAAAAAEBA",
"- c #EFBEEBADEFBE",
"; c #BEFBBEFBBEFB",
": c #A699A289A699",
"> c #F7DEF3CEF7DE",
", c #F7DEF7DEF7DE",
"< c #B6DAB2CAB6DA",
"1 c #FFFFFFFFFFFF",
"2 c #FFFFFBEEFFFF",
"3 c #B6DAB6DAB6DA",
"4 c #BEFBBAEABEFB",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ..X ",
" oO+++O.@# ",
" X$%%$$+O&X# ",
" X%%*%%$$+&.@= ",
" o$%**-*%$+O.@;: ",
" O%**>,,%$+O.Xo< ",
" +%%-,12*+O&.Xo3 ",
" .+$%*,2,%+O&.@;3< ",
" .+$$%%*%+O&.X@;3< ",
" XO+$$$++OO&.@o43< ",
" .O+++OO&&.Xo;3< ",
" @&&OO&&..X@;43# ",
" #X.....X@o;43<: ",
" #@@XX@@o;43<: ",
" =;oo;;433<: ",
" :<3333<#: ",
" <<< ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};
/************************************/
/* ArcBall.c (c) Ken Shoemake, 1993 */
/* Modified by Tom Bech, 1996 */
/************************************/
#include <math.h>
#include <gdk/gdk.h>
#include <libgimp/gimp.h>
#include "arcball.h"
/* Gloval variables */
/* ================ */
HVect center;
double radius;
Quat qNow, qDown, qDrag;
HVect vNow, vDown, vFrom, vTo, vrFrom, vrTo;
HMatrix mNow, mDown;
unsigned int showResult, dragging;
ConstraintSet sets[NSets];
int setSizes[NSets];
AxisSet axisSet;
int axisIndex;
HMatrix mId = {{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1}};
double otherAxis[][4] = {{-0.48, 0.80, 0.36, 1}};
Quat qOne = {0, 0, 0, 1};
/* Externally visible methods */
/* ========================== */
void ArcBall_Init();
void ArcBall_Place(HVect Center, 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);
void ArcBall_BeginDrag(void);
void ArcBall_EndDrag(void);
void ArcBall_Mouse(HVect v_Now);
void ArcBall_CopyMat(HMatrix inm,HMatrix outm);
/* Internal methods */
/* ================ */
HMatrix *Qt_ToMatrix(Quat q,HMatrix out);
Quat Qt_Conj(Quat q);
Quat Qt_Mul(Quat qL, Quat qR);
Quat Qt_FromBallPoints(HVect from, HVect to);
void Qt_ToBallPoints(Quat q, HVect *arcFrom, HVect *arcTo);
HVect V3_(double x, double y, double z);
double V3_Norm(HVect v);
HVect V3_Unit(HVect v);
HVect V3_Scale(HVect v, double s);
HVect V3_Negate(HVect v);
HVect V3_Add(HVect v1, HVect v2);
HVect V3_Sub(HVect v1, HVect v2);
double V3_Dot(HVect v1, HVect v2);
HVect V3_Cross(HVect v1, HVect v2);
HVect V3_Bisect(HVect v0, HVect v1);
HVect MouseOnSphere(HVect mouse, HVect ballCenter, double ballRadius);
HVect ConstrainToAxis(HVect loose, HVect axis);
int NearestConstraintAxis(HVect loose, HVect *axes, int nAxes);
/* Establish reasonable initial values for controller. */
/* =================================================== */
void ArcBall_Init(void)
{
int i;
center = qOne;
radius = 1.0;
vDown = vNow = qOne;
qDown = qNow = qOne;
for (i=15; i>=0; i--) ((double *)mNow)[i] = ((double *)mDown)[i] = ((double *)mId)[i];
showResult = dragging = FALSE;
axisSet = NoAxes;
sets[CameraAxes] = mId[X];
setSizes[CameraAxes] = 3;
sets[BodyAxes] = mDown[X];
setSizes[BodyAxes] = 3;
sets[OtherAxes] = otherAxis[X];
setSizes[OtherAxes] = 1;
}
/* Set the center and size of the controller. */
/* ========================================== */
void ArcBall_Place(HVect Center, double Radius)
{
center = Center;
radius = Radius;
}
/* Incorporate new mouse position. */
/* =============================== */
void ArcBall_Mouse(HVect v_Now)
{
vNow = v_Now;
}
/* Choose a constraint set, or none. */
/* ================================= */
void ArcBall_UseSet(AxisSet axis_Set)
{
if (!dragging) axisSet = axis_Set;
}
/* Using vDown, vNow, dragging, and axisSet, compute rotation etc. */
/* =============================================================== */
void ArcBall_Update(void)
{
int setSize = setSizes[axisSet];
HVect *set = (HVect *)(sets[axisSet]);
vFrom = MouseOnSphere(vDown, center, radius);
vTo = MouseOnSphere(vNow, center, radius);
if (dragging)
{
if (axisSet!=NoAxes)
{
vFrom = ConstrainToAxis(vFrom, set[axisIndex]);
vTo = ConstrainToAxis(vTo, set[axisIndex]);
}
qDrag = Qt_FromBallPoints(vFrom, vTo);
qNow = Qt_Mul(qDrag, qDown);
}
else
{
if (axisSet!=NoAxes) axisIndex = NearestConstraintAxis(vTo, set, setSize);
}
Qt_ToBallPoints(qDown, &vrFrom, &vrTo);
Qt_ToMatrix(Qt_Conj(qNow), mNow); /* Gives transpose for GL. */
}
/* Return rotation matrix defined by controller use. */
/* ================================================= */
void ArcBall_Value(HMatrix m_Now)
{
ArcBall_CopyMat(mNow,m_Now);
}
/* Extract rotation angles from matrix */
/* =================================== */
void ArcBall_Values(double *alpha,double *beta,double *gamma)
{
if ((*beta=asin(-mNow[0][2]))!=0.0)
{
*gamma=atan2(mNow[1][2],mNow[2][2]);
*alpha=atan2(mNow[0][1],mNow[0][0]);
}
else
{
*gamma=atan2(mNow[1][0],mNow[1][1]);
*alpha=0.0;
}
}
/* Begin drag sequence. */
/* ==================== */
void ArcBall_BeginDrag(void)
{
dragging = TRUE;
vDown = vNow;
}
/* Stop drag sequence. */
/* =================== */
void ArcBall_EndDrag(void)
{
dragging = FALSE;
qDown = qNow;
ArcBall_CopyMat(mNow,mDown);
}
/*===================*/
/***** BallAux.c *****/
/*===================*/
/* Return quaternion product qL * qR. Note: order is important! */
/* To combine rotations, use the product Mul(qSecond, qFirst), */
/* which gives the effect of rotating by qFirst then qSecond. */
/* ============================================================= */
Quat Qt_Mul(Quat qL, Quat qR)
{
Quat qq;
qq.w = qL.w*qR.w - qL.x*qR.x - qL.y*qR.y - qL.z*qR.z;
qq.x = qL.w*qR.x + qL.x*qR.w + qL.y*qR.z - qL.z*qR.y;
qq.y = qL.w*qR.y + qL.y*qR.w + qL.z*qR.x - qL.x*qR.z;
qq.z = qL.w*qR.z + qL.z*qR.w + qL.x*qR.y - qL.y*qR.x;
return (qq);
}
/* Construct rotation matrix from (possibly non-unit) quaternion. */
/* Assumes matrix is used to multiply column vector on the left: */
/* vnew = mat vold. Works correctly for right-handed coordinate */
/* system and right-handed rotations. */
/* ============================================================== */
HMatrix *Qt_ToMatrix(Quat q, 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;
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);
out[X][W] = out[Y][W] = out[Z][W] = out[W][X] = out[W][Y] = out[W][Z] = 0.0;
out[W][W] = 1.0;
return ((HMatrix *)&out);
}
/* Return conjugate of quaternion. */
/* =============================== */
Quat Qt_Conj(Quat q)
{
Quat qq;
qq.x = -q.x; qq.y = -q.y; qq.z = -q.z; qq.w = q.w;
return (qq);
}
/* Return vector formed from components */
/* ==================================== */
HVect V3_(double x, double y, double z)
{
HVect v;
v.x = x; v.y = y; v.z = z; v.w = 0;
return (v);
}
/* Return norm of v, defined as sum of squares of components */
/* ========================================================= */
double V3_Norm(HVect v)
{
return ( v.x*v.x + v.y*v.y + v.z*v.z );
}
/* Return unit magnitude vector in direction of v */
/* ============================================== */
HVect V3_Unit(HVect v)
{
static HVect u = {0, 0, 0, 0};
double vlen = sqrt(V3_Norm(v));
if (vlen != 0.0) u.x = v.x/vlen; u.y = v.y/vlen; u.z = v.z/vlen;
return (u);
}