-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencoder_api_lib.cpp
More file actions
48 lines (37 loc) · 1.48 KB
/
Copy pathencoder_api_lib.cpp
File metadata and controls
48 lines (37 loc) · 1.48 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
#include <qr_frame_producer.h>
#include "public_encoder_api.h"
Qr_frame_producer* internal_frame_producer = NULL;
int init_and_set_external_file_info(const char* filename,
const char* filepath,
int suggested_qr_payload_length,
double err_fraction,
int suggested_N){
if (internal_frame_producer == NULL){
internal_frame_producer = new Qr_frame_producer;
internal_frame_producer->set_external_file_info(filename, filepath, suggested_qr_payload_length,
err_fraction, suggested_N);
}
return 0;
};
int produce_next_qr_grayscale_image_to_mem(char** produced_image, int *produced_width){
if (internal_frame_producer == NULL)
return -2;
return internal_frame_producer->produce_next_qr_grayscale_image_to_mem(produced_image, produced_width);
};
int tell_no_more_generating_header(){
if (internal_frame_producer == NULL){
return -2;
}
return internal_frame_producer->tell_no_more_generating_header();
};
int tell_how_much_frames_will_be_generated(){
if (internal_frame_producer == NULL)
return -1;
return internal_frame_producer->tell_how_much_frames_will_be_generated();
};
int destroy_current_encoder(){
if (internal_frame_producer != NULL){
delete internal_frame_producer;
internal_frame_producer = NULL;
}
};