Skip to content

Commit

Permalink
fix roi configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
danil-tolkachev authored and Danil Tolkachev committed Apr 30, 2019
1 parent 04488cf commit c4326c3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/avt_vimba_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,26 +1097,26 @@ void AvtVimbaCamera::updateROIConfig(Config& config) {
width = right_x - offset_x;
height = bottom_y - offset_y;

config.width = width/binning_or_decimation_x;
config.height = height/binning_or_decimation_y;
config.roi_width = width/binning_or_decimation_x;
config.roi_height = height/binning_or_decimation_y;
config.roi_offset_x = offset_x/binning_or_decimation_x;
config.roi_offset_y = offset_y/binning_or_decimation_y;

if (config.roi_offset_x != config_.roi_offset_x || on_init_) {
if (config.roi_width != config_.roi_width || on_init_) {
changed = true;
setFeatureValue("OffsetX", static_cast<VmbInt64_t>(config.roi_offset_x));
setFeatureValue("Width", static_cast<VmbInt64_t>(config.roi_width));
}
if (config.roi_offset_y != config_.roi_offset_y || on_init_) {
if (config.roi_height != config_.roi_height || on_init_) {
changed = true;
setFeatureValue("OffsetY", static_cast<VmbInt64_t>(config.roi_offset_y));
setFeatureValue("Height", static_cast<VmbInt64_t>(config.roi_height));
}
if (config.width != config_.width || on_init_) {
if (config.roi_offset_x != config_.roi_offset_x || on_init_) {
changed = true;
setFeatureValue("Width", static_cast<VmbInt64_t>(config.width));
setFeatureValue("OffsetX", static_cast<VmbInt64_t>(config.roi_offset_x));
}
if (config.height != config_.height || on_init_) {
if (config.roi_offset_y != config_.roi_offset_y || on_init_) {
changed = true;
setFeatureValue("Height", static_cast<VmbInt64_t>(config.height));
setFeatureValue("OffsetY", static_cast<VmbInt64_t>(config.roi_offset_y));
}

if(changed && show_debug_prints_){
Expand Down

0 comments on commit c4326c3

Please sign in to comment.