Settings
[EDT Digital Video Library]


Detailed Description

Get and set EDT interface board (register) values as well as device driver and camera settings.

Most values get initialized from the config file, via the initcam program or the the camera configuration dialog (see pdv_initcam, initcam.c and the Camera Configuration Guide). In many cases the "get" routines are all that are used from an application, but sometimes it is useful for an application to make changes as well. These subroutines can be used to do both.


Functions

int pdv_auto_set_roi (PdvDev *pdv_p)
 set ROI to camera width/height; adjust ROI width to be a multiple of 4, and enable ROI
char * pdv_camera_type (PdvDev *pdv_p)
 Alias of pdv_get_cameratype.
void pdv_enable_external_trigger (PdvDev *pdv_p, int flag)
 Enables external triggering.
int pdv_enable_roi (PdvDev *pdv_p, int flag)
 Enables on-board region of interest.
int pdv_extra_headersize (PdvDev *pdv_p)
 Return the header space allocated but not used for DMA.
int pdv_get_allocated_size (PdvDev *pdv_p)
 Returns the allocated size of the image, including any header and pad for page alignment.
int pdv_get_blacklevel (PdvDev *pdv_p)
 Gets the black level (offset) on the video device.
int pdv_get_bytes_per_image (PdvDev *pdv_p)
 Gets the number of bytes per image, based on the set width, height, and depth.
int pdv_get_cam_height (PdvDev *pdv_p)
 Returns the camera image height, in pixels, as set by the configuration file directive height, unaffected by changes made by setting a region of interest.
int pdv_get_cam_width (PdvDev *pdv_p)
 Returns the camera image width, in pixels, as set by the configuration file directive width.
char * pdv_get_camera_class (PdvDev *pdv_p)
 Gets the class of the camera (usually the manufacturer name), as set by initcam from the camera_config file camera_class directive.
char * pdv_get_camera_info (PdvDev *pdv_p)
 Gets the string set by the camera_info configuration file directive.
char * pdv_get_camera_model (PdvDev *pdv_p)
 Gets the model of the camera, as set by initcam from the camera_config file camera_model directive.
char * pdv_get_cameratype (PdvDev *pdv_p)
 Gets the type of the camera, as set by initcam from the camera configuration file's camera description directives.
int pdv_get_depth (PdvDev *pdv_p)
 Gets the depth of the image (number of bits per pixel), as set in the configuration file for the camera in use.
 pdv_get_dmasize (PdvDev *pdv_p)
 Returns the actual amount of image data for DMA Normally the "depth" value For some de-interleave and or color interpolation options, uses extdepth.
int pdv_get_exposure (PdvDev *pdv_p)
 Gets the exposure time on the digital video device.
int pdv_get_extdepth (PdvDev *pdv_p)
 Gets the extended depth of the camera.
int pdv_get_frame_height (PdvDev *pdv_p)
 Gets the camera image height.
int pdv_get_frame_period (PdvDev *pdv_p)
 Get the frame period.
int pdv_get_gain (PdvDev *pdv_p)
 Gets the gain on the device.
int pdv_get_header_dma (PdvDev *pdv_p)
 Returns the current setting for flag which determines whether the header size is to be added to the DMA size.
int pdv_get_header_offset (PdvDev *pdv_p)
 Returns the byte offset of the header in the buffer.
int pdv_get_header_position (PdvDev *pdv_p)
 Returns the header position value.
int pdv_get_header_size (PdvDev *pdv_p)
 Returns the currently defined header size.
int pdv_get_height (PdvDev *pdv_p)
 Gets the height of the image (number of lines), based on the camera in use.
int pdv_get_imagesize (PdvDev *pdv_p)
 Returns the size of the image, absent any padding or header data.
int pdv_get_max_gain (PdvDev *pdv_p)
 Gets the maximum allowable gain value for this camera, as set by initcam from the camera configuration file gain_max directive.
int pdv_get_max_offset (PdvDev *pdv_p)
 Gets the maximum allowable offset (black level) value for this camera, as set by initcam from the camera configuration file offset_max directive.
int pdv_get_max_shutter (PdvDev *pdv_p)
 Gets the maximum allowable exposure value for this camera, as set by initcam from the camera_config file shutter_speed_max directive.
