This class represents the Camera Link grabber module.
See class VIB::CameraLinkIn in the VisionBox Interface Library for a detailed description.
Public Types | |
enum | eCC_SOURCE |
Source signal definition for the Camera Link CC lines, used by ConfigureCC() More... | |
enum | eINMODE_FLAGS |
Special or additional configuration modes, used by ConfigureCLInput() More... | |
enum | eINMODE_TYPE |
The data organization on the Camera Link cable, used by ConfigureCLInput() More... | |
enum | eMODULE_CONFIGURATION |
Type of Camera Link module configuration, used by ConfigureModule() and GetNumberOfInputs() More... | |
Public Member Functions | |
void | AbortBufferUsage (const UInt32 ChannelIndex) |
Force the driver to stop using any added buffer immediately More... | |
void | AbortWaitingForDMA (const UInt32 ChannelIndex) |
Force every waiting thread to return from the WaitForImageBuffer() function call More... | |
void | AddImageBufferForCapturing (const UInt32 ChannelIndex, IntPtr ptr) |
Add a previously allocated buffer into a queue for capturing image data into More... | |
IntPtr | AllocateImageBuffer (const UInt32 ChannelIndex) |
Allocate a proper image buffer for capturing More... | |
CameraLinkIn () | |
Default constructor for the device object More... | |
void | ConfigureCC (const UInt32 ChannelIndex, const UInt32 CCIndex, const CameraLinkIn::eCC_SOURCE src, const bool Invert) |
Select the source for the given CameraLink-CC line More... | |
void | ConfigureCLInput (const UInt32 ChannelIndex, const CameraLinkIn::eINMODE_TYPE InType, const CameraLinkIn::eINMODE_FLAGS InFlags, const UInt16 Width, const UInt16 Height, const UInt16 AOI_X, const UInt16 AOI_Y, const UInt16 AOI_Width, const UInt16 AOI_Height) |
Configures a camera channel More... | |
void | ConfigureCLInput (const UInt32 ChannelIndex, const CameraLinkIn::eINMODE_TYPE InType, const CameraLinkIn::eINMODE_FLAGS InFlags, const UInt32 AOI_Width, const UInt32 AOI_Height) |
Configures a camera channel More... | |
void | ConfigureCLInput (const UInt32 ChannelIndex, const CameraLinkIn::eINMODE_TYPE InType, const CameraLinkIn::eINMODE_FLAGS InFlags, const UInt32 AOI_Width, const UInt32 AOI_Height, const UInt32 AOI_X, const UInt32 AOI_Y) |
Configures a camera channel More... | |
void | ConfigureModule (const CameraLinkIn::eMODULE_CONFIGURATION ModuleConfig) |
Configure the module to the given mode More... | |
void | FreeImageBuffer (const UInt32 ChannelIndex, IntPtr ptr) |
Frees the specified buffer More... | |
void | GetAOI (const UInt32 ChannelIndex, UInt32 % AOI_X, UInt32 % AOI_Y, UInt32 % AOI_Width, UInt32 % AOI_Height) |
Returns the configured AOI size. More... | |
void | GetBitsPerPixel (const UInt32 ChannelIndex, UInt32 % ValidBits, UInt32 % BufferBits) |
Returns the number of bits for each pixel. More... | |
void | GetBufferSize (const UInt32 ChannelIndex, UInt32 % Bytes) |
Returns the number of bytes allocated for each image buffer. More... | |
UInt32 | GetNumberOfInputs (const CameraLinkIn::eMODULE_CONFIGURATION ModuleConfig) |
Returns the number of independent Camera Link input channels More... | |
void | Reset () |
Resets the device to default settings. More... | |
IntPtr | WaitForImageBuffer (const UInt32 ChannelIndex, const UInt32 msTimeOut, bool % IsContentValid) |
Waits for completion of image buffers and transfers ownership to the user More... | |
IntPtr | WaitForImageBuffer (const UInt32 ChannelIndex, const UInt32 msTimeOut, bool % IsContentValid, UInt64 % timestamp) |
Waits for completion of image buffers and transfers ownership to the user More... | |
Public Member Functions inherited from VIB_NET::iDevice | |
void | Close () |
Closes a device More... | |
bool | isOpen () |
Returns the open state of a device object More... | |
void | Open () |
Opens a device More... | |
void | Open (unsigned int Index) |
Opens a device More... | |
Properties | |
virtual VIB_NET::eDEVICE_TYPE | Type [get] |
Returns the device type for the current instance, see eDEVICE_TYPE More... | |
Properties inherited from VIB_NET::iDevice | |
virtual VIB_NET::eDEVICE_TYPE | Type [get] |
Returns the device type for the current instance, see eDEVICE_TYPE More... | |
|
strong |
Source signal definition for the Camera Link CC lines, used by ConfigureCC()
|
strong |
Special or additional configuration modes, used by ConfigureCLInput()
Enumerator | |
---|---|
FLAGS_DEFAULT | Use this value if no special behavior needed. |
FLAGS_IGNORE_FVAL | Use this value for linescan cameras. |
FLAGS_IGNORE_DVAL | Use this value to ignore the CL DVAL signal. |
|
strong |
The data organization on the Camera Link cable, used by ConfigureCLInput()
|
strong |
Type of Camera Link module configuration, used by ConfigureModule() and GetNumberOfInputs()
Enumerator | |
---|---|
BASE | CL-Base input, one cable for one camera. |
MEDIUM | CL-Medium input, two cable for one camera. |
FULL | CL-Full input, two cable for one camera. |
DECA | CL-Deca input, two cables for one camera. |
VIB_NET::CameraLinkIn::CameraLinkIn | ( | ) |
Default constructor for the device object
The device must be opened with Open() before it can be used.
void VIB_NET::CameraLinkIn::AbortBufferUsage | ( | const UInt32 | ChannelIndex | ) |
Force the driver to stop using any added buffer immediately
The driver delivers the buffers to the user by calling WaitForImageBuffer(). The buffers can then be accessed or freed by the user.
The grabber enters the reset state when calling this function. The unit has to be reinitialized again.
ChannelIndex | Camera index, use GetNumberOfInputs() to find the maximum |
void VIB_NET::CameraLinkIn::AbortWaitingForDMA | ( | const UInt32 | ChannelIndex | ) |
Force every waiting thread to return from the WaitForImageBuffer() function call
Image acquisition and the buffers hold by the library are not affected.
ChannelIndex | Camera index, use GetNumberOfInputs() to find the maximum |
void VIB_NET::CameraLinkIn::AddImageBufferForCapturing | ( | const UInt32 | ChannelIndex, |
IntPtr | ptr | ||
) |
Add a previously allocated buffer into a queue for capturing image data into
There is no rule, in which sequence the added buffers are used. After a call to this function, the buffer is controlled by the driver. ItÂ’s not allowed to access or free this buffer until the buffer was delivered by the function WaitForImageBuffer().
ChannelIndex | Camera index, use GetNumberOfInputs() to find the maximum |
ptr | pointer to the image buffer |
IntPtr VIB_NET::CameraLinkIn::AllocateImageBuffer | ( | const UInt32 | ChannelIndex | ) |
Allocate a proper image buffer for capturing
The buffer has the correct size for one image. Refer to ConfigureCLInput() and eINMODE_TYPE which defines the buffer size.
It's not allowed to use a buffer with a channel which was allocated for a different channel. Furthermore, the buffer must be released by FreeImageBuffer() not by free() or delete().
ChannelIndex | Camera index, use GetNumberOfInputs() to find the maximum |
void VIB_NET::CameraLinkIn::ConfigureCC | ( | const UInt32 | ChannelIndex, |
const UInt32 | CCIndex, | ||
const CameraLinkIn::eCC_SOURCE | src, | ||
const bool | Invert | ||
) |
Select the source for the given CameraLink-CC line
See also Camera trigger example.
ChannelIndex | Camera index, use GetNumberOfInputs() to find the maximum |
CCIndex | Index for the CC-Line [1...4] |
src | The desired source signal |
Invert | Polarity of the output signal |
void VIB_NET::CameraLinkIn::ConfigureCLInput | ( | const UInt32 | ChannelIndex, |
const CameraLinkIn::eINMODE_TYPE | InType, | ||
const CameraLinkIn::eINMODE_FLAGS | InFlags, | ||
const UInt16 | Width, | ||
const UInt16 | Height, | ||
const UInt16 | AOI_X, | ||
const UInt16 | AOI_Y, | ||
const UInt16 | AOI_Width, | ||
const UInt16 | AOI_Height | ||
) |
Configures a camera channel
To reconfigure the channel, after the first call, the complete device has to be closed and opened again.
ChannelIndex | Camera index, 0 ... GetNumberOfInputs() |
InType | Define the desired Pixel/Data or streaming format |
InFlags | Bitwise OR of configuration flags defined in eINMODE_FLAGS Use eINMODE_FLAGS::FLAGS_DEFAULT for area scan cameras and eINMODE_FLAGS::FLAGS_IGNORE_FVAL for line scan cameras |
Width | The complete camera image width |
Height | The complete camera image Height |
AOI_X | Offset/start position inside the camera image |
AOI_Y | Offset/start position inside the camera image |
AOI_Width | Width of the returned image |
AOI_Height | Height of the returned image |
void VIB_NET::CameraLinkIn::ConfigureCLInput | ( | const UInt32 | ChannelIndex, |
const CameraLinkIn::eINMODE_TYPE | InType, | ||
const CameraLinkIn::eINMODE_FLAGS | InFlags, | ||
const UInt32 | AOI_Width, | ||
const UInt32 | AOI_Height | ||
) |
Configures a camera channel
To reconfigure the channel, after the first call, the complete device has to be closed and opened again.
ChannelIndex | Camera index, 0 ... GetNumberOfInputs() |
InType | Define the desired Pixel/Data or streaming format |
InFlags | Bitwise OR of configuration flags defined in eINMODE_FLAGS Use eINMODE_FLAGS::FLAGS_DEFAULT for area scan cameras and eINMODE_FLAGS::FLAGS_IGNORE_FVAL for line scan cameras |
AOI_Width | AOI width |
AOI_Height | AOI height |
void VIB_NET::CameraLinkIn::ConfigureCLInput | ( | const UInt32 | ChannelIndex, |
const CameraLinkIn::eINMODE_TYPE | InType, | ||
const CameraLinkIn::eINMODE_FLAGS | InFlags, | ||
const UInt32 | AOI_Width, | ||
const UInt32 | AOI_Height, | ||
const UInt32 | AOI_X, | ||
const UInt32 | AOI_Y | ||
) |
Configures a camera channel
To reconfigure the channel, after the first call, the complete device has to be closed and opened again.
ChannelIndex | Camera index, 0 ... GetNumberOfInputs() |
InType | Define the desired Pixel/Data or streaming format |
InFlags | Bitwise OR of configuration flags defined in eINMODE_FLAGS Use eINMODE_FLAGS::FLAGS_DEFAULT for area scan cameras and eINMODE_FLAGS::FLAGS_IGNORE_FVAL for line scan cameras |
AOI_Width | AOI width |
AOI_Height | AOI height |
AOI_X | Horizontal start position |
AOI_Y | Vertical start position |
void VIB_NET::CameraLinkIn::ConfigureModule | ( | const CameraLinkIn::eMODULE_CONFIGURATION | ModuleConfig | ) |
Configure the module to the given mode
This function can only be called once after the device was opened.
ModuleConfig | the new working mode for the whole module |
void VIB_NET::CameraLinkIn::FreeImageBuffer | ( | const UInt32 | ChannelIndex, |
IntPtr | ptr | ||
) |
Frees the specified buffer
It's only allowed to clean up buffers which is owned by the user. Use AbortBufferUsage() and WaitForImageBuffer() to gain ownership for buffers in the aquisition queue.
ChannelIndex | Camera index, use GetNumberOfInputs() to find the maximum |
ptr | Pointer to the image buffer |
void VIB_NET::CameraLinkIn::GetAOI | ( | const UInt32 | ChannelIndex, |
UInt32 % | AOI_X, | ||
UInt32 % | AOI_Y, | ||
UInt32 % | AOI_Width, | ||
UInt32 % | AOI_Height | ||
) |
Returns the configured AOI size.
The camera channel must be configured with ConfigureCLInput() before calling this function.
ChannelIndex | Camera index, 0 ... GetNumberOfInputs() |
AOI_X | Horizontal AOI start position |
AOI_Y | Vertical AOI start position |
AOI_Width | AOI width |
AOI_Height | AOI height |
void VIB_NET::CameraLinkIn::GetBitsPerPixel | ( | const UInt32 | ChannelIndex, |
UInt32 % | ValidBits, | ||
UInt32 % | BufferBits | ||
) |
Returns the number of bits for each pixel.
The camera channel must be configured with ConfigureCLInput() before calling this function.
ChannelIndex | Camera index, 0 ... GetNumberOfInputs() |
ValidBits | Number of usable bits per pixel |
BufferBits | Number of bits per pixel used in the image buffers, including the unused padding bits |
void VIB_NET::CameraLinkIn::GetBufferSize | ( | const UInt32 | ChannelIndex, |
UInt32 % | Bytes | ||
) |
Returns the number of bytes allocated for each image buffer.
The camera channel must be configured with ConfigureCLInput() before calling this function.
ChannelIndex | Camera index, 0 ... GetNumberOfInputs() |
Bytes | Number of bytes |
UInt32 VIB_NET::CameraLinkIn::GetNumberOfInputs | ( | const CameraLinkIn::eMODULE_CONFIGURATION | ModuleConfig | ) |
Returns the number of independent Camera Link input channels
The number depends on hardware, firmware and the specified Camera Link configuration. The returned number can be 0 for 'not supported', 1 for one channel / camera and 2 for two cameras (Camera Link Base only).
ModuleConfig | Specifies the configuration for which the function returns the number of channels |
void VIB_NET::CameraLinkIn::Reset | ( | ) |
Resets the device to default settings.
See also VIB::CameraTrigger::Reset().
IntPtr VIB_NET::CameraLinkIn::WaitForImageBuffer | ( | const UInt32 | ChannelIndex, |
const UInt32 | msTimeOut, | ||
bool % | IsContentValid | ||
) |
Waits for completion of image buffers and transfers ownership to the user
See overloaded version of this function with the additional timestamp parameter for details.
ChannelIndex | Camera index, use GetNumberOfInputs() to find the maximum |
msTimeOut | TimeOut in milliseconds, 0 ... INFINITE |
IsContentValid | If the returned image buffer is valid, this flag indicates if the buffer contents are valid (acquisition was successful) |
IntPtr VIB_NET::CameraLinkIn::WaitForImageBuffer | ( | const UInt32 | ChannelIndex, |
const UInt32 | msTimeOut, | ||
bool % | IsContentValid, | ||
UInt64 % | timestamp | ||
) |
Waits for completion of image buffers and transfers ownership to the user
Multiple threads can call this function simultaneously. The first caller returns first with the next completed buffer.
After successful return of the function, one of three events have occured:
NULL
:After a valid buffer was returned, it can be released with FreeImageBuffer() or added to the acquisition queue again with WaitForImageBuffer().
This function is also used to obtain buffers after AbortBufferUsage() was called.
ChannelIndex | Camera index, use GetNumberOfInputs() to find the maximum |
msTimeOut | TimeOut in milliseconds, 0 ... INFINITE |
IsContentValid | If the returned image buffer is valid, this flag indicates if the buffer contents are valid (acquisition was successful) |
timestamp | If the returned image buffer is valid, the timestamp value contains the point in time of the image transfer completion within the driver. The timestamp value is stored in micro-seconds and is based on the Windows performance counter (QueryPerformanceCounter()). The value will be zero if the driver doesn't support timestamps. |
|
get |
Returns the device type for the current instance, see eDEVICE_TYPE