Annotation of q_a/samples/scrnsave/fractal.h, revision 1.1.1.1

1.1       root        1: #define idsName             100
                      2: #define idsXFrom            9001
                      3: #define idsYFrom            9002
                      4: #define idsXTo              9003
                      5: #define idsYTo              9004
                      6: #define idsSaveAs           9005
                      7: #define idsIteration        9006
                      8: 
                      9: #define FIRST_PIXEL     429496796
                     10: #define MAXDOUBLELEN        22          // big enough?
                     11: #define MAXPATHLEN          256
                     12: 
                     13: #define ID_XFROM              2000
                     14: #define ID_XTO                2001
                     15: #define ID_YFROM              2002
                     16: #define ID_YTO                2003
                     17: #define ID_SAVEAS             2004
                     18: #define ID_ITERATION          2005
                     19: 
                     20: extern TCHAR szName[TITLEBARNAMELEN];
                     21: extern TCHAR szAppName[APPNAMEBUFFERLEN];
                     22: TCHAR szXFrom[MAXDOUBLELEN];
                     23: TCHAR szXTo[MAXDOUBLELEN];
                     24: TCHAR szYFrom[MAXDOUBLELEN];
                     25: TCHAR szYTo[MAXDOUBLELEN];
                     26: TCHAR szSaveFile[MAXPATHLEN];
                     27: extern TCHAR szIniFile[MAXFILELEN];
                     28: TCHAR szIteration[MAXDOUBLELEN];
                     29: extern TCHAR szScreenSaver[22];
                     30: extern TCHAR szHelpFile[MAXFILELEN];
                     31: extern TCHAR szNoHelpMemory[BUFFLEN];
                     32: extern UINT  MyHelpMessage;
                     33: 
                     34: CHAR  gtext[128];
                     35: HPEN   hpnRed;
                     36: HPEN   hpnBlack;
                     37: HPEN   hpnGreen;
                     38: 
                     39: 
                     40: 
                     41: INT    giPen = 0;
                     42: 
                     43: BOOL   gFloat = TRUE;
                     44: LONG   gStep = 1;
                     45: LONG   gIteration = 500;
                     46: BOOL   gbStretch = TRUE;
                     47: INT    giStretchMode = COLORONCOLOR;
                     48: INT    giDmOrient = DMORIENT_PORTRAIT;
                     49: INT    giNPrinters = 0;
                     50: 
                     51: typedef struct _PerWndInfo {
                     52:     HWND    hwnd;               // hJulia or hView, the drawing surface
                     53:     HANDLE  hThrd;              // handle to drawing thread or play thread
                     54:     BOOL    bDrawing;           // curently drawing?
                     55:     DWORD   dwThreadId;         // drawing thread or play thread ID
                     56:     DWORD   dwElapsed;          // elapsed time for the drawing operation
                     57:     double  xFrom;              // drawing range in floating points
                     58:     double  xTo;                //
                     59:     double  yFrom;              //         Floating Points
                     60:     double  yTo;                //
                     61:     double  c1;                 // C = c1 + i c2 where c1, c2 are reals
                     62:     double  c2;                 // the C value corresponding to the Julia set
                     63:     LONG    lxFrom;             // drawing range in fix points
                     64:     LONG    lxTo;               //
                     65:     LONG    lyFrom;             //         Fix Points
                     66:     LONG    lyTo;               //
                     67:     LONG    lc1;                // C = c1 + i c2 where c1, c2 are reals
                     68:     LONG    lc2;                // the C value corresponding to the Julia set
                     69:     HBITMAP hBmpSaved;          // saved bitmap for the drawing
                     70:     BOOL    bMandel;            // Drawing is a Mandelbrot or Julia set?
                     71:     int     iIteration;         // number of computations done on each pixel
                     72:     int     iStep;              // drawn on every one, two or three line(s)?
                     73:     BOOL    bStretch;           // stretching bitmaps
                     74:     int     iStretchMode;       // stretching mode to use
                     75:     BOOL    bSetDIBsToDevice;   // SetDIBsToDevice reather than BitBlt?
                     76:     HPALETTE    hPal;           // The palette used for the drawing
                     77:     HPALETTE    hHTPal;         // The halftone palette used for the drawing
                     78:     PVOID   *prghPen;
                     79:     INT     iPen;
                     80:     char    szSavef[MAXPATHLEN];
                     81:     BOOL    bClrCycle;
                     82: } INFO, *PINFO;
                     83: 
                     84: INFO  gInfo;
                     85: 
                     86: 
                     87: //
                     88: // Handy macros for the transformations used in fractal generations
                     89: //
                     90: #define Xform(Pt, SrcFrom, SrcTo, DestFrom, DestTo) \
                     91:          (((Pt-SrcFrom)/(SrcTo-SrcFrom)*(DestTo-DestFrom))+DestFrom)
                     92: #define Xform2(Pt, SrcFrom, SrcTo, DestFrom, DestTo) \
                     93:          ((int) ((Pt-SrcFrom)/(SrcTo-SrcFrom)*(DestTo-DestFrom)+DestFrom))
                     94: #define XformFix(Pt, SrcFrom, SrcTo, DestFrom, DestTo) \
                     95:          (lMul(lDiv(Pt-SrcFrom,SrcTo-SrcFrom), DestTo-DestFrom)+DestFrom)

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.