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_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_width (PdvDev *pdv_p)
 Gets the width of the image (number of pixels per line), based on the camera in use.
int pdv_get_pitch (PdvDev *pdv_p)
 Gets the number of bytes per line (pitch).
int pdv_get_cam_width (PdvDev *pdv_p)
 Returns the camera image width, in pixels, as set by the configuration file directive width.
int pdv_get_dmasize (PdvDev *pdv_p)
 Returns the actual amount of image data for DMA.
int pdv_setsize (PdvDev *pdv_p, int width, int height)
 Sets the width and height of the image.
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_get_imagesize (PdvDev *pdv_p)
 Returns the size of the image, absent any padding or header data.
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_picture_timeout (PdvDev *pdv_p, int value)
 Sets the length of time to wait for data on acquisition before timing out.
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_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_frame_height (PdvDev *pdv_p)
 Gets the camera image height.
int pdv_set_width (PdvDev *pdv_p, int value)
 Sets width and reallocates buffers accordingly.
int pdv_set_height (PdvDev *pdv_p, int value)
 Sets height and reallocates buffers accordingly.
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_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.
int pdv_get_extdepth (PdvDev *pdv_p)
 Gets the extended depth of the camera.
int pdv_set_depth (PdvDev *pdv_p, int value)
 Sets the bit depth.
int pdv_set_extdepth (PdvDev *pdv_p, int value)
 Sets the bit depth coming from the camera.
int pdv_set_cameratype (PdvDev *pdv_p, char *model)
 Sets the camera's type (model) string in the dependent structure.
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.
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_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_camera_info (PdvDev *pdv_p)
 Gets the string set by the camera_info configuration file directive.
char * pdv_camera_type (PdvDev *pdv_p)
 Alias of pdv_get_cameratype.
int pdv_set_exposure (PdvDev *pdv_p, int value)
 Sets the exposure time on the digital video device, using the method defined by the directives in the camera configuration file, if set.
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_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_gain_duncan_ch (PdvDev *pdv_p, int value, int ch)
 Set gain for Redlake (formerly Duncantech) DT and MS series cameras.
int pdv_set_gain (PdvDev *pdv_p, int value)
 Sets the gain on the input device.
int pdv_set_blacklevel (PdvDev *pdv_p, int value)
 Sets the black level (offset) on the input device.
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_get_exposure (PdvDev *pdv_p)
 Gets the exposure time on the digital video device.
int 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_get_gain (PdvDev *pdv_p)
 Gets the gain on the device.
int pdv_get_blacklevel (PdvDev *pdv_p)
 Gets the black level (offset) on the video device.
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.
 pdv_set_header_type (PdvDev *pdv_p, int header_type, int irig_slave, int irig_offset, int irig_raw)
 Sets the header (or footer) type.
int pdv_get_header_size (PdvDev *pdv_p)
 Returns the currently defined header size.
HdrPosition pdv_get_header_position (PdvDev *pdv_p)
 Returns the header position value.
int pdv_get_header_offset (PdvDev *pdv_p)
 Returns the byte offset of the header in the buffer.
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_within (PdvDev *pdv_p)
int pdv_extra_headersize (PdvDev *pdv_p)
 Return the header space allocated but not used for DMA.
void pdv_set_header_size (PdvDev *pdv_p, int header_size)
 Sets the header size (in bytes) for the pdv.
void pdv_set_header_position (PdvDev *pdv_p, HdrPosition header_position)
 Sets the header position.
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.
int pdv_shutter_method (PdvDev *pdv_p)
 Return shutter (expose) timing method.
int pdv_image_size (PdvDev *pdv_p)
 Returns the size of the image buffer in bytes, based on its width, height, and depth.
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_auto_set_roi (PdvDev *pdv_p)
 set ROI to camera width/height; adjust ROI width to be a multiple of 4, and enable ROI
int pdv_enable_roi (PdvDev *pdv_p, int flag)
 Enables on-board region of interest.
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_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_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_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_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_enable_lock (PdvDev *pdv_p, int flag)
 Convenience routine to enable/disable shutter lock on/off on certain cameras.
int pdv_set_binning_dvc (PdvDev *pdv_p, int xval, int yval)
 DVC 1312 binning.
