--- a/filter.h
+++ b/filter.h
@@ -20,7 +20,6 @@
 #ifndef FILTER_H
 #define FILTER_H
 
-
 #include <math.h>
 #include <stdio.h>
 #include <stdarg.h>
@@ -89,7 +88,7 @@
 #define MAX_FISHEYE_FOV		179.0
 
 extern int JavaUI; // Flag to indicate use of java dialogs
-void JPrintError( char* text );
+PANO13_IMPEX void JPrintError( char* text );
 
 #define FAST_TRANSFORM_STEP_NORMAL	40
 #define FAST_TRANSFORM_STEP_MORPH	6
@@ -478,7 +477,7 @@
 
 
 	
-void filter_main( TrformStr *TrPtr, sPrefs *spref);	
+PANO13_IMPEX void filter_main( TrformStr *TrPtr, sPrefs *spref);	
 
 
 // Transformation function type (we have only one...)
@@ -558,11 +557,11 @@
 //---------------------------------- Functions identical in all platforms ------------------------
 
 
-void 	dispatch 	(TrformStr *TrPtr, sPrefs *s);	   // Entry into platform independent code
-void 	DoTransForm	(TrformStr *TrPtr, panoPrefs *p );
-
-void setLibToResFile  ( void );			// MacOS: Get resources from shared lib
-void unsetLibToResFile( void );			// MacOS: Don't get resources from shared lib
+PANO13_IMPEX void 	dispatch 	(TrformStr *TrPtr, sPrefs *s);	   // Entry into platform independent code
+PANO13_IMPEX void 	DoTransForm	(TrformStr *TrPtr, panoPrefs *p );
+
+PANO13_IMPEX void setLibToResFile  ( void );			// MacOS: Get resources from shared lib
+PANO13_IMPEX void unsetLibToResFile( void );			// MacOS: Don't get resources from shared lib
 
 enum{					// Enumerates used by Progress and infoDlg
 	_initProgress,   	// display message "argument"
@@ -571,113 +570,112 @@
 	_idleProgress		// do nothing; on Mac: call waitnextevent;
 	};
 
-void PT_setProgressFcn(int (*ptr)(int, char *));           // set custom progress callback
-int 	Progress( int command, char* argument );	// Progress Reporting 
-void PT_setInfoDlgFcn(int (*ptr)(int, char *));            // set custom info callback
-int 	infoDlg ( int command, char* argument );	// Display info: same argumenmts as progress
-void PT_setErrorFcn( void (*ptr)( char* , va_list va));         // set custom error function
-void  	PrintError( char* fmt, ...);				// Error Reporting
-void dieWithError(char*fmt, ...);
-
-int 	ccommand( char ***argvPtr);					// Shell for standalone programs
+PANO13_IMPEX void PT_setProgressFcn(int (*ptr)(int, char *));           // set custom progress callback
+PANO13_IMPEX int 	Progress( int command, char* argument );	// Progress Reporting 
+PANO13_IMPEX void PT_setInfoDlgFcn(int (*ptr)(int, char *));            // set custom info callback
+PANO13_IMPEX int 	infoDlg ( int command, char* argument );	// Display info: same argumenmts as progress
+PANO13_IMPEX void PT_setErrorFcn( void (*ptr)( char* , va_list va));         // set custom error function
+PANO13_IMPEX void  	PrintError( char* fmt, ...);				// Error Reporting
+PANO13_IMPEX void dieWithError(char*fmt, ...);
+
+PANO13_IMPEX int 	ccommand( char ***argvPtr);					// Shell for standalone programs
 
 
 //  Panorama Tool functions
 
 
-void 	perspective	(TrformStr *TrPtr, pPrefs *p); 	
-void 	correct		(TrformStr *TrPtr, cPrefs *c);  
-void 	remap		(TrformStr *TrPtr, rPrefs *r); 
-void 	adjust		(TrformStr *TrPtr, aPrefs *a); 
-void 	pan			(TrformStr *TrPtr, panControls *pc);
-
-
-
+PANO13_IMPEX void 	perspective	(TrformStr *TrPtr, pPrefs *p); 	
+PANO13_IMPEX void 	correct		(TrformStr *TrPtr, cPrefs *c);  
+PANO13_IMPEX void 	remap		(TrformStr *TrPtr, rPrefs *r); 
+PANO13_IMPEX void 	adjust		(TrformStr *TrPtr, aPrefs *a); 
+PANO13_IMPEX void 	pan			(TrformStr *TrPtr, panControls *pc);
 
 // Set Struct defaults
 