int pdv_get_min_gain (PdvDev *pdv_p)
 Gets the minimum allowable gain value for this camera, as set by initcam from the camera configuration file gain_min directive.
int pdv_get_min_offset (PdvDev *pdv_p)
 Gets the minimum allowable offset (black level) value for this camera, as set by initcam from the camera configuration file offset_min directive.
int pdv_get_min_shutter (PdvDev *pdv_p)
 Gets the minimum allowable exposure value for this camera, as set by initcam from the camera_config file shutter_speed_min directive.
int pdv_get_pitch (PdvDev *pdv_p)
 Gets the number of bytes per line (pitch).
int pdv_get_width (PdvDev *pdv_p)
 Gets the width of the image (number of pixels per line), based on the camera in use.
int pdv_image_size (PdvDev *pdv_p)
 Returns the size of the image buffer in bytes, based on its width, height, and depth.
void pdv_invert (PdvDev *pdv_p, int val)
 Tell the PCI DV hardware to invert each pixel before transferring it to the host computer's memory.
void pdv_invert_fval_interrupt (PdvDev *pdv_p)
 Set the Frame Valid interrupt to occur on the rising instead of falling edge of frame valid.
int pdv_picture_timeout (PdvDev *pdv_p, int value)
 Sets the length of time to wait for data on acquisition before timing out.
 pdv_read_response (PdvDev *pdv_p, char *buf)
 Read serial response, wait for timeout (or serial_term if specified), max is 2048 (arbitrary).
int pdv_set_binning (PdvDev *pdv_p, int xval, int yval)
 Set binning on the camera to the specified values, and recalculate the values that will be returned by pdv_get_width, pdv_get_height, and pdv_get_imagesize.
int pdv_set_binning_dvc (PdvDev *pdv_p, int xval, int yval)
 DVC 1312 binning.
int pdv_set_blacklevel (PdvDev *pdv_p, int value)
 Sets the black level (offset) on the input device.
int pdv_set_cam_height (PdvDev *pdv_p, int value)
 Sets placeholder for original full camera frame height, unaffected by ROI changes and usually only called by pdv_initcam.
int pdv_set_cam_width (PdvDev *pdv_p, int value)
 Sets placeholder for original full camera frame width, unaffected by ROI changes and usually only called by pdv_initcam.
int pdv_set_cameratype (PdvDev *pdv_p, char *model)
 Sets the camera's type (model) string in the dependent structure.
int pdv_set_depth (PdvDev *pdv_p, int value)
 Sets the bit depth.
int pdv_set_exposure (PdvDev *pdv_p, int value)
 Sets the exposure time on the digital video device.
int pdv_set_exposure_basler202k (PdvDev *pdv_p, int value)
 set exposure (,gain, blacklevel) on basler A202K -- ref BASLER A202K Camera Manual Document ID number DA044003.
int pdv_set_exposure_duncan_ch (PdvDev *pdv_p, int value, int ch)
 Set exposure for Redlake (formerly Duncantech) DT and MS series cameras.
int pdv_set_exposure_mcl (PdvDev *pdv_p, int value)
 Set the exposure when in pulse-width mode (also known as level trigger mode).
int pdv_set_extdepth (PdvDev *pdv_p, int value)
 Sets the bit depth coming from the camera.
int pdv_set_frame_period (PdvDev *pdv_p, int period, int method)
 Set the frame period counter and enable/disable frame timing.
void pdv_set_full_bayer_parameters (int nSourceDepth, double scale[3], double gamma, int nBlackOffset, int bRedRowFirst, int bGreenPixelFirst, int quality, int bias, int gradientcolor)
 Sets the full bayer parameters for images for PCI DV library decoding of bayer formatted color image data.
int pdv_set_gain (PdvDev *pdv_p, int value)
 Sets the gain on the input device.
int pdv_set_gain_duncan_ch (PdvDev *pdv_p, int value, int ch)
 Set gain for Redlake (formerly Duncantech) DT and MS series cameras.
void pdv_set_header_dma (PdvDev *pdv_p, int header_dma)
 Sets the boolean value for whether the image header is included in the DMA from the camera.
void pdv_set_header_offset (PdvDev *pdv_p, int header_offset)
 Sets the byte offset of the header data in the allocated buffer.
