EPIX, Inc. Home Page

4MOBJ "C" Library V3.2
Reference Manual

CONTENTS

 1.  Installation, Configuration, and Usage  -	Compile Time............................    4
     1.A   Introduction.................................................................    4
     1.B   Library Installation.........................................................    4
     1.C   Compiling....................................................................    5
       1.C.1  Stack.....................................................................    6
       1.C.2  Heap......................................................................    6
       1.C.3  Example: Microsoft C/C++..................................................    6
       1.C.4  Example: Borland C/C++....................................................    7
       1.C.5  Example: Watcom 32 Bit C/C++..............................................    7
     1.D   Compile Time Inclusions......................................................    7
     1.E   Common Types and Structures..................................................    8
       1.E.1  Coordinates, Images, and Image Window Structures..........................    9
     1.F   Usage Assumptions............................................................   10
     1.G   Error Codes..................................................................   10
     1.H   Memory Allocation Hooks......................................................   10
     1.I   16 Bit Environment Notes.....................................................   11
     1.J   Windows 3.x Environment Notes................................................   12
       1.J.1  Windows 3.x Environment - Callback Functions..............................   12
     1.K   Tenberry DOS4GW Environment Notes............................................   13
     1.L   Windows 95 Environment Notes.................................................   13

 2.  Installation and Configuration  -	Run Time........................................   14
     2.A   Driver Configuration Parameters..............................................   14
     2.B   DOS Environment..............................................................   15
       2.B.1  DOS Environment - Installation Errors.....................................   16
       2.B.2  DOS Environment - Software Interrupt Selection............................   17
       2.B.3  DOS Environment - EMM386..................................................   19
     2.C   Windows 3.X Environment......................................................   19
     2.D   Tenberry DOS4GW Environment..................................................   20
     2.E   Windows 95 Environment.......................................................   20

 3.  SCF Level Interface................................................................   22
     4MEG VIDEO: Open and Set Video Format - pxd_m4open.................................   22
     Get Version ID String, Run Time - pxd_id...........................................   24
     Get Version ID String, Compile Time - pxd_idstr....................................   24
     4MEG VIDEO: Close - pxd_close......................................................   24
     Get Total Image Memory Size - pxd_imsize...........................................   25
     Set Video Mode and Buffer - pxd_video..............................................   25
     Acquire: Snap Video into Buffer - pxd_snap.........................................   27
     Set Field for Video Switch - pxd_vidfield..........................................   28
     Set Genlock vs. Master Modes - pxd_vidgenlock......................................   28
     Set Video Digitize Gain and Offset - pxd_vidgainoffset.............................   29
     Set Video Resolution - pxd_vidparm.................................................   29
     Set Digitize Resolution of Split Video Formats - pxd_vidigparm.....................   31
     Get Horizontal Image Dimension - pxd_xdim..........................................   32
     Get Vertical Image Dimension - pxd_ydim............................................   32
     Get Vertical Interlace Dimension - pxd_ylace.......................................   32
     Get Pixel Component Dimension - pxd_cdim...........................................   32
     Get Horizontal Display Dimension - pxd_xdim_disp...................................   32
     Get Vertical Display Dimension - pxd_ydim_disp.....................................   32
     Get Vertical Interlace Display Dimension - pxd_ylace_disp..........................   32
     Get Pixel Component Display Dimension - pxd_cdim_disp..............................   32
     Get Current Image Buffer Number - pxd_imbuf........................................   33
     Get Number of Image Buffers - pxd_imbufs...........................................   33
     Get Field Time - pxd_vidtime.......................................................   34
     Pixel Value: Read - pxd_pixread....................................................   35
     Pixel Value: Write - pxd_pixwrite..................................................   35
     Imaging Board Buffer: Open Access to Buffer - pxd_iopen............................   36
     Imaging Board Buffer: Open Access to Color Buffer - pxd_iopencolor.................   36
     Imaging Board Buffer: Read &Write, Char - pxd_ioc.................................   38
     Imaging Board Buffer: Read &Write, Short - pxd_ios................................   38
     Imaging Board Buffer: Read &Write, Long - pxd_iol.................................   38
     Imaging Board Buffer: Test End of Access - pxd_ioeof...............................   41
     Output Lookup Table: Read &Write - pxd_lut........................................   42
     Soft Cursor: Draw &Remove - pxd_drcurs............................................   43
     Hardware Cursor: Draw &Remove - pxd_drcurd........................................   44
     Soft Rectangular Box: Draw &Remove - pxd_drbox....................................   45
     External Input Signal: Sense - pxd_extin...........................................   46
     External Output Signal: Set - pxd_extout...........................................   46
     Get PXIMAGE: Access Imaging Board Buffer - pxd_defimage............................   47
     Get PXIMAGE: Access Imaging Board Color Buffer - pxd_defimagecolor.................   47
     Set Zoom and Pan - pxd_zoom........................................................   49
     Set Subimage Pan Position - pxd_pan................................................   50
     MEGAPLUS Mode Enable - pxd_videkset................................................   51
     MEGAPLUS Mode and Acquisition - pxd_videkdo........................................   51
     MEGAPLUS Mode and Acquisition - pxd_videkdo2.......................................   51
     Errors: Check &Report Insufficient Stack Space - pxd_chkstack.....................   53
     Errors: Check &Report Severe Fault - pxd_chkfault.................................   53
     Save Image: BMP Format - pxd_bmpsave...............................................   54
     Load Image: BMP Format - pxd_bmpload...............................................   54
     Save Image: TIFF Format - pxd_tiffsave.............................................   56
     Load Image: TIFF Format - pxd_tiffload.............................................   56
     Save Image: PCX Format - pxd_pcxsave...............................................   57
     Windows: Display Image Buffer On Device - pxd_StretchDIBits........................   59

 4.  Initialization &Support Functions.................................................   61
     4MEG VIDEO Driver: Open - m4drv_open...............................................   61
     4MEG VIDEO Driver: Close - m4drv_close.............................................   63
     Errors: Obtain Last Posted Fault Information - pxdrv_fault.........................   63
     Construct PXIMAGE: Access Imaging Board Buffer - pxvid_setpximage..................   65
     Construct PXIMAGE: Access Imaging Board Buffer - pxvid_setpximage2.................   65
     Construct PXIMAGE3: Access Imaging Board Buffers - pxvid_setpximage3...............   68
     Errors: Translate Error Code to String - pxerrnomesg...............................   69

 5.  Video Control......................................................................   71
     M4FORMAT: 4MEG VIDEO, Video Format Specification - Struct m4format.................   71
     PXVIDPARM: Video Resolution Specification - Struct pxvidparm.......................   77
     PXVIDMODE: Video Mode Specification - Struct pxvidmode.............................   82
     PXCAMCARD: Auxiliary Camera Control Card Specification - Struct pxcamcard..........   84
     Video States, Define - pxvid_define................................................   84
     Video States, Define - pxvid_define4...............................................   84
     Video States, Undefine - pxvid_undefine............................................   89
     Video States: Load - pxvid_load....................................................   90
     Video States: Unload - pxvid_unload................................................   91
     Video State: Activate State &Mode - pxvid_gomode..................................   91
     Video State: Activate State &Buffer - pxvid_gobuf.................................   92
     Video State: Activate State &Buffer - pxvid_go....................................   92
     Video State: Activate State &Mode, Async. - pxvid_gomodea.........................   93
     Video State: Test Completion of Activate State, Async. - pxvid_gomodew.............   94
     Video State: Get State's Video Components - pxvid_xstatevect.......................   95
     Video State: Get State's Video Resolution - pxvid_xparm............................   95
     Video State: Get State's Video Format - pxvid_xformat..............................   95
     Video State: Get State's Video Mode - pxvid_xmode..................................   95
     Video State: Get State's Definition Options - pxvid_xdipopt........................   95
     Video State: Get State's Device Independent Format - pxvid_xpformat................   95
     Video State: Get State's Current Image Buffer - pxvid_xbuf.........................   95
     Video State: Get State's Maximum Image Buffers - pxvid_xbufs.......................   95
     Video State: Get Current State - pxvid_xstate......................................   97
     Get Vertical Blanking Time - pxdrv_xvbtime.........................................   97
     Get Video Status - pxdrv_xstatus...................................................   98
     Get Video State - pxdrv_xstate.....................................................   99
     Video States: Import - pxvib_defimport.............................................  100
     Video States: Export - pxvib_defexport.............................................  100

 6.  Image Memory Access................................................................  102
     Image Memory: Translate X, Y Coordinate to Address - pxvid_xyadrs..................  102
     Image Memory: Read &Write - pxdrv_imio............................................  103
     Image Memory: Test Completion of Read &Write - pxdrv_imiow........................  104
     Image Memory: Get Optimal Read &Write Length - pxdrv_imioz........................  104
     Image Memory: Obtain Direct Mapping - pxdrv_imap...................................  105
     Image Memory: Release Direct Mapping - pxdrv_imapr.................................  106
     PXIMAGE: Image and Pixel Specifications - Struct pximage...........................  107
     PXIMAGE: Set &Get Area of Interest Window - pximage::xwind........................  111
     PXIMAGE: Get Advice, Errors, Info &Options - pximage::aeiou.......................  111
     PXIMAGE: Set to Access Sequential Pixels - pximage::ioset..........................  113
     PXIMAGE: Read Sequential Pixels - pximage::ioread..................................  113
     PXIMAGE: Write Sequential Pixels - pximage::iorite.................................  113
     PXIMAGE: Wait for Sequential Access Completion - pximage::iowait...................  113
     PXIMAGE: Obtain Sequential Access Pixel Count - pximage::iolen.....................  113
     PXIMAGE: Set to Access Non-Sequential Pixels - pximage::bxts.......................  115
     PXIMAGE: Prepare for Non-Sequential Pixel Access - pximage::bxtp...................  115
     PXIMAGE: Access Non-Sequential Pixels - pximage::bxta..............................  115
     PXIMAGE: Wait for Non-Sequential Access Completion - pximage::bxtw.................  115
     PXIMAGE: Set to Obtain Pointer to Pixels - pximage::imapset........................  117
     PXIMAGE: Obtain Pointer to Pixels - pximage::imap..................................  117
     PXIMAGE: Release Pointer to Pixels - pximage::imapr................................  117
     Sequential Access: Establish Access to Image Buffer - pxb8_iopen...................  121
     Sequential Access: Read &Write Image Buffer - pxb8_io.............................  121
     Sequential Access: Test End of Image Buffer - pxb8_ioeof...........................  121
     Sequential Access: Reposition within Image Buffer - pxb8_ioseek....................  121
     Sequential Access: Read &Write Image Buffer, Async. - pxb8_iof....................  121
     Sequential Access: Test Read &Write Complete - pxb8_iow...........................  121
     Sequential Access: Get Transfer Count - pxb8_iodone................................  121
     Sequential Access: Check or Wait upon Read &Write - pxb8_ioflush..................  121
     Sequential Access: Terminate Access - pxb8_ioclose.................................  121
     Sequential Access: Obtain Number of Unused Handles - pxb8_iopens...................  121
     Pixel List: Access &Modify Pixels - pxdrv_pixbxt..................................  122
     Pixel List: Test Access Completion - pxdrv_pixbxtw.................................  122
     Pixel List: Get Optimal Asynchronous Length - pxdrv_pixbxtz........................  122
     Pixel List: Translate Memory Addresses - pxdrv_pixlate.............................  122
     Pixel List: Translate X, Y Coordinates - pxvid_pixlate.............................  122

 7.  TMS320C2x Based Image Processing...................................................  124
     TMS320C2x: Load and Execute Program upon AOI - pxd_tmstmx..........................  124
     TMS320C2x Bound: 3x3 Convolution upon AOI - pxd_tmscon3............................  125
     TMS320C2x Bound: Compute Histogram upon AOI - pxd_tmshist..........................  126
     TMS320C2x: Load Program - m4drv_tmxload............................................  127
     TMS320C2x: Check if Program Loaded - m4drv_tmxloaded...............................  128
     TMS320C2x: Execute Program - m4drv_tmxec...........................................  129
     TMS320C2x Support: Fill m4tmxarg Structure - m4drv_tmxsetarg.......................  130
     TMS320C2x: Test Completion of Program - m4drv_tmxecw...............................  131
     TMS320C2x: Terminate Program - m4drv_tmxdone.......................................  132
     TMS320C2x Native: Low pass Filter - TMXLPF11.HEX...................................  132
     TMS320C2x Native: Morphological Medial Axis Thin - TMXMEDAX.HEX....................  133
     TMS320C2x Native: Morphological Erode - TMXMPERO.HEX...............................  133
     TMS320C2x Native: Morphological Dilate - TMXMPDIL.HEX..............................  133
     TMS320C2x Native: Morphological Boundary - TMXMPBOU.HEX............................  133
     TMS320C2x Native: Binarize for Morphology - TMXMPBIN.HEX...........................  133
     TMS320C2x Native: Image Flips - TMXROTAT.HEX.......................................  134
     TMS320C2x Native: Pixel AND, OR, XOR - TMXSPO.HEX..................................  135
     TMS320C2x Native: Pixel Set, Complement, Threshold - TMXSPO.HEX....................  135
     TMS320C2x Native: Image Sequence Average - TMXSQAVE.HEX............................  136
     TMS320C2x Native: Image Sequence Subtraction - TMXSQDIF.HEX........................  136
     TMS320C2x Native: Count Pixels Relative to Threshold - TMXCNTHR.HEX................  137
     TMS320C2x Native: Image Pair Logical Operations - TMXPRLOG.HEX.....................  138
     TMS320C2x Native: Image Copy - TMXPRLOG.HEX........................................  138
     TMS320C2x Native: Image Pair Add &Subtract - TMXPRADD.HEX.........................  139
     TMS320C2x Native: Tabulate Histogram - TMXHIST.HEX.................................  140
     TMS320C2x Native: Compute Pixel Summation/Mean - TMXNSUM.HEX.......................  141

 8.  TMS320C40 Based Image Processing...................................................  142
     TMS320C40: Load Program from File - m4drv_tmyloadfile..............................  142
     TMS320C40: Load Program from Buffer - m4drv_tmyloadprog............................  142
     TMS320C40: Obtain Number of Processors - m4drv_tmyprocs............................  143
     TMS320C40: Obtain Processor Corresponding to Image - m4drv_tmyprocimage............  144
     TMS320C40: Execute Program - m4drv_tmyexec.........................................  144
     TMS320C40: Communicate with Program - m4drv_tmymesg................................  146
     TMS320C40: Test Completion of Program - m4drv_tmyexecw.............................  147
     TMS320C40: Terminate Program - m4drv_tmydone.......................................  148
     TMS320C40 Support: Image Specification - struct m4c40image.........................  148
     TMS320C40 Support: Create Image Definition from PXIMAGE - m4c40_setimage...........  148
     TMS320C40 Support: Create Image Definition from PXIMAGE3 - m4c40_setimage3.........  148
     TMS320C40 Native: Convert IEEE Float to C40 Float - c40toieee......................  150
     TMS320C40 Native: Convert C40 Float to IEEE Float - c40fromieee....................  150
     TMS320C40 Native: Check Stack - c40m4_checkstack...................................  150
     TMS320C40 Native: Construct PXIMAGE from c40m4image - c40m4_setpximage.............  151
     TMS320C40 Native: Construct PXIMAGE3 from c40m4image - c40m4_setpximage3...........  151
     TMS320C40 Native: Construct PXIMAGE for Image in Memory - c40m4_pximage_memory.....  152
     TMS320C40 Native: Construct PXIMAGE3 for Images in Memory - c40m4_pximage3_memory..  152

 9.  Lookup Tables......................................................................  154
     Output Lookup Table: Read &Write - pxdrv_olutio...................................  154
     Output Lookup Table: Test Completion of Read &Write - pxdrv_olutiow...............  155
     Output Lookup Table: Get Number of Table Sets - pxdrv_olutsetn.....................  155