-void    SetPrefDefaults			(panoPrefs *prPtr,  int selector);
-void 	SetCorrectDefaults		( cPrefs *p );
-void 	SetAdjustDefaults		( aPrefs *p );
-void 	SetRemapDefaults		( rPrefs *p );
-void 	SetPerspectiveDefaults	( pPrefs *p );
-void 	SetImageDefaults		( Image *im);
-void	SetOptDefaults			( optVars *opt );
-void	SetPanDefaults			( panControls *pc);
-void 	SetSizeDefaults			( sPrefs *pref);
-void	SetStitchDefaults		( stBuf *sbuf);
-void	SetVRPanoOptionsDefaults( VRPanoOptions *v);
-void 	SettMatrixDefaults		( tMatrix *t );
-void 	SetCoordDefaults		( CoordInfo *c, int num);
-
-int		SetAlignParams			( double *x );
-int 	SetLMParams				( double *x );
-void 	SetGlobalPtr			( AlignInfo *p );
-
+PANO13_IMPEX void    SetPrefDefaults			(panoPrefs *prPtr,  int selector);
+PANO13_IMPEX void 	SetCorrectDefaults		( cPrefs *p );
+PANO13_IMPEX void 	SetAdjustDefaults		( aPrefs *p );
+PANO13_IMPEX void 	SetRemapDefaults		( rPrefs *p );
+PANO13_IMPEX void 	SetPerspectiveDefaults	( pPrefs *p );
+PANO13_IMPEX void 	SetImageDefaults		( Image *im);
+PANO13_IMPEX void	SetOptDefaults			( optVars *opt );
+PANO13_IMPEX void	SetPanDefaults			( panControls *pc);
+PANO13_IMPEX void 	SetSizeDefaults			( sPrefs *pref);
+PANO13_IMPEX void	SetStitchDefaults		( stBuf *sbuf);
+PANO13_IMPEX void	SetVRPanoOptionsDefaults( VRPanoOptions *v);
+PANO13_IMPEX void 	SettMatrixDefaults		( tMatrix *t );
+PANO13_IMPEX void 	SetCoordDefaults		( CoordInfo *c, int num);
+
+PANO13_IMPEX int    SetAlignParams			( double *x );
+PANO13_IMPEX int 	SetLMParams				( double *x );
+PANO13_IMPEX void 	SetGlobalPtr			( AlignInfo *p );
+
+PANO13_IMPEX int    CheckParams( AlignInfo *g );
+PANO13_IMPEX void   setFcnPanoHuberSigma(double sigma);
 
 
 // Dialogs
-int 	SetPrefs		( panoPrefs *p );
-int	SetPanPrefs		( panControls *p );
-int 	SetCorrectPrefs		( cPrefs *p );
-int 	SetRadialOptions	( cPrefs *p );
-int 	SetHorizontalOptions	( cPrefs *p );
-int 	SetVerticalOptions	( cPrefs *p );
-int 	SetShearOptions		( cPrefs *p );
-int 	SetScaleOptions		( cPrefs *p );
-int 	SetLumOptions		( cPrefs *p );
-int 	setSizePrefs		( sPrefs *p, int can_resize );
-int 	SetRemapPrefs		( rPrefs *p );
-int 	SetPerspectivePrefs	( pPrefs *p );
-int 	SetAdjustPrefs		( aPrefs *p );
-int 	SetInterpolator		( sPrefs *p );
-int 	SetCreateOptions	( aPrefs *p );
-int 	SetCutOptions		( cPrefs *p );
-int 	SetFourierOptions	( cPrefs *p );
+PANO13_IMPEX int 	SetPrefs		( panoPrefs *p );
+PANO13_IMPEX int	SetPanPrefs		( panControls *p );
+PANO13_IMPEX int 	SetCorrectPrefs		( cPrefs *p );
+PANO13_IMPEX int 	SetRadialOptions	( cPrefs *p );
+PANO13_IMPEX int 	SetHorizontalOptions	( cPrefs *p );
+PANO13_IMPEX int 	SetVerticalOptions	( cPrefs *p );
+PANO13_IMPEX int 	SetShearOptions		( cPrefs *p );
+PANO13_IMPEX int 	SetScaleOptions		( cPrefs *p );
+PANO13_IMPEX int 	SetLumOptions		( cPrefs *p );
+PANO13_IMPEX int 	setSizePrefs		( sPrefs *p, int can_resize );
+PANO13_IMPEX int 	SetRemapPrefs		( rPrefs *p );
+PANO13_IMPEX int 	SetPerspectivePrefs	( pPrefs *p );
+PANO13_IMPEX int 	SetAdjustPrefs		( aPrefs *p );
+PANO13_IMPEX int 	SetInterpolator		( sPrefs *p );
+PANO13_IMPEX int 	SetCreateOptions	( aPrefs *p );
+PANO13_IMPEX int 	SetCutOptions		( cPrefs *p );
+PANO13_IMPEX int 	SetFourierOptions	( cPrefs *p );
 
 
 
 // File I/O
 
-int 	readPrefs			(char* p, int selector );   			// Preferences, same selector as dispatch
-void 	writePrefs			(char* p, int selector );   			// Preferences, same selector as dispatch
-
-int	LoadBufImage		( Image *image, char *fname, int mode);
-int	SaveBufImage		( Image *image, char *fname );
-int writeCroppedTIFF    ( Image *im, fullPath *sfile, CropInfo *crop_info);
-int	writeTIFF			( Image *im, fullPath *fname);			// On Mac: fname is FSSpec*				
-void 	SaveOptions			( struct correct_Prefs * thePrefs );
-int 	LoadOptions			( struct correct_Prefs * thePrefs );
-void  	FindScript			( struct adjust_Prefs *thePrefs );
-char* 	LoadScript			( fullPath* scriptFile  );
-int 	WriteScript			( char* res, fullPath* scriptFile, int launch );
+PANO13_IMPEX int 	readPrefs			(char* p, int selector );   			// Preferences, same selector as dispatch
+PANO13_IMPEX void 	writePrefs			(char* p, int selector );   			// Preferences, same selector as dispatch
+
+PANO13_IMPEX int	LoadBufImage		( Image *image, char *fname, int mode);
+PANO13_IMPEX int	SaveBufImage		( Image *image, char *fname );
+PANO13_IMPEX int writeCroppedTIFF    ( Image *im, fullPath *sfile, CropInfo *crop_info);
+PANO13_IMPEX int	writeTIFF			( Image *im, fullPath *fname);			// On Mac: fname is FSSpec*				
+PANO13_IMPEX void 	SaveOptions			( struct correct_Prefs * thePrefs );
+PANO13_IMPEX int 	LoadOptions			( struct correct_Prefs * thePrefs );
+PANO13_IMPEX void  	FindScript			( struct adjust_Prefs *thePrefs );
+PANO13_IMPEX char* 	LoadScript			( fullPath* scriptFile  );
+PANO13_IMPEX int 	WriteScript			( char* res, fullPath* scriptFile, int launch );
 // Write PSB and PSD files
