Logo Search packages:      
Sourcecode: libdc1394-22 version File versions  Download package

dc1394error_t dc1394_feature_set_value ( dc1394camera_t camera,
dc1394feature_t  feature,
uint32_t  value 
)

Sets the value of a feature

Definition at line 1224 of file control.c.

References dc1394_get_control_register(), and dc1394_set_control_register().

{
    uint32_t quadval;
    uint64_t offset;
    dc1394error_t err;

    if ( (feature<DC1394_FEATURE_MIN) || (feature>DC1394_FEATURE_MAX) )
        return DC1394_INVALID_FEATURE;

    if ((feature==DC1394_FEATURE_WHITE_BALANCE)||
        (feature==DC1394_FEATURE_WHITE_SHADING)||
        (feature==DC1394_FEATURE_TEMPERATURE)) {
        err=DC1394_INVALID_FEATURE;
        DC1394_ERR_RTN(err, "You should use the specific functions to write from multiple-value features");
    }

    FEATURE_TO_VALUE_OFFSET(feature, offset);

    err=dc1394_get_control_register(camera, offset, &quadval);
    DC1394_ERR_RTN(err, "Could not get feature value");

    err=dc1394_set_control_register(camera, offset, (quadval & 0xFFFFF000UL) | (value & 0xFFFUL));
    DC1394_ERR_RTN(err, "Could not set feature value");
    return err;
}


Generated by  Doxygen 1.6.0   Back to index