void pdv_set_header_position (PdvDev *pdv_p, int header_position)
 Sets the header position.
void pdv_set_header_size (PdvDev *pdv_p, int header_size)
 Sets the header size (in bytes) for the pdv.
int pdv_set_height (PdvDev *pdv_p, int value)
 Sets height and reallocates buffers accordingly.
int pdv_set_roi (PdvDev *pdv_p, int hskip, int hactv, int vskip, int vactv)
 Sets a rectangular region of interest, supporting cropping.
int pdv_set_width (PdvDev *pdv_p, int value)
 Sets width and reallocates buffers accordingly.
int pdv_setsize (PdvDev *pdv_p, int width, int height)
 Sets the width and height of the image.
int pdv_shutter_method (PdvDev *pdv_p)
 Return shutter (expose) timing method.


Function Documentation

int pdv_auto_set_roi ( PdvDev pdv_p  ) 

set ROI to camera width/height; adjust ROI width to be a multiple of 4, and enable ROI

mainly for use starting up with PCI DV C-Link which we want to use ROI in by default. But can be used for other stuff.

Definition at line 6904 of file libpdv.c.

char* pdv_camera_type ( PdvDev pdv_p  ) 

Alias of pdv_get_cameratype.

This is the same as pdv_get_cameratype (but diff name) and exists for backward compatability.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
the camera type
See also:
pdv_get_cameratype

Definition at line 1505 of file libpdv.c.

void pdv_enable_external_trigger ( PdvDev pdv_p,
int  flag 
)

Enables external triggering.

One of several methods for external triggering. Calling this subroutine will enable the board's external trigger logic. When enabled via this subroutine, the hardware will queue any acquisition request made via pdv_start_image or similar subroutine, but will not service the request (that is, trigger the camera) until it sees a transition on the external trigger line coming in to the optical trigger pins (TTL level) on the board. If the camera is in freerun mode this of course won't have any effect.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
flag one of --
  • 0 = turn off trigger
  • 1 = turn on photo trigger
  • 2 = turn on field ID trigger (through camera or cable). Does not apply to PCI C-Link.

Definition at line 8541 of file libpdv.c.

int pdv_enable_roi ( PdvDev pdv_p,
int  flag 
)

Enables on-board region of interest.

The rectangular region of interest parameters are set using pdv_set_roi; this subroutine is used to enable/disballe that region. Also calls pdv_setsize so subsequent calls to pdv_get_width or pdv_get_height return the values after region of interest is applied. Also resizes and reallocates any buffers allocated as a result of calling pdv_multibuf. Returns an error if the region of interest values are out of range.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
flag nonzero to enable region of interest; 0 to disable it.
Returns:
0 on success, -1 on failure.
See also:
pdv_set_roi for an example.

Definition at line 6940 of file libpdv.c.

int pdv_extra_headersize ( PdvDev pdv_p  ) 

Return the header space allocated but not used for DMA.

Typically set via the header_dma and header_size directives in the configuration file.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
See also:
pdv_get_header_dma, pdv_set_header_size

Definition at line 5316 of file libpdv.c.

int pdv_get_allocated_size ( PdvDev pdv_p  ) 

Returns the allocated size of the image, including any header and pad for page alignment.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
allocated size, in bytes.
See also:
pdv_image_size, pdv_get_header_dma

Definition at line 844 of file libpdv.c.

int pdv_get_blacklevel ( PdvDev pdv_p  ) 

Gets the black level (offset) on the video device.

Applies only to cameras for which extended control capabilities have been written into the libaray, such as the Kodak Megaplus i series.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Black level value
See also:
pdv_set_blacklevel, pdv_get_max_offset, pdv_get_min_offset, serial_offset configuration file directive.

Definition at line 3036 of file libpdv.c.

int pdv_get_bytes_per_image ( PdvDev pdv_p  ) 

Gets the number of bytes per image, based on the set width, height, and depth.

Functionally equivalent to pdv_get_imagesize.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open

Definition at line 632 of file libpdv.c.

int pdv_get_cam_height ( PdvDev pdv_p  ) 

Returns the camera image height, in pixels, as set by the configuration file directive height, unaffected by changes made by setting a region of interest.

