//The most part of this Code is from the MMS V.2 Project:

#ifndef __OSDOUT_FBRENDERER_HPP
#define __OSDOUT_FBRENDERER_HPP

#define X_DISPLAY_MISSING
#include <Imlib2.h>

#include <stdio.h>
#include <linux/fb.h>

class FbRenderer
{
private:
		char *fb_dev_name;
		int _initialized;
		Imlib_Image _resized;

		int fb_dev_fd;
		int fb_depth;
		int fb_type;
		size_t fb_size;
		int fb_line_len;
		int y_offset;

		struct fb_var_screeninfo fb_orig_vinfo;
		struct fb_fix_screeninfo fb_finfo;

		void fbdev_draw_32(unsigned char * frame);
		void fbdev_draw_24(unsigned char * frame);
		void fbdev_draw_16(unsigned char * frame);

public:	
		FbRenderer();
		~FbRenderer();

		void init(int devnum);
		void deinit();

		void refresh();
};

#endif // __OSDOUT_FBRENDERER_H
