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

2.3.1.9 Load External Routine (%X)

Cogsys External Routines are dynamically-linked subroutines which generate graphics stimuli using the %I directive. Discussion of the creation and use of external routines (commonly called extensions) is complicated enough to merit its own chapter (3. Extensions). However, loading an external routine is a relatively simple end-user command. A single argument is needed: the name of the file that contains the Cogsys Extension Routine. In Cogsys 3.x, these files were named with the `*.CXR' extension. In Cogsys 4.x, these files have a `*.so' extension, but the %X call still uses a `*.CXR' extension, to allow old Cogsys testlists to be compatible with the new object files.

Only one extension may be loaded at a time. Successive calls to Load External Routine implicitly unload the previously loaded code, and load the new code. However, the output of two extensions can be combined on to the same image and can be displayed simultaneously.

Extensions operate on a 320-pixel wide by 200-pixel high "playground" in the center of a 640-by-480 screen. The coordinate systems used by extensions either have (0,0) be the center of the screen, or (160,100) is the center of the screen. In all cases, an increasing Y-value will place drawn images closer to the bottom of the screen.

These are the extensions which are included with Cogsys 4.x:

`RANDEXT.CXR'
create pictures that contain random dot patterns
`CIRCEXT.CXR'
create pictures that contain circles
`SQUAREXT.CXR'
create pictures that contain squares
`RECTEXT.CXR'
create pictures that contain rectangles
`DOTSEXT.CXR'
create pictures that move dots coherently
`GABOREXT.CXR'
create pictures with Gabor patches
`TXTEXT.CXR'
create pictures that contain text

Name:
Load External Routine
Class:
Control
Code:
%X
Syntax:
%X[filename]
System:
Loads the external routine filename into memory.

History:
The entire external loading functionality was brand new as of Cogsys 3.x.

Test Files:
LCXR_T01.IN: Tests basic operation

 
%M2%C2#F10

%X[squarext.cxr]
%I[1,20,-80,-80]

%X[circext.cxr]
%I[1,P1,10,80,0]

%X[rectext.cxr]
%I[1,P2,201,51,0,25]
%I[1,P3,320,200,0,0]

%J[1,4,100]%J[4,4,1]
%A[X320,Y75,J2,C15,F1]
#G[Press any key to exit]#R

Example:

input
 
%M2
%X[txtext.cxr]
%I[1,1,160,100,N]
%I[12,P1,4,.3]
%K[2,13,1]
cogsys
Loads the Cogsys text extension routine, `txtext.so'. The %I invokes the Create Pictures from CXR command (2.3.5.5 Create Pictures from CXR (%I)), which uses the CXR to create 13 pictures (twelve pictures use the first picture as a starting point). The %K command then displays pictures 2-13 until a key is pressed.


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

This document was generated on November, 24 2008 using texi2html