From 24439e72e8b0d13bccce21e19a28d70d1bd98760 Mon Sep 17 00:00:00 2001 From: Andreas Mair Date: Mon, 11 Jun 2007 12:57:02 +0200 Subject: 2007-06-11: Version 0.0.5rc - Fixed possible crash in recording's details. - Added MoBuntu theme (Submitted by Morone @vdr-portal.de). - Added Blue, Blue2, Blue3 and Coolblue theme (Submitted by Uwe @vdr-portal.de). - Added support for TrueTypeFonts (based on graphtft and text2skin plugins). - Added support for new epgsearch tags. - Updated French translation. (Submitted by pat @vdr-portal.de) - Changed size calculation for scrollbars. - Add setup options to individually set the fonts to use. See README for details. - Set used colors for every area in menu OSD when using multiple areas. - Reworked multiple areas mode in menu OSD. - Do not disable logos/symbols/flags if 4bpp single area is configured in setup. - Replaced setup options "One area (if possible)" and "Bpp in single area" by option "Try 8bpp single areas". - Unified appearance of error/info/status messages in all OSDs. - Added setup option to selectively enable scrolling text. - Added setup option to selectively enable logos in the different OSDs. - Added text effects (e.g. scrolling and blinking) for selected text. - Removed clrMenuHighlight, clrMessageBorder, clrMenuItemCurrentFg, clrMenuEventTitle, clrMenuEventShortText, clrMenuScrollbarTotal and clrMenuScrollbarShown in themes. - Fixed height of title/subtitle box in EPG & recording details. - Recognize mediamanager plugin in mainmenu logos. - Don't cut info line in EPG & recording details at logo area's left edge. - Updated Russian translation (Submitted by neptunvasja @vdr-portal.de). - Added Dutch translation (Submitted by dorpsgek @vdr-portal.de). - Various bugfixes and graphical changes. --- bitmap.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'bitmap.c') diff --git a/bitmap.c b/bitmap.c index 59bf98b..4ca52b4 100644 --- a/bitmap.c +++ b/bitmap.c @@ -1,15 +1,20 @@ #ifdef HAVE_IMAGEMAGICK + +#include "common.h" #include "bitmap.h" #include "config.h" -#include - +#ifndef X_DISPLAY_MISSING #define X_DISPLAY_MISSING +#endif + +#undef debug #include using namespace Magick; #include -using namespace std; + +#include cOSDImageBitmap::cOSDImageBitmap() {} @@ -18,12 +23,12 @@ cOSDImageBitmap::cOSDImageBitmap() cOSDImageBitmap::~cOSDImageBitmap() {} -bool cOSDImageBitmap::LoadImage(const char *fileNameP, int w, int h, int colors, cBitmap &bmp) +bool cOSDImageBitmap::DrawImage(const char *fileNameP, int x, int y, int w, int h, int colors, cBitmap *bmp) { - return LoadMagick(fileNameP, w, h, colors, bmp); + return DrawMagick(fileNameP, x, y, w, h, colors, bmp); } -bool cOSDImageBitmap::LoadMagick(const char *Filename, int width, int height, int colors, cBitmap &bmp) +bool cOSDImageBitmap::DrawMagick(const char *Filename, int x, int y, int width, int height, int colors, cBitmap *bmp) { Image image; try { @@ -52,8 +57,10 @@ bool cOSDImageBitmap::LoadMagick(const char *Filename, int width, int height, in image.quantizeColors(colors); image.quantize(); } - bmp.SetSize(w, h); - bmp.SetBpp(colors <= 16 ? 4 : 8); + + // center image + x += ((width - w) / 2); + y += ((height - h) / 2); const PixelPacket *pix = image.getConstPixels(0, 0, w, h); for (int iy = 0; iy < h; ++iy) { @@ -62,7 +69,7 @@ bool cOSDImageBitmap::LoadMagick(const char *Filename, int width, int height, in | ((pix->red * 255 / MaxRGB) << 16) | ((pix->green * 255 / MaxRGB) << 8) | (pix->blue * 255 / MaxRGB); - bmp.DrawPixel(ix, iy, col); + bmp->DrawPixel(x + ix, y + iy, col); ++pix; } } -- cgit v1.2.3