VisionBox .NET Library
VIB_NET::CameraLinkIn Class Reference
+ Inheritance diagram for VIB_NET::CameraLinkIn:

Detailed Description

This class represents the Camera Link grabber module.

See class VIB::CameraLinkIn in the VisionBox Interface Library for a detailed description.

+ Image acquisition example in C#

+ Camera trigger example in C#

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)
 The function waits for new captured image 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...
 

Member Enumeration Documentation

◆ eCC_SOURCE

Source signal definition for the Camera Link CC lines, used by ConfigureCC()

Enumerator
OFF 

static off

ON 

static on

MUX_OUT0 

Multiplexer Output 0.

MUX_OUT1 

Multiplexer Output 1.

MUX_OUT2 

Multiplexer Output 2.

MUX_OUT3 

Multiplexer Output 3.

MUX_OUT4 

Multiplexer Output 4.

MUX_OUT5 

Multiplexer Output 5.

MUX_OUT6 

Multiplexer Output 6.

MUX_OUT7 

Multiplexer Output 7.

MUX_OUT8 

Multiplexer Output 8.

MUX_OUT9 

Multiplexer Output 9.

MUX_OUT10 

Multiplexer Output 10.

MUX_OUT11 

Multiplexer Output 11.

MUX_OUT12 

Multiplexer Output 12.

MUX_OUT13 

Multiplexer Output 13.

MUX_OUT14 

Multiplexer Output 14.

MUX_OUT15 

Multiplexer Output 15

◆ eINMODE_FLAGS

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.

◆ eINMODE_TYPE

The data organization on the Camera Link cable, used by ConfigureCLInput()

Enumerator
MODE_1TAP_8BIT 

The Image(Buffer) has the total size of AOI_Width * AOI_Height, one pixel is one byte long, delivered over one Tap.

MODE_1TAP_10BIT 

The Image(Buffer) has the total size of 2 * AOI_Width * AOI_Height, one pixel is two bytes long, delivered over one Tap.

MODE_1TAP_12BIT 

The Image(Buffer) has the total size of 2 * AOI_Width * AOI_Height, one pixel is two bytes long, delivered over one Tap.

MODE_1TAP_14BIT 

The Image(Buffer) has the total size of 2 * AOI_Width * AOI_Height, one pixel is two bytes long, delivered over one Tap.

MODE_1TAP_16BIT 

The Image(Buffer) has the total size of 2 * AOI_Width * AOI_Height, one pixel is two bytes long, delivered over one Tap.

MODE_2TAP_8BIT 

The Image(Buffer) has the total size of AOI_Width * AOI_Height, one pixel is one byte long, delivered over two Taps.

MODE_2TAP_10BIT 

The Image(Buffer) has the total size of 2 * AOI_Width * AOI_Height, one pixel is two bytes long, delivered over two Taps.

MODE_2TAP_12BIT 

The Image(Buffer) has the total size of 2 * AOI_Width * AOI_Height, one pixel is two bytes long, delivered over two Taps.

MODE_3TAP_8BIT 

The Image(Buffer) has the total size of AOI_Width * AOI_Height, one pixel is one byte long, delivered over three Taps.

MODE_1TAP_24BIT_RGB 

The Image(Buffer) has the total size of 4 * AOI_Width * AOI_Height, one pixel is three bytes long (+ one unused byte), delivered over one Tap.

MODE_4TAP_8BIT 

The Image(Buffer) has the total size of AOI_Width * AOI_Height, one pixel is one byte long, delivered over four Taps.

MODE_4TAP_10BIT 

The Image(Buffer) has the total size of 2 * AOI_Width * AOI_Height, one pixel is two bytes long, delivered over four Taps.

MODE_4TAP_12BIT 

The Image(Buffer) has the total size of 2 * AOI_Width * AOI_Height, one pixel is two bytes long, delivered over four Taps.

MODE_6TAP_8BIT 

The Image(Buffer) has the total size of AOI_Width * AOI_Height, one pixel is one byte long, delivered over six Taps.

MODE_1TAP_30BIT_RGB 

The Image(Buffer) has the total size of 8 * AOI_Width * AOI_Height, one pixel is six bytes long (+ one unused word), delivered over one Tap.

MODE_1TAP_36BIT_RGB 

The Image(Buffer) has the total size of 8 * AOI_Width * AOI_Height, one pixel is six bytes long (+ one unused word), delivered over one Tap.

MODE_2TAP_24BIT_RGB 

The Image(Buffer) has the total size of 4 * AOI_Width * AOI_Height, one pixel is three bytes long (+ one unused byte), delivered over two Taps.

MODE_8TAP_8BIT 

The Image(Buffer) has the total size of AOI_Width * AOI_Height, one pixel is one byte long, delivered over eight Taps.

MODE_10TAP_8BIT 

The Image(Buffer) has the total size of AOI_Width * AOI_Height, one pixel is one byte long, delivered over ten Taps.

MODE_8TAP_10BIT 

The Image(Buffer) has the total size of AOI_Width * AOI_Height * 10 / 8, eight bytes containing the MSBs for eight pixels are followed by two bytes conaining the remaining two LSBs for these pixels.

◆ eMODULE_CONFIGURATION

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.

Constructor & Destructor Documentation

◆ CameraLinkIn()

VIB_NET::CameraLinkIn::CameraLinkIn ( )

Default constructor for the device object

The device must be opened with Open() before it can be used.

Member Function Documentation

◆ AbortBufferUsage()

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.

