LightMeter Control Reference 15.0
Error Handling

cvbres_t error codes and helper macros. More...

Macros

#define CVC_ERROR(a)   ((a) != 0 ? (static_cast<cvbres_t>(a)) | static_cast<cvbres_t>(0x80000000) : (a))
 
#define CVC_ERROR_FROM_HRES(hr)   ((hr) & 0x7FFFFFFF)
 

Enumerations

enum  CVC_ERROR_CODES {
  CVC_E_OK = 0 , CVC_E_ERROR = 1 , CVC_E_PARAMETER = 2 , CVC_E_FILEIO = 3 ,
  CVC_E_TIMEOUT = 4 , CVC_E_MEMORY = 5 , CVC_E_INVALIDPLANE = 6 , CVC_E_UNSUPPORTEDDATATYPE = 7 ,
  CVC_E_INVALIDCAMERAPORT = 8 , CVC_E_BOARDSELECT = 9 , CVC_E_INVALIDTRIGGERMODE = 10 , CVC_E_PROPERTYREAD = 11 ,
  CVC_E_PROPERTYWRITE = 12 , CVC_E_INVALIDPORT = 13 , CVC_E_PORTREAD = 14 , CVC_E_PORTWRITE = 15 ,
  CVC_E_NOIMAGE = 16 , CVC_E_NOINTERFACE = 17 , CVC_E_BUSY = 18 , CVC_E_NOTSUPPORTED = 19 ,
  CVC_E_GRABABORTED = 20 , CVC_E_NOPIXELLIST = 21 , CVC_E_NOTENOUGHDATA = 22 , CVC_E_NOTRANSFORMATION = 23 ,
  CVC_E_LINEAR_ONLY = 24 , CVC_E_DIVISIONBYZERO = 25 , CVC_E_INVALIDDIMENSION = 26 , CVC_E_INVALIDCOLORMODEL = 27 ,
  CVC_E_INVALIDDATATYPE = 28 , CVC_E_WRONGOBJECT = 29 , CVC_E_NOTREADY = 30 , CVC_E_NOANGLE = 31 ,
  CVC_E_NOVECTOR2D = 32 , CVC_E_NOLINE2D = 33 , CVC_E_VECTOR2D_ZERO_LENGTH = 34 , CVC_E_VECTORS_IDENTICAL = 35 ,
  CVC_E_LINE2D_VERTICAL = 36 , CVC_E_LINE2D_HORIZONTAL = 37 , CVC_E_NOARGUMENT = 38 , CVC_E_LINE2D_UNDEFINED = 39 ,
  CVC_E_NOINTERSECTION = 40 , CVC_E_NOCLIPPING = 41 , CVC_E_NOTENOUGHLINES = 42 , CVC_E_OVERFLOW = 43 ,
  CVC_E_NOCIRCLE = 44 , CVC_E_ACCESS = 45 , CVC_E_NOTPRESENT = 46 , CVC_E_UNSUPPORTEDFEATURE = 47 ,
  CVC_E_INVALIDINDEX = 48 , CVC_E_NOOVERLAY = 49 , CVC_E_INVALIDSTATE = 50 , CVC_E_EMPTYRESULT = 51
}
 Error codes returned by CVB functions. More...
 
enum  CVC_WARNINGS { CVC_W_WARNING = 1 , CVC_W_X86ASM_FUNCTION = 2 , CVC_W_NOTENOUGHPIXELS = 3 }
 

Detailed Description

cvbres_t error codes and helper macros.

Macro Definition Documentation

◆ CVC_ERROR

#define CVC_ERROR (   a)    ((a) != 0 ? (static_cast<cvbres_t>(a)) | static_cast<cvbres_t>(0x80000000) : (a))

Creates a cvbres_t error code from CVC_ERROR_CODES entry.

◆ CVC_ERROR_FROM_HRES

#define CVC_ERROR_FROM_HRES (   hr)    ((hr) & 0x7FFFFFFF)

Extracts the error entry from a cvbres_t error code as CVC_ERROR_CODES.

Enumeration Type Documentation

◆ CVC_ERROR_CODES

Error codes returned by CVB functions.

Note
These error codes are only the lowermost bits of a 32 bit value whose highest bit has been set to 1 to indicate an error. Thus, every negative return value in CVB functions that does return a value of type cvbres_t indicates an error condition, whereas positive values or zero indicate success.
So in order to get from the cvbres_t return value to one of the enumerated values below, you will need to set the uppermost bit of the cvbres_t to zero (for example by using the CVC_ERROR_FROM_HRES macro).
Enumerator
CVC_E_OK 

No Error occurred.

CVC_E_ERROR 

An unspecified error occurred for which no further information is available.

CVC_E_PARAMETER 

A function was called with an invalid parameter value for one of the function's arguments.

CVC_E_FILEIO 

An error occurred during a File I/O operation (e.g. while loading/saving data from/to a file).

CVC_E_TIMEOUT 

A timeout occurred in an asynchronous function call.

