Table of Contents
video_capture_set_property
Sets properties of a video capture device, such as the brightness or contrast.
Description
The video_capture_set_property function sets properties of a video capture device, such as brightness or contrast. The following table shows the properties that may be set. Note that not all devices support all properties.
Property Code |
Description |
---|---|
VIDEO_CAPTURE_PROPERTY_BRIGHTNESS |
The brightness of the image from the device. |
VIDEO_CAPTURE_PROPERTY_CONTRAST |
The contrast of the image from the device. |
VIDEO_CAPTURE_PROPERTY_HUE |
The hue of the image from the device, which affects the colour of the image. |
VIDEO_CAPTURE_PROPERTY_SATURATION |
The saturation of the image from the device, which affects the depth of the colour of the image. If the saturation is zero then the image will be grayscale. |
VIDEO_CAPTURE_PROPERTY_SHARPNESS |
The sharpness of the image from the device, which affects the clarity of edges in the image. |
VIDEO_CAPTURE_PROPERTY_GAMMA |
The gamma factor of the image from the device, which affects the colour of the image. |
VIDEO_CAPTURE_PROPERTY_COLOREFFECT |
The colour effect to apply to the image from the device. See the
|
VIDEO_CAPTURE_PROPERTY_WHITEBALANCE |
The white balance to apply to the image from the device. |
VIDEO_CAPTURE_PROPERTY_BACKLIGHTCOMPENSATION |
The backlight compensation to use for the image from the device. |
VIDEO_CAPTURE_PROPERTY_GAIN |
The gain to apply to the image from the device. |
VIDEO_CAPTURE_PROPERTY_PAN |
How much to pan the camera view from the device. |
VIDEO_CAPTURE_PROPERTY_TILT |
How much to tilt the camera view from the device. |
VIDEO_CAPTURE_PROPERTY_ROLL |
How much to roll the camera view from the device. |
VIDEO_CAPTURE_PROPERTY_ZOOM |
How much to zoom the camera view from the device. |
VIDEO_CAPTURE_PROPERTY_EXPOSURE |
The exposure to use for the image from the device. |
VIDEO_CAPTURE_PROPERTY_IRIS |
The aperture to use for the image from the device. |
VIDEO_CAPTURE_PROPERTY_FOCUS |
The focus to use for the image from the device. |
Properties are set using an array of t_video_capture_attribute
structures. Each structure
contains the following fields:
Field |
Data Type |
Description |
---|---|---|
property_code |
t_video_capture_property_code |
The property which is being set. Valid property codes are listed above. |
value |
t_double |
The value to which to set the attribute, if the attribute is being set manually. The interpretation
of this value depends on the |
manual |
t_boolean |
Whether the value is being set manually or will be determined automatically. |
is_enumeration |
t_boolean |
Whether the value is an enumeration or fraction. See the discussion of the |
Prototype
t_error video_capture_set_property(t_video_capture capture, t_video_capture_attribute * attributes, t_uint num_attributes);
Parameters
t_video_capture capture
A handle to the video capture session, as returned by video_capture_open.
t_video_capture_attribute * attributes
The address of an array of t_video_capture_attribute structures. Each element in the array describes a setting for an attribute of the video capture device, such as the brightness or contrast to use.
Each element of the array is a structure containing four elements, as outlined in the description above.
t_uint num_attributes
The number of attributes in the attributes array.
Return value
The return value is 0 if the attributes are set successfully. Unrecognized property codes are ignored and
do not produce an error. Otherwise a negative error code is returned. Error codes are
defined in quanser_errors.h
. A suitable error message
may be retrieved using msg_get_error_message.
Error codes
QERR_INVALID_ARGUMENT
One of the arguments is invalid.
QERR_OUT_OF_MEMORY
There is not enough memory to complete the operation.
Requirements
Include Files |
Libraries |
---|---|
quanser_video.h |
quanser_media.lib;quanser_communications.lib;quanser_runtime.lib;quanser_common.lib |
Examples
t_video_capture_attribute attributes[2]; t_error result; attributes[0].property_code = VIDEO_CAPTURE_PROPERTY_BRIGHTNESS; attributes[0].value = 0.50; /* 50% brightness */ attributes[0].manual = true; attributes[0].is_enumeration = false; attributes[1].property_code = VIDEO_CAPTURE_PROPERTY_CONTRAST; attributes[1].value = 0.70; /* 70% contrast */ attributes[1].manual = true; attributes[1].is_enumeration = false; result = video_capture_set_property(capture, attributes, ARRAY_LENGTH(attributes));
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.