GetChunkSize
Top  Previous  Next

Description

Returns the size of the data associated with the specified chunk feature.


Syntax


[VB]
Value=objActiveUSB.GetChunkSize( Name )


[C/C++]
HRESULT GetChunkSize( bstr Name, long* pValue );


Data Types
[VB]


Return value: Variant (pointer)


Parameters
[C/C++]

Name [in]  
String specifying the name of the chunk feature  
pValue [out,retval]  
Pointer to the size of the chunk data in bytes.  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  
E_INVALIDARG  
Invalid input arguments.  


Example


This fragment of the C++ code grabs a frame, retrieves a pointer to the chunk data and copies them into a byte array.

VARIANT var; LONG var_size;
char buffer[255]; short v;

pActiveUSB->SetFeature( OLESTR("ChunkEnable"), 1);
pActiveUSB->Grab(&v);

pActiveUSB->GetChunkPointer( OLESTR( "ChunkInputStatusAtLineTriggerValue" ), &var);
pActiveUSB->GetChunkSize(OLESTR( "ChunkInputStatusAtLineTriggerValue" ), &var_size);
memcpy( buffer, (BYTE*)var.byref, var_size);


 

Remarks


Chunks are tagged blocks of auxilary data that are transmitted along with each image frame. The GetChunkSize and GetChunkPointer methods provides the most efficient way to quickly access the chunk data in pointer-aware programming languages. It is especially useful for accessing data associated with array-type features.

Note that when several chunk features share the same Chunk ID, this method will return the size of the data block identified by the given Chunk ID. For more information on the chunk data refer to "USB3 Vision Camera Interface Standard For Machine Vision" published by the Automated Imaging Association.