MACHINE=$(shell uname -m)
BELIBFILES=
ifeq ($(MACHINE), BePC)
        CPU = x86
else
        CPU = ppc
endif

ifeq ($(CPU), x86)
	CFLAGS = -O3 -g
	LD = gcc
	LDFLAGS = -lroot -lbe
else
	CFLAGS = -opt full -g
	LDFLAGS = -lroot -lbe glue-noinit.a init_term_dyn.o start_dyn.o  -map $@.xMAP
endif
DESTDIR=../../GobeProductive/GIMP


OBJS=	gimp.o GIMPMessage.o
SUPPORT=gimp.c gimp.h msg.h dialog_types.h GIMPMessage.cpp
DIST=	waves mblur pixelize shift spread whirl bcg blackwhite blur2 despeckle engrave\
		fade gauss_recurse median noisify pinch prep4tile deinterlace plasma\
		checkerboard sparkl relief invert bleed grayify gamma edge enhance\
		lensflare rothue threshold flip_horz flip_vert lunarize solarize mosaic\
		ripple pagecurl transp rot180
DISTSRC=$(SUPPORT) waves.c mblur.c pixelize.c shift.c spread.c whirl.c bcg.c blackwhite.c\
		blur2.c despeckle.c engrave.c fade.c gauss_recurse.c median.c noisify.c\
		pinch.c prep4tile.c deinterlace.c plasma.c checkerboard.c sparkl.c hsltorgb.c\
		hcon.h hf_io.h gems.h relief.c invert.c bleed.c grayify.c gamma.c edge.c enhance.c\
		lensflare.c rothue.c threshold.c flip_horz.c flip_vert.c lunarize.c solarize.c mosaic.c\
		ripple.c pagecurl.c rot180.c
ALL=	blur waves to-color to-gray extrude lensflare lunarize map_sphere mblur oilify pixelize\
		scale shift solarizet spread subtract tile whirl bcg blackwhite blur2 c_astretch compose\
		contintp contour darkest decompose degrade despeckle displace engrave fade gauss_recurse histogram\
		imgsplit interpolate levels lightest lighting median mosaic noisify pagecurl pinch polar prep4tile\
		ripple rot180 rot90ccw rot90cw rothue superzoom threshold warp dplasma sparkl charcoal\
		deinterlace plasma checkerboard\
		relief invert rotate bleed difference duplicate flip_horz multiply offset grayify\
		gamma flip_vert edge enhance composite blend add solarize bumpmap lic autocrop\
		to-indexed transp

%.o : %.cpp
	$(CC) $(CFLAGS) -c $< -o $@

demo:	$(DIST)
all:	$(ALL)

multi:
	make -j `sysinfo | grep "^[0-9] " | sed -e "s/[A-Za-z].*//"` all

#
# The following have compilation problems, so aren't included in "all"
#
# quant
#



GIMPMessage.o:	GIMPMessage.cpp
	$(CC) $(CFLAGS) -c GIMPMessage.cpp

gimp.o: gimp.c gimp.h msg.h dialog_types.h
	$(CC) $(CFLAGS) -c gimp.c

*.o: gimp.h

neat:
	rm -f *.o *.xMAP *.xSYM

clean:
	rm -f *.o *.xMAP *.xSYM $(ALL)

tree:
ifeq ($(CPU), x86)
	strip2 $(DIST)
endif
	mkdir -p $(DESTDIR)
	mkdir -p $(DESTDIR)/src
	copyattr . $(DESTDIR)
	copyattr -d  $(DIST) $(DESTDIR)
	cp COPYING $(DESTDIR)
	cp Makefile $(DESTDIR)/src
	cp README $(DESTDIR)
#	cp $(DISTSRC) $(DESTDIR)/src
#	cp $(SUPPORT) $(DESTDIR)/src


blur:		blur.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name Blur $@
	addattr category "Blur" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

