/* $Id: widget_image.c,v 1.7 2006/04/15 05:22:52 reinelt Exp $ * * image widget handling * * Copyright (C) 2006 Michael Reinelt * Copyright (C) 2006 The LCD4Linux Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * $Log: widget_image.c,v $ * Revision 1.7 2006/04/15 05:22:52 reinelt * mpd plugin from Stefan Kuhne * * Revision 1.6 2006/04/09 14:17:50 reinelt * autoconf/library fixes, image and graphic display inversion * * Revision 1.5 2006/02/25 13:36:33 geronet * updated indent.sh, applied coding style * * Revision 1.4 2006/02/19 07:20:54 reinelt * image support nearly finished * * Revision 1.3 2006/02/08 04:55:05 reinelt * moved widget registration to drv_generic_graphic * * Revision 1.2 2006/01/23 06:17:18 reinelt * timer widget added * * Revision 1.1 2006/01/22 09:16:11 reinelt * Image Widget framework added * */ /* * exported functions: * * WIDGET_CLASS Widget_Image * the image widget * */ #include "config.h" #include #include #include #include #include #include "debug.h" #include "cfg.h" #include "qprintf.h" #include "evaluator.h" #include "timer.h" #include "widget.h" #include "widget_image.h" #include "rgb.h" #ifdef HAVE_GD_GD_H #include #define WITH_GD #else #ifdef HAVE_GD_H #include #define WITH_GD #endif #endif #ifdef WITH_DMALLOC #include #endif #ifdef WITH_GD static void widget_image_render(const char *Name, WIDGET_IMAGE * Image) { int x, y; FILE *fd; gdImagePtr gdImage = NULL; /* clear bitmap */ if (Image->bitmap) { int i; for (i = 0; i < Image->height * Image->width; i++) { RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 }; Image->bitmap[i] = empty; } } if (Image->file == NULL || Image->file[0] == '\0') { error("Warning: Image %s has no file", Name); return; } fd = fopen(Image->file, "rb"); if (fd == NULL) { error("Warning: Image %s: fopen(%s) failed: %s", Name, Image->file, strerror(errno)); return; } gdImage = gdImageCreateFromPng(fd); fclose(fd); if (fd == NULL) { error("Warning: Image %s: CreateFromPng(%s) failed!", Name, Image->file); return; } /* maybe resize bitmap */ if (gdImage->sx > Image->width) { Image->width = gdImage->sx; if (Image->bitmap) free(Image->bitmap); Image->bitmap = NULL; } if (gdImage->sy > Image->height) { Image->height = gdImage->sy; if (Image->bitmap) free(Image->bitmap); Image->bitmap = NULL; } if (Image->bitmap == NULL && Image->width > 0 && Image->height > 0) { int i = Image->width * Image->height * sizeof(Image->bitmap[0]); Image->bitmap = malloc(i); if (Image->bitmap == NULL) { error("W
# Channel table for G-Sat 8 at 55.0°E
# Source: http://www.lyngsat.com/G-Sat-8.html

[T-Sat]
	DELIVERY_SYSTEM = DVBS
	FREQUENCY = 10968000
	POLARIZATION = VERTICAL
	SYMBOL_RATE = 11630000
	INNER_FEC = AUTO
	INVERSION = AUTO

[various]
	DELIVERY_SYSTEM = DVBS
	FREQUENCY = 11686000
	POLARIZATION = HORIZONTAL
	SYMBOL_RATE = 3333000
	INNER_FEC = AUTO
	INVERSION = AUTO