2020-11-25 14:34:57 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "camera_config.h"
|
2021-02-19 11:57:44 +01:00
|
|
|
#include "zbar_pipeline.h"
|
2021-04-15 15:14:20 +02:00
|
|
|
#include "process_pipeline.h"
|
2020-11-25 14:34:57 +01:00
|
|
|
#include "gtk/gtk.h"
|
|
|
|
|
2021-01-06 13:24:05 +01:00
|
|
|
#define MP_MAIN_THUMB_SIZE 24
|
|
|
|
|
2020-11-25 14:34:57 +01:00
|
|
|
struct mp_main_state {
|
2020-12-06 15:44:31 +01:00
|
|
|
const struct mp_camera_config *camera;
|
|
|
|
MPCameraMode mode;
|
2020-11-25 14:34:57 +01:00
|
|
|
|
2020-12-06 15:44:31 +01:00
|
|
|
bool gain_is_manual;
|
|
|
|
int gain;
|
|
|
|
int gain_max;
|
2020-11-25 14:34:57 +01:00
|
|
|
|
2020-12-06 15:44:31 +01:00
|
|
|
bool exposure_is_manual;
|
|
|
|
int exposure;
|
2020-11-25 14:34:57 +01:00
|
|
|
|
2020-12-06 15:44:31 +01:00
|
|
|
bool has_auto_focus_continuous;
|
|
|
|
bool has_auto_focus_start;
|
2020-11-25 14:34:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
void mp_main_update_state(const struct mp_main_state *state);
|
|
|
|
|
2021-04-15 15:14:20 +02:00
|
|
|
void mp_main_set_preview(MPProcessPipelineBuffer *buffer);
|
2021-01-06 13:24:05 +01:00
|
|
|
void mp_main_capture_completed(cairo_surface_t *thumb, const char *fname);
|
2020-11-25 14:34:57 +01:00
|
|
|
|
2021-02-19 11:57:44 +01:00
|
|
|
void mp_main_set_zbar_result(MPZBarScanResult *result);
|
|
|
|
|
2020-12-06 15:44:31 +01:00
|
|
|
int remap(int value, int input_min, int input_max, int output_min, int output_max);
|
2021-01-06 13:24:05 +01:00
|
|
|
|
|
|
|
void draw_surface_scaled_centered(cairo_t *cr, uint32_t dst_width, uint32_t dst_height,
|
|
|
|
cairo_surface_t *surface);
|