CVC_E_MEMORY 

The allocation of a block of memory failed, typically because the amount of memory available to the application was insufficient for the operation at hand.

CVC_E_INVALIDPLANE 

A plane index was specified that was either negative or bigger than or equal to the number of planes in the image.

CVC_E_UNSUPPORTEDDATATYPE 

The data type of the input image is not supported by the function that has been called.

CVC_E_INVALIDCAMERAPORT 

An attempt to switch to an invalid/unavailable camera port was made.

CVC_E_BOARDSELECT 

An attempt to switch to an invalid/unavailable board was made.

CVC_E_INVALIDTRIGGERMODE 

An attempt to select and invalid/unsupported trigger mode was made.

CVC_E_PROPERTYREAD 

An attempt to read a property was unsuccessful, either because the property does not exist or because the device or property is in a state that prevents the property from being read.

CVC_E_PROPERTYWRITE 

An attempt to write a property was unsuccessful, either because the property does not exist or because the device or property is in a state that prevents the property from being written.

CVC_E_INVALIDPORT 

An invalid/unavailable port was selected.

CVC_E_PORTREAD 

A port read operation failed.

CVC_E_PORTWRITE 

A port write operation failed.

CVC_E_NOIMAGE 

The handle to at least one of the input images does not point to a valid image.

CVC_E_NOINTERFACE 

The input image object does not support the interface required for this operation.

CVC_E_BUSY 

The operation failed because the hardware is not in a state where it can handle that operation.

CVC_E_NOTSUPPORTED 

The requested feature is not supported.

CVC_E_GRABABORTED 

The current grab operation was aborted.

CVC_E_NOPIXELLIST 

At least one of the input handles does not point to a valid pixel list.

CVC_E_NOTENOUGHDATA 

The amount of input data is insufficient for the requested operation.

CVC_E_NOTRANSFORMATION 

The object handle that was passed to the function does not point to a valid non linear transformation object.

CVC_E_LINEAR_ONLY 

The function only works on images with a linear VPAT layout.

CVC_E_DIVISIONBYZERO 

A division by zero was attempted.

CVC_E_INVALIDDIMENSION 

An invalid number of planes was specified.

CVC_E_INVALIDCOLORMODEL 

An invalid/undefined color model mode has been passed to the function.

CVC_E_INVALIDDATATYPE 

An invalid data type descriptor has been passed to the function.

CVC_E_WRONGOBJECT 

At least one of the input handles points to the wrong type of object.

CVC_E_NOTREADY 

The device or object is not ready to handle the requested operation.

CVC_E_NOANGLE 

The input handle does not point to a valid angle object.

CVC_E_NOVECTOR2D 

The input handle does not point to a valid 2D vector object.

CVC_E_NOLINE2D 

The input handle does not point to a valid 2D line object.

CVC_E_VECTOR2D_ZERO_LENGTH 

The operation failed because the vector passed to this function has length zero.

CVC_E_VECTORS_IDENTICAL 

The function call failed because the input vectors to this operation are identical.

CVC_E_LINE2D_VERTICAL 

The operation failed because the line object passed to it is vertical.

CVC_E_LINE2D_HORIZONTAL 

The operation failed because the line object passed to it is horizontal.

CVC_E_NOARGUMENT 

The argument cannot be calculated for a vector of length zero.

CVC_E_LINE2D_UNDEFINED 

The operation failed because the input line 2D object has not yet been defined

CVC_E_NOINTERSECTION 

The operation failed because the the line objects provided to the function do not intersect

CVC_E_NOCLIPPING 

No clipping points available.

CVC_E_NOTENOUGHLINES 

Not enough lines available to calculate the intersection reliably.

CVC_E_OVERFLOW 

An input value was too big or did lead to a too big result.

CVC_E_NOCIRCLE 

The input handle does not point to a valid 2D circle object.

CVC_E_ACCESS 

A feature access failed.

CVC_E_NOTPRESENT 

The requested operation failed because the selected feature is not present.

CVC_E_UNSUPPORTEDFEATURE 

The requested feature is not supported (may happen if a specific interface implementation does not implement all functionality).

CVC_E_INVALIDINDEX 

An index value in an indexed access exceeded its limits.

CVC_E_NOOVERLAY 

An image object that is expected to have overlay bits does not have overlay bits (see DT_Overlay).

CVC_E_INVALIDSTATE 

A state which does not allow to call a function.

CVC_E_EMPTYRESULT 

The function returned an empty result, e.g. nullptr for an empty point cloud.

◆ CVC_WARNINGS

Execution was in principle successful, but result may not exactly be what the caller had in mind.

Enumerator
CVC_W_WARNING 

A function did not complete as expected.

CVC_W_X86ASM_FUNCTION 

A function has been called that will - in that form - only be available on platforms that support 32 bit x86 assembler.

CVC_W_NOTENOUGHPIXELS 

A pixel list function completed successfully, but did not have enough data to perform its actual task.