-int 	writePS 			( Image *im, fullPath* fname, Boolean bBig );			// On Mac: fname is FSSpec*	
-int 	writePSD			( Image *im, fullPath* fname );
-int 	readPSD				( Image *im, fullPath* fname, int mode); // Can handle both PSD and PSB
-int 	writePSwithLayer	( Image *im, fullPath *fname, Boolean bBig);
-int 	writePSDwithLayer	( Image *im, fullPath *fname);
-int 	addLayerToFile		( Image *im, fullPath* sfile, fullPath* dfile, stBuf *sB); //works with PSD & PSB
-int 	readPSDMultiLayerImage( MultiLayerImage *mim, fullPath* sfile);
-int 	FindFile			( fullPath *fname );
-int 	SaveFileAs			( fullPath *fname, char *prompt, char *name );
-void 	ConvFileName		( fullPath *fname,char *string);
-void 	showScript			( fullPath* scriptFile );
-void 	MakeTempName		( fullPath *fspec, char *fname );
-void 	makePathForResult	( fullPath *path );
-int 	makePathToHost 		( fullPath *path );
-void    open_selection		( fullPath *path );
-int 	GetFullPath 		(fullPath *path, char *filename); // Somewhat confusing, for compatibility easons
-int 	StringtoFullPath	(fullPath *path, char *filename);
-int 	IsTextFile			( char* fname );
-int 	readPositions		( char* script, transformCoord *tP );
-int	readJPEG			( Image *im, fullPath *sfile );
-int	readTIFF			( Image *im, fullPath *sfile );
-int 	writeJPEG			( Image *im, fullPath *sfile, 	int quality, int progressive );
-int 	writePNG			( Image *im, fullPath *sfile );
-int 	readPNG				( Image *im, fullPath *sfile );
-int 	LaunchAndSendScript(char* application, char* script);
-aPrefs* readAdjustLine( fullPath *theScript );
+PANO13_IMPEX int 	writePS 			( Image *im, fullPath* fname, Boolean bBig );			// On Mac: fname is FSSpec*	
+PANO13_IMPEX int 	writePSD			( Image *im, fullPath* fname );
+PANO13_IMPEX int 	readPSD				( Image *im, fullPath* fname, int mode); // Can handle both PSD and PSB
+PANO13_IMPEX int 	writePSwithLayer	( Image *im, fullPath *fname, Boolean bBig);
+PANO13_IMPEX int 	writePSDwithLayer	( Image *im, fullPath *fname);
+PANO13_IMPEX int 	addLayerToFile		( Image *im, fullPath* sfile, fullPath* dfile, stBuf *sB); //works with PSD & PSB
+PANO13_IMPEX int 	readPSDMultiLayerImage( MultiLayerImage *mim, fullPath* sfile);
+PANO13_IMPEX int 	FindFile			( fullPath *fname );
+PANO13_IMPEX int 	SaveFileAs			( fullPath *fname, char *prompt, char *name );
+PANO13_IMPEX void 	ConvFileName		( fullPath *fname,char *string);
+PANO13_IMPEX void 	showScript			( fullPath* scriptFile );
+PANO13_IMPEX void 	MakeTempName		( fullPath *fspec, char *fname );
+PANO13_IMPEX void 	makePathForResult	( fullPath *path );
+PANO13_IMPEX int 	makePathToHost 		( fullPath *path );
+PANO13_IMPEX void    open_selection		( fullPath *path );
+PANO13_IMPEX int 	GetFullPath 		(fullPath *path, char *filename); // Somewhat confusing, for compatibility easons
+PANO13_IMPEX int 	StringtoFullPath	(fullPath *path, char *filename);
+PANO13_IMPEX int 	IsTextFile			( char* fname );
+PANO13_IMPEX int 	readPositions		( char* script, transformCoord *tP );
+PANO13_IMPEX int	readJPEG			( Image *im, fullPath *sfile );
+PANO13_IMPEX int	readTIFF			( Image *im, fullPath *sfile );
+PANO13_IMPEX int 	writeJPEG			( Image *im, fullPath *sfile, 	int quality, int progressive );
+PANO13_IMPEX int 	writePNG			( Image *im, fullPath *sfile );
+PANO13_IMPEX int 	readPNG				( Image *im, fullPath *sfile );
+PANO13_IMPEX int 	LaunchAndSendScript(char* application, char* script);
+PANO13_IMPEX aPrefs* readAdjustLine( fullPath *theScript );
 
 #ifdef __Mac__
 
@@ -687,232 +685,232 @@
 #endif
 
 //int	readtif(Image *im, TIFF* tif);
-void getCropInformation(char *filename, CropInfo *c);
+PANO13_IMPEX void getCropInformation(char *filename, CropInfo *c);
 
 // Read and Write Radiance HDR files
-int 	writeHDR			( Image *im, fullPath *sfile );
-int 	readHDR				( Image *im, fullPath *sfile );
+PANO13_IMPEX int 	writeHDR			( Image *im, fullPath *sfile );
+PANO13_IMPEX int 	readHDR				( Image *im, fullPath *sfile );
 
 #define FullPathtoString( path, string ) 		GetFullPath( path, string)
 
 
-int		ReadMorphPoints( char *script, AlignInfo *gl, int nIm );
+PANO13_IMPEX int		ReadMorphPoints( char *script, AlignInfo *gl, int nIm );
 
 // Image manipulation
 
