Convert IMAGE_PRECAP to bool

This commit is contained in:
Mr-Dave
2025-03-13 16:28:03 -06:00
parent a00aff7270
commit 3c0dcf3746
2 changed files with 6 additions and 5 deletions

View File

@@ -109,7 +109,7 @@ void cls_camera::ring_process_debug()
t = "Trigger";
} else if (current_image->motion) {
t = "Motion";
} else if (current_image->flags & IMAGE_PRECAP) {
} else if (current_image->precap) {
t = "Precap";
} else if (current_image->flags & IMAGE_POSTCAP) {
t = "Postcap";
@@ -1287,6 +1287,7 @@ void cls_camera::resetimages()
current_image->flags = 0;
current_image->trigger = false;
current_image->motion = false;
current_image->precap = false;
current_image->cent_dist = 0;
memset(&current_image->location, 0, sizeof(current_image->location));
current_image->total_labels = 0;
@@ -1597,7 +1598,7 @@ void cls_camera::actions_motion()
current_image->flags |= (IMAGE_POSTCAP | IMAGE_SAVE);
postcap--;
} else {
current_image->flags |= IMAGE_PRECAP;
current_image->precap = true;
}
detected();
@@ -1654,7 +1655,7 @@ void cls_camera::actions_event()
((frame_curr_ts.tv_sec - movie_start_time) >=
cfg->movie_max_time) &&
( !(current_image->flags & IMAGE_POSTCAP)) &&
( !(current_image->flags & IMAGE_PRECAP))) {
( current_image->precap == false)) {
movie_end();
movie_start();
}
@@ -1698,7 +1699,7 @@ void cls_camera::actions()
current_image->flags |= (IMAGE_POSTCAP | IMAGE_SAVE);
postcap--;
} else {
current_image->flags |= IMAGE_PRECAP;
current_image->precap = true;
if ((cfg->event_gap == 0) && detecting_motion) {
event_stop = true;
}

View File

@@ -22,7 +22,6 @@
#define IMAGE_SAVE 4
#define IMAGE_SAVED 8
#define IMAGE_PRECAP 16
#define IMAGE_POSTCAP 32
enum CAMERA_TYPE {
@@ -67,6 +66,7 @@ struct ctx_image_data {
unsigned int flags; /* See IMAGE_* defines */
bool trigger;
bool motion;
bool precap;
ctx_coord location; /* coordinates for center and size of last motion detection*/
int total_labels;
};