Enumerations | Functions
IImageRect
Miscellaneous

Interface for changing resolution of an image. More...

Enumerations

enum  IMAGERECT_CMD {
  IMAGERECT_CMD_GET = 0, IMAGERECT_CMD_SET_AUTODELETE = 1, IMAGERECT_CMD_VALIDATE = 2, IMAGERECT_CMD_SET = 3,
  IMAGERECT_CMD_RESET = 4, IMAGERECT_CMD_CHECK = 5
}
 Defines options for the IRImageSize and IRImageOffset functions. More...
 

Functions

cvbbool_t CanImageRect (IMG Image)
 This function verifies whether the image supports the ImageRect interface.
 
cvbres_t IRImageOffset (IMG Image, IMAGERECT_CMD lAction, cvbdim_t &lXOffset, cvbdim_t &lYOffset)
 Sets/ Gets/ Inquires the offsets of the current image.
 
cvbres_t IRImageSize (IMG Image, IMAGERECT_CMD lAction, cvbdim_t &lDx, cvbdim_t &lDy, IMG &imgNew)
 Sets/ Gets/ Inquires the size of the current image.
When IMAGERECT_CMD_GET or IMAGERECT_CMD_VALIDATE is used the imgNew will not be assigned with a new image. IT will be assigned with null.
A new image will be returned with imgNew if the set or reset functionality is used and the return value is 0 (OK).
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. With IMAGERECT_CMD_SET_AUTODELETE only the newImg has to be released.
 

Detailed Description

Interface for changing resolution of an image.

Enumeration Type Documentation

Defines options for the IRImageSize and IRImageOffset functions.

Attention
The list below descripes the specific constant declarations and typedefs. There are declared in the header file iCVCDriver.* .
Enumerator:
IMAGERECT_CMD_GET 

Get the actual settings for the size or the offset.

IMAGERECT_CMD_SET_AUTODELETE 

Sets the size and decrement the image reference count of the input image automatically (calls ReleaseImage automatically).

IMAGERECT_CMD_VALIDATE 

Validates a certain size or offset. The function returns the closest possible values.

IMAGERECT_CMD_SET 

Sets the size or the offset but doesn't decrement the RefCount.

Attention
Be aware that the RefCount of the input image is increased by one. You have to release the input image manually.
IMAGERECT_CMD_RESET 

Creates a new image with the standard size of the image acquisition device driver.

IMAGERECT_CMD_CHECK 

Not allowed.

Function Documentation

cvbbool_t CanImageRect ( IMG  Image)

This function verifies whether the image supports the ImageRect interface.

Parameters
[in]ImageHandle of image object.
Returns
TRUE if the image supports the ImageRect interface, FALSE otherwise.
Supported platforms:
Win32
Win64
Linux
Examples:
Visual C++ - VC MDI Example (DLL only)
cvbres_t IRImageOffset ( IMG  Image,
IMAGERECT_CMD  lAction,
cvbdim_t &  lXOffset,
cvbdim_t &  lYOffset 
)

Sets/ Gets/ Inquires the offsets of the current image.

Attention
Notice that some drivers may not accept new offset settings while an acquisition is active. To ensure proper offset values you should call the function with the IMAGERECT_CMD_VALIDATE action before setting the size. In this case the function returns the biggest, closest values for lXOffset and lYOffset.
The function does not increment the Image RefCount.
Parameters
[in]ImageHandle of image object.
[in]lActionCommand to execute. Valid parameters are:
IMAGERECT_CMD_GET
IMAGERECT_CMD_VALIDATE
IMAGERECT_CMD_SET
IMAGERECT_CMD_RESET
(description of parameters see IMAGERECT_CMD)
[out]lXOffsetOffset in x-direction.
[out]lYOffsetOffset in y-direction.
Returns
0 : OK
<0 : an error occured
Supported platforms:
Win32
Win64
Linux
Examples:
Visual C++ - VC MDI Example (DLL only)
cvbres_t IRImageSize ( IMG  Image,
IMAGERECT_CMD  lAction,
cvbdim_t &  lDx,
cvbdim_t &  lDy,
IMG &  imgNew 
)

Sets/ Gets/ Inquires the size of the current image.
When IMAGERECT_CMD_GET or IMAGERECT_CMD_VALIDATE is used the imgNew will not be assigned with a new image. IT will be assigned with null.
A new image will be returned with imgNew if the set or reset functionality is used and the return value is 0 (OK).
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. With IMAGERECT_CMD_SET_AUTODELETE only the newImg has to be released.

Attention
To ensure proper size values you should call the function with the IMAGERECT_CMD_VALIDATE action before setting the size. In this case the function returns the biggest, closest values for dx and dy. To retrieve the maximum values for dx and dy call the function with the IMAGERECT_CMD_VALIDATE action and pass 0xFFFFFFFF as dx and dy into the function. Notice that some drivers may not accept new size settings while a grab is active.
Parameters
[in]ImageHandle of image object.
[in]lActionCommand to execute. Valid parameters are:
IMAGERECT_CMD_GET
IMAGERECT_CMD_VALIDATE
IMAGERECT_CMD_SET_AUTODELETE
(recommended as default)
IMAGERECT_CMD_SET
IMAGERECT_CMD_RESET
(description of parameters see IMAGERECT_CMD)
[out]lDxImage width.
[out]lDyImage Height.
[out]imgNewNew image.
Returns
0 : OK
<0 : an error occured
Supported platforms:
Win32
Win64
Linux
Examples:
Visual C++ - VC MDI Example (DLL only)
Example Code in C++:
if ( IRImageSize((IMG)m_cvImg.GetImage(), IMAGERECT_CMD_SET_AUTODELETE, lDx, lDy, INew) >= 0)
{
m_cvImg.SetImage(0);
m_cvDisp.SetImage(0);
m_cvImg.SetImage((long)INew);
m_cvDisp.SetImage((long)INew);
ReleaseImage(INew);
m_cvDisp.SetStatusUserText(" IMAGERECT: size changed");
}
else
{
m_cvDisp.SetStatusUserText("Unable to Set Size");
}