-void 	addAlpha			( Image *im ); 
-void 	transForm			( TrformStr *TrPtr, fDesc *fD, int color);
-void 	transFormEx			( TrformStr *TrPtr, fDesc *fD, fDesc *finvD, int color, int imageNum);
-void    filter				( TrformStr *TrPtr, flfn func, flfn16 func16, void* params, int color);		
-void 	CopyImageData		( Image *dest, Image *src );
-void 	laplace				( Image *im );
-void 	blurr				( Image *im );
-void 	MakePano			( TrformStr *TrPtr, aPrefs *aP);
-void	MyMakePano			( TrformStr *TrPtr, aPrefs *aP, int imageNum );
-void 	ExtractStill		( TrformStr *TrPtr , aPrefs *p );
-int 	HaveEqualSize		( Image *im1, Image *im2 );
-int 	merge				( Image *dst, Image *src, int feather, int showprogress, int seam );
-void 	mergeAlpha			( Image *im, unsigned char *alpha, int feather, PTRect *theRect );
-void 	SetEquColor			( cPrefs *p );
-void 	CopyPosition		( Image *to, Image *from );
-int  	isColorSpecific		( cPrefs *p );
-void 	ThreeToFourBPP		( Image *im );
-void 	FourToThreeBPP		( Image *im );
-int 	SetUpGamma			( double pgamma, unsigned int psize);
-int 	cutTheFrame			( Image *dest, Image *src, int width, int height, int showprogress );
-int 	PositionCmp			( Image *im1, Image *im2 );
-int 	MorphImage			( Image *src, Image *dst, PTTriangle *ts, PTTriangle *td, int nt );
-int 	MorphImageFile		( fullPath *sfile, fullPath *dfile, AlignInfo *g,int nIm );
-int 	blendImages			( fullPath *f0,  fullPath *f1, fullPath *result, double s );
-int 	InterpolateImage	( Image *src, Image *dst, PTTriangle *ts, PTTriangle *td, int nt );
-int 	InterpolateTrianglesPerspective( AlignInfo *g, int nIm, double s, PTTriangle** t  );
-int 	InterpolateImageFile( fullPath *sfile, fullPath *dfile, AlignInfo *g,int nIm );
-void 	OneToTwoByte		( Image *im );
-void 	TwoToOneByte		( Image *im );
-void 	SetMakeParams           ( struct fDesc *stack, struct MakeParams *mp, Image *im , Image *pn, int color );
-void 	SetInvMakeParams	( struct fDesc *stack, struct MakeParams *mp, Image *im , Image *pn, int color );
+PANO13_IMPEX void 	addAlpha			( Image *im ); 
+PANO13_IMPEX void 	transForm			( TrformStr *TrPtr, fDesc *fD, int color);
+PANO13_IMPEX void 	transFormEx			( TrformStr *TrPtr, fDesc *fD, fDesc *finvD, int color, int imageNum);
+PANO13_IMPEX void    filter				( TrformStr *TrPtr, flfn func, flfn16 func16, void* params, int color);		
+PANO13_IMPEX void 	CopyImageData		( Image *dest, Image *src );
+PANO13_IMPEX void 	laplace				( Image *im );
+PANO13_IMPEX void 	blurr				( Image *im );
+PANO13_IMPEX void 	MakePano			( TrformStr *TrPtr, aPrefs *aP);
+PANO13_IMPEX void	MyMakePano			( TrformStr *TrPtr, aPrefs *aP, int imageNum );
+PANO13_IMPEX void 	ExtractStill		( TrformStr *TrPtr , aPrefs *p );
+PANO13_IMPEX int 	HaveEqualSize		( Image *im1, Image *im2 );
+PANO13_IMPEX int 	merge				( Image *dst, Image *src, int feather, int showprogress, int seam );
+PANO13_IMPEX void 	mergeAlpha			( Image *im, unsigned char *alpha, int feather, PTRect *theRect );
+PANO13_IMPEX void 	SetEquColor			( cPrefs *p );
+PANO13_IMPEX void 	CopyPosition		( Image *to, Image *from );
+PANO13_IMPEX int  	isColorSpecific		( cPrefs *p );
+PANO13_IMPEX void 	ThreeToFourBPP		( Image *im );
+PANO13_IMPEX void 	FourToThreeBPP		( Image *im );
+PANO13_IMPEX int 	SetUpGamma			( double pgamma, unsigned int psize);
+PANO13_IMPEX int 	cutTheFrame			( Image *dest, Image *src, int width, int height, int showprogress );
+PANO13_IMPEX int 	PositionCmp			( Image *im1, Image *im2 );
+PANO13_IMPEX int 	MorphImage			( Image *src, Image *dst, PTTriangle *ts, PTTriangle *td, int nt );
+PANO13_IMPEX int 	MorphImageFile		( fullPath *sfile, fullPath *dfile, AlignInfo *g,int nIm );
+PANO13_IMPEX int 	blendImages			( fullPath *f0,  fullPath *f1, fullPath *result, double s );
+PANO13_IMPEX int 	InterpolateImage	( Image *src, Image *dst, PTTriangle *ts, PTTriangle *td, int nt );
+PANO13_IMPEX int 	InterpolateTrianglesPerspective( AlignInfo *g, int nIm, double s, PTTriangle** t  );
+PANO13_IMPEX int 	InterpolateImageFile( fullPath *sfile, fullPath *dfile, AlignInfo *g,int nIm );
+PANO13_IMPEX void 	OneToTwoByte		( Image *im );
+PANO13_IMPEX void 	TwoToOneByte		( Image *im );
+PANO13_IMPEX void 	SetMakeParams           ( struct fDesc *stack, struct MakeParams *mp, Image *im , Image *pn, int color );
+PANO13_IMPEX void 	SetInvMakeParams	( struct fDesc *stack, struct MakeParams *mp, Image *im , Image *pn, int color );
 // same as SetInvMakeParams but includes Joosts inverted changes to SetMakeParams
