Welcome to the EyeBot
Version 7 - RPi1
A Controller For Various Hardware IO
|
Defines functions to interact with the LCD screen. More...
#include "lcd.h"
Functions | |
XColor | getColor (char *colorName) |
Return the XColor color from the color name. More... | |
XColor | RGBtoXCol (COLOR rgb) |
Convcerts an RGB colour to XColor. More... | |
int | LCDDrawFrame (int x1, int y1, int x2, int y2, XColor color) |
Draw a bordered frame. More... | |
int | LCDRect (int x1, int y1, int x2, int y2, COLOR col) |
A wrapper for LCDDrawFrame. More... | |
int | LCDDrawMenu (void) |
Draw the menu. More... | |
int | LCDDrawList (void) |
Draw the list. More... | |
int | LCDInit () |
Initialize the LCD. More... | |
int | LCDClear (void) |
Clear the LCD display and all display buffers ie. turn it black. More... | |
int | LCDSetMode (HWORD mode) |
Update the internal mode flag bits. More... | |
HWORD | LCDGetMode (void) |
Get the internal mode flag bits. More... | |
int | LCDResetMode (HWORD mode) |
Reset the internal mode flag bits to a previously saved mode. More... | |
int | LCDMenu (char *string1, char *string2, char *string3, char *string4) |
Set menu entries in KEY_CLASSIC mode (4-buttons). Also sets the LCD_SHOWMENU flag and refresh the LCD. More... | |
int | LCDMenuIRaw (int pos, char *string, XColor fgcol, XColor bgcol, void *userp) |
Set specific menu entry in KEY_CLASSIC mode (index given by pos). Color customization for specific key is now possible (fgcol/bgcol). A user-specific data can be linked to the menu using userp pointer. Will also set the LCD_SHOWMENU flag and refresh the LCD. More... | |
int | LCDMenuI (int pos, char *string, COLOR fg, COLOR bg) |
A wrapper for LCDMenuIRaw. More... | |
MENU_ITEM * | LCDMenuItem (int index) |
Return the menuitem at a given position. More... | |
int | LCDList (LIST_MENU *menulist) |
Setup the list menu display and update appropriate info in the LIST_MENU structure pointed by menulist (e.g. scroll, count). Will also set the LCD_LISTMENU flag and refresh the LCD. More... | |
int | LCDSetList (LIST_MENU *menulist) |
Unlike LCDList(), this will blindly assign menulist to the mainlist for display. Doesn't update anything in the menulist structure, nor modify any internal flags. Useful to maintain multiple lists for menu display. More... | |
LIST_MENU * | LCDGetList (void) |
Get the currently active list menu. More... | |
RECT * | LCDListBox (int pos) |
Get the frame info of a specific list item in form of a RECT structure. More... | |
MENU_ITEM * | LCDListActiveItem (void) |
Get the selected menuitem in the list menu – using index & start variable in LIST_MENU. Will return 0x0 (NUL) if no item is currently selected. More... | |
int | LCDAreaRaw (int x1, int y1, int x2, int y2, XColor color) |
Draw a color-filled rectangle with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate. More... | |
int | LCDArea (int x1, int y1, int x2, int y2, COLOR col, int fill) |
A wrapper for LCDAreaRaw. More... | |
int | LCDFrame (int x1, int y1, int x2, int y2, XColor color) |
Draw a color rectangle frame with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate. More... | |
int | LCDTextColor (XColor fgcol, XColor bgcol, char colorflags) |
Set the default color for text (including background) and related flags (e.g. for transparent background). More... | |
int | LCDSetColor (COLOR fg, COLOR bg) |
A wrapper for LCDTextColor. More... | |
int | LCDSetFontRaw (char *fontAlias) |
Sets the font using alias in Xlib. More... | |
int | LCDSetFont (int fontName, int variation) |
Sets the font using fontName and variation. More... | |
int | LCDSetFontSize (int fontsize) |
Sets the font size. More... | |
int | LCDPrintfFont (EYEFONT eyeFont, const char *format,...) |
Print formatted string to LCD and refresh LCD. Cursor position is updated. More... | |
int | LCDPrintf (const char *format,...) |
Print formatted string to LCD and refresh LCD. Cursor position is updated. More... | |
int | LCDSetPrintf (int row, int column, const char *format,...) |
LCDPrintf with text position specified. More... | |
int | LCDSetPrintfFont (int row, int column, EYEFONT eyeFont, const char *format,...) |
LCDPrintf with text position and text colour specified. More... | |
int | LCDSetPos (int row, int column) |
Set the text cursor position to (row, column). More... | |
int | LCDGetPos (int *row, int *column) |
Get the text cursor position. More... | |
int | LCDSetPixel (int x, int y, XColor color) |
Sets the color of the pixel at (x,y) coordinate to color. More... | |
int | LCDPixel (int x, int y, COLOR col) |
A wrapper for LCDSet Pixel. More... | |
XColor | LCDGetPixel (int x, int y) |
Get the RGB color value of the pixel at (x,y) coordinate. More... | |
XColor | InvertColor (XColor color) |
Invert a RGB color. More... | |
int | LCDPixelInvert (int x, int y) |
Bit-invert the color of the pixel at (x,y) coordinate. More... | |
int | LCDCircle (int x1, int y1, int size, COLOR col, int fill) |
Draws a circle. More... | |
int | LCDCircleInvert (int x1, int y1, int r) |
Inverts the pixels inside of the given circle. More... | |
int | LCDLineRaw (int x1, int y1, int x2, int y2, XColor color) |
Draw a color line from (x1,y1) to (x2,y2). More... | |
int | LCDLine (int x1, int y1, int x2, int y2, COLOR col) |
A wrapper for LCDLineRaw. More... | |
int | LCDLineInvert (int x1, int y1, int x2, int y2) |
Draw a line from (x1,y1) to (x2,y2). The line pixels will invert the color of existing pixels. More... | |
int | LCDAreaInvert (int x1, int y1, int x2, int y2) |
Draw a rectangle with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate. The pixels in the specified area will invert the color of existing pixels. More... | |
RECT | LCDTextBar (int row, int column, int length, int fill, XColor color) |
Draw a textbar for text starting at position (row, column) until (row, column+length). The textbar will take about 25%-50% of text height & width to draw its frame. The fill parameter will define how much of the text bar should be 'filled' with color (like a progress bar). More... | |
int | LCDNeedRefresh (void) |
Indicate if the LCD need to be refreshed. More... | |
int | LCDRelease () |
Release the LCD. More... | |
int | LCDRefresh (void) |
Refresh the screen (i.e write display buffers to the framebuffer device). Refreshes the menu. More... | |
int | LCDRefresh2 (void) |
Refresh the screen (i.e write display buffers to the framebuffer device). Does not refresh the menu. More... | |
int | LCDRefresh3 (void) |
Refresh the screen (i.e write display buffers to the framebuffer device). Does not refresh the menu or the listmenu. More... | |
int | LCDGetFBInfo (FBINFO *pinfo) |
Get display information and save to structure pointed by pinfo. Cursor info needs LCDInit() for textsize. More... | |
int | LCDListCount (void) |
Get the number of list items supported by the current display (text) configuration. This includes the item for title bar - thus, different from count variable in LIST_MENU as updated by an LCDList() call. More... | |
int | LCDListIndex (int index) |
Set the list index. More... | |
int | LCDListScrollUp (void) |
Scrolls the list display up. Menu index is not altered. If the active menu item goes out of focus, the index becomes negative (no item selected). More... | |
int | LCDListScrollDown (void) |
Scrolls the list display down. Menu index is not altered. If the active menu item goes out of focus, the index becomes negative (no item selected). More... | |
int | get_byte_order (void) |
XImage * | create_image_from_buffer (Display *dis, int screen, u_char *buf, int width, int height) |
int | LCDPutImageRGB (int xpos, int ypos, int xsize, int ysize, BYTE *data) |
Place a RGB color image (24bpp) at (xpos,ypos) position on the LCD screen. More... | |
int | convertGrey (BYTE *greyimage, BYTE *newImage) |
Converts a color image to grey. More... | |
int | LCDPutImageGrey (int xpos, int ypos, int xsize, int ysize, BYTE *image) |
Place a Grey image (24bpp) at (xpos,ypos) position on the LCD screen. More... | |
int | LCDImageStart (int t, int x, int y, int xs, int ys) |
Sets the parameters for subsequent image draws. More... | |
int | LCDImage (BYTE *img) |
Draws a colour (RGB) image to the LCD. More... | |
int | LCDImageGray (BYTE *greyImage) |
Draws a grey image to the LCD. More... | |
int | LCDGetSize (int *x, int *y) |
Get LCD resolution in pixels. More... | |
Defines functions to interact with the LCD screen.
Defines functions to connect wirelessly between Eyebots.
int convertGrey | ( | BYTE * | greyimage, |
BYTE * | newImage | ||
) |
Converts a color image to grey.
greyimage | : the input image |
newImage | the output image |
int get_byte_order | ( | void | ) |
Starting the Printing Image functions
XColor getColor | ( | char * | colorName | ) |
Return the XColor color from the color name.
char* | colorName |
XColor InvertColor | ( | XColor | color | ) |
Invert a RGB color.
XColor | color : RGB color value |
int LCDArea | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
COLOR | col, | ||
int | fill | ||
) |
A wrapper for LCDAreaRaw.
int | x1 : X-coordinate of top-left pixel |
int | y1 : Y-coordinate of top-left pixel |
int | x2 : X-coordinate of bottom-right pixel |
int | y2 : Y-coordinate of bottom-right pixel |
XColor | color : RGB fill color value |
int LCDAreaInvert | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Draw a rectangle with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate. The pixels in the specified area will invert the color of existing pixels.
int | x1 : X-coordinate of top-left pixel |
int | y1 : Y-coordinate of top-left pixel |
int | x2 : X-coordinate of bottom-right pixel |
int | y2 : Y-coordinate of bottom-right pixel |
int LCDAreaRaw | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
XColor | color | ||
) |
Draw a color-filled rectangle with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate.
int | x1 : X-coordinate of top-left pixel |
int | y1 : Y-coordinate of top-left pixel |
int | x2 : X-coordinate of bottom-right pixel |
int | y2 : Y-coordinate of bottom-right pixel |
XColor | color : RGB fill color value |
int LCDCircle | ( | int | x1, |
int | y1, | ||
int | size, | ||
COLOR | col, | ||
int | fill | ||
) |
Draws a circle.
int | x1 : X-coordinate of the centre |
int | y1 : Y-coordinate of the centre |
int | size : radius of the circle |
COLOR | col: the color of the circle |
int | fill : fill(1) or no fill(0) |
int LCDCircleInvert | ( | int | x1, |
int | y1, | ||
int | r | ||
) |
Inverts the pixels inside of the given circle.
int | x1 : X-coordinate of the centre |
int | y1 : Y-coordinate of the centre |
int | r the radius of the circle |
int LCDClear | ( | void | ) |
Clear the LCD display and all display buffers ie. turn it black.
int LCDDrawFrame | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
XColor | color | ||
) |
Draw a bordered frame.
int | x1 : X-coordinate of top-left pixel |
int | y1 : Y-coordinate of top-left pixel |
int | x2 : X-coordinate of bottom-right pixel |
int | y2 : Y-coordinate of bottom-right pixel |
int LCDDrawList | ( | void | ) |
Draw the list.
int LCDDrawMenu | ( | void | ) |
Draw the menu.
int LCDFrame | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
XColor | color | ||
) |
Draw a color rectangle frame with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate.
int | x1 : X-coordinate of top-left pixel |
int | y1 : Y-coordinate of top-left pixel |
int | x2 : X-coordinate of bottom-right pixel |
int | y2 : Y-coordinate of bottom-right pixel |
XColor | color : RGB fill color value |
int LCDGetFBInfo | ( | FBINFO * | pinfo | ) |
Get display information and save to structure pointed by pinfo. Cursor info needs LCDInit() for textsize.
FBINFO* | pinfo : Pointer to storage for screen & cursor info |
LIST_MENU* LCDGetList | ( | void | ) |
Get the currently active list menu.
HWORD LCDGetMode | ( | void | ) |
Get the internal mode flag bits.
XColor LCDGetPixel | ( | int | x, |
int | y | ||
) |
Get the RGB color value of the pixel at (x,y) coordinate.
int | x : X-coordinate of the pixel |
int | y : Y-coordinate of the pixel |
int LCDGetPos | ( | int * | row, |
int * | column | ||
) |
Get the text cursor position.
int* | row : Pointer to cursor row index |
int* | column : Pointer to cursor column index |
int LCDGetSize | ( | int * | x, |
int * | y | ||
) |
Get LCD resolution in pixels.
x | : Where to store the width of the LCD |
y | : Where to store the height of the LCD |
int LCDImage | ( | BYTE * | img | ) |
Draws a colour (RGB) image to the LCD.
img | : A pointer to the BYTE buffer of the image |
int LCDImageGray | ( | BYTE * | greyImage | ) |
Draws a grey image to the LCD.
img | : A pointer to the BYTE buffer of the image |
int LCDImageStart | ( | int | t, |
int | x, | ||
int | y, | ||
int | xs, | ||
int | ys | ||
) |
Sets the parameters for subsequent image draws.
int | t : the image type |
int | x : x-coordinate of top-left image position |
int | y : y-coordinate of top-left image position |
int | xs : Image width |
int | ys : Image height |
int LCDInit | ( | ) |
Initialize the LCD.
int LCDLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
COLOR | col | ||
) |
A wrapper for LCDLineRaw.
int | x1 : X-coordinate of first pixel |
int | y1 : Y-coordinate of first pixel |
int | x2 : X-coordinate of second pixel |
int | y2 : Y-coordinate of second pixel |
col | : RGB color value for the pixel |
int LCDLineInvert | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Draw a line from (x1,y1) to (x2,y2). The line pixels will invert the color of existing pixels.
int | x1 : X-coordinate of first pixel |
int | y1 : Y-coordinate of first pixel |
int | x2 : X-coordinate of second pixel |
int | y2 : Y-coordinate of second pixel |
int LCDLineRaw | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
XColor | color | ||
) |
Draw a color line from (x1,y1) to (x2,y2).
int | x1 : X-coordinate of first pixel |
int | y1 : Y-coordinate of first pixel |
int | x2 : X-coordinate of second pixel |
int | y2 : Y-coordinate of second pixel |
XColor | color : RGB color value for the pixel |
int LCDList | ( | LIST_MENU * | menulist | ) |
Setup the list menu display and update appropriate info in the LIST_MENU structure pointed by menulist (e.g. scroll, count). Will also set the LCD_LISTMENU flag and refresh the LCD.
LIST_MENU* | menulist : Listmenu to be used for display |
MENU_ITEM* LCDListActiveItem | ( | void | ) |
RECT* LCDListBox | ( | int | pos | ) |
int LCDListCount | ( | void | ) |
int LCDListIndex | ( | int | index | ) |
Set the list index.
int | index : List index |
int LCDListScrollDown | ( | void | ) |
Scrolls the list display down. Menu index is not altered. If the active menu item goes out of focus, the index becomes negative (no item selected).
int LCDListScrollUp | ( | void | ) |
Scrolls the list display up. Menu index is not altered. If the active menu item goes out of focus, the index becomes negative (no item selected).
int LCDMenu | ( | char * | string1, |
char * | string2, | ||
char * | string3, | ||
char * | string4 | ||
) |
Set menu entries in KEY_CLASSIC mode (4-buttons). Also sets the LCD_SHOWMENU flag and refresh the LCD.
char* | string1 : Menu entry for KEY1 in classic mode |
char* | string2 : Menu entry for KEY2 in classic mode |
char* | string3 : Menu entry for KEY3 in classic mode |
char* | string4 : Menu entry for KEY4 in classic mode |
int LCDMenuI | ( | int | pos, |
char * | string, | ||
COLOR | fg, | ||
COLOR | bg | ||
) |
A wrapper for LCDMenuIRaw.
int | pos : Select menu entry in classic mode (from 1->4) |
char* | string : Menu entry for the key at specified index |
XColor | fgcol : Textcolor for the menu |
XColor | bgcol : Background color for the menu |
void* | userp : A general purpose pointer for user-specific data |
int LCDMenuIRaw | ( | int | pos, |
char * | string, | ||
XColor | fgcol, | ||
XColor | bgcol, | ||
void * | userp | ||
) |
Set specific menu entry in KEY_CLASSIC mode (index given by pos). Color customization for specific key is now possible (fgcol/bgcol). A user-specific data can be linked to the menu using userp pointer. Will also set the LCD_SHOWMENU flag and refresh the LCD.
int | pos : Select menu entry in classic mode |
char* | string : Menu entry for the key at specified index |
XColor | fgcol : Textcolor for the menu |
XColor | bgcol : Background color for the menu |
void* | userp : A general purpose pointer for user-specific data |
MENU_ITEM* LCDMenuItem | ( | int | index | ) |
Return the menuitem at a given position.
int | index : position of the menuitem (from 1->4) |
int LCDNeedRefresh | ( | void | ) |
Indicate if the LCD need to be refreshed.
int LCDPixel | ( | int | x, |
int | y, | ||
COLOR | col | ||
) |
A wrapper for LCDSet Pixel.
int | x : X-coordinate of the pixel |
int | y : Y-coordinate of the pixel |
col | : RGB color value for the pixel |
int LCDPixelInvert | ( | int | x, |
int | y | ||
) |
Bit-invert the color of the pixel at (x,y) coordinate.
int | x : X-coordinate of the pixel |
int | y : Y-coordinate of the pixel |
int LCDPrintf | ( | const char * | format, |
... | |||
) |
Print formatted string to LCD and refresh LCD. Cursor position is updated.
const | char* format : Formatted string |
int LCDPrintfFont | ( | EYEFONT | eyeFont, |
const char * | format, | ||
... | |||
) |
Print formatted string to LCD and refresh LCD. Cursor position is updated.
const | char* format : Formatted string |
int LCDPutImageGrey | ( | int | xpos, |
int | ypos, | ||
int | xsize, | ||
int | ysize, | ||
BYTE * | image | ||
) |
Place a Grey image (24bpp) at (xpos,ypos) position on the LCD screen.
int | xpos : X-coordinate of top-left image position |
int | ypos : Y-coordinate of top-left image position |
int | xsize : Image width |
int | ysize : Image height |
BYTE* | data : Pointer to image data (24-bit per pixel) |
int LCDPutImageRGB | ( | int | xpos, |
int | ypos, | ||
int | xsize, | ||
int | ysize, | ||
BYTE * | data | ||
) |
Place a RGB color image (24bpp) at (xpos,ypos) position on the LCD screen.
int | xpos : X-coordinate of top-left image position |
int | ypos : Y-coordinate of top-left image position |
int | xsize : Image width |
int | ysize : Image height |
BYTE* | data : Pointer to image data (24-bit per pixel) |
int LCDRect | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
COLOR | col | ||
) |
A wrapper for LCDDrawFrame.
int | x1 : X-coordinate of top-left pixel |
int | y1 : Y-coordinate of top-left pixel |
int | x2 : X-coordinate of bottom-right pixel |
int | y2 : Y-coordinate of bottom-right pixel |
int LCDRefresh | ( | void | ) |
Refresh the screen (i.e write display buffers to the framebuffer device). Refreshes the menu.
int LCDRefresh2 | ( | void | ) |
Refresh the screen (i.e write display buffers to the framebuffer device). Does not refresh the menu.
int LCDRefresh3 | ( | void | ) |
Refresh the screen (i.e write display buffers to the framebuffer device). Does not refresh the menu or the listmenu.
int LCDRelease | ( | ) |
Release the LCD.
int LCDResetMode | ( | HWORD | mode | ) |
Reset the internal mode flag bits to a previously saved mode.
HWORD | mode : Mode flag - bit XORed |
int LCDSetColor | ( | COLOR | fg, |
COLOR | bg | ||
) |
A wrapper for LCDTextColor.
fg | : Default color for text |
bg | : Default color for text background |
int LCDSetFont | ( | int | fontName, |
int | variation | ||
) |
Sets the font using fontName and variation.
int | fontNmae the type of font |
int | variation the variation (NORMAL/BOLD) |
int LCDSetFontRaw | ( | char * | fontAlias | ) |
Sets the font using alias in Xlib.
fontAlias | the alias for the font |
int LCDSetFontSize | ( | int | fontsize | ) |
Sets the font size.
int | fontsize the size of font |
int LCDSetList | ( | LIST_MENU * | menulist | ) |
Unlike LCDList(), this will blindly assign menulist to the mainlist for display. Doesn't update anything in the menulist structure, nor modify any internal flags. Useful to maintain multiple lists for menu display.
LIST_MENU* | menulist : Listmenu to be used for display |
int LCDSetMode | ( | HWORD | mode | ) |
Update the internal mode flag bits.
HWORD | mode : LCD Mode flag |
int LCDSetPixel | ( | int | x, |
int | y, | ||
XColor | color | ||
) |
Sets the color of the pixel at (x,y) coordinate to color.
int | x : X-coordinate of the pixel |
int | y : Y-coordinate of the pixel |
XColor | color : color value for the pixel |
int LCDSetPos | ( | int | row, |
int | column | ||
) |
Set the text cursor position to (row, column).
int | row : Text cursor row index |
int | column : Text cursor column index |
int LCDSetPrintf | ( | int | row, |
int | column, | ||
const char * | format, | ||
... | |||
) |
LCDPrintf with text position specified.
int | row : Cursor position |
int | column : Cursor position |
const | char* format : Formatted string |
int LCDSetPrintfFont | ( | int | row, |
int | column, | ||
EYEFONT | eyeFont, | ||
const char * | format, | ||
... | |||
) |
LCDPrintf with text position and text colour specified.
int | row : Cursor position |
int | column : Cursor position |
XColor | colour : the colour of the text |
const | char* format : Formatted string |
RECT LCDTextBar | ( | int | row, |
int | column, | ||
int | length, | ||
int | fill, | ||
XColor | color | ||
) |
Draw a textbar for text starting at position (row, column) until (row, column+length). The textbar will take about 25%-50% of text height & width to draw its frame. The fill parameter will define how much of the text bar should be 'filled' with color (like a progress bar).
int | row : Start text cursor position |
int | column : Start text cursor position |
int | length : Text length of the bar |
int | fill : Percentage of textbar to be filled |
XColor | color : Fill color for the textbar |
int LCDTextColor | ( | XColor | fgcol, |
XColor | bgcol, | ||
char | colorflags | ||
) |
Set the default color for text (including background) and related flags (e.g. for transparent background).
XColor | fgcol : Default color for text |
XColor | bgcol : Default color for text background |
char | colorflags : Mode flag for text color |
Valid value for colorflags :
XColor RGBtoXCol | ( | COLOR | rgb | ) |
Convcerts an RGB colour to XColor.
rgb | the COLOR object |