
#ifndef __MOBILEPHOTOTOOL__
#define __MOBILEPHOTOTOOL__

#include <cstdio>

#ifdef _MSC_VER
	#ifdef MPT_export
		#define DLL __declspec(dllexport)
	#else
		#define DLL __declspec(dllimport)
	#endif
#else
	#define DLL
#endif

#ifndef MPT_SUCCESS
#define MPT_SUCCESS		0
#define MPT_ERROR 		1
#define MPT_NOSUCCESS	2
#endif

#ifdef __cplusplus
extern "C"
{
#endif
	DLL void *create_Reader_01(const char *file);

	DLL void *create_Reader_02(const char *file, int num_threads);

	DLL void delete_Reader(void *reader);

	DLL unsigned int get_PreviewWidth(void *reader);

	DLL unsigned int get_PreviewLength(void *reader);

	DLL unsigned int get_PreviewData_01(void *reader, unsigned int *data, size_t count);

	DLL unsigned int get_PreviewData_02(void *reader, unsigned short *data, size_t count);

	DLL unsigned int get_RawWidth(void *reader);

	DLL unsigned int get_RawLength(void *reader);

	DLL unsigned int get_RawData(void *reader, unsigned int *data, size_t count);

	DLL unsigned int get_ZoomWidth(void *reader);

	DLL unsigned int get_ZoomLength(void *reader);

	DLL unsigned int get_ZoomData(void *reader, unsigned int *data, size_t count);

	DLL int set_Zoom(void *reader, float zoom, int size[2]);

	DLL void get_zoom_image(	void *reader,
								unsigned int *data_out,
								unsigned int linestride,
								unsigned int width,
								unsigned int length,
								unsigned int out_x0,
								unsigned int out_y0,
								unsigned int in_x0,
								unsigned int in_y0);

	DLL int get_zoom_image_02(	void *reader,
									unsigned short *data_out,
									unsigned int linestride,
									unsigned int width,
									unsigned int length,
									unsigned int out_x0,
									unsigned int out_y0,
									unsigned int in_x0,
									unsigned int in_y0);

	/**
	 * Extract from the Exif the Exposure Time and write the time as rationel in the retrun_value.
	 * If there is no Exif_ExposureTime it return MPT_NOSUCESS;
	 */
	DLL unsigned int get_Exif_ExposureTime(void *reader, unsigned int return_value[2]);

	DLL unsigned int get_Exif_FNumber(void *reader, unsigned int return_value[2]);

	DLL unsigned int get_Exif_ExposureProgram(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_ISOSpeedRatings(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_DateTimeOriginal(void *reader, char return_value[20]);

	DLL unsigned int get_Exif_SubsecTimeOriginal(void *reader, char return_value[20]);

	DLL unsigned int get_Exif_DateTimeDigitized(void *reader, char return_value[20]);

	DLL unsigned int get_Exif_SubsecTimeDigitized(void *reader, char return_value[20]);

	DLL unsigned int get_Exif_ExposureBiasValue(void *reader, int return_value[2]);

	DLL unsigned int get_Exif_MeteringMode(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_Flash(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_FlashEnergy(void *reader, unsigned int return_value[2]);

	DLL unsigned int get_Exif_FocalLength(void *reader, unsigned int return_value[2]);

	DLL unsigned int get_Exif_FocalLengthIn35mmFilm(void *readern, unsigned int return_value[1]);

	DLL unsigned int get_Exif_SensingMethod(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_CustomRendered(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_ExposureMode(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_WhiteBalance(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_SceneCaptureType(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_Contrast(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_Saturation(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_Sharpness(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_BaselineSharpness(void *reader, unsigned int return_value[1]);

	DLL unsigned int get_Exif_SubjectDistanceRange(void *reader, unsigned int return_value[1]);


#ifdef __cplusplus
}
#endif
#endif