-void 	SetInvMakeParamsCorrect( struct fDesc *stack, struct MakeParams *mp, Image *im , Image *pn, int color );
-
-void 	GetControlPointCoordinates(int i, double *x, double *y, AlignInfo *gl );
-void 	ARGBtoRGBA(uint8_t* buf, int width, int bitsPerPixel);
-void 	RGBAtoARGB(uint8_t* buf, int width, int bitsPerPixel);
-int 	CropImage(Image *im, PTRect *r);
-void 	DoColorCorrection( Image *im1, Image *im2, int mode );
+PANO13_IMPEX void 	SetInvMakeParamsCorrect( struct fDesc *stack, struct MakeParams *mp, Image *im , Image *pn, int color );
+
+PANO13_IMPEX void 	GetControlPointCoordinates(int i, double *x, double *y, AlignInfo *gl );
+PANO13_IMPEX void 	ARGBtoRGBA(uint8_t* buf, int width, int bitsPerPixel);
+PANO13_IMPEX void 	RGBAtoARGB(uint8_t* buf, int width, int bitsPerPixel);
+PANO13_IMPEX int 	CropImage(Image *im, PTRect *r);
+PANO13_IMPEX void 	DoColorCorrection( Image *im1, Image *im2, int mode );
 
 // Script Reading/Parsing/Writing
 
-int 	ParseScript			( char* script, AlignInfo *gl );
-void 	WriteResults		( char* script, fullPath *sfile, AlignInfo *g, double ds( int i) , int launch);
-int 	readAdjust		( aPrefs *p,  fullPath* sfile, int insert, sPrefs *sP );
-void 	readControlPoints	(char* script, controlPoint *c );
-int	getVRPanoOptions	( VRPanoOptions *v, char *line );
-void 	nextWord			( register char* word, char** ch );
-void 	nextLine			( register char* line, char** ch );
-int 	numLines			( char* script, char first );
-
-char *panoParserFindOLine(char *script, int index);
+PANO13_IMPEX int 	ParseScript			( char* script, AlignInfo *gl );
+PANO13_IMPEX void 	WriteResults		( char* script, fullPath *sfile, AlignInfo *g, double ds( int i) , int launch);
+PANO13_IMPEX int 	readAdjust		( aPrefs *p,  fullPath* sfile, int insert, sPrefs *sP );
+PANO13_IMPEX void 	readControlPoints	(char* script, controlPoint *c );
+PANO13_IMPEX int	getVRPanoOptions	( VRPanoOptions *v, char *line );
+PANO13_IMPEX void 	nextWord			( register char* word, char** ch );
+PANO13_IMPEX void 	nextLine			( register char* line, char** ch );
+PANO13_IMPEX int 	numLines			( char* script, char first );
+
+PANO13_IMPEX char *panoParserFindOLine(char *script, int index);
 
 
 
 
 // Memory
 
-void 	DisposeAlignInfo	( AlignInfo *g );
-void**  mymalloc			( size_t numBytes );					// Memory allocation, use Handles
-void 	myfree				( void** Hdl );						// free Memory, use Handles
-int 	SetDestImage		( TrformStr *TrPtr, int width, int height) ;
-void	DisposeMultiLayerImage( MultiLayerImage *mim );
+PANO13_IMPEX void 	DisposeAlignInfo	( AlignInfo *g );
+PANO13_IMPEX void**  mymalloc			( size_t numBytes );					// Memory allocation, use Handles
+PANO13_IMPEX void 	myfree				( void** Hdl );						// free Memory, use Handles
+PANO13_IMPEX int 	SetDestImage		( TrformStr *TrPtr, int width, int height) ;
+PANO13_IMPEX void	DisposeMultiLayerImage( MultiLayerImage *mim );
 
 
 // Math
 
-void 	RunLMOptimizer		( OptInfo	*g);
-void 	RunBROptimizer		( OptInfo	*g, double minStepWidth);
-void 	RunOverlapOptimizer ( AlignInfo	*g);
-
-void 	SetMatrix			( double a, double b, double c , double m[3][3], int cl );
-void 	matrix_mult			( double m[3][3], double vector[3] );
-void 	matrix_inv_mult		( double m[3][3], double vector[3] );
-double 	smallestRoot		( double *p );
-void 	SetCorrectionRadius	( cPrefs *cP );
-int		lmdif				();
-void	fourier				( TrformStr *TrPtr, cPrefs *cP );
-unsigned short 	gamma_correct( double pix );
-int 	EqualCPrefs( cPrefs *c1, cPrefs *c2 );
-double 	OverlapRMS			( MultiLayerImage *mim );
-double 	distSquared			( int num ); 
-int		fcnPano();
-int		EvaluateControlPointError ( int num, double *errptr, double errComponent[2]);
-void 	doCoordinateTransform( CoordInfo *c, tMatrix *t );
-void 	findOptimumtMatrix( transformCoord *tP, tMatrix *tM, lmfunc f);
-int 	SolveLinearEquation2( double a[2][2], double b[2], double x[2] );
-void 	SortControlPoints( AlignInfo *g , int nIm);
-void 	noisefilter			( Image *dest, Image *src );	
-void 	fwiener				( TrformStr *TrPtr, Image *nf, Image *psf, double gamma, double frame );
+PANO13_IMPEX void 	RunLMOptimizer		( OptInfo	*g);
+PANO13_IMPEX void 	RunBROptimizer		( OptInfo	*g, double minStepWidth);
+PANO13_IMPEX void 	RunOverlapOptimizer ( AlignInfo	*g);
+
+PANO13_IMPEX void 	SetMatrix			( double a, double b, double c , double m[3][3], int cl );
+PANO13_IMPEX void 	matrix_mult			( double m[3][3], double vector[3] );
+PANO13_IMPEX void 	matrix_inv_mult		( double m[3][3], double vector[3] );
+PANO13_IMPEX double 	smallestRoot		( double *p );
+PANO13_IMPEX void 	SetCorrectionRadius	( cPrefs *cP );
+PANO13_IMPEX int		lmdif				();
+PANO13_IMPEX void	fourier				( TrformStr *TrPtr, cPrefs *cP );
+PANO13_IMPEX unsigned short 	gamma_correct( double pix );
+PANO13_IMPEX int 	EqualCPrefs( cPrefs *c1, cPrefs *c2 );
+PANO13_IMPEX double 	OverlapRMS			( MultiLayerImage *mim );
+PANO13_IMPEX double 	distSquared			( int num ); 
+PANO13_IMPEX int		fcnPano();
+PANO13_IMPEX int		EvaluateControlPointError ( int num, double *errptr, double errComponent[2]);
+PANO13_IMPEX void 	doCoordinateTransform( CoordInfo *c, tMatrix *t );
+PANO13_IMPEX void 	findOptimumtMatrix( transformCoord *tP, tMatrix *tM, lmfunc f);
+PANO13_IMPEX int 	SolveLinearEquation2( double a[2][2], double b[2], double x[2] );
+PANO13_IMPEX void 	SortControlPoints( AlignInfo *g , int nIm);
+PANO13_IMPEX void 	noisefilter			( Image *dest, Image *src );	
+PANO13_IMPEX void 	fwiener				( TrformStr *TrPtr, Image *nf, Image *psf, double gamma, double frame );
 
 
 // Triangulation
