GetSequenceRawData (DVR version only)
Top  Previous  Next

Description

Returns the two-dimensional array of raw values in the selected frame buffer of the memory sequence or pointer to this buffer.


Syntax


[VB]
Value=objActiveUSB.GetSequenceRawData (Frame [, isPointer=False])


[C/C++]
HRESULT GetSequenceRawData( long iFrame,  bool isPointer, VARIANT* pArray );


Data Types
[VB]

Frame: Long
Return value
: Variant (SAFEARRAY)


Parameters
[C/C++]

iFrame [in]  
The zero-based index of the frame in the memory sequence  
isPointer [in]  
If false returns the array of raw data, otherwise returns pointer to data.  
pArray [out,retval]  
Pointer to the SAFEARRAY containing the raw data buffer.  


Return Values


S_OK  
Success  
E_FAIL  
Failure  
E_INVALIDARG  
Invalid input arguments  


Example


This VB retrieves the raw data array from frame #4 in the memory sequence and displays the value of the specified element of the array.

Dim
 pix 
as Long

RawData=ActiveUSB1.GetRawSequenceData
x=16
y=32
pix=RawSequenceData(4,x,y)
if
 pix < 0 
then

pix=65535-pix
endif

MsgBox RawData(x,y)
 

Remarks


This function returns the sequence data as they have been recorded (not converted). Raw image data are stored in the standard order from top to bottom, therefore the first element of the array is first pixel of the top line of the image. The type of data and dimensions of the array returned by GetSequenceRawData depends on the current pixel format, horizontal width SizeX and the number of lines acquired, as specified in the following table:



Pixel Format
Data type
Dimensions

Mono8, Mono8Signed
Byte
0 to SizeX -1, 0 to Lines - 1
Bayer**8
Byte
0 to SizeX -1, 0 to Lines - 1
Mono10, Mono12, Mono16
Integer (word)
0 to SizeX -1, 0 to Lines - 1
Bayer**10, Bayer**12, Bayer**16
Integer (word)
0 to SizeX -1, 0 to Lines - 1
Mono10Packed, Mono12Packed
Byte
0 to SizeX*3/2 -1, 0 to Lines - 1
YUV411Packed
Byte
0 to SizeX*3/2 -1, 0 to Lines - 1
YUV422Packed, YUV444Packed
Integer (word)
0 to SizeX -1, 0 to Lines - 1
RGB8Packed, BGR8Packed
Byte
0 to SizeX * 3 - 1, 0 to Lines - 1
RGBA8Packed, BGRA8Packed
Byte
0 to SizeX * 4 - 1, 0 to Lines - 1
RGB10Packed, BGR10Packed, RGB12Packed, BGR12Packed
Integer (word)
0 to SizeX * 3 - 1, 0 to Lines - 1
BGR10V1Packed, BGR10V2Packed
Long
0 to SizeX -1, 0 to Lines - 1
RGB8Planar
Byte
0 to SizeX * 3 - 1, 0 to Lines - 1
RGB10Planar, RGB12Planar, RGB16Planar
Integer (word)
0 to SizeX * 3 - 1, 0 to Lines - 1


For integer (word) type of data you can receive negative numbers if pixel values exceed 32767. In C and C# you can convert signed integers to unsigned ones by using data casting. To get rid of negative values in VB and Delphi, subtract them from 65535 (see the example above).