typedef struct {
   double real ;
   double imag ;
   }  COMPLEX ;

typedef struct {
   double r, i, j, k ;
   } QUATERNION ;

typedef struct PrintParams {
   int fraction ;
   int vert_scaling ;
   } PRINT_PARAMS ;



/*
--------------------------------------------------------------------------------

   Image header

--------------------------------------------------------------------------------
*/

typedef struct {
   int type ;        // 1=TON; 2=BMP
   int nr ;          // Number of rows
   int nc ;          // Number of columns
   int nbytes ;      // Number of bytes per pixel
   char *dib ;       // DIB for BMP file (allocated/deallocated)
   char *dibdata ;   // Its data starts here
   int inverted ;    // If BMP, is it bottom-to-top?
   }  IMAGE_HEADER ;


/*
--------------------------------------------------------------------------------

   DIBimage - This is a DIB manipulation class

--------------------------------------------------------------------------------
*/

class DIBimage {

public:

   DIBimage () ;                       // Default constructor (never called)
   DIBimage ( int nrows , int ncols , int nbytes , unsigned char *image ) ;
   ~DIBimage () ;
   int draw ( HWND hwnd , int printing ) ;
   int valid () ;

private:
   int nr ;        // Number of rows
   int nc ;        // Number of columns
   int nb ;        // Bytes per pixel (1 or 3 now)
   int rgb_size ;  // Number of RGBQUAD entries in bit_map_info
   int row_bytes ; // nc * nb padded (if needed) to LONG boundary for img
   BITMAPINFO *bit_map_info ;
   BITMAPINFOHEADER *bit_map_info_header ;
   RGBQUAD *rgb_quad ;
   unsigned char *img ; // The image is here
} ;
