TEXT="no"
GRAPHIC="no"
GPIO="no"
-IMAGE="no"
# generiv I/O drivers
PARPORT="no"
I2C="no"
KEYPAD="no"
+# generic libraries
+LIBUSB="no"
if test "$BECKMANNEGLE" = "yes"; then
TEXT="yes"
if test "$has_usb" = "true"; then
TEXT="yes"
DRIVERS="$DRIVERS drv_BWCT.o"
- DRVLIBS="$DRVLIBS -lusb"
+ LIBUSB="yes"
cat >>confdefs.h <<\_ACEOF
#define WITH_BWCT 1
if test "$G15" = "yes"; then
if test "$has_usb" = "true"; then
GRAPHIC="yes"
+ LIBUSB="yes"
DRIVERS="$DRIVERS drv_G15.o"
- DRVLIBS="$DRVLIBS -lusb"
cat >>confdefs.h <<\_ACEOF
#define WITH_G15 1
TEXT="yes"
SERIAL="yes"
DRIVERS="$DRIVERS drv_LCD2USB.o"
- DRVLIBS="$DRVLIBS -lusb"
+ LIBUSB="yes"
cat >>confdefs.h <<\_ACEOF
#define WITH_LCD2USB 1
if test "$PNG" = "yes"; then
if test "$has_gd" = "true"; then
GRAPHIC="yes"
- IMAGE="yes"
- DRVLIBS="$DRVLIBS -lgd"
cat >>confdefs.h <<\_ACEOF
#define WITH_PNG 1
if test "$PPM" = "yes"; then
GRAPHIC="yes"
- IMAGE="yes"
cat >>confdefs.h <<\_ACEOF
#define WITH_PPM 1
fi
-if test "$IMAGE" = "yes"; then
- DRIVERS="$DRIVERS drv_Image.o"
-fi
-
if test "$ROUTERBOARD" = "yes"; then
TEXT="yes"
GPIO="yes"
#define WITH_SERDISPLIB 1
_ACEOF
+ if test "$has_usb" = "true"; then
+ LIBUSB="yes"
+ fi
else
{ echo "$as_me:$LINENO: WARNING: serdisp.h not found: serdisplib driver disabled" >&5
echo "$as_me: WARNING: serdisp.h not found: serdisplib driver disabled" >&2;}
if test "$has_usb" = "true"; then
TEXT="yes"
DRIVERS="$DRIVERS drv_Trefon.o"
- DRVLIBS="$DRVLIBS -lusb"
+ LIBUSB="yes"
cat >>confdefs.h <<\_ACEOF
#define WITH_TREFON 1
SERIAL="yes"
DRIVERS="$DRIVERS drv_USBLCD.o"
if test "$has_usb" = "true"; then
- DRVLIBS="$DRVLIBS -lusb"
+ LIBUSB="yes"
fi
cat >>confdefs.h <<\_ACEOF
# generic graphic driver
if test "$GRAPHIC" = "yes"; then
DRIVERS="$DRIVERS drv_generic_graphic.o"
+ if test "$has_gd" = "true"; then
+ DRIVERS="$DRIVERS drv_Image.o"
+ DRVLIBS="$DRVLIBS -lgd"
+ fi
fi
# generic GPIO driver
DRIVERS="$DRIVERS drv_generic_keypad.o"
fi
+# libusb
+if test "$LIBUSB" = "yes"; then
+ DRVLIBS="$DRVLIBS -lusb"
+fi
+
TEXT="no"
GRAPHIC="no"
GPIO="no"
-IMAGE="no"
# generiv I/O drivers
PARPORT="no"
I2C="no"
KEYPAD="no"
+# generic libraries
+LIBUSB="no"
if test "$BECKMANNEGLE" = "yes"; then
TEXT="yes"
if test "$has_usb" = "true"; then
TEXT="yes"
DRIVERS="$DRIVERS drv_BWCT.o"
- DRVLIBS="$DRVLIBS -lusb"
+ LIBUSB="yes"
AC_DEFINE(WITH_BWCT,1,[BWCT driver])
else
AC_MSG_WARN(usb.h not found: BWCT driver disabled)
if test "$G15" = "yes"; then
if test "$has_usb" = "true"; then
GRAPHIC="yes"
+ LIBUSB="yes"
DRIVERS="$DRIVERS drv_G15.o"
- DRVLIBS="$DRVLIBS -lusb"
AC_DEFINE(WITH_G15,1,[G-15 driver])
else
AC_MSG_WARN(usb.h not found: G15 driver disabled)
TEXT="yes"
SERIAL="yes"
DRIVERS="$DRIVERS drv_LCD2USB.o"
- DRVLIBS="$DRVLIBS -lusb"
+ LIBUSB="yes"
AC_DEFINE(WITH_LCD2USB,1,[LCD2USB driver])
else
AC_MSG_WARN(usb.h not found: LCD2USB driver disabled)
if test "$PNG" = "yes"; then
if test "$has_gd" = "true"; then
GRAPHIC="yes"
- IMAGE="yes"
- DRVLIBS="$DRVLIBS -lgd"
AC_DEFINE(WITH_PNG,1,[ driver])
else
AC_MSG_WARN(gd.h not found: PNG driver disabled)
if test "$PPM" = "yes"; then
GRAPHIC="yes"
- IMAGE="yes"
AC_DEFINE(WITH_PPM,1,[ driver])
fi
-if test "$IMAGE" = "yes"; then
- DRIVERS="$DRIVERS drv_Image.o"
-fi
-
if test "$ROUTERBOARD" = "yes"; then
TEXT="yes"
GPIO="yes"
DRIVERS="$DRIVERS drv_serdisplib.o"
DRVLIBS="$DRVLIBS -L/usr/local/lib -lserdisp"
AC_DEFINE(WITH_SERDISPLIB,1,[serdisplib driver])
+ if test "$has_usb" = "true"; then
+ LIBUSB="yes"
+ fi
else
AC_MSG_WARN(serdisp.h not found: serdisplib driver disabled)
fi
if test "$has_usb" = "true"; then
TEXT="yes"
DRIVERS="$DRIVERS drv_Trefon.o"
- DRVLIBS="$DRVLIBS -lusb"
+ LIBUSB="yes"
AC_DEFINE(WITH_TREFON,1,[TREFON driver])
else
AC_MSG_WARN(usb.h not found: Trefon driver disabled)
SERIAL="yes"
DRIVERS="$DRIVERS drv_USBLCD.o"
if test "$has_usb" = "true"; then
- DRVLIBS="$DRVLIBS -lusb"
+ LIBUSB="yes"
fi
AC_DEFINE(WITH_USBLCD,1,[USBLCD driver])
fi
# generic graphic driver
if test "$GRAPHIC" = "yes"; then
DRIVERS="$DRIVERS drv_generic_graphic.o"
+ if test "$has_gd" = "true"; then
+ DRIVERS="$DRIVERS drv_Image.o"
+ DRVLIBS="$DRVLIBS -lgd"
+ fi
fi
# generic GPIO driver
DRIVERS="$DRIVERS drv_generic_keypad.o"
fi
+# libusb
+if test "$LIBUSB" = "yes"; then
+ DRVLIBS="$DRVLIBS -lusb"
+fi
+
AC_SUBST(DRIVERS)
AC_SUBST(DRVLIBS)
-/* $Id: drv_LCD2USB.c,v 1.9 2006/03/18 14:54:36 harbaum Exp $
+/* $Id: drv_LCD2USB.c,v 1.10 2006/04/09 14:17:50 reinelt Exp $
*
* driver for USB2LCD display interface
* see http://www.harbaum.org/till/lcd2usb for schematics
*
*
* $Log: drv_LCD2USB.c,v $
+ * Revision 1.10 2006/04/09 14:17:50 reinelt
+ * autoconf/library fixes, image and graphic display inversion
+ *
* Revision 1.9 2006/03/18 14:54:36 harbaum
* Improved USB error recovery
*
// try to close and reopen connection
if (drv_L2U_open(bus_id, device_id) < 0) {
- error("%s: could not re-detect LCD2USB USB LCD", Name);
- got_signal = -1;
- return -1;
+ error("%s: could not re-detect LCD2USB USB LCD", Name);
+ got_signal = -1;
+ return -1;
}
-
// and try to re-send command
if (usb_control_msg(lcd, USB_TYPE_VENDOR, request, value, index, NULL, 0, 1000) < 0) {
- error("%s: retried USB request failed, aborting!", Name);
- got_signal = -1;
- return -1;
+ error("%s: retried USB request failed, aborting!", Name);
+ got_signal = -1;
+ return -1;
}
- info("%s: Device successfully reconnected.", Name);
+ info("%s: Device successfully reconnected.", Name);
}
return 0;
int asc255bug;
int ret;
- info("%s: %s", Name, "$Revision: 1.9 $");
+ info("%s: %s", Name, "$Revision: 1.10 $");
/* display preferences */
XRES = 5; /* pixel width of one char */
-/* $Id: drv_LUIse.c,v 1.5 2006/03/10 18:06:52 tooly-bln Exp $
+/* $Id: drv_LUIse.c,v 1.6 2006/04/09 14:17:50 reinelt Exp $
*
* LUIse lcd4linux driver
*
*
*
* $Log: drv_LUIse.c,v $
+ * Revision 1.6 2006/04/09 14:17:50 reinelt
+ * autoconf/library fixes, image and graphic display inversion
+ *
* Revision 1.5 2006/03/10 18:06:52 tooly-bln
* replace drv_generic_graphic_FB with drv_generic_graphic_black
*
for (r = row; r < row + height; r++) {
for (c = col; c < col + width; c++) {
- if (drv_generic_graphic_black(r,c)) {
+ if (drv_generic_graphic_black(r, c)) {
LUI_SetPixel(devNum, 0, c, r, 1);
} else {
LUI_SetPixel(devNum, 0, c, r, 0);
- }
+ }
}
}
}
{
int ret;
- info("%s: %s", Name, "$Revision: 1.5 $");
+ info("%s: %s", Name, "$Revision: 1.6 $");
/* real worker functions */
drv_generic_graphic_real_blit = drv_LUIse_blit;
*
*
* $Log: drv_generic_graphic.c,v $
+ * Revision 1.26 2006/04/09 14:17:50 reinelt
+ * autoconf/library fixes, image and graphic display inversion
+ *
* Revision 1.25 2006/02/27 07:53:52 reinelt
* some more graphic issues fixed
*
static char *Section = NULL;
static char *Driver = NULL;
-static int LROWS = 0; /* layout size (pixels!) */
-static int LCOLS = 0; /* layout size (pixels!) */
+/* layout size (pixels!) */
+static int LROWS = 0;
+static int LCOLS = 0;
+/* framebuffer */
static RGBA *drv_generic_graphic_FB[LAYERS] = { NULL, };
+/* inverted colors */
+static int INVERTED = 0;
+
/* must be implemented by the real driver */
void (*drv_generic_graphic_real_blit) () = NULL;
ret.B = (p.B * p.A + ret.B * (255 - p.A)) / 255;
}
}
+ if (INVERTED) {
+ ret.R = 255 - ret.R;
+ ret.G = 255 - ret.G;
+ ret.B = 255 - ret.B;
+ }
+
return ret;
}
if (color)
free(color);
+ /* inverted display? */
+ cfg_number(section, "inverted", 0, 0, 1, &INVERTED);
+
/* register text widget */
wc = Widget_Text;
wc.draw = drv_generic_graphic_draw;
unsigned char drv_generic_graphic_black(const int row, const int col)
{
- RGBA p = drv_generic_graphic_blend(row, col);
- if (p.R > 127 || p.G > 127 || p.B > 127) {
- return 0;
- }
- return 1;
+ return drv_generic_graphic_gray(row, col) < 127;
}
Port '/dev/parports/0'
Font '6x8'
Contrast 15
+ Inverted 0
}
Display LPH7508-serdisplib {
Display ctinclud {
Driver 'serdisplib'
- Port 'USB:0x07c0/0x1501'
+ Port 'USB:7c0/1501'
Model 'CTINCLUD'
Options ''
+ Inverted 0
}
Display XWindow {
Widget ImageTest {
class 'Image'
- file 'Michi.png'
+ file 'tux.png'
update 1000
visible 1
+ inverted 0
}
Layout Default {
}
Layout TestImage {
- Row4 {
- Col1 'OS'
- }
- Row2 {
- Col1 'CPU'
- Col10 'RAM'
- }
Layer 2 {
X1.Y1 'ImageTest'
}
#Display 'M50530-24x8'
#Display 'LCDTerm'
#Display 'SimpleLCD'
-Display 'BA63'
+#Display 'BA63'
#Display 'CT20x4'
#Display 'T6963-240x64'
#Display 'XWindow'
#Display 'Trefon'
#Display 'LCD2USB'
#Display 'LPH7508-serdisplib'
-#Display 'LPH7508'
+Display 'LPH7508'
#Display 'ctinclud'
-Layout 'Default'
+#Layout 'Default'
#Layout 'TestLayer'
-#Layout 'TestImage'
+Layout 'TestImage'
#Layout 'L8x2'
#Layout 'L16x1'
#Layout 'L16x2'
-/* $Id: widget_image.c,v 1.5 2006/02/25 13:36:33 geronet Exp $
+/* $Id: widget_image.c,v 1.6 2006/04/09 14:17:50 reinelt Exp $
*
* image widget handling
*
*
*
* $Log: widget_image.c,v $
+ * 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
*
}
/* finally really render it */
- for (x = 0; x < gdImage->sx; x++) {
- for (y = 0; y < gdImage->sy; y++) {
- int p = gdImageGetTrueColorPixel(gdImage, x, y);
- int a = gdTrueColorGetAlpha(p);
- int i = y * Image->width + x;
- Image->bitmap[i].R = gdTrueColorGetRed(p);
- Image->bitmap[i].G = gdTrueColorGetGreen(p);
- Image->bitmap[i].B = gdTrueColorGetBlue(p);
- /* GD's alpha is 0 (opaque) to 127 (tranparanet) */
- /* our alpha is 0 (transparent) to 255 (opaque) */
- Image->bitmap[i].A = (a == 127) ? 0 : 255 - 2 * a;
+ if (Image->visible) {
+ for (x = 0; x < gdImage->sx; x++) {
+ for (y = 0; y < gdImage->sy; y++) {
+ int p = gdImageGetTrueColorPixel(gdImage, x, y);
+ int a = gdTrueColorGetAlpha(p);
+ int i = y * Image->width + x;
+ Image->bitmap[i].R = gdTrueColorGetRed(p);
+ Image->bitmap[i].G = gdTrueColorGetGreen(p);
+ Image->bitmap[i].B = gdTrueColorGetBlue(p);
+ /* GD's alpha is 0 (opaque) to 127 (tranparanet) */
+ /* our alpha is 0 (transparent) to 255 (opaque) */
+ Image->bitmap[i].A = (a == 127) ? 0 : 255 - 2 * a;
+ if (Image->inverted) {
+ Image->bitmap[i].R = 255 - Image->bitmap[i].R;
+ Image->bitmap[i].G = 255 - Image->bitmap[i].G;
+ Image->bitmap[i].B = 255 - Image->bitmap[i].B;
+ }
+ }
}
}
}
if (Image->visible_tree != NULL) {
Eval(Image->visible_tree, &result);
Image->visible = R2N(&result);
- if (Image->visible < 0)
- Image->visible = 0;
+ Image->visible = Image->visible > 0;
+ DelResult(&result);
+ }
+
+ Image->inverted = 0;
+ if (Image->inverted_tree != NULL) {
+ Eval(Image->inverted_tree, &result);
+ Image->inverted = R2N(&result);
+ Image->inverted = Image->inverted > 0;
DelResult(&result);
}
+
#ifdef WITH_GD
/* render image into bitmap */
widget_image_render(W->name, Image);
Image->file_expr = cfg_get_raw(section, "file", NULL);
Image->update_expr = cfg_get_raw(section, "update", NULL);
Image->visible_expr = cfg_get_raw(section, "visible", NULL);
+ Image->inverted_expr = cfg_get_raw(section, "inverted", NULL);
/* sanity checks */
if (Image->file_expr == NULL || *Image->file_expr == '\0') {
Compile(Image->file_expr, &Image->file_tree);
Compile(Image->update_expr, &Image->update_tree);
Compile(Image->visible_expr, &Image->visible_tree);
+ Compile(Image->inverted_expr, &Image->inverted_tree);
free(section);
Self->data = Image;
DelTree(Image->file_tree);
DelTree(Image->update_tree);
DelTree(Image->visible_tree);
+ DelTree(Image->inverted_tree);
free(Self->data);
Self->data = NULL;
}
-/* $Id: widget_image.h,v 1.3 2006/02/25 13:36:33 geronet Exp $
+/* $Id: widget_image.h,v 1.4 2006/04/09 14:17:50 reinelt Exp $
*
* image widget handling
*
*
*
* $Log: widget_image.h,v $
+ * Revision 1.4 2006/04/09 14:17:50 reinelt
+ * autoconf/library fixes, image and graphic display inversion
+ *
* Revision 1.3 2006/02/25 13:36:33 geronet
* updated indent.sh, applied coding style
*
int update; /* update interval (msec) */
char *visible_expr; /* expression for visibility */
void *visible_tree; /* pre-compiled expression for visibility */
- int visible; /* icon visible? */
+ int visible; /* image visible? */
+ char *inverted_expr; /* expression for inversion */
+ void *inverted_tree; /* pre-compiled expression for inversion */
+ int inverted; /* image inverted? */
} WIDGET_IMAGE;
extern WIDGET_CLASS Widget_Image;