/**
 *  GraphTFT plugin for the Video Disk Recorder 
 * 
 *  imlibrenderer.h - A plugin for the Video Disk Recorder
 *
 *  (c) 2004 Lars Tegeler, Sascha Volkenandt  
 *
 * This code is distributed under the terms and conditions of the
 * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
 *
 * $Id: imlibrenderer.h,v 1.2 2004/05/08 18:55:45 tegeler Exp $
 *
 **/

#ifndef __GTFT_IMLIBRENDERER_HPP
#define __GTFT_IMLIBRENDERER_HPP

#include "renderer.h"
#include <vdr/device.h>

#define X_DISPLAY_MISSING
#include <Imlib2.h>

typedef unsigned char UINT8;

// used to render the images with imlib2
class ImlibRenderer : public Renderer
{
	private:
		int _width;
		int _height;
	public:
		ImlibRenderer();
		virtual ~ImlibRenderer();
                
		// the image you're working on
		Imlib_Image _cur_image;
		// the image displayed on the screen the last time.
		Imlib_Image _render_image;
		
		void set_context_to_buffer(Imlib_Image img);
		Imlib_Image new_imlib_image();
		
		void dumpImage2File(const char* fname, int dumpWidth, int dumpHeight);
		void image(const char* fname, int x, int y, bool fullpath = false );
		int text(const char *text, const char *font_name, int size, int align, int x, int y, int r, int g, int b, int widht, int height,int lines);
		void rectangle(int x, int y, int width, int height, int r, int g, int b, int a);

		virtual void refresh();
		virtual void clear();
};

#endif // __GTFT_IMLIBRENDERER_H