waves: 	waves.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name Waves $@
	addattr category "Distortion" $@
	addattr GIMP_AUTHOR "Stephen Norris" $@
	addattr GIMP_EMAIL "srn@flibble.cs.su.oz.au" $@
	addattr GIMP_DESC "Introduces waves into the image, with user-selectable amplitude, wavelength andphase. Be warned that amplitudes greater than 1 with reflective waves will cause areas outside theselected region to be reflected.  Much of the code taken from the whirl plug-in.  Many hints and suggestions from Mena Quintero Federico <quartic@polloux.fciencias.unam.mx>, who also wrote the whirl plug-in." $@

to-color:	to-color.o $(OBJS)
	$(LD) -o to-color to-color.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "To Color" $@
	addattr category "•Output" $@
#	addattr category "Color Map" $@
	addattr GIMP_DESC "Takes a grayscale input image and creates a new color image." $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

to-gray:	to-gray.o $(OBJS)
	$(LD) -o to-gray to-gray.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "To Gray" $@
	addattr category "•Output" $@
#	addattr category "Color Map" $@
	addattr GIMP_DESC "Takes a color input image and creates a new grayscale image." $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

extrude:	extrude.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Extrude" $@
	addattr category "•Multi-input" $@
#	addattr category "Distortion" $@
	addattr GIMP_AUTHOR "Karl LaRocca" $@
	addattr GIMP_EMAIL "larocca@cobite.com" $@
	addattr GIMP_DESC "Extrudes the image ... weird!" $@

lensflare:	lensflare.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Lensflare" $@
	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "Marc Bless" $@
	addattr GIMP_EMAIL "bless@ai-lab.fh-furtwangen.de" $@
	addattr GIMP_DESC "Simulates the \"sun in the camera\" effect." $@

lunarize:	lunarize.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Lunarize" $@
	addattr category "Color Map" $@
	addattr GIMP_AUTHOR "Ian Tester" $@
	addattr GIMP_EMAIL "94024831@postoffice.csu.edu.au" $@
	addattr GIMP_DESC "Applies the \"lunarize\" effect, an interesting take on the solarize effect. It is just the inversion of the solarize effect." $@
   
map_sphere:	map_sphere.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Map to Sphere" $@
	addattr category "•Output" $@
#	addattr category "Distortion" $@
	addattr GIMP_AUTHOR "Tom Bech & Federico Mena Quintero (Quartic)" $@
	addattr GIMP_EMAIL "tomb@ii.uib.no, federico@nuclecu.unam.mx" $@
	addattr GIMP_DESC "Maps a picture around a sphere" $@

mblur:	mblur.o $(OBJS)
	# OK -- Doesn't deal quite right with edge? Radial/Linear/Zoom - differences?
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Motion Blur" $@
	addattr category "Blur" $@
	addattr GIMP_AUTHOR "Torsten Martinsen" $@
	addattr GIMP_EMAIL "bullestock@dk-online.dk" $@
	addattr GIMP_DESC "Simulates the effect seen when photographing a moving object at a slow shutter speed. You can choose the angle and amount of displacement." $@

oilify:	oilify.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Oil Paint" $@
	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "Torsten Martinsen" $@
	addattr GIMP_EMAIL "bullestock@dk-online.dk" $@
	addattr GIMP_DESC "Do the 'oil paint' effect." $@

pixelize:	pixelize.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Pixelize" $@
	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "Tracy Scott" $@
	addattr GIMP_EMAIL "bullestock@dk-online.dk" $@
	addattr GIMP_DESC "Acts as a low pass filter on the color components of the provided region." $@

scale:	scale.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Scale" $@
	addattr category "•Output" $@
#	addattr category "Transforms" $@
	addattr GIMP_DESC "Scales an image into a new image" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

shift:	shift.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Shift" $@
	addattr category "Distortion" $@
	addattr GIMP_DESC "Displaces each row of images pixels by a random amount. (left or right)  The idea for this filter is based on ppmshift, a program that is part of the netpbm package." $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

solarizet:	solarizet.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Solarize (simple)" $@
	addattr category "Color Map" $@
	addattr GIMP_AUTHOR "Ian Tester" $@
	addattr GIMP_EMAIL "94024831@postoffice.csu.edu.au" $@
	addattr GIMP_DESC "Applies the \"solarize\" effect.  All intensities are doubled. Any values above 255 are made to \"reverse\" back down to 0." $@

