This is an old version from the tos.hyp. The new is on GitHub!

HomeAESShellfunktionenZeichensatzauswahl

8.19 Erweiterte Grafikfunktionen

Diese Bibliothek enthält Funktionen um sich bewegende (ausdehnende bzw. zusammenziehende) Rechtecke zu animieren; für diesen Zweck gibt es die folgenden Routinen:

xgrf_2box Animation sich bewegender Rechtecke
xgrf_stepcalc Parameter-Berechnung für Rechteck-Animation

Hinweis: Diese Funktionen sind in erster Linie als Ersatz für die Funktionen graf_growbox und graf_shrinkbox zu verstehen, die in PC-GEM dem Rechtsstreit zwischen Apple und Digital Research zum Opfer gefallen sind.

Querverweis: graf_growbox   graf_shrinkbox   Style-Guidelines

8.19.1 xgrf_2box

Name: »Animate Rectangles« - zeichnet eine Menge sich bewegender Rechtecke.
AES-Nummer: 131
Deklaration: int16_t xgrf_2box ( int16_t cx, int16_t cy, int16_t w, int16_t h, int16_t corners, int16_t cnt, int16_t xstep, int16_t ystep, int16_t doubled );
Beschreibung: Die Funktion zeichnet eine Reihe von Rechtecken, die sich über den Bildschirm bewegen. Es gilt:
Parameter Bedeutung
   
cx Anfangsposition in x-Richtung
cy Anfangsposition in y-Richtung
w Breite der Anfangsposition
h Höhe der Anfangsposition
corners Zeichnung
0 = ganze Rechtecke zeichnen
1 = nur die Ecken zeichnen
cnt Anzahl der Einzelschritte
xstep Schrittweite in x-Richtung
ystep Schrittweite in y-Richtung
doubled Schrittweite
0 = normale Schrittweite
1 = Schrittweite verdoppeln


Hinweis: Die Funktion ist ein Ersatz für die in PC-GEM (aufgrund des Rechtstreits zwischen Apple und Digital Research) gestrichenen Funktionen der FORM und GRAF Bibliotheken.
Ergebnis: Der Rückgabewert der Funktion ist z.Zt. unbekannt.
Verfügbar: Die Funktion ist nur ab PC-GEM 2.0, ab KAOS 1.4.2 und MagiC vorhanden.
Gruppe: X-Grafikfunktionen
Querverweis: Binding   xgrf_stepcalc   MagiC

8.19.2 Bindings für xgrf_2box

C: int16_t xgrf_2box ( int16_t cx, int16_t cy, int16_t w, int16_t h, int16_t corners, int16_t cnt, int16_t xstep, int16_t ystep, int16_t doubled );
Umsetzung:
int16_t xgrf_2box ( int16_t cx, int16_t cy, int16_t w, int16_t h,
                    int16_t corners, int16_t cnt,
                    int16_t xstep, int16_t ystep, int16_t doubled )
{
   int_in[0] = cnt;
   int_in[1] = xstep;
   int_in[2] = ystep;
   int_in[3] = doubled;
   int_in[4] = corners;
   int_in[5] = cx;
   int_in[6] = cy;
   int_in[7] = w;
   int_in[8] = h;

   return ( crys_if(131) );
}
GEM-Arrays:

Adresse Feldelement Belegung
control control[0] 131 # Opcode der Funktion
control+2 control[1] 9 # Einträge in int_in
control+4 control[2] 1 # Einträge in int_out
control+6 control[3] 0 # Einträge in addr_in
control+8 control[4] 0 # Einträge in addr_out
int_in int_in[0] cnt
int_in+2 int_in[1] xstep
int_in+4 int_in[2] ystep
int_in+6 int_in[3] doubled
int_in+8 int_in[4] corners
int_in+10 int_in[5] cx
int_in+12 int_in[6] cy
int_in+14 int_in[7] w
int_in+16 int_in[8] h
int_out int_out[0] Return-Wert

8.19.3 xgrf_stepcalc

Name: »Stepcalc for XGraf« - Parameterberechnung für die Animation von Rechtecken.
AES-Nummer: 130
Deklaration: int16_t xgrf_stepcalc ( int16_t orgw, int16_t orgh, int16_t xc, int16_t yc, int16_t w, int16_t h, int16_t *pcx, int16_t *pcy, int16_t *pcnt, int16_t *pxstep, int16_t *pystep );
Beschreibung: Die Funktion berechnet alle Parameter für einen Aufruf von xgrf_2box. Es gilt:
Parameter Bedeutung
   
orgw anfängliche Breite
orgh anfängliche Höhe
xc Endposition in x-Richtung
yc Endposition in y-Richtung
w Breite der Endgröße
h Höhe der Endgröße
pcx zentrierte Position nach Ablauf des Vorgangs in x-Richtung
pcy dto. für y-Richtung
pcnt Anzahl der Einzelschritte
pxstep Schrittweite in x-Richtung
pystep Schrittweite in y-Richtung


Hinweis: Aus Anfangsgröße, Endgröße und Endposition des Rechtecks werden Endposition, Anzahl der Schritte sowie Größe der Schritte bestimmt.
Ergebnis: Der Rückgabewert der Funktion ist z.Zt. unbekannt.
Verfügbar: Die Funktion ist nur ab PC-GEM 2.0, ab KAOS 1.4.2 und MagiC vorhanden.
Gruppe: X-Grafikfunktionen
Querverweis: Binding   xgrf_2box   MagiC

8.19.4 Bindings für xgrf_stepcalc

C: int16_t xgrf_stepcalc ( int16_t orgw, int16_t orgh, int16_t xc, int16_t yc, int16_t w, int16_t h, int16_t *pcx, int16_t *pcy, int16_t *pcnt, int16_t *pxstep, int16_t *pystep );
Umsetzung:
int16_t xgrf_stepcalc ( int16_t orgw, int16_t orgh, int16_t xc,
                        int16_t yc, int16_t w, int16_t h,
                        int16_t *pcx, int16_t *pcy, int16_t *pcnt,
                        int16_t *pxstep, int16_t *pystep )
{
   int_in[0] = orgw;
   int_in[1] = orgh;
   int_in[2] = xc;
   int_in[3] = yc;
   int_in[4] = w;
   int_in[5] = h;

   crys_if (130);

   *pcx    = int_out[1];
   *pcy    = int_out[2];
   *pcnt   = int_out[3];
   *pxstep = int_out[4];
   *pystep = int_out[5];

   return ( int_out[0] );
}
GEM-Arrays:

Adresse Feldelement Belegung
control control[0] 130 # Opcode der Funktion
control+2 control[1] 6 # Einträge in int_in
control+4 control[2] 6 # Einträge in int_out
control+6 control[3] 0 # Einträge in addr_in
control+8 control[4] 0 # Einträge in addr_out
int_in int_in[0] orgw
int_in+2 int_in[1] orgh
int_in+4 int_in[2] xc
int_in+6 int_in[3] yc
int_in+8 int_in[4] w
int_in+10 int_in[5] h
int_out int_out[0] Return-Wert
int_out+2 int_out[1] pcx
int_out+4 int_out[2] pcy
int_out+6 int_out[3] pcnt
int_out+8 int_out[4] pxstep
int_out+10 int_out[5] pystep

HomeAESShellfunktionenZeichensatzauswahl