Add more mode support to libmegapixels

This commit is contained in:
Martijn Braam
2023-07-12 11:48:13 +02:00
parent c1fea1ef82
commit 80aef3fa80
7 changed files with 277 additions and 31 deletions

View File

@@ -12,6 +12,12 @@ libmegapixels_find_config(char *configfile);
#define LIBMEGAPIXELS_CMD_LINK 1
#define LIBMEGAPIXELS_CMD_MODE 2
#define LIBMEGAPIXELS_CFA_NONE 0
#define LIBMEGAPIXELS_CFA_BGGR 1
#define LIBMEGAPIXELS_CFA_GBRG 2
#define LIBMEGAPIXELS_CFA_GRBG 3
#define LIBMEGAPIXELS_CFA_RGGB 4
struct _lmp_cmd {
int type;
const char *entity_from;
@@ -35,6 +41,7 @@ struct _lmp_mode {
int rate;
int format;
int rotation;
int mirrored;
double focal_length;
double f_number;
@@ -54,6 +61,7 @@ struct _lmp_subdev {
typedef struct _lmp_subdev libmegapixels_subdev;
struct _lmp_camera {
int index;
char *name;
char *sensor_name;
char *bridge_name;
@@ -67,6 +75,7 @@ struct _lmp_camera {
int num_modes;
libmegapixels_mode **modes;
libmegapixels_mode *current_mode;
int num_handles;
libmegapixels_subdev **handles;
@@ -102,4 +111,31 @@ libmegapixels_close(libmegapixels_camera *camera);
EXPORT unsigned int
libmegapixels_select_mode(libmegapixels_camera *camera, libmegapixels_mode *mode);
EXPORT char *
libmegapixels_v4l_pixfmt_to_string(uint32_t pixfmt);
EXPORT const char *
libmegapixels_format_cfa_pattern(int format);
EXPORT uint32_t
libmegapixels_mode_raw_width_to_width(int index, uint32_t width);
EXPORT uint32_t
libmegapixels_mode_width_to_padding(int index, uint32_t width);
EXPORT uint32_t
libmegapixels_mode_width_to_bytes(int index, uint32_t width);
EXPORT uint32_t
libmegapixels_format_to_v4l_pixfmt(int index);
EXPORT uint32_t
libmegapixels_format_to_media_busfmt(int index);
EXPORT uint32_t
libmegapixels_format_bits_per_pixel(int format);
EXPORT int
libmegapixels_mode_equals(libmegapixels_mode *a, libmegapixels_mode *b);
#endif