spread:	spread.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Spread" $@
	addattr category "Distortion" $@
	addattr GIMP_DESC "Displaces an images pixels by a random amount.  The idea for this filter is based on ppmspread, a program that is part of the netpbm package." $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

subtract:	subtract.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Subtract" $@
	addattr category "•Multi-input" $@
#	addattr category "Miscellaneous" $@
	addattr GIMP_DESC "Takes the difference between corresponding pixels of the 2 input images." $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

tile:	tile.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Tile" $@
	addattr category "•Output" $@
#	addattr category "Transforms" $@
	addattr GIMP_DESC "This filter tiles an image to arbitrary width and height" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

whirl:	whirl.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Whirl" $@
	addattr category "Distortion" $@
	addattr GIMP_AUTHOR "Federico Mena Quintero" $@
	addattr GIMP_EMAIL "quartic@polloux.fciencias.unam.mx" $@
	addattr GIMP_DESC "Similar to Photoshop's 'Twirl' filter. Imagine pressing your finger on the center of a round table with a tablecloth (your finger is perpendicular to the table, of course), and then rotating your finger. Produces a whirlpool on the image." $@

autocrop:	autocrop.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "AutoCrop" $@
	addattr category "•Output" $@
#	addattr category "Transforms" $@
	addattr GIMP_AUTHOR "Torsten Martinsen" $@
	addattr GIMP_EMAIL "bullestock@dk-online.dk" $@
	addattr GIMP_DESC "Remove any borders from the image." $@

bcg:	bcg.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "BCG" $@
	addattr category "Color Map" $@
	addattr GIMP_EMAIL "aspirin@tigerden.com, 94024831@athene.mit.csu.edu.au, quartic@polloux.fciencias.unam.mx" $@
	addattr GIMP_DESC "Allows the image gamma, brightness, and contrast to be adjusted.  The gamma of each channel may be set independantly." $@


blackwhite:	blackwhite.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "BlackWhite" $@
	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "Marc Bless" $@
	addattr GIMP_EMAIL "bless@ai-lab.fh-furtwangen.de" $@
	addattr GIMP_DESC "Sets color values below a threshold to 0 (black), color value above to 255 (white). With rgb-option enabled it operates on each rgb-part instead of the whole triplet." $@

blur2:	blur2.o $(OBJS)
	# OK
	$(LD) -o blur2 blur2.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Variable Blur" $@
	addattr category "Blur" $@
	addattr GIMP_AUTHOR "Torsten Martinsen" $@
	addattr GIMP_EMAIL "bullestock@dk-online.dk" $@
	addattr GIMP_DESC "Blur an image, using variable size convolution kernel." $@

c_astretch:	c_astretch.o $(OBJS)
	# OK (can be very subtle)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Contrast Autostretch (normalize)" $@
	addattr category "Color Map" $@
	addattr GIMP_AUTHOR "Federico Mena Quintero" $@
	addattr GIMP_EMAIL "quartic@polloux.fciencias.unam.mx" $@
	addattr GIMP_DESC "This simple plug-in does an automatic contrast stretch.  For each channel in the image, it finds the minimum and maximum values... it uses those values to stretch the individual histograms to the full contrast range.  For some images it may do just what you want; for others it may be total crap :)" $@

compose:	compose.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Compose" $@
	addattr category "•Multi-input" $@
#	addattr category "Transforms" $@
	addattr GIMP_DESC "Compose 3-4 grayscale images into an rgb image" $@
	addattr GIMP_AUTHOR "Peter Kirchgessner" $@

contintp:	contintp.o $(OBJS)
	# Requires Grayscale Image
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Contour interpolation" $@
	addattr category "•Multi-input" $@
#	addattr category "Miscellaneous" $@
	addattr GIMP_DESC "Generates a grayscale heightfield from a contour map.  This is based loosely on 'levcon' by Kari Kivisalo (kkivisal@cc.hut.fi), although I completely reimplemented the basic algorithm (and added a few twists)." $@
	addattr GIMP_AUTHOR "John A. Breen" $@
	addattr GIMP_EMAIL "jab3@cec.wustl.edu" $@