See pdv_set_roi for more information.

Not to be confused with pdv_get_height; this subroutine gets the pdv_p->dd_p->cam_height value which only exists as a place to record the camera's (presumably) full height, as set by the config file 'height' directive and unaffected by any subsequent region of interest or pdv_setsize changes. This subroutine is just here to give applications a way to remember what that is. Doesn't change the buffer sizes or region of interest -- for that, use pdv_set_roi or pdv_setsize.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Image height in pixels.
See also:
pdv_get_height, pdv_get_imagesize, width camera configuration directive

Definition at line 1089 of file libpdv.c.

int pdv_get_cam_width ( PdvDev pdv_p  ) 

Returns the camera image width, in pixels, as set by the configuration file directive width.

Not to be confused with pdv_get_width; this subroutine gets the pdv_p->dd_p->cam_width value which only exists as a place to record the camera's (presumably) full width, as set by the config file 'width' directive and unaffected by any subsequent region of interest or pdv_setsize changes. Generally only useful to provide a hint to applications that want to know the original camera size since the value returned doesn't necessarily reflect the actual size of the buffers, frame passed in as modified by padding, headers or region of interest.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Image width in pixels.
See also:
pdv_get_dmasize, pdv_image_size, width camera configuration directive

Definition at line 712 of file libpdv.c.

char* pdv_get_camera_class ( PdvDev pdv_p  ) 

Gets the class of the camera (usually the manufacturer name), as set by initcam from the camera_config file camera_class directive.

Note:
the camera class is for application/GUI information only, and is not used by the driver or library. It is provided for the convenience of applications; for example the PdvShow and other camera configuration dialogs get and display the camera class, model and info strings to help the user to choose a spcific configuration.
Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
String representing the camera class.
See also:
pdv_get_cameratype, camera_class camera configuration directive

Definition at line 1450 of file libpdv.c.

char* pdv_get_camera_info ( PdvDev pdv_p  ) 

Gets the string set by the camera_info configuration file directive.

see pdv_get_cameratype for more information on camera strings.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
String representing the camera info.
See also:
pdv_set_camera_info, camera_info camera configuration directive

Definition at line 1486 of file libpdv.c.

char* pdv_get_camera_model ( PdvDev pdv_p  ) 

Gets the model of the camera, as set by initcam from the camera_config file camera_model directive.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
String representing the camera model.
See also:
pdv_set_camera_model, camera_model camera configuration directive

Definition at line 1468 of file libpdv.c.

char* pdv_get_cameratype ( PdvDev pdv_p  ) 

Gets the type of the camera, as set by initcam from the camera configuration file's camera description directives.

This is a concatenation of camera_class, camera_model, and camera_info, directives.

Note:
the camera class, model and info are for application/GUI information only, and are not used in any other way by the driver or library. They are provided for the convenience of applications such as PdvShow which uses them to help the user choose a specific camera configuration in the camera setup dialog.
Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
String representing the camera type.
See also:
pdv_get_camera_class, pdv_get_camera_model, pdv_get_camera_info, Camera Configuration Guide

Definition at line 1425 of file libpdv.c.

int pdv_get_depth ( PdvDev pdv_p  ) 

Gets the depth of the image (number of bits per pixel), as set in the configuration file for the camera in use.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Number of bits per pixel in the image.
See also:
pdv_set_depth, pdv_get_extdepth, depth camera configuration directive

Definition at line 1244 of file libpdv.c.

pdv_get_dmasize ( PdvDev pdv_p  ) 

Returns the actual amount of image data for DMA Normally the "depth" value For some de-interleave and or color interpolation options, uses extdepth.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
DMA size in bytes -- that is, the actual number of bytes acquired, excluding any header data or padding
See also:
pdv_image_size

Definition at line 730 of file libpdv.c.

int pdv_get_exposure ( PdvDev pdv_p  ) 

Gets the exposure time on the digital video device.

Applies only when using board-controlled shutter timing (with a few cameras) for which shutter timing methods have been programmed into the library. The valid range is camera-dependent. See method_camera_shutter_timing configuration directive for more information.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Exposure time, in milliseconds.
See also:
pdv_set_exposure, method_camera_shutter_timing camera configuration directive