void pdv_enable_external_trigger (PdvDev *pdv_p, int flag)
 Enables external triggering.
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_set_frame_period (PdvDev *pdv_p, int period, int method)
 Set the frame period counter and enable/disable frame timing.
int pdv_get_frame_period (PdvDev *pdv_p)
 Get the frame period.
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.


Function Documentation

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 641 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 664 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 684 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 721 of file libpdv.c.

int pdv_get_dmasize ( PdvDev pdv_p  ) 

Returns the actual amount of image data for DMA.

Normally DMA is the same as the size of the sensor output (width x height x depth in bytes), so for example a 1K x 1k 8 bits per pixel camera would be 1024x1024x1 = 1048576 bytes, and a 1K x 1k 10 bits per pixel camera would be 1024x1024x2 = 2097152. However if DMA header is inserted (for IRIGB timestamp input for example), dmasize will be imagesize plus the size of the header. And if the sensor is a bayer or other interpolated image with one of the interleave options enabled (via the method_interlace: BGGR_WORD directive in the config file for example), imagesize will be at least 3x dmasize.

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 plus any added DMA if header data WITHIN the data is specified -- see ,
See also:
pdv_image_size

Definition at line 744 of file libpdv.c.

int pdv_setsize ( PdvDev pdv_p,
int  width,
int  height 
)

Sets the width and height of the image.

Tells the driver what width and height (in pixels) to expect from the camera. This call is ordinarily unnecessary in an application program, because the width and height are set automatically when initcam runs. Exceptions can occur, however; for example, if the camera's output size can be changed while running, or if the application performs setup that supersedes initcam. This routine is provided for these special cases.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
width width of the image in pixels.
height height of the image in pixels.
Returns:
0 on success, -1 on failure.

Definition at line 788 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 821 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 846 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 863 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 965 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 1070 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 1100 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 1126 of file libpdv.c.

int pdv_set_width ( PdvDev pdv_p,
int  value 
)

Sets width and reallocates buffers accordingly.

Since we rarely ever set width and not height, you should normally just use pdv_setsize to set both.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
value the new width.

Definition at line 1181 of file libpdv.c.

int pdv_set_height ( PdvDev pdv_p,
int  value 
)

Sets height and reallocates buffers accordingly.

Since we rarely ever set height and not width, you should normally just use pdv_setsize to set both at once.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
value the new height.

Definition at line 1202 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 1232 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 1255 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 1283 of file libpdv.c.

int pdv_set_depth ( PdvDev pdv_p,
int  value 
)

Sets the bit depth.

Normally only called by pdv_initcam; user applications should avoid calling this subroutine directly.

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 1317 of file libpdv.c.

int pdv_set_extdepth ( PdvDev pdv_p,
int  value 
)

Sets the bit depth coming from the camera.

Normally only called by pdv_initcam; user applications should avoid calling this subroutine directly.

Extdepth must match the number of valid bits per pixel coming from the camera. Normally this is initialized during initcam via the configuration file extdepth directive. The only time this subroutine should be needed is if the camera's depth changes, via a post-initialization command sent 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. 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
value the extended depth, in bits per pixel
Returns:
The extended depth (an integer).
See also:
pdv_get_extdepth, pdv_set_depth, extdepth camera configuration directive

Definition at line 1377 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 1403 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 1432 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 1457 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 1475 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 1493 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 1512 of file libpdv.c.

int pdv_set_exposure ( PdvDev pdv_p,
int  value 
)

Sets the exposure time on the digital video device, using the method defined by the directives in the camera configuration file, if set.

pdv_set_exposure will set the exposure (or not) on the camera depending on how the related directives are set in the camera configuration file. Some cameras have specific methods that are coded into the subroutine -- these are set via the method_camera_shutter_timing directive. If the directive is not present in the config file, the default method will be SERIAL_ASCII, and the subroutine will set the exposure by sending the command specified by the serial_exposure directive, if it exists. If method_camera_shutter_timing is AIA_MCL or AIA_MCL_100US and something other than 0 is in the left nibble of MODE_CNTL_NORM, the board will use its internal shutter timer and send out a trigger pulse on the specified line with a TRUE period of the value in milliseconds (AIA_MCL) or tenths of milliseconds (AIA_MCL_100US). The min/max value for this mode in either case is 0-25500. In the case of SERIAL_ASCII or any other mode, the range is camera dependent. Other methods are available that are specific to specific cameras -- see the Camera Configuration guide for details.