contour:	contour.o $(OBJS)
	# Requires Grayscale Image
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Contours" $@
	addattr category "•Output" $@
#	addattr category "Miscellaneous" $@
	addattr GIMP_DESC "Generates a contour map from a grayscale height field." $@
	addattr GIMP_AUTHOR "John A. Breen" $@
	addattr GIMP_EMAIL "jab3@cec.wustl.edu" $@

darkest:	darkest.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Darkest" $@
	addattr category "•Multi-input" $@
#	addattr category "Channel Ops" $@
	addattr GIMP_DESC "Takes the darker pixel of the 2 input images and outputs them." $@
	addattr GIMP_AUTHOR "Zachary Beane" $@
	addattr GIMP_EMAIL "xach@mint.net" $@

decompose:	decompose.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Decompose" $@
	addattr category "•Output" $@
#	addattr category "Transforms" $@
	addattr GIMP_AUTHOR "Peter Kirchgessner" $@
	addattr GIMP_DESC "Decompose a color image into its constituent channels: RGB, HVS, CMY, CMYK." $@

degrade:	degrade.o $(OBJS)
	# Ugly crasher?
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Degrade Color Depth" $@
	addattr category "Color Map" $@
	addattr GIMP_AUTHOR "Adam D. Moss" $@
	addattr GIMP_EMAIL "aspirin@tigerden.com" $@
	addattr GIMP_DESC "Allows fine reduction of the colour resolution of an image" $@

despeckle:	despeckle.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Despeckle" $@
	addattr category "Sharpen" $@
	addattr GIMP_AUTHOR "Ian Tester" $@
	addattr GIMP_EMAIL "94024831@postoffice.csu.edu.au" $@
	addattr GIMP_DESC "Uses the classic \"De-speckle\" algorithm, which I believe was first used by JPL and NASA to remove drop-outs from data sent back from the early planetary space probes.  It simply goes along each pixel, taking the average of the surrounding 8-neighbor pixels. if the difference between the "current" pixel and that average is greater that a certain tolerence, replace it with the average." $@

displace:	displace.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Displace" $@
	addattr category "•Multi-input" $@
#	addattr category "Distortion" $@
	addattr GIMP_AUTHOR "Stephen Robert Norris" $@
	addattr GIMP_EMAIL "srn@flibble.cs.su.oz.au" $@
	addattr GIMP_DESC "Can use one or two images as displacement maps." $@

engrave:	engrave.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Engrave" $@
	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "Torsten Martinsen" $@
	addattr GIMP_EMAIL "bullestock@dk-online.dk" $@
	addattr GIMP_DESC "Creates a black-and-white 'engraved' version of an image." $@

fade:	fade.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Fade" $@
	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "Marc Bless" $@
	addattr GIMP_EMAIL "bless@ai-lab.fh-furtwangen.de" $@
	addattr GIMP_DESC "Fades out to a border colour." $@

gauss_recurse:	gauss_recurse.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Gaussian Blur" $@
	addattr category "Blur" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@
	addattr GIMP_DESC "New gaussian blur, much faster for larger radii." $@

histogram:	histogram.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Histogram" $@
	addattr category "•Output" $@
#	addattr category "Color Map" $@
	addattr GIMP_DESC "Renders a histogram of either a grayscale or rgb color image showing the shade distribution (intended for use with the Levels plugin)." $@
	addattr GIMP_AUTHOR "Ed Connel" $@
	addattr GIMP_EMAIL "econnel@uoft02.utoledo.edu" $@

imgsplit:	imgsplit.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Image Split" $@
	addattr category "•Output" $@
#	addattr category "Miscellaneous" $@
	addattr GIMP_AUTHOR "Danny Sung" $@
	addattr GIMP_EMAIL "dannys@ucla.edu" $@
	addattr GIMP_DESC "This is a simple plug-in that will cut an image into MxN pieces" $@

