#ifndef LIBRAW_WRAPPER_H
#define LIBRAW_WRAPPER_H
#include <string>
#include <vector>
#ifdef __cplusplus
extern "C" {
#endif
#define RW_SUCCESS 0
#define RW_ERROR_OPEN_FILE 1
#define RW_ERROR_UNPACK 2
#define RW_ERROR_PROCESS 3
#define RW_ERROR_WRITE 4
#define RW_ERROR_UNKNOWN 5
struct ExifData {
char camera_make[64];
char camera_model[64];
char* software;
int iso_speed;
double shutter;
double aperture;
double focal_length;
int raw_width;
int raw_height;
int output_width;
int output_height;
int colors;
int color_filter;
double cam_mul[4];
char* date_taken;
char* lens;
double max_aperture;
int focal_length_35mm;
char* description;
char* artist;
};
int process_raw_to_jpeg(const char* input_path, const char* output_path, ExifData& exif_data);
int process_raw_bytes_to_jpeg(const unsigned char* data, size_t size, const char* output_path, ExifData& exif_data);
int process_raw_bytes_to_jpeg_buffer(const unsigned char* data, size_t size, unsigned char** out_buf, size_t* out_size, ExifData& exif_data);
int convert_ppm_to_jpeg(const std::vector<unsigned char>& ppm_data, int width, int height, const char* jpeg_path, int quality);
const char* get_last_error();
#ifdef __cplusplus
}
#endif
#endif