10.  Hardware Cursor....................................................................  157
     Hardware Cursor: Draw - pxvid_curon................................................  157
     Hardware Cursor: Remove - pxvid_curoff.............................................  157
     Hardware Cursor: Draw Box - pxvid_curboxon.........................................  158
     Hardware Cursor: Remove Box - pxvid_curboxoff......................................  158
     Hardware Cursor: Save State - pxdrv_cursave........................................  159
     Hardware Cursor: Load State - pxdrv_curload........................................  159
     Hardware Cursor: Get State Size - pxdrv_cursavez...................................  159
     Hardware Cursor: Set Appearance - m4drv_curopt.....................................  160
     Hardware Cursor: Set Icon - m4drv_curicon..........................................  161

11.  Miscellaneous Services.............................................................  163
     Video State: Define State for Zoom - pxvib_zoom....................................  163
     External Input Signal: Sense - pxdrv_extin.........................................  166
     External Output Signal: Set - pxdrv_extout.........................................  166
     External Output Signal: Test Completion of Set - pxdrv_extoutw.....................  167
     External Output Signal: Get Current Value - pxdrv_extoutv..........................  167
     Interrupt Invocation: Request - pxdrv_intfun.......................................  168
     Interrupt Invocation: Cancel - pxdrv_intfunr.......................................  169