Parameters
ChannelIndexCamera index, use GetNumberOfInputs() to find the maximum

◆ AbortWaitingForDMA()

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.

Parameters
ChannelIndexCamera index, use GetNumberOfInputs() to find the maximum

◆ AddImageBufferForCapturing()

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().

Parameters
ChannelIndexCamera index, use GetNumberOfInputs() to find the maximum
ptrpointer to the image buffer

◆ AllocateImageBuffer()

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().

Parameters
ChannelIndexCamera index, use GetNumberOfInputs() to find the maximum
Returns
Pointer to the new image buffer

◆ ConfigureCC()

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.

Parameters
ChannelIndexCamera index, use GetNumberOfInputs() to find the maximum
CCIndexIndex for the CC-Line [1...4]
srcThe desired source signal
InvertPolarity of the output signal

◆ ConfigureCLInput() [1/3]

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.

Parameters
ChannelIndexCamera index, 0 ... GetNumberOfInputs()
InTypeDefine the desired Pixel/Data or streaming format
InFlagsBitwise 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
WidthThe complete camera image width
HeightThe complete camera image Height
AOI_XOffset/start position inside the camera image
AOI_YOffset/start position inside the camera image
AOI_WidthWidth of the returned image
AOI_HeightHeight of the returned image

◆ ConfigureCLInput() [2/3]

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.

Parameters
ChannelIndexCamera index, 0 ... GetNumberOfInputs()
InTypeDefine the desired Pixel/Data or streaming format
InFlagsBitwise 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_WidthAOI width
AOI_HeightAOI height

◆ ConfigureCLInput() [3/3]

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.

Parameters
ChannelIndexCamera index, 0 ... GetNumberOfInputs()
InTypeDefine the desired Pixel/Data or streaming format
InFlagsBitwise 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_WidthAOI width
AOI_HeightAOI height
AOI_XHorizontal start position
AOI_YVertical start position

◆ ConfigureModule()

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.

Parameters
ModuleConfigthe new working mode for the whole module

◆ FreeImageBuffer()

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.

Parameters
ChannelIndexCamera index, use GetNumberOfInputs() to find the maximum
ptrPointer to the image buffer

◆ GetAOI()

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.

Parameters
ChannelIndexCamera index, 0 ... GetNumberOfInputs()
AOI_XHorizontal AOI start position
AOI_YVertical AOI start position
AOI_WidthAOI width
AOI_HeightAOI height

◆ GetBitsPerPixel()

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.

Parameters
ChannelIndexCamera index, 0 ... GetNumberOfInputs()
ValidBitsNumber of usable bits per pixel
BufferBitsNumber of bits per pixel used in the image buffers, including the unused padding bits

◆ GetBufferSize()

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.

Parameters
ChannelIndexCamera index, 0 ... GetNumberOfInputs()
BytesNumber of bytes

◆ GetNumberOfInputs()

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).

Parameters
ModuleConfigSpecifies the configuration for which the function returns the number of channels
Returns
Number of channels / cameras which can be connected

◆ Reset()

void VIB_NET::CameraLinkIn::Reset ( )

Resets the device to default settings.

See also VIB::CameraTrigger::Reset().

◆ WaitForImageBuffer()

IntPtr VIB_NET::CameraLinkIn::WaitForImageBuffer ( const UInt32  ChannelIndex,
const UInt32  msTimeOut,
bool %  IsContentValid 
)

The function waits for new captured image

In the case the timeout is counted out, the function returns successful a NULL-pointer. This makes possible to test for a new image like busy waiting.
You can wait for a new image with more than one thread. The function implements this like a FIFO. The first added thread returns after the first image is done, the second after the second image and so on. Becomes the thread inside the FIFO a timeout, an error will occur and the pointer is undefined. The function returns with the oldest ready image, but it doesn't have to be the first buffer which was added by AddImageBufferForCapturing().
After a successful call, the user can access the image data, free the buffer with FreeImageBuffer() or add this buffer back to the driver with WaitForImageBuffer().
To remove the waiting threads directly, the user have to call AbortWaitingForDMA().

Parameters
ChannelIndexCamera index, use GetNumberOfInputs() to find the maximum
msTimeOutTimeOut in [ms], the range are from 0, for no wait up to INFINITE for waiting for ever
IsContentValidif false, the content of the received buffer is unchanged or partial invalid but the memory region is valid
Returns
Pointer to the new image data or NULL-Pointer if a timeout occurs

Property Documentation

◆ Type

VIB_NET::CameraLinkIn::Type
get

Returns the device type for the current instance, see eDEVICE_TYPE

VIB_NET
All relevant classes and functions are residing in this namespace.
Definition: CameraLinkIn.cpp:6
VIB_NET::Multiplexer
This class controls the Multiplexer unit which connects signal sources and sinks with each other.
Definition: VIB_NET.h:978
VIB_NET::TriggerGenerator
This module controls the FPGA Trigger Unit.
Definition: VIB_NET.h:633
INFINITE
#define INFINITE
VIB_NET::Multiplexer::eMUX_SOURCE
eMUX_SOURCE
Source signal definitions for the Multiplexer
Definition: VIB_NET.h:983
VIB_NET::VIBSystem::OpenDevice
VIB_NET::iDevice ^ OpenDevice(VIB_NET::eDEVICE_TYPE Type, Int32 Index)
Opens a device and creates a device object
Definition: VIBSystem.cpp:245
VIB_NET::VIBSystem
Factory for devices
Definition: VIB_NET.h:1707