o_gnuplot_poi.cpp
1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "blc_channel.h"
#include "blc_program.h"
#include <unistd.h>
#include <signal.h>
#include <pthread.h>
#include <sys/time.h>
#include "graph.h"
char const *with_option, *style_option;
int sx, sy;
int sampling_period;
int interactive_mode=0;
int final_columns_nb, final_rows_nb;
int offset=0;
int bands=1;
int dims_nb, *lengths;
double min, max;
enum {RUN, PAUSE};
int status=RUN;
void refresh_period_cb(char *argument, void*){
sampling_period=strtol(argument, NULL, 10)*1000;
}
int main(int argc, char *argv[]){
blc_channel input_image, poi;
char const *poi_name, *input_image_name;
blc_program_set_description("Display an image with the point of interests");
blc_program_add_parameter(&input_image_name, "blc_channel-in", 1, "image on which you want to show the points of interest", NULL);
blc_program_add_parameter(&poi_name, "blc_channel-in", 1, "points of interest", NULL);
// blc_program_add_option(&size_str, 's', "size", "UI32[xUI32]", "size of the matrix", NULL);
blc_program_init(&argc, &argv, blc_quit);
blc_command_forward_blc_channels();
input_image.open(input_image_name, BLC_CHANNEL_READ);
poi.open(poi_name, BLC_CHANNEL_READ);
blc_loop_try_add_waiting_semaphore(input_image.sem_new_data);
blc_loop_try_add_posting_semaphore(input_image.sem_ack_data);
blc_loop_try_add_waiting_semaphore(poi.sem_new_data);
blc_loop_try_add_posting_semaphore(poi.sem_ack_data);
create_poi_loop(input_image.uchars, input_image.dims[0].length, input_image.dims[1].length, poi.uints16, poi.dims[0].length);
return EXIT_SUCCESS;
}