interpolate:	interpolate.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Interpolate/Extrapolate" $@
	addattr category "•Multi-input" $@
#	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "Federico Mena Quintero" $@
	addattr GIMP_EMAIL "quartic@polloux.fciencias.unam.mx" $@
	addattr GIMP_DESC "Interpolate between two images, or, more interestingly, extrapolate aprogression or inverse function effect from two images." $@

levels:	levels.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Levels" $@
	addattr category "•Output" $@
#	addattr category "Color Map" $@
	addattr GIMP_AUTHOR "Ed Connell & Kris Wehner" $@
	addattr GIMP_EMAIL "ed@lucas.further.com, econnel@uoft02.utoledo.edu" $@
	addattr GIMP_DESC "Turns dark grays to black and light grays to white" $@

lightest:	lightest.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Lightest" $@
	addattr category "•Multi-input" $@
#	addattr category "Channel Ops" $@
	addattr GIMP_AUTHOR "Zachary Beane" $@
	addattr GIMP_EMAIL "xach@mint.net" $@
	addattr GIMP_DESC "Takes the lightest pixel of the 2 input images and outputs them" $@

lighting:	lighting.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Lighting" $@
	addattr category "•Multi-input" $@
#	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "Tom Bech & Federico Mena Quintero (Quartic)" $@
	addattr GIMP_EMAIL "tomb@ii.uib.no, federico@nuclecu.unam.mx" $@
	addattr GIMP_DESC "Apply various lighting and refraction effects to a picture" $@

median:	median.o $(OBJS)
	# OK -- Doesn't seem like a sharpen to me.
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Median" $@
	addattr category "Sharpen" $@
	addattr GIMP_AUTHOR "Ian Tester" $@
	addattr GIMP_EMAIL "94024831@postoffice.csu.edu.au" $@
	addattr GIMP_DESC "This plug-in goes along each pixel, taking the median of the surrounding 8-neighbor pixels and the "current" pixel" $@

mosaic:	mosaic.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Mosaic" $@
	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "Spencer Kimball" $@
	addattr GIMP_EMAIL "bullestock@dk-online.dk" $@
	addattr GIMP_DESC "Transforms an image into what appears to be a mosaic, composed of small primitives, each of constant color and of an approximate size." $@

noisify:	noisify.o $(OBJS)
	# OK - Lock RGB doesn't happen immediately.
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Add Noise" $@
	addattr category "Noise" $@
	addattr GIMP_AUTHOR "Torsten Martinsen" $@
	addattr GIMP_EMAIL "bullestock@dk-online.dk" $@
	addattr GIMP_DESC "This filter adds random noise to an image. The amount of noise can be set individually for each RGB channel." $@

pagecurl:	pagecurl.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Page Curl" $@
	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "Federico Mena Quintero" $@
	addattr GIMP_EMAIL "quartic@polloux.fciencias.unam.mx" $@
	addattr GIMP_DESC "This plug-in does the well-known \"page curl\" effect (a la KPT). It is likewhen you curl one of the corners of a sheet of paper." $@

pinch:	pinch.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Pinch" $@
	addattr category "Distortion" $@
	addattr GIMP_AUTHOR "Federico Mena Quintero" $@
	addattr GIMP_EMAIL "quartic@polloux.fciencias.unam.mx" $@
	addattr GIMP_DESC "Similar to Photoshop's 'Pinch' filter. Imagine having an elastic cloth and pressing your finger into it (to the 'inside'), or pushing it from behind (to the 'outside')." $@

polar:	polar.o $(OBJS)
	# OK? Polar to Rectangular??? -- Seems to misuse selection bounds
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Polar" $@
	addattr category "Distortion" $@
	addattr GIMP_AUTHOR "Marc Bless" $@
	addattr GIMP_EMAIL "bless@ai-lab.fh-furtwangen.de" $@
	addattr GIMP_DESC "Converts an image from rectangular to polar." $@

prep4tile:	prep4tile.o $(OBJS)
	# OK
	$(LD) -o prep4tile prep4tile.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Prep4Tile" $@
	addattr category "Transforms" $@
	addattr GIMP_DESC "Transform borders colours, such that tiling image is seamless" $@

