⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fractint.h

📁 frasr200的win 版本源码(18.21),使用make文件,使用的vc版本较低,在我的环境下编译有问题! 很不错的分形程序代码!
💻 H
📖 第 1 页 / 共 2 页
字号:
/* FRACTINT.H - common structures and values for the FRACTINT routines */

#if defined(PUTTHEMHERE)        /* this MUST be defined ONLY in FRACTINT.C */
struct videoinfo videoentry;
int helpmode;
#endif

#ifndef FRACTINT_H
#define FRACTINT_H

#if !defined(PUTTHEMHERE)  
extern struct videoinfo videoentry;
extern int		helpmode;
#endif

#include <math.h>
#include "port.h"

typedef BYTE BOOLEAN;

#ifndef C6
#define _fastcall	/* _fastcall is a Microsoft C6.00 extension */
#endif

#ifndef XFRACT
typedef int SEGTYPE;
typedef unsigned USEGTYPE;
#ifdef __TURBOC__
#   define _bios_printer(a,b,c)   biosprint((a),(c),(b))
#   define _bios_serialcom(a,b,c) bioscom((a),(c),(b))
#else
#ifndef __WATCOMC__
#ifndef MK_FP
#   define MK_FP(seg,off) (VOIDFARPTR )( (((long)(seg))<<16) | \
                                          ((unsigned)(off)) )
#endif
#endif
#endif
#else
typedef char * SEGTYPE;
typedef char * USEGTYPE;
#   define MK_FP(seg,off) (VOIDFARPTR )(seg+off)
#endif


#ifndef XFRACT
#define clock_ticks() clock()
#endif

#ifdef XFRACT
#define _fstrcpy(to,from) strcpy(to,from)
#endif

/* these are used to declare arrays for file names */
#define FILE_MAX_PATH  80       /* max length of path+filename  */
#define FILE_MAX_DIR   80       /* max length of directory name */
#define FILE_MAX_DRIVE  3       /* max length of drive letter   */
#define FILE_MAX_FNAME  9       /* max length of filename       */
#define FILE_MAX_EXT    5       /* max length of extension      */

#define MAXPARAMS 10		/* maximum number of parameters */
#define MAXPIXELS 2048		/* Maximum pixel count across/down the screen */
#define DEFAULTASPECT 0.75	/* Assumed overall screen dimensions, y/x     */

struct videoinfo {		/* All we need to know about a Video Adapter */
	char	name[26];	/* Adapter name (IBM EGA, etc)		*/
	char	comment[26];	/* Comments (UNTESTED, etc)		*/
	int	keynum; 	/* key number used to invoked this mode */
				/* 2-10 = F2-10, 11-40 = S,C,A{F1-F10}	*/
	int	videomodeax;	/* begin with INT 10H, AX=(this)	*/
	int	videomodebx;	/*		...and BX=(this)	*/
	int	videomodecx;	/*		...and CX=(this)	*/
	int	videomodedx;	/*		...and DX=(this)	*/
				/* NOTE:  IF AX==BX==CX==0, SEE BELOW	*/
	int	dotmode;	/* video access method used by asm code */
				/*	1 == BIOS 10H, AH=12,13 (SLOW)	*/
				/*	2 == access like EGA/VGA	*/
				/*	3 == access like MCGA		*/
				/*	4 == Tseng-like  SuperVGA*256	*/
				/*	5 == P'dise-like SuperVGA*256   */
				/*	6 == Vega-like	 SuperVGA*256	*/
				/*	7 == "Tweaked" IBM-VGA ...*256  */
				/*	8 == "Tweaked" SuperVGA ...*256 */
				/*	9 == Targa Format		*/
				/*	10 = Hercules			*/
				/*	11 = "disk video" (no screen)   */
				/*	12 = 8514/A			*/
				/*	13 = CGA 320x200x4, 640x200x2	*/
				/*	14 = Tandy 1000 		*/
				/*	15 = TRIDENT  SuperVGA*256	*/
				/*	16 = Chips&Tech SuperVGA*256	*/
	int	xdots;		/* number of dots across the screen	*/
	int	ydots;		/* number of dots down the screen	*/
	int	colors; 	/* number of colors available		*/
	};


