Cterm's graphics ================ Escape sequence overview: ------------------------- A valid cterm graphics escape sequence consists of, in the following order, ... 1. the "introducer" ESC @ 2. the optional decimal parameter numbers (Pn, Px, Py, ... etc.), separated by semicolons (;) if more than one parameter is required 3. the final command character which, with the exception of '@', must be an alphabetic (ie. between A and Z or between a and z). Eg. assuming the current graphics position (x,y) is (1,1), to draw a line from (1,1) to (300,150) cterm should receive the escape sequence: ESC @ 1 5 0 ; 3 0 0 h (short form: ^[@150;300h). The graphics sequence format is patterned after the ANSI escape sequences. Whenever possible, the final command character for a graphics function is the same as the command character for the equivalent ANSI function Currently accepted sequences: ----------------------------- ^[ @ Pn m - set graphics colour to Pn (from 0 to whatever). ^[ @ Pn M - set the graphics/interlace mode: if Pn = 0 turn graphics off if Pn != 0 turn graphics/interlace on ^[ @ J - clear graphics screen. ^[ @ x - request graphics screen bounds. Cterm will then respond with ... ^[ @ Py ; Px ; Pc x where Px is the total number of pixels across the screen, Py is the total number of pixels down the screen and Pc is the number of colours available (black included). (eg. On a TI Pro, cterm would respond "^[@300;720;8x" On a PC with EGA, it would send "^[@200;640;16x"). ^[ @ Py ; Px @ - move to (Px,Py) and light the pixel. ^[ @ F - Fill the enclosed space surrounding the current position. (NB: if the area is not enclosed, the filling process will "leak" out the opening and go on to fill the entire graphics screen, causing cterm to ignore all else until it's finished). ^[ @ Pr O - draw Circle with radius Pr around the current position. ^[ @ Pb ; Pa L - draw Ellipse with half-axes Pa,Pb around the current position. ^[ @ Py ; Px ; Pb ; Pa R - draw an Arc centred at (Px,Py) clockwise from the current position to closest to (Pa,Pb). If Px or Py is greater than the final pixel position in its direction, then the number is subtracted from the limit to yield a negative number indicating an off-screen position. Eg. on the TI Pro, assuming the current graphics position is (x=10, y=5), the escape sequence ^[@116;738;230;10R would mean draw an arc, centered at (-18, 116), from (10,5) to the point closest to (10,230). (a rule of thumb for the following motion sequences: - an upper-case command means a "pen up" move - a lower-case command means a "pen down" move (ie. draw something)) ^[ @ Py A - move up Py pixels. ^[ @ Py B - move down Py pixels. ^[ @ Px C - move right Px pixels. ^[ @ Px D - move left Px pixels. ^[ @ Py ; Px H - move to (Px,Py). ^[ @ Py a - draw a line up Py pixels. ^[ @ Py b - draw a line down Py pixels. ^[ @ Px c - draw a line right Px pixels. ^[ @ Px d - draw a line left Px pixels. ^[ @ Py ; Px h - draw a line to (Px,Py).