quant:	quant.o $(OBJS)
	# Doesn't compile!  GCC-ism
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Quant" $@
	addattr category "Color Map" $@
	addattr GIMP_AUTHOR "Matthias Clasen" $@
	addattr GIMP_EMAIL "stu30917@mail.uni-kiel.d400.de" $@
	addattr GIMP_DESC "Implements a variation of the quantization algorithm that is described in the article: Xiaolin Wu, Color Quantization by Dynamic Programming and Principal Analysis, ACM Transactions on Graphics, Vol. 11, No. 4 (1992)." $@

ripple:	ripple.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Ripple" $@
	addattr category "Distortion" $@
	addattr GIMP_AUTHOR "Torsten Martinsen" $@
	addattr GIMP_EMAIL "bullestock@dk-online.dk" $@
	addattr GIMP_DESC "Displaces each row of the image according to a sine function, producing an undulating effect. The frequency and amplitude of the sine wave can be adjusteddisplaces each row of the image according to a sine function, producing an undulating effect. The frequency and amplitude of the sine wave can be adjusted." $@

rot180:	rot180.o $(OBJS)
	# OK
	$(LD) -o rot180 rot180.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Rotate 180°" $@
	addattr category "Transforms" $@
	addattr GIMP_AUTHOR "Ian Tester" $@
	addattr GIMP_EMAIL "94024831@postoffice.csu.edu.au" $@
	addattr GIMP_DESC "Rotates the whole image by 180 degrees" $@

rot90ccw:	rot90ccw.o $(OBJS)
	$(LD) -o rot90ccw rot90ccw.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Rot90CCW" $@
	addattr category "•Output" $@
#	addattr category "Transforms" $@
	addattr GIMP_AUTHOR "Ian Tester" $@
	addattr GIMP_EMAIL "94024831@postoffice.csu.edu.au" $@
	addattr GIMP_DESC "Rotates the whole image by 90 degrees in the counter-clock-wise direction, creating a new image" $@

rot90cw:	rot90cw.o $(OBJS)
	$(LD) -o rot90cw rot90cw.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Rot90CW" $@
	addattr category "•Output" $@
#	addattr category "Transforms" $@
	addattr GIMP_AUTHOR "Ian Tester" $@
	addattr GIMP_EMAIL "94024831@postoffice.csu.edu.au" $@
	addattr GIMP_DESC "Rotates the whole image by 90 degrees in the clock-wise direction, creating a new image" $@

rothue:	rothue.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Rotate Hue" $@
	addattr category "Color Map" $@
	addattr GIMP_AUTHOR "Ian Tester" $@
	addattr GIMP_EMAIL "94024831@postoffice.csu.edu.au" $@
	addattr GIMP_DESC "\"Rotates\" the hue of an RGB image." $@

superzoom:	superzoom.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Superzoom" $@
	addattr category "•Output" $@
#	addattr category "Transforms" $@
	addattr GIMP_AUTHOR "Adam Moss" $@
	addattr GIMP_EMAIL "adam@fox.org" $@

threshold:	threshold.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Threshold" $@
	addattr category "Transforms" $@
	addattr GIMP_AUTHOR "Ian Tester" $@
	addattr GIMP_EMAIL "94024831@postoffice.csu.edu.au" $@
	addattr GIMP_DESC "Takes any pixels larger than a threshold and sets them to the maximum value (i.e 255), the rest are set to 0." $@

to-indexed:	to-indexed.o $(OBJS) fsdither.h
	$(LD) -o to-indexed to-indexed.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "To Indexed" $@
	addattr category "•Output" $@
#	addattr category "Color Map" $@
	addattr GIMP_DESC "Takes a grayscale or rgb input image and creates a new indexed color image" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

warp:	warp.o $(OBJS)
	# BOOM
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Warp" $@
	addattr category "•Multi-input" $@
#	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "John Beale" $@
	addattr GIMP_EMAIL "beale@best.com" $@
	addattr GIMP_DESC "Twists an image according to the gradient of a control matrix. By an iterative method generates fluid smears, turbulent whorls. Imagine painting your image on the surface of a bowl of soup and then stirring" $@

