Enumerations | |
enum | CVB_OS_INFO { OSI_NONE = -1 , OSI_WIN32 = 0 , OSI_WOW64 = 1 , OSI_X64 = 2 , OSI_LIN_i686 = 3 , OSI_LIN_x86_64 = 4 , OSI_LIN_ARMv7 = 5 , OSI_LIN_ARMv8 = 6 } |
Possible return values of GetCVBVersion and GetCVBVersionEx describing the operating system and processor architecture. More... | |
enum | DIRECTDRAW_STATUS { DDP_NOPROBLEM = 0 , DDP_UNKNOWN = 1 , DDP_NOTINSTALLED = 2 , DDP_WRONGVERSION = 3 , DDP_INVALIDRES = 4 , DDP_NOOFFSCREENMEM = 5 , DDP_INIT = 6 } |
Possible return and status values concerning the DirectDraw/Direct3D subsystem on the host machine as returned by the function CanCVBDirectDraw. More... | |
enum | VPAT_X_ANALYSIS { XVPAT_NO_IMAGE = -1 , XVPAT_INVALID_PLANE = -2 , XVPAT_CONFUSE = 0 , XVPAT_LINEAR_WITH_DATATYPE = 1 , XVPAT_FIX_INCREMENT = 2 } |
Possible result values for x-VPAT analysis (see AnalyseXVPAT). More... | |
enum | VPAT_Y_ANALYSIS { YVPAT_NO_IMAGE = -1 , YVPAT_INVALID_PLANE = -2 , YVPAT_CONFUSE = 0 , YVPAT_LINEAR_WITH_DATATYPE_AND_WIDTH = 1 , YVPAT_FIX_INCREMENT = 2 , YVPAT_REVERSE = 3 } |
Possible result values for y-VPAT analysis (see AnalyseYVPAT). More... | |
Functions | |
VPAT_X_ANALYSIS | AnalyseXVPAT (IMG Img, cvbdim_t Plane, intptr_t *pIncrement) |
Analyzes the X-offset table (X-VPAT) of an image. More... | |
VPAT_Y_ANALYSIS | AnalyseYVPAT (IMG Img, cvbdim_t Plane, intptr_t *pIncrement) |
Analyzes the Y-offset table (Y-VPAT) of an image. More... | |
cvbres_t | AnalyzeVPATRotation (IMG Img, cvbdim_t Plane, TVPATRotation &Rotation) |
Analyzes the VPAT to guess the VPAT rotation on the given Img. More... | |
DIRECTDRAW_STATUS | CanCVBDirectDraw (HWND hWnd) |
Checks whether DirectDraw is usable for the Common Vision Blox Display on this machine. More... | |
cvbbool_t | GetApplicationDirectory (char *Directory, size_t MaxLen) |
Returns the directory from which the calling application's executable was loaded. More... | |
cvbbool_t | GetApplicationDirectoryW (wchar_t *Directory, size_t MaxLen) |
Returns the directory from which the calling application's executable was loaded. More... | |
cvbbool_t | GetLinearAccess (IMG Img, cvbdim_t Plane, void **ppBaseAddress, intptr_t *pXInc, intptr_t *pYInc) |
Checks whether the image data can be accessed linearly and returns the necessary parameters to do so. More... | |
HRESULT | OpenCommonVisionBloxKey (const char *SubKey, REGSAM samDesired, PHKEY phKeyResult) |
Opens the Common Vision Blox root key in the Windows registry or one of its sub keys. (Windows only) More... | |
HRESULT | OpenCommonVisionBloxKeyW (const wchar_t *SubKey, REGSAM samDesired, PHKEY phKeyResult) |
Opens the Common Vision Blox root key in the Windows registry or one of its sub keys. (Windows only) More... | |
void | ProcessQueue (HWND hWnd) |
Processes pending Window messages. More... | |
cvbbool_t | ShowPropertyFrame (HWND hWndParent, IUnknown *pUnknown, const char *Title) |
Opens and displays the property page(s) of an ActiveX Control. More... | |
cvbbool_t | ShowPropertyFrameW (HWND hWndParent, IUnknown *pUnknown, const wchar_t *Title) |
Opens and displays the property page(s) of an ActiveX Control. More... | |
enum CVB_OS_INFO |
Possible return values of GetCVBVersion and GetCVBVersionEx describing the operating system and processor architecture.
enum DIRECTDRAW_STATUS |
Possible return and status values concerning the DirectDraw/Direct3D subsystem on the host machine as returned by the function CanCVBDirectDraw.
enum VPAT_X_ANALYSIS |
Possible result values for x-VPAT analysis (see AnalyseXVPAT).
enum VPAT_Y_ANALYSIS |
Possible result values for y-VPAT analysis (see AnalyseYVPAT).
Enumerator | |
---|---|
YVPAT_NO_IMAGE | The input was not a valid CVB image. |
YVPAT_INVALID_PLANE | The index of the plane to be analyzed does not exist in the input image. |
YVPAT_CONFUSE | The y-VPAT has a confuse arrangement, i.e. no linear access can be performed on the image's lines. |
YVPAT_LINEAR_WITH_DATATYPE_AND_WIDTH | The y-VPAT is linear with an increment that matches the plane's pixel data type and width. |
YVPAT_FIX_INCREMENT | The y-VPAT is linear with a fixed increment that does not match the plane's pixel data type and width (i.e. there are padding bytes at the end of each line). |
YVPAT_REVERSE | Like YVPAT_FIX_INCREMENT, but with a negative increment. |
VPAT_X_ANALYSIS AnalyseXVPAT | ( | IMG | Img, |
cvbdim_t | Plane, | ||
intptr_t * | pIncrement | ||
) |
Analyzes the X-offset table (X-VPAT) of an image.
If the function returns a value greater or equal to zero, then linear pixel access in x direction is possible and pIncrement contains the increment (in bytes) necessary to walk from pixel (x, y) to pixel (x+1, y).
[in] | Img | Handle to the image object to be analyzed. |
[in] | Plane | Index of the image plane to be analyzed. Must be in the range [0...ImageDimension(Img)-1 ]. |
[out] | pIncrement | If linear access is possible (check return value!) then the x increment will be written to the address pointed to by this parameter. Pass NULL here if you are not interested in the increment. |
enum
gives the result of the X-VPAT analysis (see VPAT_X_ANALYSIS for more information).GetImageVPA
, Proposal for a common image model. VPAT_Y_ANALYSIS AnalyseYVPAT | ( | IMG | Img, |
cvbdim_t | Plane, | ||
intptr_t * | pIncrement | ||
) |
Analyzes the Y-offset table (Y-VPAT) of an image.
If the function returns a value greater or equal to zero, then linear pixel access in y direction is possible and pIncrement contains the increment (in bytes) necessary to walk from pixel (x, y) to pixel (x, y+1).
[in] | Img | Handle to the image object to be analyzed. |
[in] | Plane | Index of the image plane to be analyzed. Must be in the range [0...ImageDimension(Img)-1 ]. |
[out] | pIncrement | If linear access is possible (check return value!) then the y increment will be written to the address pointed to by this parameter. Pass NULL here if you are not interested in the increment. |
enum
gives the result of the X-VPAT analysis (see VPAT_Y_ANALYSIS for more information).GetImageVPA
, Proposal for a common image model. cvbres_t AnalyzeVPATRotation | ( | IMG | Img, |
cvbdim_t | Plane, | ||
TVPATRotation & | Rotation | ||
) |
Analyzes the VPAT to guess the VPAT rotation on the given Img.
The assumption about the basic buffer format is that the image is linear with fixed positive x- and y-increments. If this assumption is not valid (e.g. on non-rotated images with default negative y-increment as with windows bitmaps) the returned Rotation is plain wrong! So make sure to check with AnalyseXVPAT and AnalyseYVPAT before using AnalyzeVPATRotation
.
The rotation returned is according to the Vin-driver rotation (counter clockwise).
..._FIX_INCREMENT or ..._LINEAR_WITH_DATATYPE; a simple check with GetLinearAccess won't do because GetLinearAccess returns also for images with a negative x or y increment).[in] | Img | Handle to the image Image to be analyzed. |
[in] | Plane | Image plane to be analyzed. |
[out] | Rotation | Rotation of the Img. |
cvbres_t:
Less than zero on error. DIRECTDRAW_STATUS CanCVBDirectDraw | ( | HWND | hWnd | ) |
Checks whether DirectDraw is usable for the Common Vision Blox Display on this machine.
This function is only available on the Windows platform.
[in] | hWnd | Window handle of the display window. |
cvbbool_t GetApplicationDirectory | ( | char * | Directory, |
size_t | MaxLen | ||
) |
Returns the directory from which the calling application's executable was loaded.
Only available on the Windows platform.
[in] | Directory | Pointer to the buffer to be filled with the start directory path. |
[in] | MaxLen | The maximum number of characters to be copied to the buffer pointed to by Directory . Remember to reserve enough space for the trailing zero. If the MaxLen is too small to accommodate the entire path to be copied then the string will be truncated. |
cvbbool_t GetApplicationDirectoryW | ( | wchar_t * | Directory, |
size_t | MaxLen | ||
) |
Returns the directory from which the calling application's executable was loaded.
Only available on the Windows platform.
[in] | Directory | Pointer to the buffer to be filled with the start directory path. |
[in] | MaxLen | The maximum number of characters to be copied to the buffer pointed to by Directory . Remember to reserve enough space for the trailing zero. If the MaxLen is too small to accommodate the entire path to be copied then the string will be truncated. |
cvbbool_t GetLinearAccess | ( | IMG | Img, |
cvbdim_t | Plane, | ||
void ** | ppBaseAddress, | ||
intptr_t * | pXInc, | ||
intptr_t * | pYInc | ||
) |
Checks whether the image data can be accessed linearly and returns the necessary parameters to do so.
This function considers an image plane linearly accessible if it is possible to navigate (in memory) from any pixel (x, y) to its vertical or horizontal neighbor using a fixed byte increment which is independent of the coordinate (x, y).
If linear access is not possible, the image data will need to be accessed through the VPAT (see the description of the GetImageVPA
function for details).
System.Runtime.InteropServices.Marshal
class.[in] | Img | Handle of the image object to be analyzed. |
[in] | Plane | Index of the plane to be analyzed. Must be in the range [0...ImageDimension(Img)-1 ]. |
[out] | ppBaseAddress | Will receive the pointer to the first pixel of the first line if linear access is possible. Pass NULL here if you're not interested in retrieving this pointer. |
[out] | pXInc | Will receive the increment in X direction in bytes. Pass NULL here if this increment is not needed. |
[out] | pYInc | Will receive the increment in Y direction in bytes. Pass NULL here if this increment is not needed. |
GetImageVPA
, AnalyseXVPAT, AnalyseYVPAT Create an 8 bit per pixel monochrome ramp image:
For higher bit data (e.g. 16 bit per pixel image) the for-loops looks similar - the differences lie in the way the pointers are interpreted:
Inversion of a rectangular region of an image with 8 bits per pixel. Remember to activate unsafe code in the project settings.
HRESULT OpenCommonVisionBloxKey | ( | const char * | SubKey, |
REGSAM | samDesired, | ||
PHKEY | phKeyResult | ||
) |
Opens the Common Vision Blox root key in the Windows registry or one of its sub keys. (Windows only)
This function does almost the same thing as the Windows SDK function RegOpenKeyEx
, the only difference being that OpenCommonVisionBloxKey
is restricted to the Common Vision Blox root key ("HKEY_LOCAL_MACHINE\Software\Common Vision Blox\Image Manager" when running the 32 bit version of Common Vision Blox on a 32 bit Windows system or when running the 64 bit version of Common Vision Blox on a 64 bit Windows system or "HKEY_LOCAL_MACHINE\Software\Wow6432Node\Common Vision Blox\Image Manager" when running the 32 bit version of Common Vision Blox on a 64 bit Windows system).
Remember to close any key opened by this function with the Windows SDK function RegCloseKey
.
Only available on the Windows platform.
[in] | SubKey | Path to the sub key to be opened (relative to the Common Vision Blox root key) or NULL for the Common Vision Blox root key. |
[in] | samDesired | Access rights with which to open the key (see the documentation of the Windows SDK function RegOpenKeyEx for a list of possible values. |
[out] | phKeyResult | Pointer to the variable that will receive the handle to the newly opened key. Release this handle with RegCloseKey when it is no longer needed. |
RegOpenKeyEx
(see WINERROR.H).RegOpenKeyEx
and RegCloseKey
HRESULT OpenCommonVisionBloxKeyW | ( | const wchar_t * | SubKey, |
REGSAM | samDesired, | ||
PHKEY | phKeyResult | ||
) |
Opens the Common Vision Blox root key in the Windows registry or one of its sub keys. (Windows only)
This function does almost the same thing as the Windows SDK function RegOpenKeyEx
, the only difference being that OpenCommonVisionBloxKeyW
is restricted to the Common Vision Blox root key ("HKEY_LOCAL_MACHINE\Software\Common Vision Blox\Image Manager" when running the 32 bit version of Common Vision Blox on a 32 bit Windows system or when running the 64 bit version of Common Vision Blox on a 64 bit Windows system or "HKEY_LOCAL_MACHINE\Software\Wow6432Node\Common Vision Blox\Image Manager" when running the 32 bit verison of Common Vision Blox on a 64 bit Windows system).
Remember to close any key opened by this function with the Windows SDK function RegCloseKey
.
Only available on the Windows platform.
[in] | SubKey | Path to the sub key to be opened (relative to the Common Vision Blox root key) or NULL for the Common Vision Blox root key. |
[in] | samDesired | Access rights with which to open the key (see the documentation of the Windows SDK function RegOpenKeyEx for a list of possible values. |
[out] | phKeyResult | Pointer to the variable that will receive the handle to the newly opened key. Release this handle with RegCloseKey when it is no longer needed. |
RegOpenKeyEx
(see WINERROR.H).RegOpenKeyEx
and RegCloseKey
void ProcessQueue | ( | HWND | hWnd | ) |
Processes pending Window messages.
This method may be used in computationally intensive processing that happens in the UI thread (e.g. because processing happens in an event handler) to keep the application reactive.
An application that calls ProcessQueue
needs to thorougly disable all UI elements that might interfere with the long running processing task that called ProcessQueue
, otherwise undefined behavior is to be expected. Use of ProcessQueue
may furthermore lead to reentrance problems because in the presence of ProcessQueue
for example a button handler may easily be entered again while it is already running, and the handler code will need to be made resilient to that if an application uses ProcessQueue
. On top of that, the implementation of proper and well-defined termination behavior of an application is difficult in the presence of ProcessQueue
calls.
Generally speaking, it is usually preferable to shift long running processing to asynchronous processing patterns like e.g. threads to
Some GUI toolkits offer functionality similar to that of ProcessQueue
. For example the Windows Forms SDK offers the method System.Windows.Forms.Application.DoEvents()
. Where available, such native functionality should be preferred over the use of ProcessQueue
from the CVCUtilities.dll.
This function is only available on the Windows platform.
[in] | hWnd | Window handle of the window to process messages on. |
cvbbool_t ShowPropertyFrame | ( | HWND | hWndParent, |
IUnknown * | pUnknown, | ||
const char * | Title | ||
) |
Opens and displays the property page(s) of an ActiveX Control.
This function opens a modal dialog with the ActiveX Control's property page(s) and uses the hWndParent as the dialogs parent.
This function is only available on the Windows platform.
ShowPropertyPages
to each ActiveX control wrapper and Delphi or CBuilder provide the function BrowseProperties
) and it is usually preferable to use the functionality provided by the GUI toolkit.[in] | hWndParent | Handle of the parent window of the dialog (e.g the main window of the application). |
[out] | pUnknown | Pointer to the IUnknown interface of the OCX. |
[in] | Title | Title of the property page dialog. |
cvbbool_t ShowPropertyFrameW | ( | HWND | hWndParent, |
IUnknown * | pUnknown, | ||
const wchar_t * | Title | ||
) |
Opens and displays the property page(s) of an ActiveX Control.
This function opens a modal dialog with the ActiveX Control's property page(s) and uses the hWndParent as the dialogs parent.
This function is only available on the Windows platform.
ShowPropertyPages
to each ActiveX control wrapper and Delphi or CBuilder provide the function BrowseProperties
) and it is usually preferable to use the functionality provided by the GUI toolkit.[in] | hWndParent | Handle of the parent window of the dialog (e.g the main window of the application). |
[out] | pUnknown | Pointer to the IUnknown interface of the OCX. |
[in] | Title | Title of the property page dialog. |