#define INFO_ID 	"Fractal"
#define FRACTAL_INFO   struct fractal_info

/*
 * Note: because non-MSDOS machines store structures differently, we have
 * to do special processing of the fractal_info structure in loadfile.c.
 * Make sure changes to the structure here get reflected there.
 */
#ifndef XFRACT
#define FRACTAL_INFO_SIZE sizeof(FRACTAL_INFO)
#else
/* This value should be the MSDOS size, not the Unix size. */
#define FRACTAL_INFO_SIZE 502
#endif

struct fractal_info	    /*  for saving data in GIF file     */
{
    char  info_id[8];	    /* Unique identifier for info block */
    short iterations;
    short fractal_type;	    /* 0=Mandelbrot 1=Julia 2= ... */
    double xmin;
    double xmax;
    double ymin;
    double ymax;
    double creal;
    double cimag;
    short videomodeax;
    short videomodebx;
    short videomodecx;
    short videomodedx;
    short dotmode;
    short xdots;
    short ydots;
    short colors;
    short version;	    /* used to be 'future[0]' */
    float parm3;
    float parm4;
    float potential[3];
    short rseed;
    short rflag;
    short biomorph;
    short inside;
    short logmap;
    float invert[3];
    short decomp[2];
    short symmetry;
			/* version 2 stuff */
    short init3d[16];
    short previewfactor;
    short xtrans;
    short ytrans;
    short red_crop_left;
    short red_crop_right;
    short blue_crop_left;
    short blue_crop_right;
    short red_bright;
    short blue_bright;
    short xadjust;
    short eyeseparation;
    short glassestype;
			/* version 3 stuff, release 13 */
    short outside;
			/* version 4 stuff, release 14 */
    double x3rd;	  /* 3rd corner */
    double y3rd;
    char stdcalcmode;	  /* 1/2/g/b */
    char useinitorbit;	  /* init Mandelbrot orbit flag */
    short calc_status;	  /* resumable, finished, etc */
    long tot_extend_len;  /* total length of extension blocks in .gif file */
    short distest;
    short floatflag;
    short bailout;
    long calctime;
    BYTE trigndx[4];      /* which trig functions selected */
    short finattract;
    double initorbit[2];  /* init Mandelbrot orbit values */
    short periodicity;	  /* periodicity checking */
			/* version 5 stuff, release 15 */
    short pot16bit;	  /* save 16 bit continuous potential info */
    float faspectratio;   /* finalaspectratio, y/x */
    short system; 	  /* 0 for dos, 1 for windows */
    short release;	  /* release number, with 2 decimals implied */
    short flag3d; 	  /* stored only for now, for future use */
    short transparent[2];
    short ambient;
    short haze;
    short randomize;
			/* version 6 stuff, release 15.x */
    short rotate_lo;
    short rotate_hi;
    short distestwidth;
			/* version 7 stuff, release 16 */
    double dparm3;
    double dparm4;
			/* version 8 stuff, release 17 */
    short fillcolor;
			/* version 9 stuff, release 18 */
    double mxmaxfp;
    double mxminfp;
    double mymaxfp;
    double myminfp;
    short zdots;
    float originfp;
    float depthfp;
    float heightfp;
    float widthfp;
    float distfp;
    float eyesfp;
    short orbittype;
    short juli3Dmode;
    short maxfn;
    short inversejulia;
    double dparm5;
    double dparm6;
    double dparm7;
    double dparm8;
    double dparm9;
    double dparm10;
    short future[50];	  /* for stuff we haven't thought of yet */
};



#define MAXVIDEOMODES 300	/* maximum entries in fractint.cfg	  */
#ifndef XFRACT
#define MAXVIDEOTABLE 40        /* size of the resident video modes table */
#else
#define MAXVIDEOTABLE 2         /* size of the resident video modes table */
#endif

#define AUTOINVERT -123456.789

#define N_ATTR 8			/* max number of attractors	*/

extern	long	 l_at_rad;	/* finite attractor radius  */
extern	double	 f_at_rad;	/* finite attractor radius  */