dplasma:	dplasma.o $(OBJS)
	# Selection probs
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Difference Plasma" $@
	addattr category "Miscellaneous" $@
	addattr GIMP_AUTHOR "Andrew Kieschnick" $@
	addattr GIMP_EMAIL "andrewk@mail.utexas.edu" $@
	addattr GIMP_DESC "Hack of the plasma plug-in to produce \"difference clouds\".  original code by <srn@flibble.cs.su.oz.au>.     Uses foreground and background as colors for "cloud".  You generally get more of the foreground color than of the background color - call it a bug or a feature :)" $@

	
charcoal:	charcoal.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Charcoalify" $@
	addattr category "•Multi-sheet" $@
#	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "Andrew Kieschnick" $@
	addattr GIMP_EMAIL "andrewk@mail.utexas.edu" $@
	addattr GIMP_DESC "Produces an image that looks like a charcoal drawing." $@

deinterlace:	deinterlace.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "De-interlace" $@
	addattr category "Miscellaneous" $@
	addattr GIMP_AUTHOR "Federico Mena Quintero" $@
	addattr GIMP_EMAIL "quartic@polloux.fciencias.unam.mx" $@
	addattr GIMP_DESC "When an image is taken from a video capture (f.i. a freeze-frame), sometimes only either the odd or the even fields get captured, resulting in an image which, line by line, is data-black-data-black-etc.  This plug-in does an interpolation between the odd or even lines in an image to correct this." $@

plasma:	plasma.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Plasma" $@
	addattr category "Render" $@
	addattr GIMP_AUTHOR "Stephen Norris" $@
	addattr GIMP_EMAIL "srn@flibble.cs.su.oz.au" $@
	addattr GIMP_DESC "Produces plasma fractal images. The algorithm is losely based on a description of the fractint algorithm, but completely re-implemented because the fractint code was too ugly to read :)" $@

checkerboard:	checkerboard.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Checkerboard" $@
	addattr category "Render" $@
	addattr GIMP_AUTHOR "Brent Burton" $@
	addattr GIMP_EMAIL "brentb@io.com" $@
	addattr GIMP_DESC "Creates a checkerboard pattern using squares of variable size.  Also, the user can specify a regular checker pattern or the ramped (1,2,3,4,...,N,...,4,3,2,1,2,3....) pattern." $@

sparkl:		sparkl.o hsltorgb.o $(OBJS) hcon.h hf_io.h gems.h
	# OK
	$(LD) -o $@ sparkl.o hsltorgb.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Sparkle" $@
	addattr category "Artistic" $@
	addattr GIMP_AUTHOR "John Beale, Michael J. Hammel" $@
	addattr GIMP_EMAIL "mjhammel@csn.net" $@
	addattr GIMP_DESC "Simulate pixel bloom and diffraction effects" $@

relief:	relief.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Relief" $@
	addattr category "Miscellaneous" $@
	addattr GIMP_AUTHOR "Wilson H. Bent, Jr, Peter Mattis" $@
	addattr GIMP_DESC "Generate a relief map" $@

invert:	invert.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Invert" $@
	addattr category "Color Map" $@
	addattr GIMP_DESC "Simply inverts the input image" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

rotate:	rotate.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Rotate" $@
	addattr category "•Output" $@
#	addattr category "Transforms" $@
	addattr GIMP_DESC "Rotates an image, creating a new image" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

bleed:	bleed.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Bleed" $@
	addattr category "Color Map" $@
	addattr GIMP_DESC "Acts as a low pass filter on the color components of the provided region" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

difference:	difference.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Difference" $@
	addattr category "•Multi-input" $@
#	addattr category "GIMP" $@
	addattr GIMP_DESC "Takes the absolute value of the difference between corresponding pixels of the 2 input images" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

duplicate:	duplicate.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Duplicate" $@
	addattr category "•Output" $@
#	addattr category "GIMP" $@
	addattr GIMP_DESC "Duplicates the input image" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

