void Private_Impl_Still::commitParameters() {
    if ( !changedSettings ) return;
    commitSharpness();
    commitContrast();
    commitBrightness();
    commitQuality();
    commitSaturation();
    commitISO();
    commitExposure();
    commitMetering();
    commitAWB();
    commitImageEffect();
    commitRotation();
    commitFlips();
    // Set Video Stabilization
    if ( mmal_port_parameter_set_boolean ( camera->control, MMAL_PARAMETER_VIDEO_STABILISATION, 0 ) != MMAL_SUCCESS )
        cout << API_NAME << ": Failed to set video stabilization parameter.\n";
    // Set Exposure Compensation
    if ( mmal_port_parameter_set_int32 ( camera->control, MMAL_PARAMETER_EXPOSURE_COMP , 0 ) != MMAL_SUCCESS )
        cout << API_NAME << ": Failed to set exposure compensation parameter.\n";
    // Set Color Efects
    MMAL_PARAMETER_COLOURFX_T colfx = {{MMAL_PARAMETER_COLOUR_EFFECT,sizeof ( colfx ) }, 0, 0, 0};
    colfx.enable = 0;
    colfx.u = 128;
    colfx.v = 128;
    if ( mmal_port_parameter_set ( camera->control, &colfx.hdr ) != MMAL_SUCCESS )
        cout << API_NAME << ": Failed to set color effects parameter.\n";
    // Set ROI
    MMAL_PARAMETER_INPUT_CROP_T crop = {{MMAL_PARAMETER_INPUT_CROP, sizeof ( MMAL_PARAMETER_INPUT_CROP_T ) }};
    crop.rect.x = ( 65536 * 0 );
    crop.rect.y = ( 65536 * 0 );
    crop.rect.width = ( 65536 * 1 );
    crop.rect.height = ( 65536 * 1 );
    if ( mmal_port_parameter_set ( camera->control, &crop.hdr ) != MMAL_SUCCESS )
        cout << API_NAME << ": Failed to set ROI parameter.\n";
    // Set encoder encoding
    if ( encoder_output_port != NULL ) {
        encoder_output_port->format->encoding = convertEncoding ( encoding );
        mmal_port_format_commit ( encoder_output_port );
    }
    changedSettings = false;
}
Пример #2
0
/**
 * Set the specified camera to all the specified settings
 * @param camera Pointer to camera component
 * @param params Pointer to parameter block containing parameters
 * @return 0 if successful, none-zero if unsuccessful.
 */
void Private_Impl::commitParameters ( ) {
    assert ( State.camera_component != 0 );
    commitSaturation();
    commitSharpness();
    commitContrast();
    commitBrightness();
    commitISO();
    if ( State.shutterSpeed != 0 ) {
        commitShutterSpeed();
        State.rpc_exposureMode = RASPICAM_EXPOSURE_FIXEDFPS;
        commitExposure();
    } else           commitExposure();
    commitExposureCompensation();
    commitMetering();
    commitImageEffect();
    commitRotation();
    commitFlips();
    commitVideoStabilization();
    commitAWB();
    commitAWB_RB();

}
Пример #3
0
void Private_Impl::setISO ( int iso ) {
    State.ISO = iso;
    if ( isOpened() ) commitISO();
}