-int 	PointInTriangle( double x, double y, PTTriangle *T, double c[2] );
-int 	SetSourceTriangles( AlignInfo *g, int nIm, PTTriangle** t  );
-int 	SetDestTriangles( AlignInfo *g, int nIm, PTTriangle** t  );
-int 	InterpolateTriangles( AlignInfo *g, int nIm, double s, PTTriangle** t  );
-int 	DelaunayIteration( AlignInfo *g, int nIm );
-int 	PointInCircumcircle( double x, double y, PTTriangle *tC );
-int 	TriangulatePoints( AlignInfo *g, int nIm );
-int 	AddTriangle( triangle *t, AlignInfo *g );
-int 	RemoveTriangle( int nt, AlignInfo *g );
-void 	OrderVerticesInTriangle( int nt, AlignInfo *g );
-void 	SetTriangleCoordinates( triangle *t, PTTriangle *tC, AlignInfo *g );
-int 	TrianglesOverlap( PTTriangle *t0, PTTriangle *t1 );
-int 	LinesIntersect( PTLine *s0, PTLine *s1) ; 
-double 	PTDistance( PTPoint *s0, PTPoint *s1 );
-int 	PTPointInRectangle(  PTPoint *p, PTLine *r );
-int 	PTElementOf(  double x, double a, double b );
-int 	PTNormal( double *a, double *b, double *c, PTLine *s );
-int 	PTGetLineCrossing( PTLine *s0, PTLine *s1, PTPoint *ps );
-int 	ReduceTriangles( AlignInfo *g, int nIm );
-double 	PTAreaOfTriangle( PTTriangle *t );
-int 	normalToTriangle( CoordInfo *n, CoordInfo *v, triangle *t );
-
-
-
-
-double GetBlendfactor( int d, int s, int feather );
-
-
-
-
-
-void execute_stack		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-
-int execute_stack_new               ( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );   
-
-int resize				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );		
-int shear				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int shearInv				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int horiz				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int vert				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int radial				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int radial_brown			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-
-int tiltForward				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int tiltInverse				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-
-int persp_sphere		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int persp_rect			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-
-
-int rect_pano			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int pano_rect			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int pano_erect			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int erect_pano			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int sphere_cp_erect	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int sphere_tp_erect	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int erect_sphere_cp	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int rect_sphere_tp		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int sphere_tp_rect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int sphere_cp_pano		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int rect_erect			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int erect_rect			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int plane_transfer_to_camera( double x_dest, double y_dest, double * x_src, double * y_src, void * params);
-int plane_transfer_from_camera( double x_dest, double y_dest, double * x_src, double * y_src, void * params);
-int erect_sphere_tp	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int mirror_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int mercator_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_mercator		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int lambert_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_lambert		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_lambertazimuthal( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
-int lambertazimuthal_erect( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
-int erect_hammer( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
-int hammer_erect( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
-int transmercator_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_transmercator		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int sinusoidal_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_sinusoidal		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int stereographic_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_stereographic		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int albersequalareaconic_erect	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_albersequalareaconic	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int albersequalareaconic_distance	( double *x_src, void* params );
-int millercylindrical_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_millercylindrical		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int panini_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_panini		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int equipanini_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_equipanini		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-
-int panini_general_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_panini_general		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-Image * setup_panini_general	( struct MakeParams * pmp );
-int maxFOVs_panini_general	( double *params, double *fovs );
-
-int arch_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_arch		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-
-int biplane_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_biplane		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int biplane_distance ( double width, double b, void* params );
-int triplane_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int erect_triplane		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int triplane_distance ( double width, double b, void* params );
-
-int mirror_sphere_cp	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int mirror_pano		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-int sphere_cp_mirror	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
-
-int sphere_tp_pano		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int pano_sphere_tp		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-int sphere_tp_mirror( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
-int mirror_sphere_tp( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
-int sphere_tp_equisolid( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
-int equisolid_sphere_tp( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
-int sphere_tp_orthographic( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
-int orthographic_sphere_tp( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
-
-int sphere_tp_thoby( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
-int thoby_sphere_tp( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
+PANO13_IMPEX int 	PointInTriangle( double x, double y, PTTriangle *T, double c[2] );
+PANO13_IMPEX int 	SetSourceTriangles( AlignInfo *g, int nIm, PTTriangle** t  );
+PANO13_IMPEX int 	SetDestTriangles( AlignInfo *g, int nIm, PTTriangle** t  );
+PANO13_IMPEX int 	InterpolateTriangles( AlignInfo *g, int nIm, double s, PTTriangle** t  );
+PANO13_IMPEX int 	DelaunayIteration( AlignInfo *g, int nIm );
+PANO13_IMPEX int 	PointInCircumcircle( double x, double y, PTTriangle *tC );
+PANO13_IMPEX int 	TriangulatePoints( AlignInfo *g, int nIm );
+PANO13_IMPEX int 	AddTriangle( triangle *t, AlignInfo *g );
+PANO13_IMPEX int 	RemoveTriangle( int nt, AlignInfo *g );
+PANO13_IMPEX void 	OrderVerticesInTriangle( int nt, AlignInfo *g );
+PANO13_IMPEX void 	SetTriangleCoordinates( triangle *t, PTTriangle *tC, AlignInfo *g );
+PANO13_IMPEX int 	TrianglesOverlap( PTTriangle *t0, PTTriangle *t1 );
+PANO13_IMPEX int 	LinesIntersect( PTLine *s0, PTLine *s1) ; 
+PANO13_IMPEX double 	PTDistance( PTPoint *s0, PTPoint *s1 );
+PANO13_IMPEX int 	PTPointInRectangle(  PTPoint *p, PTLine *r );
+PANO13_IMPEX int 	PTElementOf(  double x, double a, double b );
+PANO13_IMPEX int 	PTNormal( double *a, double *b, double *c, PTLine *s );
+PANO13_IMPEX int 	PTGetLineCrossing( PTLine *s0, PTLine *s1, PTPoint *ps );
+PANO13_IMPEX int 	ReduceTriangles( AlignInfo *g, int nIm );
+PANO13_IMPEX double 	PTAreaOfTriangle( PTTriangle *t );
+PANO13_IMPEX int 	normalToTriangle( CoordInfo *n, CoordInfo *v, triangle *t );
+
+
+
+
+PANO13_IMPEX double GetBlendfactor( int d, int s, int feather );
+
+
+
+
+
+PANO13_IMPEX void execute_stack		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+
+PANO13_IMPEX int execute_stack_new               ( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );   
+
+PANO13_IMPEX int resize				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );		
+PANO13_IMPEX int shear				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int shearInv				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int horiz				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int vert				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int radial				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int radial_brown			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+
+PANO13_IMPEX int tiltForward				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int tiltInverse				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+
+PANO13_IMPEX int persp_sphere		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int persp_rect			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+
+
+PANO13_IMPEX int rect_pano			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int pano_rect			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int pano_erect			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int erect_pano			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int sphere_cp_erect	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int sphere_tp_erect	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int erect_sphere_cp	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int rect_sphere_tp		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int sphere_tp_rect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int sphere_cp_pano		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int rect_erect			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int erect_rect			( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int plane_transfer_to_camera( double x_dest, double y_dest, double * x_src, double * y_src, void * params);
+PANO13_IMPEX int plane_transfer_from_camera( double x_dest, double y_dest, double * x_src, double * y_src, void * params);
+PANO13_IMPEX int erect_sphere_tp	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int mirror_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int mercator_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_mercator		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int lambert_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_lambert		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_lambertazimuthal( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
+PANO13_IMPEX int lambertazimuthal_erect( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
+PANO13_IMPEX int erect_hammer( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
+PANO13_IMPEX int hammer_erect( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
+PANO13_IMPEX int transmercator_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_transmercator		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int sinusoidal_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_sinusoidal		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int stereographic_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_stereographic		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int albersequalareaconic_erect	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_albersequalareaconic	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int albersequalareaconic_distance	( double *x_src, void* params );
+PANO13_IMPEX int millercylindrical_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_millercylindrical		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int panini_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_panini		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int equipanini_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_equipanini		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+
+PANO13_IMPEX int panini_general_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_panini_general		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX Image * setup_panini_general	( struct MakeParams * pmp );
+PANO13_IMPEX int maxFOVs_panini_general	( double *params, double *fovs );
+
+PANO13_IMPEX int arch_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_arch		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+
+PANO13_IMPEX int biplane_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_biplane		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int biplane_distance ( double width, double b, void* params );
+PANO13_IMPEX int triplane_erect		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int erect_triplane		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int triplane_distance ( double width, double b, void* params );
+
+PANO13_IMPEX int mirror_sphere_cp	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int mirror_pano		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+PANO13_IMPEX int sphere_cp_mirror	( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );	
+
+PANO13_IMPEX int sphere_tp_pano		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int pano_sphere_tp		( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int sphere_tp_mirror( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
+PANO13_IMPEX int mirror_sphere_tp( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
+PANO13_IMPEX int sphere_tp_equisolid( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
+PANO13_IMPEX int equisolid_sphere_tp( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
+PANO13_IMPEX int sphere_tp_orthographic( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
+PANO13_IMPEX int orthographic_sphere_tp( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
+
+PANO13_IMPEX int sphere_tp_thoby( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
+PANO13_IMPEX int thoby_sphere_tp( double x_dest,double  y_dest, double* x_src, double* y_src, void* params);
 
 
 
@@ -920,16 +918,16 @@
 #define THOBY_K2_PARM 0.713
 
 
-int rotate_erect		( double x_dest, double y_dest, double* x_src, double* y_src, void* params );
-int inv_radial			( double x_dest, double y_dest, double* x_src, double* y_src, void* params );
-int inv_radial_brown		( double x_dest, double y_dest, double* x_src, double* y_src, void* params );
-
-int vertical			( double x_dest, double y_dest, double* x_src, double* y_src, void* params );
-int inv_vertical		( double x_dest, double y_dest, double* x_src, double* y_src, void* params );
-int deregister			( double x_dest, double y_dest, double* x_src, double* y_src, void* params );
-int tmorph				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
-
-int shift_scale_rotate ( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int rotate_erect		( double x_dest, double y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int inv_radial			( double x_dest, double y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int inv_radial_brown		( double x_dest, double y_dest, double* x_src, double* y_src, void* params );
+
+PANO13_IMPEX int vertical			( double x_dest, double y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int inv_vertical		( double x_dest, double y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int deregister			( double x_dest, double y_dest, double* x_src, double* y_src, void* params );
+PANO13_IMPEX int tmorph				( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
+
+PANO13_IMPEX int shift_scale_rotate ( double x_dest,double  y_dest, double* x_src, double* y_src, void* params );
 
 
 
@@ -1098,16 +1096,16 @@
 #endif
 
 /* ENDIAN aware file i/o funtions.  Used for reading and writing photoshop files */
-Boolean panoWriteUCHAR(file_spec fnum, uint8_t   theChar );
-Boolean panoWriteSHORT(file_spec fnum, uint16_t  theShort );
-Boolean panoWriteINT32(file_spec fnum, uint32_t   theLong );
-Boolean panoWriteINT64(file_spec fnum, int64_t theLongLong );
-Boolean panoWriteINT32or64(file_spec fnum, int64_t theLongLong, Boolean bBig );
-Boolean panoReadUCHAR (file_spec fnum, uint8_t  *pChar );
-Boolean panoReadSHORT (file_spec fnum, uint16_t *pShort );
-Boolean panoReadINT32 (file_spec fnum, uint32_t  *pLong );
-Boolean panoReadINT64 (file_spec fnum, int64_t  *pLongLong );
-Boolean panoReadINT32or64(file_spec fnum, int64_t  *pLongLong, Boolean bBig );
+PANO13_IMPEX Boolean panoWriteUCHAR(file_spec fnum, uint8_t   theChar );
+PANO13_IMPEX Boolean panoWriteSHORT(file_spec fnum, uint16_t  theShort );
+PANO13_IMPEX Boolean panoWriteINT32(file_spec fnum, uint32_t   theLong );
+PANO13_IMPEX Boolean panoWriteINT64(file_spec fnum, int64_t theLongLong );
+PANO13_IMPEX Boolean panoWriteINT32or64(file_spec fnum, int64_t theLongLong, Boolean bBig );
+PANO13_IMPEX Boolean panoReadUCHAR (file_spec fnum, uint8_t  *pChar );
+PANO13_IMPEX Boolean panoReadSHORT (file_spec fnum, uint16_t *pShort );
+PANO13_IMPEX Boolean panoReadINT32 (file_spec fnum, uint32_t  *pLong );
+PANO13_IMPEX Boolean panoReadINT64 (file_spec fnum, int64_t  *pLongLong );
+PANO13_IMPEX Boolean panoReadINT32or64(file_spec fnum, int64_t  *pLongLong, Boolean bBig );
 
 
 #define PANO_DEFAULT_PIXELS_PER_RESOLUTION  150.0
@@ -1116,26 +1114,26 @@
 // better than PACKBITS
 #define PANO_DEFAULT_TIFF_COMPRESSION       COMPRESSION_DEFLATE
 
-void panoMetadataFree(pano_ImageMetadata * metadata);
-int panoMetadataCopy(pano_ImageMetadata * to, pano_ImageMetadata * from);
-int panoROIRowInside(pano_CropInfo * cropInfo, int row);
-void panoMetadataSetCompression(pano_ImageMetadata * metadata, char *compressionName);
-int panoMetadataCopy(pano_ImageMetadata * to, pano_ImageMetadata * from);
-void panoMetadataFree(pano_ImageMetadata * metadata);
-
-void panoMetadataSetAsCropped(pano_ImageMetadata * metadata, 
+PANO13_IMPEX void panoMetadataFree(pano_ImageMetadata * metadata);
+PANO13_IMPEX int panoMetadataCopy(pano_ImageMetadata * to, pano_ImageMetadata * from);
+PANO13_IMPEX int panoROIRowInside(pano_CropInfo * cropInfo, int row);
+PANO13_IMPEX void panoMetadataSetCompression(pano_ImageMetadata * metadata, char *compressionName);
+PANO13_IMPEX int panoMetadataCopy(pano_ImageMetadata * to, pano_ImageMetadata * from);
+PANO13_IMPEX void panoMetadataFree(pano_ImageMetadata * metadata);
+
+PANO13_IMPEX void panoMetadataSetAsCropped(pano_ImageMetadata * metadata, 
 			      int croppedWidth, 
 			      int croppedHeight,
 			      int roiLeft, 
 			      int roiRight);
 
-void panoMetadataResetSize(pano_ImageMetadata * metadata, 
+PANO13_IMPEX void panoMetadataResetSize(pano_ImageMetadata * metadata, 
 			   int width, int height);
 
-int panoReadJPEG(Image * im, fullPath * sfile);
+PANO13_IMPEX int panoReadJPEG(Image * im, fullPath * sfile);
 
 #ifndef PAN_DEBUG_METADATA
-void panoDumpMetadata(pano_ImageMetadata * metadata, char *message);
+PANO13_IMPEX void panoDumpMetadata(pano_ImageMetadata * metadata, char *message);
 #else 
 #define panoDumpMetadata(a,b)  ;
 #endif