Definition at line 2955 of file libpdv.c.

int pdv_get_extdepth ( PdvDev pdv_p  ) 

Gets the extended depth of the camera.

The extended depth is the number of valid bits per pixel that the camera outputs, as set by initcam from the configuration file edtdepth directive. Note that if depth is set differently than extdepth, the actual number of bits per pixel passed through by the PCI DV board will be different. For example, if extdepth is 10 but depth is 8, the board will only pass one byte per pixel, even though the camera is outputting two bytes per pixel.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
The extended depth (an integer).
See also:
pdv_get_depth, extdepth camera configuration directive

Definition at line 1272 of file libpdv.c.

int pdv_get_frame_height ( PdvDev pdv_p  ) 

Gets the camera image height.

The camera image height is in pixels, as set by the configuration file directive height, and is unaffected by changes made by setting the region of interest. Typically the value is the same as that returned by pdv_get_height unless the frame_height directive is specified in the config file and is different than height. This may occur in some cases where special handling of image data by an application is used such as multiple frames per image.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
the camera image height in pixels
See also:
pdv_set_roi, pdv_debug, pdv_get_imagesize

Definition at line 1115 of file libpdv.c.

int pdv_get_frame_period ( PdvDev pdv_p  ) 

Get the frame period.

Returns the frame period, for boards that support the frame delay / frame period functionality. Frame_period is typically initialized via the frame_period configuration file directive (which pretty much always goes along with the method_frame_timing directive). frame_period is an integer value that determines either the number of microseconds between the start of one frame and the next, or the continuous frame trigger interval, depending on the state of the frame_timing. A more complete description of frame interval and frame timing can be found in pdv_set_frame_period.

Parameters:
pdv_p device handle returned by pdv_open
Returns:
period the frame period (microsecond units)
See also:
pdv_set_frame_period, frame_period camera configuration directive

Definition at line 8668 of file libpdv.c.

int pdv_get_gain ( PdvDev pdv_p  ) 

Gets the gain on the device.

Applies only to cameras for which extended control capabilities have been written into the library, such as the Kodak Megaplus i series.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Gain value. The valid range is -128 to 128. The actual range is camera-dependent.
See also:
pdv_set_gain, pdv_get_max_gain, pdv_get_min_gain, serial_gain configuration file directive.

Definition at line 3015 of file libpdv.c.

int pdv_get_header_dma ( PdvDev pdv_p  ) 

Returns the current setting for flag which determines whether the header size is to be added to the DMA size.

This is true if the camera/device returns header information at the beginning or end of its transfer.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
1 true or 0 false.

Definition at line 5301 of file libpdv.c.

int pdv_get_header_offset ( PdvDev pdv_p  ) 

Returns the byte offset of the header in the buffer.

The byte offset is determined by the header position value. If header_position is PDV_HEADER_BEFORE, the offset is 0; if header_position is PDV_HEADER_AFTER, the offset is the image size. If header_position is PDV_HEADER_WITHIN, the header offset can be set using the header_offset directive in the camera_configuration file, or by calling pdv_set_header_offset.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
A byte offset from the beginning of the buffer.
See also:
pdv_get_header_position, pdv_set_header_offset

Definition at line 5276 of file libpdv.c.

int pdv_get_header_position ( PdvDev pdv_p  ) 

Returns the header position value.

The header position value can by on of three values defined in pdv_dependent.h: PDV_HEADER_BEFORE header data is before the image data in the allocated buffer. PDV_HEADER_AFTER header data is after the image data in the allocated buffer. PDV_HEADER_WITHIN header data is within the defined data, at a position determined by the header_offset.

These values can be set in the configuration file with the method_header_position directive. The values in the configuration file should be the same as the definitions above without the leading pdv_.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Current header position.
See also:
pdv_get_header_offset, header_offset camera configuration directive

Definition at line 5254 of file libpdv.c.

int pdv_get_header_size ( PdvDev pdv_p  ) 

Returns the currently defined header size.

This is usually set in the configuration file with the directive header_size. It can also be set by calling pdv_set_header_size.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Current header size.
See also:
pdv_set_header_size, header_size camera configuration directive

Definition at line 5226 of file libpdv.c.

int pdv_get_height ( PdvDev pdv_p  ) 