If no method is set via any of these methods, the subroutine will be a no-op.

An alternative to using this convenience routine is 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 Exposure time. For AIA_MCL or AIA_MCL_100US, the valid range is 0-25500. For other methods, valid range and increments are camera-dependent.
Returns:
0 if successful, -1 if unsuccessful.
See also:
pdv_set_exposure_mcl, pdv_shutter_method, MODE_CNTL_NORM, serial_exposure & method_camera_shutter_timing camera configuration directives

Definition at line 1602 of file libpdv.c.

int pdv_set_exposure_mcl ( PdvDev pdv_p,
int  value 
)

Set the exposure when in pulse-width mode (also known as level trigger mode).

Sets data Path register decade bits as appropriate for value input. Called by pdv_set_exposure if dd_p->camera_shutter_timing is set to AIA_MCL or AIA_MCL_100US (typically set by config file directive method_camera_shutter_timing: AIA_MCL; (MODE_CNTL_NORM: 10 should typically also be set). If AIA_MCL, units are milliseconds. If AIA_MCL_100US, units are in microseconds. Sets the actual exposure time to value + 1.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
value Exposure time, range 0-65535
Returns:
0 if successful, -1 if unsuccessful.
See also:
pdv_set_exposure, MODE_CNTL_NORM & method_camera_shutter_timing camera configuration directives

Definition at line 1796 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:
pdv_p pointer to pdv device structure returned by pdv_open
value expsosure value
ch camera channel
See also:
pdv_send_duncan_frame, pdv_read_duncan_frame

Definition at line 2539 of file libpdv.c.

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

Set gain 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:
pdv_p pointer to pdv device structure returned by pdv_open
value gain value
ch camera channel
See also:
pdv_send_duncan_frame, pdv_read_duncan_frame

Definition at line 2572 of file libpdv.c.

int pdv_set_gain ( PdvDev pdv_p,
int  value 
)

Sets the gain 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_gain 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.

Example

 pdv_set_gain(pdv_p, 0); // neutral gain 

Returns:
0 on success, -1 on failure.
See also:
pdv_get_gain, serial_gain configuration file directive.

Definition at line 2729 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_offset, serial_offset configuration file directive.

Definition at line 2940 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 3115 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 3206 of file libpdv.c.

int 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 3238 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.

Definition at line 3266 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

Definition at line 3284 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 3317 of file libpdv.c.

pdv_set_header_type ( PdvDev pdv_p,
int  header_type,
int  irig_slave,
int  irig_offset,
int  irig_raw 
)

Sets the header (or footer) type.

Enables header (or footer) functionality including position, size, dma, and associated registers for tagging data with magic number, count, and timestamp data.

Currently only one type, HDR_TYPE_IRIG2 is defined. For more about the IRIG functionality on the PCIe8 DV C-Link, see the Application Note.

This subroutine and the associated camera config directive method_header_type encapsulate setting the header logic for a specific method in a single operation. Header functionality can also be implemented by setting the header directives directly, via pdv_set_header_size, pdv_set_header_dma, pdv_set_header_offset, etc.

The subroutine will return a fail code if the EDT device is one that does not support this feature (currently only the PCIe8 DV C-Link supports the IRIGB footer). Note that only the device type, not the firmware rev, is checked, and PCIe8 firmware revs earlier than 4/22/2010 did not support HDR_TYPE_IRIG2. So programmers should make sure their board firmware is up-to-date with 4/22/2010 or later firmware via pciload. Applications can check edt_get_board_id

header type may be alternately set at init time via the configuration file directive method_header_type: IRIG2

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
header_type header type, as described above
irig_slave set to 1 if IRIGB time source is from a different device (or not present), 0 otherwise
irig_offset timecode offset, set to 2 typically (ignored if irig_slave is not set)
irig_raw enables irig timecode (ignored if irig_slave is not set)
Returns:
0 in success, -1 on failure
See also:
pdv_set_header_size, method_header_type camera configuration directive, PCIe8 DV C-Link Application Note: Using the Timestamp Function.

Definition at line 5486 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 5534 of file libpdv.c.

HdrPosition 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:

FIX - now enum HdrPosition HeaderNone, HeaderBefore, HeaderBegin, HeaderMiddle, HeaderEnd, HeaderAfter, HeaderSeparate

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 5565 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 5587 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 5618 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 5642 of file libpdv.c.

void pdv_set_header_size ( PdvDev pdv_p,
int  header_size 
)

Sets the header size (in bytes) for the pdv.

This can also be done by using the header_size directive in the camera configuration file.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
header_size new value for header size.
See also:
pdv_get_header_size, header_size camera configuration directive directive

Definition at line 5663 of file libpdv.c.

void pdv_set_header_position ( PdvDev pdv_p,
HdrPosition  header_position 
)

Sets the header position.

One of PDV_HEADER_BEFORE, PDV_HEADER_WITHIN, PDV_HEADER_AFTER, which are defined

One of HeaderNone, HeaderBefore, HeaderBegin, HeaderMiddle, HeaderEnd, HeaderAfter, HeaderSeparate

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
header_position the astarting point for the header position
See also:
pdv_get_header_offset, pdv_set_header_offset

Definition at line 5691 of file libpdv.c.

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.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
header_dma new value (0 or 1) for the header_dma attribute.
See also:
pdv_get_header_dma

Definition at line 5709 of file libpdv.c.

void pdv_set_header_offset ( PdvDev pdv_p,
int  header_offset 
)

Sets the byte offset of the header data in the allocated buffer.

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
header_offset new value for the header offset.

Definition at line 5724 of file libpdv.c.

int pdv_shutter_method ( PdvDev pdv_p  ) 

Return shutter (expose) timing method.

The default shutter timing method is AIA_SER, and simply means that the board doesn't handle any expose timing but leaves that to the camera and (possibly) controlled via serial commands to the camera. This is the typical timing method for freerun and triggered cameras/modes. Other methods may be enabled using the method_camera_shutter_timing config file directive or equivalent API calls.

Possible values are defined in edtdef.h and should be one of:

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
Returns:
the shutter (expose) timing method

Definition at line 5759 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 6301 of file libpdv.c.

int pdv_set_roi ( PdvDev pdv_p,
int  hskip,
int  hactv,
int  vskip,
int  vactv 
)

Sets a rectangular region of interest, supporting cropping.

Sets the coordinates of a rectangular region of interest within the image. Checks the camera width and height directives in the configuration file and returns an error if the coordinates provided are out of range. Use this with pdv_enable_roi, which enables the region of interest.

Note that hactv + hskip should always be less than or equal to the actual output width of the camera, and vact + vskip should be less than or equal to the number of output lines.

An initial region of interest can be set from the config file with the hactv, hskip, vactv, and vskip directives.

Note:
Region of Interest may not work with some very old cameras which required special bitfiles. It will work with most DV, DVK, and all Camera Link boards (inlcluding DVFOX with RCX C-LINK).
Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
hskip the X coordinate of the upper left corner of the region of interest.
hactv the width (number of pixels per line) of the region of interest.
vskip the Y coordinate of the upper left corner of the region of interest.
vactv the height (number of lines per frame) of the region of interest.
Example
 //use the region of interest calls to cut off a 10 pixel wide
 //border around the image.
        int cam_w = pdv_get_cam_width(pdv_p);
        int cam_h = pdv_get_cam_height(pdv_p);
        int hactv = cam_w - 20
        int vactv = cam_h - 20
        int hskip = 10;
        int vskip = 10;
        pdv_set_roi(pdv_p, hskip, hactv, vskip, vactv);
        pdv_enable_roi(pdv_p, 1); 

Returns:
0 on success, -1 on failure.
See also:
pdv_enable_roi, camera configuration directives hactv, hskip, vactv, vskip, cl_cfg_norm

Definition at line 7262 of file libpdv.c.

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 7416 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.

The initial state of the region of interest can be controlled with directives in the configuration file. Most config files provided by EDT have ROI enabled by default. See the camera configuration guide for more information.

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 7457 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 8063 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 8079 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

Definition at line 8096 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:
gain camera configuration directive

Definition at line 8113 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:
offset camera configuration directive

Definition at line 8130 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:
offset camera configuration directive

Definition at line 8147 of file libpdv.c.

int pdv_enable_lock ( PdvDev pdv_p,
int  flag 
)

Convenience routine to enable/disable shutter lock on/off on certain cameras.

Obsolete routine, if camera can lock the shutter (currently only a few old Kodak Megaplus cameras) then just do it with pdv_serial_command.

Definition at line 8160 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 8943 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 9132 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 9173 of file libpdv.c.

int pdv_set_frame_period ( PdvDev pdv_p,
int  period,
int  method 
)

Set the frame period counter and enable/disable frame timing.

Enables either continuous frame pulses at a specified interval, or extending the frame valid signal by the specified amount, to in- effect extend the amount of time after a frame comes in from the camera before the next trigger is issued. This can be used to hold off on issuing subsequent triggers for cameras that require an extra delay between triggers, or to set a specific trigger interval. Only applies when the camera is in triggered or pulse-width mode and the board is controlling the timing.

The camera config file directives frame_period and method_frame_timing which pretty much always go together, are typically used to initialize these values at initcam time for cameras that need a fixed frame delay for reliable operation in a given mode. Note that frame/timing and frame delays are not normally needed and are disabled unless set in the config file or by a call to this this subroutine in an application.

Note:
See the Triggering section in the PCI DV Users Guide, and also the Camera Configuration Guide for more on camera triggering methods. @

Frame timing/frame delay functionality is available only with newer bitfiles (aiag, pdvcamlk, pdvcamlk2), dated 5/15/2002 or later).

Parameters:
pdv_p pointer to pdv device structure returned by pdv_open
period frame period in microseconds-2, range 0-16777215
method one of:
  • 0 -- disable frame counter
  • PDV_FRAME_ENABLE -- continuous frame counter
  • PDV_FVAL_ADJUST -- frame counter extends every frame valid by 'period' microseconds
Returns:
-1 on error, 0 on success
See also:
pdv_get_frame_period

Definition at line 9219 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 9259 of file libpdv.c.

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.

Bayer decoding by the library is typically enabled by setting the config file directive method_interlace to BGGR or BGGR_WORD; this subroutine can be used to manipulate the specific Bayer decoding parameters. Images captured with pdv_image, pdv_wait_images or othe PCI DV library acquisition routines (excepting _raw routines) will be preprocessed to RGB color before the image pointer is returned.

The bRedRowFirst and bGreenPixelFirst parameters are typically initialized by the kbs_red_row_first and kbs_green_pixel_first configuration file directives. Current values can be found in the PdvDev dd_p->kbs_green_pixel_first and dd_p->kbs_dd_p->red_row_first structure elements.

The most common operation for pdv_set_full_bayer_parameters is adjusting the white balance. To do so, the calling application should provide a method for acquiring an image of a white background, calcluate the average of all pixels in each of the R, G and B components, then set scale[0] (green) to 1.0, and adjust scale[1-2] (red/blue) such that red and blue will be scaled appropriately. Click on the color wheel toolbar icon in PdvShow to see an example of such an implementation.

Note that the Bayer decoding functionality uses MMX instructions when run under the Windows environment, providing greater efficiency and more algorithm (quality) options. Only one algorithm is defined in the Linux/Unix implementation so the quality parameter will be ignored on those platforms.

Parameters:
nSourceDepth depth in bits of source (unfiltered) data
scale array of 3 values (R,G,B) for scaling (gain); default 1.0, 1.0, 1.0
gamma gamma value -- default 1.0
nBlackOffset Black Offset (black level); 1 is default
bRedRowFirst 1 if red/green row is first on the sensor, 0 if blue/green is first
bGreenPixelFirst 1 if green pixel is first on sensor, 0 if red or blue
quality selects one of 3 Bayer decoding algorithms: 0=Bilinear, 1=Gradient, 2=Bias-corrected -- MS Windows only. Note that in Linux/Unix, only Bilinear is implemented and this parameter is ignored
bias selects the bias for bias method Bayer algorithm; (MS Windows only)
gradientcolor selects the gradient for the gradient Bayer algorithm (MS Windows only)
See also:
method_interlace, kbs_red_row_first, kbs_green_pixel_first camera configuration directives -- see the Camera configuration guide

Definition at line 237 of file pdv_bayer_filter.c.


Generated on Mon Mar 21 14:15:10 2011 by  doxygen 1.4.7