(******************************************************************************
*                                GRAPH21 .DEF                                 *
*                              ABO Software Dep.                              *
*                                                                             *
* Purpose : To provide simple low level pixel oriented graphics routines.     *
*                                                                             *
*   Notes : These routines, to provide speed, have no error checking, and no  *
*         clipping. Hence care must be taken to ensure that valid parameters  *
*         are used when they are called.                                      *
*                                                                             *
*         Version Date : 21/07/95                                             *
******************************************************************************)
DEFINITION MODULE GRAPH2;

CONST
  MaxPts = 20;

  Xmax =640;
  Ymax =350;
  Cmax = 16;
  Pmax = 64;

  XmaxL= 320; YmaxL= 200;
  XmaxM= 640; YmaxM= 480;
  XmaxH= 800; YmaxH= 600;
  XmaxX=1024; YmaxX= 768;

  CmaxL=  10H;
  CmaxM= 100H;
  CmaxH=1000H;

TYPE
  ResolMode = (LRes,MRes,HRes,XRes);
  ColorMode = (LCol,MCol,HCol,XCol);
  LPattern  = ARRAY [0..7] OF SHORTCARD;
  FPattern  = ARRAY [0..7] OF LPattern;
  Color     = RECORD
    CASE :ColorMode OF
      |LCol,MCol:
        d:FPattern;
      |HCol:
        h:CARDINAL;
      |XCol:
        x:LONGCARD;
    END;
  END;
  ColorRGB  = RECORD
    R    :SHORTCARD;
    G    :SHORTCARD;
    B    :SHORTCARD;
  END;
  Point     = RECORD
    X    : INTEGER;
    Y    : INTEGER;
  END;


PROCEDURE initgraph;

PROCEDURE closegraph;

PROCEDURE setactive(n:SHORTCARD);

PROCEDURE setvisual(n:SHORTCARD);

PROCEDURE clearpage;

PROCEDURE setpalette  (index :CARDINAL;rgb  :ColorRGB);


PROCEDURE gencolor    (rgb  :ColorRGB):Color;

PROCEDURE setcolor    (d    :Color);

PROCEDURE setcolorRGB (rgb  :ColorRGB);


PROCEDURE pixelC    (x,y  :INTEGER;i  :CARDINAL);

PROCEDURE pixelRGB  (x,y  :INTEGER;rgb:ColorRGB);


PROCEDURE pixel(x,y       :INTEGER);

PROCEDURE hline(y,x1,x2   : INTEGER);

PROCEDURE line(x1,y1,x2,y2: INTEGER);

PROCEDURE box(x1,y1,x2,y2 : INTEGER);

PROCEDURE poly(n          : INTEGER;
               p          : ARRAY OF Point);

END GRAPH2.
