/*
 * SSL_GFX.hpp
 *
 *  Created on: Feb 11, 2024
 *      Author: Gabriel
 */

#ifndef SRC_COMPONENTS_SSL_GFX_HPP_
#define SRC_COMPONENTS_SSL_GFX_HPP_

#include <inttypes.h>
#include "ILI9341.hpp"

class RobotStatus {
public:
	uint8_t robotId;
	uint8_t team;
	uint32_t status;
	bool connected;
	float batteryLevel;
};

class SSL_GFX {
private:
	static const uint16_t sizeX = 80;
	static const uint16_t sizeY = 80;
public:
	SSL_GFX(ILI9341* hDisplay, uint16_t posX, uint16_t posY, uint8_t hBuffer[][sizeX][3], uint32_t size);
	virtual ~SSL_GFX();
	int32_t init();
	int32_t draw();
	int32_t setRobotStatus(RobotStatus status);
private:
	RobotStatus robotStatus;
	ILI9341* hDisplay;
	uint16_t posX;
	uint16_t posY;
	uint8_t (*hBuffer)[sizeX][3];
	uint32_t size;
	int32_t drawText(uint8_t color[3], uint16_t posX, uint16_t posY, uint8_t* string, uint32_t size);
	int32_t drawBoundingBox(uint8_t color[3]);
	int32_t drawRobotSilhouette(uint8_t color[3]);
	int32_t drawRobotLid();
	int32_t drawId(uint8_t color[3]);
	int32_t drawBatteryBar();
};

#endif /* SRC_COMPONENTS_SSL_GFX_HPP_ */