Gets the height of the image (number of lines), based on the camera in use.

If the heigth has been changed by setting a region of interest, the new values are returned; use pdv_get_cam_height to get the unchanged height.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Height in pixels of images returned from an aquire.
See also:
pdv_get_cam_height, height camera configuration directive

Definition at line 1059 of file libpdv.c.

int pdv_get_imagesize ( PdvDev pdv_p  ) 

Returns the size of the image, absent any padding or header data.

Since padding and header data are usually absent, the value returned from this is usually the same as that returned by pdv_image_size.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
image size, in bytes.
See also:
pdv_image_size

Definition at line 827 of file libpdv.c.

int pdv_get_max_gain ( PdvDev pdv_p  ) 

Gets the maximum allowable gain value for this camera, as set by initcam from the camera configuration file gain_max directive.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Maximum gain value.
See also:
pdv_get_min_gain, pdv_set_gain, pdv_get_gain gain_max configuration file directive.

Definition at line 7583 of file libpdv.c.

int pdv_get_max_offset ( PdvDev pdv_p  ) 

Gets the maximum allowable offset (black level) value for this camera, as set by initcam from the camera configuration file offset_max directive.

Parameters:
pdv_p device struct returned from pdv_open
Returns:
maximum offset value
See also:
pdv_get_min_offset, pdv_set_blacklevel, pdv_get_blacklevel offset_max configuration file directive.

Definition at line 7617 of file libpdv.c.

int pdv_get_max_shutter ( PdvDev pdv_p  ) 

Gets the maximum allowable exposure value for this camera, as set by initcam from the camera_config file shutter_speed_max directive.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Maximum exposure value.

Definition at line 7548 of file libpdv.c.

int pdv_get_min_gain ( PdvDev pdv_p  ) 

Gets the minimum allowable gain value for this camera, as set by initcam from the camera configuration file gain_min directive.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Minimum gain value.
See also:
gain camera configuration directive

pdv_get_max_gain, pdv_set_gain, pdv_get_gain gain_min configuration file directive.

Definition at line 7566 of file libpdv.c.

int pdv_get_min_offset ( PdvDev pdv_p  ) 

Gets the minimum allowable offset (black level) value for this camera, as set by initcam from the camera configuration file offset_min directive.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Minimum offset value.
See also:
pdv_get_max_offset, pdv_set_blacklevel, pdv_get_blacklevel offset_max configuration file directive.

Definition at line 7600 of file libpdv.c.

int pdv_get_min_shutter ( PdvDev pdv_p  ) 

Gets the minimum allowable exposure value for this camera, as set by initcam from the camera_config file shutter_speed_min directive.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
Minimum exposure value.
See also:
shutter_spped_min camera configuration directive

Definition at line 7532 of file libpdv.c.

int pdv_get_pitch ( PdvDev pdv_p  ) 

Gets the number of bytes per line (pitch).

Functionally equivalent to pdv_get_width.

Parameters:
pdv_p device struct returned by pdv_open
Returns:
width in pixels of images returned from an aquire.
See also:
pdv_get_width

Definition at line 675 of file libpdv.c.

int pdv_get_width ( PdvDev pdv_p  ) 

Gets the width of the image (number of pixels per line), based on the camera in use.

If the width has been changed by setting a region of interest, the modified values are returned; use pdv_get_cam_width to get the unchanged width.

Parameters:
pdv_p device struct returned by pdv_open
Returns:
Width in pixels of images returned from an aquire.

Definition at line 655 of file libpdv.c.

int pdv_image_size ( PdvDev pdv_p  ) 

Returns the size of the image buffer in bytes, based on its width, height, and depth.

Enabling a region of interest changes this value. The size returned includes allowance for buffer headers. To obtain the actual size of the image data without any optional header or other padding, see pdv_get_dmasize.

Parameters:
pdv_p device struct returned from pdv_open
Returns:
Total number of bytes in the image, including buffer header overhead.
See also:
pdv_set_roi

Definition at line 5934 of file libpdv.c.

void pdv_invert ( PdvDev pdv_p,
int  val 
)

Tell the PCI DV hardware to invert each pixel before transferring it to the host computer's memory.

