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

dc1394error_t dc1394_avt_set_color_corr ( dc1394camera_t camera,
dc1394bool_t  on_off,
dc1394bool_t  reset,
int32_t  Crr,
int32_t  Cgr,
int32_t  Cbr,
int32_t  Crg,
int32_t  Cgg,
int32_t  Cbg,
int32_t  Crb,
int32_t  Cgb,
int32_t  Cbb 
)

Set Color Correction + Coefficients

Definition at line 1572 of file avt.c.

References dc1394_get_adv_control_register(), and dc1394_set_adv_control_register().

{
    dc1394error_t err;
    uint32_t curval;

    //retrieve color correction
    err=dc1394_get_adv_control_register(camera, REG_CAMERA_AVT_COLOR_CORR, &curval);
    DC1394_ERR_RTN(err,"Could not get AVT color correction");

    //ON / OFF : Bit 6
    curval = (curval & 0xFDFFFFFFUL) | ((on_off) << 25);

    //reset coefficients to defaults : Bit 7
    curval = (curval & 0xFEFFFFFFUL) | ((reset) << 24);

    //set new parameters
    err=dc1394_set_adv_control_register(camera,REG_CAMERA_AVT_COLOR_CORR, curval);
    DC1394_ERR_RTN(err,"Could not set AVT color correction");

    if (!reset) {
        //red channel coefficients
        err=dc1394_set_adv_control_register(camera, REG_CAMERA_AVT_COLOR_CORR_CRR, Crr);
        DC1394_ERR_RTN(err,"Could not set AVT color correction coefficient Crr");

        err=dc1394_set_adv_control_register(camera, REG_CAMERA_AVT_COLOR_CORR_CGR, Cgr);
        DC1394_ERR_RTN(err,"Could not set AVT color correction coefficient Cgr");

        err=dc1394_set_adv_control_register(camera, REG_CAMERA_AVT_COLOR_CORR_CBR, Cbr);
        DC1394_ERR_RTN(err,"Could not set AVT color correction coefficient Cbr");

        //green channel coefficients
        err=dc1394_set_adv_control_register(camera, REG_CAMERA_AVT_COLOR_CORR_CRG, Crg);
        DC1394_ERR_RTN(err,"Could not set AVT color correction coefficient Crg");

        err=dc1394_set_adv_control_register(camera, REG_CAMERA_AVT_COLOR_CORR_CGG, Cgg);
        DC1394_ERR_RTN(err,"Could not set AVT color correction coefficient Cgg");

        err=dc1394_set_adv_control_register(camera, REG_CAMERA_AVT_COLOR_CORR_CBG, Cbg);
        DC1394_ERR_RTN(err,"Could not set AVT color correction coefficient Cbg");

        //blue channel coefficients
        err=dc1394_set_adv_control_register(camera, REG_CAMERA_AVT_COLOR_CORR_CRB, Crb);
        DC1394_ERR_RTN(err,"Could not set AVT color correction coefficient Crb");

        err=dc1394_set_adv_control_register(camera, REG_CAMERA_AVT_COLOR_CORR_CGB, Cgb);
        DC1394_ERR_RTN(err,"Could not set AVT color correction coefficient Cgb");

        err=dc1394_set_adv_control_register(camera, REG_CAMERA_AVT_COLOR_CORR_CBB, Cbb);
        DC1394_ERR_RTN(err,"Could not set AVT color correction coefficient Cbb");
    }

    return DC1394_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index