/*
 * grifo_image_serializer.h
 *
 */

#ifndef GRIFO_IMAGE_SERIALIZER_H_
#define GRIFO_IMAGE_SERIALIZER_H_

#include <stdint.h>

extern void GrifoImageSerializerSetup(const char* dst_ip, unsigned int dst_port);
extern void GrifoSarSerializerSetup(const char* dst_ip, unsigned int dst_port);
extern void GrifoMfdSerializerSetup(const char* dst_ip, unsigned int dst_port);

unsigned int GrifoImageSerializerDefaultPort();

extern void GrifoMfdSerializer(const uint32_t* palette, const uint8_t* data, unsigned int dx, unsigned int dy, unsigned int stride);

extern void GrifoImageSerializerSetReservedData(unsigned int type, void* p, unsigned int max_size) __attribute__((weak));

extern void GrifoImageSerializerSetInfoData(unsigned int type, void* p, unsigned int max_size) __attribute__((weak));

struct GrifoImageSerializerHeaderData
{
	uint8_t image_type;				//Synthetic MFD image or raw SAR image
	uint8_t image_subtype;			//Synthetic MFD with or without background raw map or SAR image
	uint8_t image_logical_color;	//number of color map colors used for synthetic graphics, from 0..(image_logical_color-1), while image_logical_color..255 are associated to the background map
	uint8_t image_reserved;

	uint32_t image_producer_info[2];

	//uint16_t tod[2];
	//uint32_t batch;
	//uint32_t timetag_us64;
};

extern void GrifoImageSerializerGetHeaderData(unsigned int type, GrifoImageSerializerHeaderData* h) __attribute__((weak));

extern void GrifoImageSerializerSetScenario(
		unsigned batch, unsigned int timetag64, uint16_t tod[2],
		float scale_meters,
		float ac_true_heading,
		float ac_latitude,
		float ac_longitude,
		float ac_altitude,
		float pos_latitude,
		float pos_longitude);


extern unsigned int GrifoImageSerializerDefaultPort();

#endif /* GRIFO_IMAGE_SERIALIZER_H_ */