This is a hardware operation that is implemented in the PCI DV firmware and has no impact on performance.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
val 1=invert, 0=normal

Definition at line 3069 of file libpdv.c.

void pdv_invert_fval_interrupt ( PdvDev pdv_p  ) 

Set the Frame Valid interrupt to occur on the rising instead of falling edge of frame valid.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open

Definition at line 8582 of file libpdv.c.

int pdv_picture_timeout ( PdvDev pdv_p,
int  value 
)

Sets the length of time to wait for data on acquisition before timing out.

This function is only here for backwards compatibility. You should use pdv_set_timeout() instead.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
value the number of milliseconds to wait for timeout, or 0 to block waiting for data
Returns:
0 if successful, nonzero on failure.

Definition at line 954 of file libpdv.c.

pdv_read_response ( PdvDev pdv_p,
char *  buf 
)

Read serial response, wait for timeout (or serial_term if specified), max is 2048 (arbitrary).

This subroutine has limited usefulness. While it is convenient in that it combines the wait/read sequence, optimized command/response is usually better accomplished with separate pdv_serial_command / pdv_serial_wait / pdv_serial_read sequences

Returns:
number of characters read
See also:
pdv_serial_read, pdv_serial_wait

Definition at line 2986 of file libpdv.c.

int pdv_set_binning ( PdvDev pdv_p,
int  xval,
int  yval 
)

Set binning on the camera to the specified values, and recalculate the values that will be returned by pdv_get_width, pdv_get_height, and pdv_get_imagesize.

Only applicable to cameras for which binning logic has been implemented in the library -- specifically DVC cameras that use the BIN xval yval, Atmel cameras that use B= val (where val= 0, 1 or 2), or in conjunction with the serial_binning camera configuration directive for any camera that uses an ASCII CMD VALUE pair to set binning.

This subroutine was an attempt to provide a way to set binning in a generic way, handling a few specific cameras via special code and others using an assumed serial format. As it turned out, the "assumed" format is not all that standard, therefore this subroutine is of limited usefulness.

If your camera is one that takes a single ASCII command / argument to set a binning mode, then this subroutine may still be handy since it can be a single- call method for setting the camera and the board in a given binning mode.

To use this method, simply set the serial_binning camera configuration directive to the command that sets binning. Then when called, this subroutine will send the command and reset the board's camera size.

If your camera does not fit any of the above formats (or if you would rather not depend on this flakey logic), simply use pdv_serial_command or pdv_serial_binary_command to send the command to put the camera into binned mode, then call pdv_setsize to reset the board to the new frame size.

If the PCI DV library does not know how to set binning on the camera in use, a -1 will be returned and the width/height/imagesize will remain unchanged.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
xval x binning value. Usually 1, 2, 4 or 8. Default is 1.
yval y binning value. Usually 1, 2, 4 or 8. Default is 1.
Returns:
0 on success, -1 on failure.
See also:
serial_binning camera configuration directive

Definition at line 2863 of file libpdv.c.

int pdv_set_binning_dvc ( PdvDev pdv_p,
int  xval,
int  yval 
)

DVC 1312 binning.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
xval horizontal binning value
yval vertical binning value

Definition at line 8351 of file libpdv.c.

int pdv_set_blacklevel ( PdvDev pdv_p,
int  value 
)

Sets the black level (offset) on the input device.

Applies only to cameras for which extended control capabilities have been added to the library (see the source code), or that have a serial command protocol that has been configured using the serial_offset configuration directive. Unless you know that one of the above has been implemented for your camera, it is usually safest to just send the specific serial commands via pdv_serial_command or pdv_serial_write.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
value Black level value. The valid range is camera-dependent.
Returns:
0 on success, -1 on failure.
See also:
pdv_get_blacklevel, pdv_get_max_offset, pdv_get_min_offset, serial_offset configuration file directive.

Definition at line 2698 of file libpdv.c.

int pdv_set_cam_height ( PdvDev pdv_p,
int  value 
)

Sets placeholder for original full camera frame height, unaffected by ROI changes and usually only called by pdv_initcam.

