Image Manager (CVCDriver.dll) 15.0
ICameraSelect2

Interface for selecting a camera. More...

Functions

cvbbool_t CanCameraSelect2 (IMG Image)
 This function verifies whether the image supports the CameraSelect2 interface. More...
 
cvbres_t CS2GetCamPort (IMG Image, cvbval_t &lPort)
 Returns the number of the currently selected camera port using the ICameraSelect2 interface. More...
 
cvbres_t CS2GetNumPorts (IMG Image, cvbval_t &lNumPorts)
 Returns the number of ports of the image or image acquisition device using the ICameraSelect2 interface. More...
 
cvbres_t CS2SetCamPort (IMG Image, cvbval_t lPort, cvbval_t lImgToWait, IMG &imgNew)
 Sets the current camera port using the ICameraSelect2 interface. More...
 

Detailed Description

Interface for selecting a camera.

Function Documentation

◆ CanCameraSelect2()

cvbbool_t CanCameraSelect2 ( IMG  Image)

This function verifies whether the image supports the CameraSelect2 interface.

Parameters
[in]ImageHandle of image object.
Returns
TRUE if the image supports the CameraSelect2 interface, FALSE otherwise.
Supported platforms:
Win32
Win64
Linux
Examples:
Visual C++ - VC MDI Example (DLL only)

◆ CS2GetCamPort()

cvbres_t CS2GetCamPort ( IMG  Image,
cvbval_t &  lPort 
)

Returns the number of the currently selected camera port using the ICameraSelect2 interface.

Parameters
[in]ImageHandle of image object.
[out]lPortCurrent camera port.
Returns
0 : OK
<0 : an error occured
Supported platforms:
Win32
Win64
Linux
Examples:
Visual C++ - VC MDI Example (DLL only)

◆ CS2GetNumPorts()

cvbres_t CS2GetNumPorts ( IMG  Image,
cvbval_t &  lNumPorts 
)

Returns the number of ports of the image or image acquisition device using the ICameraSelect2 interface.

Parameters
[in]ImageHandle of image object.
[out]lNumPortsNumber of ports.
Returns
0 : OK
<0 : an error occured
Supported platforms:
Win32
Win64
Linux
Examples:
Visual C++ - VC MDI Example (DLL only)

◆ CS2SetCamPort()

cvbres_t CS2SetCamPort ( IMG  Image,
cvbval_t  lPort,
cvbval_t  lImgToWait,
IMG &  imgNew 
)

Sets the current camera port using the ICameraSelect2 interface.

Attention
Depending on the camera timing mode and the acquisition device, it is important to set the parameter lImgToWait to a value that allows the acquisition device time to synchronise. If images are not synchronised after switching increase this number by 1 or 2 frames. The function returns a new image that represents the new camera port.
The old image still exists but all driver interfaces 'move' to the new image. The old image (Image) and the new Image (imgNew) have to be released with ReleaseObject when they are not needed anymore.
Parameters
[in]ImageHandle of image object.
[in]lPortPort to be set active
[in]lImgToWaitSpecifies the number of vertical blanks to wait after switching in order to give the PLL enough time to prepare for the new signal.
[out]imgNewThe new image representing the new camera port. All driver interfaces are moving to this new image.
Returns
0 : OK
<0 : an error occured
Supported platforms:
Win32
Win64
Linux
Examples:
Visual C++ - VC MDI Example (DLL only)
Example Code in Delphi:

Switching between 2 Cameras via CameraSelect2 Interface.
procedure TForm1.OpenSwitch;
var result : LongInt; // result of driver operations
imgTmp : IMG; // just a helper to need fewer casts
imgNew : IMG; // will contain the switched image
begin
CVImg.LoadImageByDialog;
imgTmp := IMG(CVImg.Image);
// verify image source
if (CanGrabber(imgTmp)) then
begin
if (CanCameraSelect2(imgTmp)) then
begin
// switch to camera 2
imgNew := Nil;
result := CS2SetCamPort(imgTmp, 1, 0, imgNew); // port 1
if (result >= 0) then
begin
if (imgNew <> Nil) then
begin
CVImg.Image := LongInt(imgNew);
ReleaseObject(imgNew);
end;
end;
end; // CameraSelect2
end; // CanGrabber
CVDisp.Image := CVImg.Image;
end; // procedure