Camera API Technical Report:
Value Types

next up previous
Next: Example Code Up: Camera Attribute Values - Previous: Camera Attribute Values -

Value Types

Each value that can be read or set has a unique type identifier. These and the type of value are shown below. Some of the attributes are read-only.

ID, Name and Type Info
Value Type Constant Access Data type Comment
CV_Name RO char * Name of the camera
CV_Version RO int Version number
CV_InitStr RO char * Initialisation string given to CameraInit()
CV_InterfaceType RO CameraType Camera interface type, one of CAMERA_TYPE_DMA or CAMERA_TYPE_FB DMA or frame-buffer respectively.
CV_ColourType RO CameraType Pixel value type, one of CAMERA_TYPE_GREY, CAMERA_TYPE_COMPCOL and CAMERA_TYPE_RGB or grey-level (all HGU cameras), composite colour and RGB colour respectively.

To get access to attributes and functions of a particular camera that is not provided by the camera model, then it is necessary to access the camera directly. For this reason the unix device file-descriptor and/or the frame buffer address is available.

Device File Descriptor or Frame Buffer
Value Type Constant Access Data type Comment
CV_FD RO int Unix device file descriptor.
CV_FB RO char * Frame buffer pointer.

So that I could write a moderately general purpose user interface to control the camera it is necessary to be able query the camera to find what is available in terms binning options, scaling options and so on. These are returned as option tables which are null-terminated. Each entry in the table gives the settable value and a string which can be used within a menu, see example code below.

Options - Binning, Scaling .
Value Type Constant Access Data type Comment
CV_X_BinningOpt RO CameraOption * X binning options
CV_Y_BinningOpt RO CameraOption * Y binning options
CV_X_SamplingOpt RO CameraOption * X sampling options
CV_Y_SamplingOpt RO CameraOption * Y sampling options
CV_GainOpt RO CameraOption * Gain options
CV_OutputDepthOpt RO CameraOption * Output pixel depth options
CV_ClockOpt RO CameraOption * Camera pixel clock options

Most of the attribute queries and setting are to do with the binning, sampling and window geometry. This can be set individually or via the composite attribute set detailed in the next section. Note that setting window parameters individually will often fail because there are many contraints between window sizes and binning values.

Geometry Attributes
Value Type Constant Access Data type Comment
CV_X_Size RO float Real pixel size in x-direction.
CV_Y_Size RO float Real pixel size in y-direction.
CV_PixelUnits RO char * Units ( microns) if the pixel sizes.
CV_MaxWindow RO CameraWindow * Maximum values of the input-window parameters.
CV_MinWindow RO CameraWindow * Minimum values of the input-window parameters.
CV_X_Binning RW int Number of pixels to be binned in the x-direction.
CV_Y_Binning RW int Number of pixels to be binned in the y-direction.
CV_X_Sampling RW int Number of pixels to be sampled in the x-direction.
CV_Y_Sampling RW int Number of pixels to be sampled in the y-direction.
CV_InputWindow RW CameraWindow * Current input window.
CV_OutputWindow RW CameraWindow * Current output window.
CV_SetAttributes RW CameraSetAttributes * Current composite attributes.

The next two tables refer to grey-value options, input/output depths and exposure times. There are constraints between the clock rate the rate at which data is transferred and the quantisation of the exposure time. There are also constraints between the clock-rate and the output pixel depth. On the iim camera interface 16 bit pixels have to be read out at the slowest rate.

Pixel Information
Value Type Constant Access Data type Comment
CV_InputDepth RO int Number of bits-per-pixel from the camera DAC.
CV_Gain RW int Electronic gain set, only valid if there are gain-options.
CV_OutputDepth RW int Number of bits-per-pixel in the output data, only valid if there are output-depth-options.
CV_TransfLUT RW CameraLUT * Transfer look-up-table for input to output pixel values, only valid on some cameras.

Exposure, Data-rate and Data-size
Value Type Constant Access Data type Comment
CV_TimeUnits RO char * Units of time measurement ms.
CV_TimeQuanta RO float Quantum for exposure times.
CV_MinExposure RO int Minimum exposure time as an integer multiplier times the time quantum.
CV_MaxExposure RO int Minimum exposure time.
CV_Exposure RW int Current exposure time.
CV_Clock RW int Clock rate to determine the rate of data-transfer from the camera into memory.
CV_DataSize RO int Total number of bytes corresponding to the current output window and pixel depth.

On video rate cameras attached to a frame buffer there are usually a number of additional facilities to control the independent video display. These attribute should cover most of them.

Video Extensions
Value Type Constant Access Data type Comment
CV_VideoOpt RO int If non-zero then there is a video option.
CV_VideoMode RW int Video mode - see VideoMode bitmasks.
CV_VideoOverlay RO char * Pointer to the overlay plane if present.
CV_VideoOvlyCol RW int [3] array of three integers to set the overlay plane colour.
CV_VideoLUT RW CameraLUT * Video display look-up table.


next up previous
Next: Example Code Up: Camera Attribute Values - Previous: Camera Attribute Values -

Richard Baldock
1998-07-02