12.  Multiple Imaging Boards............................................................  170
     Imaging Boards: Get Number of Units - pxdrv_xunits.................................  170
     Imaging Boards: Select Units - pxdrv_devunits......................................  170
     Imaging Boards: Select Unit - pxdrv_devunit........................................  173
     Imaging Boards: Get Selected Unit(s) - pxdrv_xdevunits.............................  174

13.  Additional Features................................................................  175
     User-Defined Premature Termination Functions - pxabortfunc_t.......................  175
     Copy Image Buffer to Raw Image Address - pxip8_copyintoradrs.......................  176
     Copy Image Buffer from Raw Image Address - pxip8_copyfromradrs.....................  176
     Image Sequence: Save in Image Memory Format - pxio8_fmbwrite.......................  177
     Image Sequence: Load in Image Memory Format - pxio8_fmbread........................  177
     Image Sequence: Acquire - pxvib_gosequence.........................................  180
     Acquire: Triggered Video Capture - pxvib_gotrig2...................................  181
     Acquire: Triggered Video Capture - pxvib_gotrig....................................  181

14.  Hints &Code Fragments.............................................................  184
     14.A  Saving and Restoring Image Buffers...........................................  184
     14.B  Porting Custom Video Parameters..............................................  186
     14.C  Mouse Control................................................................  187

15.  Release Notes......................................................................  190

16.  Distribution Contents..............................................................  200

17.  Index..............................................................................  203

Back to EPIX Software

Back to the EPIX home page

Image Processing Products For Research and Industry