multiply:	multiply.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Multiply" $@
	addattr category "•Multi-input" $@
#	addattr category "GIMP" $@
	addattr GIMP_DESC "Multiplies corresponding pixels of the 2 input images together." $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

offset:	offset.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Offset" $@
	addattr category "•Output" $@
#	addattr category "GIMP" $@
	addattr GIMP_DESC "Duplicates and offsets the input image" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

grayify:	grayify.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Grayify" $@
	addattr category "Miscellaneous" $@
	addattr GIMP_DESC "Converts the provided region to grayscale assuming the original image was color" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

gamma:	gamma.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Gamma Correction" $@
	addattr category "Color Map" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

flip_horz:	flip_horz.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Flip Horizontally" $@
	addattr category "Transforms" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

flip_vert:	flip_vert.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Flip Vertically" $@
	addattr category "Transforms" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

edge:	edge.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Edge" $@
	addattr category "Miscellaneous" $@
	addattr GIMP_AUTHOR "Jef Poskanzer, Peter Mattis" $@
	addattr GIMP_DESC "Performs edge detection on the input image" $@

enhance:	enhance.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Enhance" $@
	addattr category "Sharpen" $@
	addattr GIMP_AUTHOR "Jef Poskanzer, Peter Mattis" $@
	addattr GIMP_DESC "Enhances or sharpens the input image" $@

composite:	composite.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Composite" $@
	addattr category "•Multi-input" $@
#	addattr category "GIMP" $@
	addattr GIMP_DESC "Composites two images together using a third image as a mask" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

blend:	blend.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Blend" $@
	addattr category "•Multi-input" $@
#	addattr category "GIMP" $@
	addattr GIMP_DESC "Blends two images together." $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

add:	add.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Add" $@
	addattr category "•Multi-input" $@
#	addattr category "GIMP" $@
	addattr GIMP_AUTHOR "Spencer Kimball and Peter Mattis" $@
	addattr GIMP_EMAIL "gimp@xcf.berkeley.edu" $@

lic: lic.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Line Integral Convolution" $@
	addattr category "•Multi-input" $@
#	addattr category "Effects" $@
	addattr GIMP_DESC "This plug-in implements the Line Integral Convolution (LIC) as described in Cabral et al. \"Imaging vector fields using line integral convolution\" in the Proceedings of ACM SIGGRAPH 93. Publ. by ACM, New York, NY, USA. p. 263-270. Some of the code is based on code by Steinar Haugen (thanks!), the Perlin noise function is practically ripped as is :)" $@
	addattr GIMP_AUTHOR "Tom Bech" $@
	addattr GIMP_EMAIL "tomb@ii.uib.no" $@

bumpmap:	bumpmap.o $(OBJS)
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Bumpmap" $@
	addattr category "•Multi-input" $@
#	addattr category "Effects" $@
	addattr GIMP_AUTHOR "Federico Mena Quintero" $@
	addattr GIMP_EMAIL "quartic@polloux.fciencias.unam.mx" $@
	addattr GIMP_DESC "This plug-in uses the algorithm described by John Schlag, \"Fast Embossing Effects on Raster Image Data\" in Graphics Gems IV (ISBN 0-12-336155-9).  It takes a grayscale image to be applied as a bump-map to another image, producing a nice embossing effect.." $@

solarize: solarize.o $(OBJS)
	# OK
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Solarize" $@
	addattr category "Color Map" $@
	addattr GIMP_AUTHOR "Torsten Martinsen" $@
	addattr GIMP_EMAIL "bullestock@dk-online.dk" $@
	addattr GIMP_DESC "Solarize an image." $@

transp: transp.o $(OBJS)
	# Not GPL
	$(LD) -o $@ $@.o $(OBJS) $(LDFLAGS)
	mimeset $@
	addattr name "Transparentize" $@
	addattr category "Miscellaneous" $@
	addattr GIMP_AUTHOR "Gobe Software, Inc." $@
	addattr GIMP_EMAIL "productive@gobe.com" $@
	addattr GIMP_DESC "Changes the pixels matching the foreground color to transparent." $@