Not to be confused with pdv_set_height; this subroutine sets the pdv_p->dd_p->cam_height value, which only exists as a place to record the camera's (presumably) full height, normally set by the config file 'height' directive and unaffected by any subsequent region of interest or pdv_setsize changes. This subroutine is just here to give applications a way to change that value, though it normally only gets called by pdv_initcam. Doesn't change the buffer sizes or region of interest -- for that, use pdv_set_roi or pdv_setsize.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
value height of the camera's sensor in pixels
Returns:
0 on success, -1 on failure.

Definition at line 1221 of file libpdv.c.

int pdv_set_cam_width ( PdvDev pdv_p,
int  value 
)

Sets placeholder for original full camera frame width, unaffected by ROI changes and usually only called by pdv_initcam.

Not to be confused with pdv_set_width; this subroutine sets the pdv_p->dd_p->cam_width value, which only exists as a place to record the camera's (presumably) full width, normally set by the config file 'width' directive and unaffected by any subsequent region of interest or pdv_setsize changes. Generally only useful to provide a hint to applications a way to change that value, though it normally only gets called by pdv_initcam. Doesn't change the buffer sizes or region of interest -- for that, use pdv_set_roi or pdv_setsize.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
value width of the camera's sensor in pixels
Returns:
0 on success, -1 on failure.

Definition at line 802 of file libpdv.c.

int pdv_set_cameratype ( PdvDev pdv_p,
char *  model 
)

Sets the camera's type (model) string in the dependent structure.

typically the camera model is set via initcam using the camera_model configuration file directive. This subroutine is provided in case there is a need for an application program to modify the string.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
model camera model (31 characters max).
Returns:
0 on success, -1 on failure.
See also:
pdv_get_cameratype, cameratype camera configuration directive

Definition at line 1396 of file libpdv.c.

int pdv_set_depth ( PdvDev pdv_p,
int  value 
)

Sets the bit depth.

Since the depth is set at initialization time (via pdv_initcam), applications won't typically need to call this subroutine, and should avoid doing so except in cases where the camera's output depth is changed without re-initializing.

The bit depth is the number of valid bits per pixel that the board will transfer across the bus. Normally this is initialized during initcam via the configuration file depth directive, and the only time this subroutine should be needed is if the depth changes, via a post-initialization command to the camera for example.

Note that if depth is set differently than extdepth, the actual number of bits per pixel passed through by the PCI DV board will be different from that received from the camera. For example, if extdepth is 10 (matching a camera output of 10 bits) but depth is 8, the board will only pass one byte per pixel, even though the camera is outputting two bytes per pixel.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
value the new depth value
Returns:
The extended depth (an integer).
See also:
pdv_get_depth, pdv_set_extdepth, extdepth camera configuration directive

Definition at line 1308 of file libpdv.c.

int pdv_set_exposure ( PdvDev pdv_p,
int  value 
)

Sets the exposure time on the digital video device.

Applies only to cameras for which extended control capabilities have been added to the library (see the source code), or that have a serial command protocol that has been configured using the serial_exposure configuration directive. Unless you know that one of the above has been implemented for your camera, it is usually safest to just send the specific serial commands via pdv_serial_command or pdv_serial_write.

Exception: in the case of pulse-width (level trigger) timing (that is, when the camera_config directives method_camera_shutter_timing: AIA_MCL and MODE_CNTL_NORM: 10 are set), either this subroutine or pdv_set_exposure_mcl should be used, since in that mode they provide the logic for setting up the board's shutter timer.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
value Exposure time. Valid range and increment are camera-dependent. For most cameras, the value set is the number of millisceonds the shutter remains open.
Returns:
0 if successful, -1 if unsuccessful.
See also:
pdv_set_exposure_mcl, pdv_shutter_method, MODE_CNTL_NORM & method_camera_shutter_timing camera configuration directives

Definition at line 1558 of file libpdv.c.

int pdv_set_exposure_duncan_ch ( PdvDev pdv_p,
int  value,
int  ch 
)

Set exposure for Redlake (formerly Duncantech) DT and MS series cameras.

ref. DuncanTech User Manual Doc # 9000-0001-05

Note:
Convenience routine, for Duncantech (Redlake) DT/MS series cameras only. Intended as a starting point for programmers wishing to use EDT serial commands with Duncantech cameras. These subroutines can be used as a template for controlling camera parameters beyond simple exposure and gain.
Parameters: