Functions | |
| BOOL | dvcAllocateUserBuffers (HANDLE hDevice, dvcBufStructP pBufStruct, Int32 nBuffers) |
| BOOL | dvcCopyCharImageData (HANDLE hDevice, PBYTE pBuffer, PBYTE pLut) |
| BOOL | dvcCopyShortImageData (HANDLE hDevice, PUSHORT pBuffer) |
| BOOL | dvcGetDriverBuffers (HANDLE hDevice, PInt32 pNBuffers, PInt32 pLastBuffer) |
| BOOL | dvcGetExposeCompleteEvent (HANDLE hDevice, PHANDLE phEvent) |
| Int32 | dvcGetExposeCount (HANDLE hDevice) |
| UInt32 | dvcGetFrameCount (HANDLE hDevice) |
| double | dvcGetFrameRate (HANDLE hDevice) |
| UInt32 | dvcGetImageBytes (HANDLE hDevice) |
| BOOL | dvcGetImageFormat (HANDLE hDevice, Int32 nX, Int32 nY, PInt32 pFormat) |
| Int32 | dvcGetImageHeight (HANDLE hDevice) |
| Int32 | dvcGetImageWidth (HANDLE hDevice) |
| BOOL | dvcGetReadCompleteEvent (HANDLE hDevice, PHANDLE phEvent) |
| BOOL | dvcGetStreamBytes (HANDLE hDevice, PInt32 pState, PULONG pnBytes) |
| Int32 | dvcGetStreamCount (HANDLE hDevice) |
| double | dvcGetStreamTime (HANDLE hDevice) |
| double | dvcGetTimeToExposeComplete (HANDLE hDevice) |
| double | dvcGetTimeToNextExpose (HANDLE hDevice) |
| double | dvcGetTimeToReadComplete (HANDLE hDevice) |
| double | dvcGetTimeToReadImage (HANDLE hDevice) |
| BOOL | dvcGetUserBufferId (HANDLE hDevice, PInt32 pID) |
| BOOL | dvcHasCallback (HANDLE hDevice) |
| BOOL | dvcReadDriverBuffer (HANDLE hDevice, Int32 nBuffer, PUSHORT pBuffer, ULONG uLeft, ULONG uTop, ULONG uWidth, ULONG uHeight) |
| BOOL | dvcReadDriverBufferEx (HANDLE hDevice, Int32 nBuffer, PUSHORT pBuffer, ULONG uLeft, ULONG uTop, ULONG uWidth, ULONG uHeight, ImageMetaDataP pMeta) |
| BOOL | dvcReadImage (HANDLE hDevice, USHORT *pBuffer, UInt32 left, UInt32 top, UInt32 width, UInt32 height) |
| BOOL | dvcReadImageAndMeta (HANDLE hDevice, PUSHORT pBuffer, ULONG uLeft, ULONG uTop, ULONG uWidth, ULONG uHeight, ImageMetaDataP pMeta) |
| BOOL | dvcReadImageEx (HANDLE hDevice, USHORT *pBuffer, UInt32 left, UInt32 top, UInt32 width, UInt32 height, UInt32 lineWidth) |
| BOOL | dvcReadImageRGB48 (HANDLE hDevice, PUSHORT pRGBBuffer, ULONG uLeft, ULONG uTop, ULONG uWidth, ULONG uHeight) |
| BOOL | dvcReadLine (HANDLE hDevice, UInt32 x, UInt32 y, UInt32 w, USHORT *pData) |
| BOOL | dvcReadMeta (HANDLE hDevice, ImageMetaDataP pMeta) |
| BOOL | dvcReadPixel (HANDLE hDevice, UInt32 x, UInt32 y, PInt32 pData) |
| BOOL | dvcReadRGB32 (HANDLE hDevice, PULONG buffer, ULONG uLeft, ULONG uTop, ULONG uWidth, ULONG uHeight, ULONG lineWidth, BOOL bWhiteBalance) |
| BOOL | dvcReleaseUserBuffers (dvcBufStructP pBufStruct) |
| BOOL | dvcSetUserBuffers (HANDLE hDevice, dvcBufStructP pBufStruct) |
| BOOL | dvcWaitExpose (HANDLE hDevice, double dWaitMilliSeconds) |
| BOOL | dvcWaitImage (HANDLE hDevice, double dWaitMilliSeconds) |
| BOOL dvcAllocateUserBuffers | ( | HANDLE | hDevice, | |
| dvcBufStructP | pBufStruct, | |||
| Int32 | nBuffers | |||
| ) |
Allocate application ring buffers for streaming acquisitions.
| hDevice | handle from dvcOpenCamera(). | |
| pBufStruct | pointer to a dvcBufStruct structure filled on return. | |
| nBuffers | the number of buffers to allocate. |
| BOOL dvcCopyCharImageData | ( | HANDLE | hDevice, | |
| PBYTE | pBuffer, | |||
| PBYTE | pLut | |||
| ) |
Returns a captured image as an 8-bit array.
| hDevice | handle from dvcOpenCamera(). | |
| pBuffer | byte array of dimensions dvcGetXDim() by dvcGetYDim(). | |
| pLut | byte array used as a lookup table to convert the 10 or 12-bit raw image data to bytes. |
| BOOL dvcCopyShortImageData | ( | HANDLE | hDevice, | |
| PUSHORT | pBuffer | |||
| ) |
returns a captured image as an 16-bit array.
| hDevice | handle from dvcOpenCamera(). | |
| pBuffer | short array of dimensions dvcGetXDim() by dvcGetYDim(). |
| BOOL dvcGetDriverBuffers | ( | HANDLE | hDevice, | |
| PInt32 | pNBuffers, | |||
| PInt32 | pLastBuffer | |||
| ) |
| hDevice | handle from dvcOpenCamera(). | |
| pNBuffers | returned with the number of buffers in the API's internal ring buffer. | |
| pLastBuffer | returned with the index of the last buffer written. |
| BOOL dvcGetExposeCompleteEvent | ( | HANDLE | hDevice, | |
| PHANDLE | phEvent | |||
| ) |
returns a previously installed expose complete event handle.
| hDevice | returned from dvcOpenCamera(). | |
| phEvent | handle for a previously installed event or NULL. |
| Int32 dvcGetExposeCount | ( | HANDLE | hDevice | ) |
| hDevice | handle returned from dvcOpenCamera(). |
| UInt32 dvcGetFrameCount | ( | HANDLE | hDevice | ) |
Get the frame number of the last image transferred.
| hDevice | camera handle returned from dvcOpenCamera(). |
| double dvcGetFrameRate | ( | HANDLE | hDevice | ) |
| hDevice | handle from dvcOpenCamera(). |
| UInt32 dvcGetImageBytes | ( | HANDLE | hDevice | ) |
| hDevice | handle from dvcOpenCamera(). |
| BOOL dvcGetImageFormat | ( | HANDLE | hDevice, | |
| Int32 | nX, | |||
| Int32 | nY, | |||
| PInt32 | pFormat | |||
| ) |
returns the bayer pattern.
| hDevice | returned from dvcOpenCamera(). | |
| nX | column for the first pixel. | |
| nY | row for the first pixel. | |
| pFormat | returns with one of the following; DVC_FORMAT_BAYER_10_RG,
DVC_FORMAT_BAYER_10_GR,
DVC_FORMAT_BAYER_10_BG,
DVC_FORMAT_BAYER_10_GB,
DVC_FORMAT_BAYER_12_RG,
DVC_FORMAT_BAYER_12_GR,
DVC_FORMAT_BAYER_12_BG,
DVC_FORMAT_BAYER_12_GB,
DVC_FORMAT_MONO_10,
DVC_FORMAT_MONO_12,
|
| Int32 dvcGetImageHeight | ( | HANDLE | hDevice | ) |
| hDevice | handle from dvcOpenCamera(). |
| Int32 dvcGetImageWidth | ( | HANDLE | hDevice | ) |
Returns the width of the last captured image in the API's ring buffer. The API's ring buffers are updated in dvcStartSequence() or dvcSnapShot() after a binning or ROI change.
| hDevice | handle from dvcOpenCamera(). |
| BOOL dvcGetReadCompleteEvent | ( | HANDLE | hDevice, | |
| PHANDLE | phEvent | |||
| ) |
returns a previously installed read complete event handle.
| hDevice | returned from dvcOpenCamera(). | |
| phEvent | handle for a previously installed event or NULL. |
| BOOL dvcGetStreamBytes | ( | HANDLE | hDevice, | |
| PInt32 | pState, | |||
| PULONG | pnBytes | |||
| ) |
| hDevice | handle returned from dvcOpenCamera(). | |
| pState | returns the readout status | |
| pnBytes | returns the number of bytes transferred in the next buffer. |
| Int32 dvcGetStreamCount | ( | HANDLE | hDevice | ) |
| hDevice | camera handle returned from dvcOpenCamera(). |
| double dvcGetStreamTime | ( | HANDLE | hDevice | ) |
| hDevice | handle from dvcOpenCamera(). |
| double dvcGetTimeToExposeComplete | ( | HANDLE | hDevice | ) |
| hDevice | returned from dvcOpenCamera(). |
| double dvcGetTimeToNextExpose | ( | HANDLE | hDevice | ) |
| hDevice | returned from dvcOpenCamera(). |
| double dvcGetTimeToReadComplete | ( | HANDLE | hDevice | ) |
| hDevice | returned from dvcOpenCamera(). |
| double dvcGetTimeToReadImage | ( | HANDLE | hDevice | ) |
| hDevice | handle from dvcOpenCamera(). |
| BOOL dvcGetUserBufferId | ( | HANDLE | hDevice, | |
| PInt32 | pID | |||
| ) |
return the last ring buffer filled.
| hDevice | handle from dvcOpenCamera(). | |
| pID | zero indexed id in the dvcBufStruct installed in the driver. |
| BOOL dvcHasCallback | ( | HANDLE | hDevice | ) |
Test if a callback is currently installed with dvcSetCallback().
| hDevice | handle from dvcOpenCamera(). |
| BOOL dvcReadDriverBuffer | ( | HANDLE | hDevice, | |
| Int32 | nBuffer, | |||
| PUSHORT | pBuffer, | |||
| ULONG | uLeft, | |||
| ULONG | uTop, | |||
| ULONG | uWidth, | |||
| ULONG | uHeight | |||
| ) |
copy the image data from an internal API buffer.
| hDevice | returned from dvcOpenCamera(). | |
| nBuffer | zero indexed driver buffer id. | |
| pBuffer | user supplied short array of uWidth by uHeight size. | |
| uLeft | the left most pixel to copy from the the driver buffer. | |
| uTop | the top most pixel to copy from the driver buffer. | |
| uWidth | the width of the area to copy. Must be less than dvcGetImageWidth(). | |
| uHeight | the height of the area to copy. Must be less than dvcGetImageHeight(). |
| BOOL dvcReadDriverBufferEx | ( | HANDLE | hDevice, | |
| Int32 | nBuffer, | |||
| PUSHORT | pBuffer, | |||
| ULONG | uLeft, | |||
| ULONG | uTop, | |||
| ULONG | uWidth, | |||
| ULONG | uHeight, | |||
| ImageMetaDataP | pMeta | |||
| ) |
copy the image and meta data from an internal API buffer.
| hDevice | returned from dvcOpenCamera(). | |
| nBuffer | zero indexed driver buffer id. | |
| pBuffer | user supplied short array of uWidth by uHeight size. | |
| uLeft | the left most pixel to copy from the the driver buffer. | |
| uTop | the top most pixel to copy from the driver buffer. | |
| uWidth | the width of the area to copy. Must be less than dvcGetImageWidth(). | |
| uHeight | the height of the area to copy. Must be less than dvcGetImageHeight(). | |
| pMeta | returned with the ImageMetaData structure filled. |
| BOOL dvcReadImage | ( | HANDLE | hDevice, | |
| USHORT * | pBuffer, | |||
| UInt32 | left, | |||
| UInt32 | top, | |||
| UInt32 | width, | |||
| UInt32 | height | |||
| ) |
Copy raw data from the last frame to an application buffer.
| hDevice | camera handle returned from dvcOpenCamera(). | |
| pBuffer | previously allocated buffer of width x height x 2 bytes. | |
| left | is the first binned column to copy to the buffer. | |
| top | is the first binned row to copy to the buffer. | |
| width | is the number of binned pixels per row to copy. | |
| height | is the number of binned pixels per column to copy. |
| BOOL dvcReadImageAndMeta | ( | HANDLE | hDevice, | |
| PUSHORT | pBuffer, | |||
| ULONG | uLeft, | |||
| ULONG | uTop, | |||
| ULONG | uWidth, | |||
| ULONG | uHeight, | |||
| ImageMetaDataP | pMeta | |||
| ) |
Copy raw data from the last frame to an application buffer.
| hDevice | camera handle returned from dvcOpenCamera(). | |
| pBuffer | application supplied buffer of uWidth x uHeight x 2 bytes. | |
| uLeft | is the first binned column to copy to the buffer. | |
| uTop | is the first binned row to copy to the buffer. | |
| uWidth | is the number of binned pixels per row to copy. | |
| uHeight | is the number of binned pixels per column to copy. | |
| pMeta | is a ImageMetaData struct returned with the associated data. |
| BOOL dvcReadImageEx | ( | HANDLE | hDevice, | |
| USHORT * | pBuffer, | |||
| UInt32 | left, | |||
| UInt32 | top, | |||
| UInt32 | width, | |||
| UInt32 | height, | |||
| UInt32 | lineWidth | |||
| ) |
Copy raw data from the last frame to an application buffer.
| hDevice | camera handle returned from dvcOpenCamera(). | |
| pBuffer | previously allocated buffer of lineWidth x height x 2 bytes. | |
| left | is the first binned column to copy to the buffer. | |
| top | is the first binned row to copy to the buffer. | |
| width | is the number of binned pixels per row to copy. | |
| height | is the number of binned pixels per column to copy. | |
| lineWidth | is the width of pBuffer in pixels ( 2 bytes/pixel ). |
| BOOL dvcReadImageRGB48 | ( | HANDLE | hDevice, | |
| PUSHORT | pRGBBuffer, | |||
| ULONG | uLeft, | |||
| ULONG | uTop, | |||
| ULONG | uWidth, | |||
| ULONG | uHeight | |||
| ) |
| hDevice | camera handle returned from dvcOpenCamera(). | |
| pRGBBuffer | application supplied buffer of uWidth x uHeight x 2 bytes x 3 channels | |
| uLeft | is the first binned column to copy to the buffer. | |
| uTop | is the first binned row to copy to the buffer. | |
| uWidth | is the number of binned pixels per row to copy. | |
| uHeight | is the number of binned pixels per column to copy. |
| BOOL dvcReadLine | ( | HANDLE | hDevice, | |
| UInt32 | x, | |||
| UInt32 | y, | |||
| UInt32 | w, | |||
| USHORT * | pData | |||
| ) |
Copy a line data from the last frame to an application buffer.
| hDevice | camera handle returned from dvcOpenCamera(). | |
| pData | previously allocated buffer of
| |
| x | is the first binned column to copy to the buffer. | |
| y | is the first binned row to copy to the buffer. | |
| w | is the number of binned pixels to copy. |
| BOOL dvcReadMeta | ( | HANDLE | hDevice, | |
| ImageMetaDataP | pMeta | |||
| ) |
copies the meta data from the last image transferred.
| hDevice | camera handle returned from dvcOpenCamera(). | |
| pMeta | is a ImageMetaData struct returned with the associated data. |
| BOOL dvcReadPixel | ( | HANDLE | hDevice, | |
| UInt32 | x, | |||
| UInt32 | y, | |||
| PInt32 | pData | |||
| ) |
Copy a data from a single pixel in the last frame to an application buffer.
| hDevice | camera handle returned from dvcOpenCamera(). | |
| pData | pointer to a 32 bit Int32 returning the value of the pixel at x,y. | |
| x | is the binned column. | |
| y | is the binned row. |
| BOOL dvcReadRGB32 | ( | HANDLE | hDevice, | |
| PULONG | buffer, | |||
| ULONG | uLeft, | |||
| ULONG | uTop, | |||
| ULONG | uWidth, | |||
| ULONG | uHeight, | |||
| ULONG | lineWidth, | |||
| BOOL | bWhiteBalance | |||
| ) |
copy an image to a RGB buffer.
| hDevice | camera handle returned from dvcOpenCamera(). | |
| buffer | application supplied buffer of lineWidth x uHeight x 4 bytes | |
| uLeft | is the first binned column to copy to the buffer. | |
| uTop | is the first binned row to copy to the buffer. | |
| uWidth | is the number of binned pixels per row to copy. | |
| uHeight | is the number of binned pixels per column to copy. | |
| lineWidth | is the number bytes per line in buffer. | |
| bWhiteBalance | if TRUE white balances the returned image buffer. |
| BOOL dvcReleaseUserBuffers | ( | dvcBufStructP | pBufStruct | ) |
release an application ring buffer and memory.
| pBufStruct | dvcBufStruct allocated with dvcAllocateUserBuffers(). |
| BOOL dvcSetUserBuffers | ( | HANDLE | hDevice, | |
| dvcBufStructP | pBufStruct | |||
| ) |
install an application ring buffer.
| hDevice | handle returned from dvcOpenCamera(). | |
| pBufStruct | dvcBufStruct pointer to a ring buffer from dvcAllocateUserBuffers() or NULL to remove a previously installed ring buffer. |
BOOL grabRingBuffer(HANDLE hDevice, int nBuffers, in nCycles ) { dvcBufStruct bufS ; int i ; if(nCycles < 1) nCycles = 1 ; if(!dvcAllocateUserBuffers(hDevice, &bufS, nBuffers)) { fprintf(stderr,"Error allocating user buffers!\n"); return FALSE ; } BOOL bRC = TRUE ; HANDLE hExpose, hRead ; hExpose = CreateEvent(NULL,FALSE,FALSE,NULL) ; hRead = CreateEvent(NULL,FALSE,FALSE,NULL); bRC = dvcSetExposeCompleteEvent(hDevice, hExpose); if(!bRC) { fprintf(stderr,"Error setting ExposeComplete!\n"); dvcReleaseUserBuffers(&bufS); CloseHandle(hExpose); CloseHandle(hRead); return FALSE ; } bRC = dvcSetReadCompleteEvent(hDevice, hRead); if(!bRC) { fprintf(stderr,"Error setting ReadComplete!\n"); dvcReleaseUserBuffers(&bufS); dvcSetExposeCompleteEvent(hDevice, NULL); dvcSetReadCompleteEvent(hDevice, NULL); CloseHandle(hExpose); CloseHandle(hRead); return FALSE ; } bRC = dvcSetUserBuffers(hDevice, &bufS); if(!bRC) { fprintf(stderr,"Error setting UserBuffers!\n"); dvcReleaseUserBuffers(&bufS); dvcSetExposeCompleteEvent(hDevice, NULL); dvcSetReadCompleteEvent(hDevice, NULL); CloseHandle(hExpose); CloseHandle(hRead); return FALSE ; } bRC = dvcStartSequenceEx(hDevice, 0, 0) ; if(!bRC) fprintf(stderr,"Error starting sequence!\n"); int nRingBuffer ; for(i=0;bRC && i<nBuffers*nCycles;i++) { if(WaitForSingleObject(hExpose,1000) != WAIT_OBJECT_0 ) { fprintf(stderr,"Error waiting expose!\n"); bRC = FALSE ; } if(WaitForSingleObject(hRead, 1000) != WAIT_OBJECT_0 ) { fprintf(stderr,"Error waiting read!\n"); bRC = FALSE ; } if(!dvcGetUserBufferId(hDevice, &nRingBuffer)) { fprintf(stderr,"Error getting buffer id!\n"); bRC = FALSE ; } if(bRC) { fprintf(stderr, "Buffer %d meta Stream %d time %.2f status %d ring %d cyles %d\n", nRingBuffer, bufS.pMeta[nRingBuffer].ulStreamCount, dvcElapseTime(bufS.pMeta[nRingBuffer].dFrameTime), bufS.pBufferStatus[nRingBuffer], bufS.pMeta[nRingBuffer].ulRingBuffer, bufS.pMeta[nRingBuffer].ulBufferWriteCount) ; // If we're cycling, clear the buffer's status // to enable refilling.. if(nCycles > 1) bufS.pBufferStatus[nRingBuffer] = 0 ; } } dvcStopSequence(hDevice); dvcSetUserBuffers(hDevice, NULL); dvcReleaseUserBuffers(&bufS); dvcSetExposeCompleteEvent(hDevice, NULL); dvcSetReadCompleteEvent(hDevice, NULL); CloseHandle(hExpose); CloseHandle(hRead); return bRC ; }
| BOOL dvcWaitExpose | ( | HANDLE | hDevice, | |
| double | dWaitMilliSeconds | |||
| ) |
Wait for an exposure to complete and data transfers to start.
| hDevice | camera handle returned from dvcOpenCamera(). | |
| dWaitMilliSeconds | is the time in milliseconds to wait before returning. Delays are implemented using pthread conditional variables to minimize CPU overhead while waiting. |
| BOOL dvcWaitImage | ( | HANDLE | hDevice, | |
| double | dWaitMilliSeconds | |||
| ) |
Wait for an image transfer to complete.
| hDevice | camera handle returned from dvcOpenCamera(). | |
| dWaitMilliSeconds | is the time in milliseconds to wait before returning. |