#define NUMIFS	  64	 /* number of ifs functions in ifs array */
#define IFSPARM    7	 /* number of ifs parameters */
#define IFS3DPARM 13	 /* number of ifs 3D parameters */

#define ITEMNAMELEN 18	 /* max length of names in .frm/.l/.ifs/.fc */

struct moreparams
{
   int      type;                    	/* index in fractalname of the fractal */
   char     *param[MAXPARAMS-4];	/* name of the parameters */
   double   paramvalue[MAXPARAMS-4]; 	/* default parameter values */
};

struct fractalspecificstuff
{
   char  *name; 			/* name of the fractal */
					/* (leading "*" supresses name display) */ 
   char  *param[4];			/* name of the parameters */
   double paramvalue[4]; 		/* default parameter values */
   int	 helptext;			/* helpdefs.h HT_xxxx, -1 for none */
   int	 helpformula;			/* helpdefs.h HF_xxxx, -1 for none */
   int	 flags; 			/* constraints, bits defined below */
   float xmin;				/* default XMIN corner */
   float xmax;				/* default XMAX corner */
   float ymin;				/* default YMIN corner */
   float ymax;				/* default YMAX corner */
   int	 isinteger;			/* 1 if integerfractal, 0 otherwise */
   int	 tojulia;			/* mandel-to-julia switch */
   int	 tomandel;			/* julia-to-mandel switch */
   int	 tofloat;			/* integer-to-floating switch */
   int	 symmetry;			/* applicable symmetry logic
					   0 = no symmetry
					  -1 = y-axis symmetry (If No Params)
					   1 = y-axis symmetry
					  -2 = x-axis symmetry (No Parms)
					   2 = x-axis symmetry
					  -3 = y-axis AND x-axis (No Parms)
					   3 = y-axis AND x-axis symmetry
					  -4 = polar symmetry (No Parms)
					   4 = polar symmetry
					   5 = PI (sin/cos) symmetry
					   6 = NEWTON (power) symmetry
								*/
   int (*orbitcalc)();		/* function that calculates one orbit */
   int (*per_pixel)();		/* once-per-pixel init */
   int (*per_image)();		/* once-per-image setup */
   int (*calctype)();		/* name of main fractal function */
   int orbit_bailout;		/* usual bailout value for orbit calc */
};

/* defines for symmetry */
#define  NOSYM		0
#define  XAXIS_NOPARM  -1
#define  XAXIS		1
#define  YAXIS_NOPARM  -2
#define  YAXIS		2
#define  XYAXIS_NOPARM -3
#define  XYAXIS 	3
#define  ORIGIN_NOPARM -4
#define  ORIGIN 	4
#define  PI_SYM_NOPARM -5
#define  PI_SYM 	5
#define  XAXIS_NOIMAG  -6
#define  XAXIS_NOREAL	6
#define  NOPLOT        99
#define  SETUP_SYM    100

/* defines for inside/outside */
#define ITER        -1
#define REAL        -2
#define IMAG        -3
#define MULT        -4
#define SUM         -5
#define ZMAG       -59
#define BOF60      -60
#define BOF61      -61
#define EPSCROSS  -100
#define STARTRAIL -101
#define PERIOD    -102

/* bitmask defines for fractalspecific flags */
#define  NOZOOM 	1    /* zoombox not allowed at all	   */
#define  NOGUESS	2    /* solid guessing not allowed	   */
#define  NOTRACE	4    /* boundary tracing not allowed	   */
#define  NOROTATE	8    /* zoombox rotate/stretch not allowed */
#define  NORESUME      16    /* can't interrupt and resume         */
#define  INFCALC       32    /* this type calculates forever	   */
#define  TRIG1	       64    /* number of trig functions in formula*/
#define  TRIG2	      128
#define  TRIG3	      192
#define  TRIG4	      256
#define  WINFRAC      512    /* supported in WinFrac		   */
#define  PARMS3D     1024    /* uses 3d parameters		   */
#define  OKJB        2048    /* works with Julibrot */
#define  MORE        4096    /* more than 4 parms */

extern struct fractalspecificstuff far fractalspecific[];
extern struct fractalspecificstuff far *curfractalspecific;

#define DEFAULTFRACTALTYPE	".gif"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -