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. | |
| int pdv_auto_set_roi | ( | PdvDev * | pdv_p | ) |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| flag | one of --
|
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| flag | nonzero to enable region of interest; 0 to disable it. |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| int pdv_get_allocated_size | ( | PdvDev * | pdv_p | ) |
Returns the allocated size of the image, including any header and pad for page alignment.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| int pdv_get_bytes_per_image | ( | PdvDev * | pdv_p | ) |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | device handle returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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_.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | device struct returned from pdv_open |
| int pdv_get_max_shutter | ( | PdvDev * | pdv_p | ) |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
pdv_get_max_gain, pdv_set_gain, pdv_get_gain gain_min configuration file 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open |
| int pdv_get_pitch | ( | PdvDev * | pdv_p | ) |
Gets the number of bytes per line (pitch).
Functionally equivalent to pdv_get_width.
| pdv_p | device struct returned by pdv_open |
| 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.
| pdv_p | device struct returned by pdv_open |
| 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.
| pdv_p | device struct returned from pdv_open |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| val | 1=invert, 0=normal |
| void pdv_invert_fval_interrupt | ( | PdvDev * | pdv_p | ) |
| 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.
| 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 |
| 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
| 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.
| 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. |
| int pdv_set_binning_dvc | ( | PdvDev * | pdv_p, | |
| int | xval, | |||
| int | yval | |||
| ) |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| value | Black level value. The valid range is camera-dependent. |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| value | height of the camera's sensor in pixels |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| value | width of the camera's sensor in pixels |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| model | camera model (31 characters max). |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| value | the new depth value |
| 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.
| 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. |
| 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
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| value | expsosure value | |
| ch | camera channel |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| value | Exposure time, range 0-65535 |
| int pdv_set_extdepth | ( | PdvDev * | pdv_p, | |
| int | value | |||
| ) |
Sets the bit depth coming from the camera.
Since the depth and extended depth are 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 might be changed without re-initializing.
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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| value | the extended depth, in bits per pixel |
| 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.
Frame timing/frame delay functionality is available only with newer bitfiles (aiag, pdvcamlk, pdvcamlk2), dated 5/15/2002 or later).
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| period | frame period in microseconds-2, range 0-16777215 | |
| method | one of:
|
| 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.
| 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) |
Definition at line 237 of file pdv_bayer_filter.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
| 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
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| value | gain value | |
| ch | camera channel |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| header_dma | new value (0 or 1) for the header_dma attribute. |
| void pdv_set_header_offset | ( | PdvDev * | pdv_p, | |
| int | header_offset | |||
| ) |
| void pdv_set_header_position | ( | PdvDev * | pdv_p, | |
| int | header_position | |||
| ) |
Sets the header position.
One of PDV_HEADER_BEFORE, PDV_HEADER_WITHIN, PDV_HEADER_AFTER, which are defined in pdv_dependent.h.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| header_position | the astarting point for the header position |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| header_size | new value for header size. |
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| value | the new height. |
| 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.
| 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. |
//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);
| 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.
| pdv_p | pointer to pdv device structure returned by pdv_open | |
| value | the new width. |
| 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.
| 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. |
| 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:
| pdv_p | pointer to pdv device structure returned by pdv_open |
1.5.1