PICOS-EXTENDED Library package contains 7 basic function blocks to control the framegrabber:
Input Functions
This group of functions controls the image data input: the selection
of the camera type (RGB or B/W), the input channel (AFP/CFP-AT: 1 of 2
for RGB, 1 of 6 for B/W; BFP-AT: 1 of 4 B/W), the A/D-converter high and
low levels for all 3 frames and the input look-up-tables (LUT's).
Output Functions
This group contains all functions to manipulate the monitor display
of the stored image data such as the selection of the frame to be displayed,
the output look-up-table, the AFP/CFP-AT's image color format (24-bit,
15-bit, 8-bit).
Display Functions
The AFP/CFP image frame grabbers provide an image and overlay data
area of up to 2048 x 1024 (CFP) or 2048 x 2048 pixels (AFP) for all 3 frames
red, green and blue. Access and display of these 3 frames can be done in
various image formats, color mode combinations and spatial resolutions.
The BFP-AT offers 2048 x 1024 x 8 bit to be defined in different ways.
Transfer Functions
These functions allow block- or line-oriented image data transfer between
the frame grabber and user memory or disk files. Image data file storage
and retrieval on harddisk may be performed with multiple 256 x 256 square
blocks or in line-by-line format. Fast user access to image data is performed
via line and column read/write functions.
Overlay Functions
The overlay area of the XFP board is an additional data plane of the
same size as the image data plane and allows for overlaying image data
with user information like text, drawings, masks, etc. Furthermore it allows
to use a bit mask for setting image data underneath this mask selectively
to live status. Selective or general clearing of this plane is possible.
LUT Functions
With this group of functions the input and output look-up-tables can
be set, switched and selected. General Functions Initializing and resetting
the frame grabber, selecting video standards and other general utilities
are provided here.
System specific functions
Windows Environment:
The Windows Library is implemented as a dynamic link library DLL. PICOS-DLL
is a complete, easy-to-use function library for compilers which are able
to call a DLL (Borland* C++, Turbo Pascal for Windows*, Microsoft-C*, Visual-Basic,etc.).
Windows is a 16 bit environment, so you have the same restrictions as under
plain old DOS. If you want to set a pointer to the frame grabber memory
you have to call the function "GetSel" to get a selector and
compute a far pointer out of this ( see function "GetSel" ).
The selector you get has a size of 64 kB if the address is below 1 MB (
Mapper address 0xA0000, 0xD0000 or 0xE0000 ) or 2MB if it is above ( Mapper
Address 0xC00000 or 0xE00000 , only BFP ). If you want to use the protected
mode mapper, verify that your computer has less than 12 MB memory and the
pointers you use are able to calculate an offset above 0xFFFF ( 32 bit
offset, normally requires assembly ).
Windows NT Environment:
The Windows NT package consists of a 32 bit DLL and an NT specific
driver. The DLL resides in user space and so it is possible to rebuild
or debug these functions very easy, whereas the driver resides in kernel
space to allow the DLL the hardware access. Windows NT has a linear address
space, that means each application uses its own selectors with 32 bit offset
to access 4 GB memory and never changes these selectors. So under Windows
NT you could create a selector and do the same things as under Windows,
but it is much easier. All you have to do is call the function "GetLinAdr"
and cast it to a pointer. This funcion returns a linear address that points
to the 64 kB mapper below 1 MB. It is not possible to use the BFP protected
mode mapper, mainly because Windows NT won't start with less than 12 MB
memory.
Win32s Environment:
This environment consists of some redistributable libraries from Microsoft
to enhance Windows 3.x to start Windows NT executables. This Win32 subset
(WIN32s), the 32 bit PICOS DLL and the Win32s specific universal thunking
„PICOS16.DLL“ allows a Windows NT exe to participate from the advantages
of 32bit and the wide distribution of Windows. The handling of Win32s applications
is identical with Windows NT.
DOS Extender Environment:
DOS Extender switch to protected mode to allow applications to use
a 32 bit environment under DOS if they don't need a GUI. The DOS Extender
package consists of several static libraries to support all possible combinations
of compiler and extender, which are shown below:
| Compiler / Extender | Borland 4.5 | Microsoft 32 bit edition | Watcom 9.5b |
| Borland PowerPack | picos3bb.lib | -- | -- |
| Pharlap TNT 6.1 | picos3bp.lib | picos3mp.li | picos3wp.lib |
| Rational 4GW | -- | -- | picos3wr.lib |
| Ergo | -- | -- | picos3we.lib |
Best combination is Watcom with the Rational extender, Microsoft with
Pharlap TNT 6.1 and Borland with the PowerPack.
The Watcom compiler supports a segmented flat memory modell , that means
it is possible to make a far call and change the selector. This is very
usefull, because so you can call "GetSel" to receive a selector
that points to the first megabyte, the DOS memory, cast it to a far pointer
and add the return value of "GetLinAdr", which is simply the
offset to the mapper base address. Now your pointer consists of 48 bits,
16 bit selector and 32 bit offset.
The Borland/Microsoft compiler do not support a segmented memory modell,
the key word "far" is unknown. But we need a pointer( selector)
to a specific address, and no extender has a system function to convert
a 16:32 pointer to a 0:32 pointer. So we had to implement something without
compiler support. The solution is to switch a selector each time we want
to access the mapper memory. You can see how this is done in the source
files hwaccess.cpp and extender.cpp( this means assembly code ), but it
is highly recommended to use the PixRd/Wr, LinRd/Wr or BlkRd/Wr functions
to copy the mapper memory in a buffer in your data area.
The libraries come with a sample (main.c) and batch files to build an executable
for the different environments. The pathes in the batch files need to be
adapted to your settings.
| ACCMOD | select 8 or 16 bit access to grabber memory |
|---|---|
| ARROW | draws arrow cursor on overlay plane |
| BGRRD | read line in BGR format |
| BGRWR | write line in BGR format |
| BLKCOP | BlockCopy: copy memory from/to user memory |
| BLKFIL | BlockFill: fill image or overlay with a value |
| CAMSEL | CameraSelect: select camera input modes |
| CLOSEDIB | CloseDIB: delete DIB |
| CLRALL | ClearAll: clear data or overlay |
| CLROVL | ClearOverlay: clear overlay plane |
| COLRD | ColumnRead: read a column |
| COLWR | ColumnWrite: write a column |
| CPUACC | CpuAccess: select access mode |
| CPUADR | CpuAddress: set mapper coordinates |
| DEFWND | DefineWindow: define area of interest on overlay plane |
| DSPADR | DisplayAddress: set display coordinates |
| DSPDIB | DisplayDIB: display DeviceIndependantBitmap |
| DSPFMT | DisplayFormat: select display format |
| DSPHLF | DisplayHalf: select half image (field) modes |
| DSPMOD | DisplayMode: select display mode |
| DSPTOVGA: | copy display to VGA device context |
| DSPVIS | DisplayVisibility: switch display on/off |
| GETAOI | Get information about AOI |
| GETERROR | GetError: convert error code to ASCII text |
| GETINF | GetInformation: get information about frame grabber |
| GETLINADR | GetLinearAddress: returns linear address of mapper memory |
| GETSEL | GetSelector: returns memory selector |
| HSICTR | HsiControll: HSI conversion |
| HSWAIT | HorizontalSyncWait: H-sync timer function |
| IMGRDEX | ImageRead: read image from file, DOS library compatibel |
| IMGWREX | ImageWrite: write image to file, DOS library compatibel |
| INGAIN | InputGainadjust: AD lower and upper level |
| INLUT | InputLUT: select/define input LUT |
| INMOD | InputMode: select image input mode |
| LEUINI | LeutronInitialization: frame grabber initialisation |
| LINRD | LineRead: read a line |
| LINWR | LineWrite: write a line |
| LIVE | Live: select live/freeze status |
| MAPFMT | MapperFormat: select map format |
| MAPTODIB | MapperToDIB: fill DIB with values from frame grabber memory |
| MSHKOFF | MouseHookOff: uninstall mouse hook function |
| MSHKON | MouseHookOn: install hook function |
| OPENDIB | OpenDIB: create a DeviceIndependentBitmap |
| OPENFILEDIB | OpenFileDIB: make a DeviceIndependentBitmap from file data |
| OPTIN | OptocouplerInput: read optocoupler input |
| OPTOUT | OptocouplerOutput: set optocoupler output |
| OPTRIG | OptocouplerTrigger: read edge detection optocoupler |
| OUTLUT | OutputLUT: define output LUT |
| OUTLVL | OutputLevel: select 8/6 bit display mode |
| OUTMOD | OutputMode: select output mode |
| OUTMSK | OutputMask: set pixel read mask |
| OVLINE | OverlayLine: draw line on overlay |
| OVRLUT | OverlayLUT: define overlay LUT |
| PIXRD | PixelRead: read a pixel |
| PIXWR | PixelWrite: write pixel |
| REGRD | RegisterRead: returns contents of PICOS shadow register |
| REGWR | RegisterWrite: manipulate PICOS shadow register |
| RGBBW | RedGreenBlueToBlackAndWhite: convert RGB line to BW |
| RGBRD | RGBRead: read RGB line |
| RGBWR | RGBWrite: write RGB line |
| STRCHDIB | StrechDIB: stretch DIB in DC to display it |
| SWPADR | SwapAddress: set active frame grabber |
| SWPMON | SwapMonitor: set VGA bypass |
| TEXT Text | write text on overlay |
| TEXTEX Text | write text on frame grabber memory plane |
| TGARD | TargaRead: read Targa file |
| TGAWR | TargaWrite: write Targa file |
| TIFRDEX | TagImageFileFormatRead: read TIFF file |
| TIFWREX | TagImageFileFormatWrite: write TIFF file |
| VIDBUS | VideoBus: video bus control |
| VIDMSK | VideoMask: video live mask control |
| VIDSTD | VideoStandard: set video standard |
| VSWAIT | VertikalSyncpulsWait: timer synchronization |
| ZOOM | Zoom: hardware zoom |
PICLAB-32 for Windows3.1, WindowsNT and DOS 32bit Extender
| Ordering Number | Description |
| 3'300'035 | PICOS-EXTENDED
basic programming library for AFP-AT, BFP-AT or CFP-AT. Supports Windows 16-bit, Win32s, Windows NT with DLLs, and DOS 32-bit with library |