[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15. Graphic Library (2 dimensional)

The library glib provides a simple interface like old BASIC to the graphic primitive (draw_obj) of Risa/Asir.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.0.1 glib_clear

glib_clear()

: Clear the screen.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.0.2 glib_flush

glib_flush()

: ; Flush the output. (Cfep only. It also set initGL to 1.).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.0.3 glib_line

glib_line(X0,Y0,X1,Y1)

: It draws the line [X0,Y0]- [X1,Y1] with color

glib_line(X0,Y0,X1,Y1 | color=key0)

: This function allows optional variables color

Example:

 
 glib_line(0,0,5,3/2 | color=0xff00ff);

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.0.4 glib_open

glib_open()

: It starts the ox_plot server and opens a canvas. The canvas size is set to Glib_canvas_x X Glib_canvas_y (the default value is 400). This function is automatically called when the user calls glib functions.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.0.5 glib_plot

glib_plot(F)

: It plots an object F on the glib canvas.

Example 0:

 
 glib_plot([[0,1],[0.1,0.9],[0.2,0.7],[0.3,0.5],[0.4,0.8]]);

Example 1:

 
 glib_plot(tan(x));

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.0.6 glib_print

glib_print(X,Y,Text)

: It put a string Text at [X,Y] on the glib canvas.

glib_print(X,Y,Text | color=key0)

: This function allows optional variables color

Example:

 
 glib_print(100,100,"Hello Worlds" | color=0xff0000);

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.0.7 glib_ps_form

glib_ps_form(S)

: It returns the PS code generated by executing S (experimental).

Example 0:

 
 glib_ps_form(quote( glib_line(0,0,100,100) ));

Example 1:

 
 glib_ps_form(quote([glib_line(0,0,100,100),glib_line(100,0,0,100)]));

References:

glib_tops


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.0.8 glib_putpixel

glib_putpixel(X,Y)

: It puts a pixel at [X,Y] with color

glib_putpixel(X,Y | color=key0)

: This function allows optional variables color

Example:

 
 glib_putpixel(1,2 | color=0xffff00);

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.0.9 glib_remove_last

glib_remove_last()

: Remove the last object. glib_flush() should also be called to remove the last object. (cfep only).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.0.10 glib_set_pixel_size

glib_set_pixel_size(P)

: Set the size of putpixel to P. 1.0 is the default. (cfep only).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.0.11 glib_tops

glib_tops()

: If Glib_ps is set to 1, it returns a postscript program to draw the picture on the canvas.

References:

print_output


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.0.12 glib_window

glib_window(Xmin,Ymin,Xmax,Ymax)

: It generates a window with the left top corner [Xmin,Ymin] and the right bottom corner [Xmax,Ymax]. If the global variable Glib_math_coordinate is set to 1, mathematical coordinate system will be employed, i.e., the left top corner will have the coordinate [Xmin,Ymax].

Example:

 
 glib_window(-1,-1,10,10);

[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Nobuki Takayama on January, 28 2008 using texi2html 1.76.