/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A. - All Rights Reserved.                        *
*                                                                          *
***************************************************************************/

#ifndef GLM_COMPRESSION_H
#define GLM_COMPRESSION_H

#include <glmCrowdIOAPI.h>
#include <stdint.h>
#include <stdio.h>

namespace glm
{
	namespace crowdio
	{
		extern GLM_CROWDIO_API void glmCompressPosition48(uint16_t outputPosition[3], float inputPosition[3], float max);
		extern GLM_CROWDIO_API void glmUncompressPosition48(float outputPosition[3], uint16_t inputPosition[3], float max);

		extern GLM_CROWDIO_API void glmCompressQuaternion32(uint32_t* outputQuaternion, float inputQuaternion[4]);
		extern GLM_CROWDIO_API void glmCompressQuaternion64(uint64_t* outputQuaternion, float inputQuaternion[4]);
		extern GLM_CROWDIO_API void glmUncompressQuaternion32(float outputQuaternion[4], uint32_t inputQuaternion);
		extern GLM_CROWDIO_API void glmUncompressQuaternion64(float outputQuaternion[4], uint64_t inputQuaternion);

		extern GLM_CROWDIO_API void glmFileRead(void* data, unsigned long elementSize, unsigned long count, FILE* fp);
		extern GLM_CROWDIO_API void glmFileReadUInt16(uint16_t* data, unsigned int count, FILE* fp);
		extern GLM_CROWDIO_API void glmFileReadUInt32(uint32_t* data, unsigned int count, FILE* fp);
		extern GLM_CROWDIO_API void glmFileReadUInt64(uint64_t* data, unsigned int count, FILE* fp);

		extern GLM_CROWDIO_API void glmFileWrite(const void* data, unsigned long elementSize, unsigned long count, FILE* fp);
		extern GLM_CROWDIO_API void glmFileWriteUInt16(const uint16_t* data, unsigned int count, FILE* fp);
		extern GLM_CROWDIO_API void glmFileWriteUInt32(const uint32_t* data, unsigned int count, FILE* fp);
		extern GLM_CROWDIO_API void glmFileWriteUInt64(const uint64_t* data, unsigned int count, FILE* fp);
	}
}

#endif	//GLM_COMPRESSION_H