Hexley Ball / RA8875_fork

Fork of RA8875 by David Smart

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DisplayDefs.h Source File

DisplayDefs.h

00001 #ifndef DISPLAYDEFS_H
00002 #define DISPLAYDEFS_H
00003 
00004 #define RGB(r,g,b) ( ((r<<8)&0xF800) | ((g<<3)&0x07E0) | (b>>3) )
00005 
00006 typedef uint16_t color_t;
00007 
00008 /// return values from functions
00009 typedef enum
00010 {
00011     noerror,                ///< no errors, command completed successfully
00012     bad_parameter,          ///< one or more parameters are invalid
00013     file_not_found,         ///< specified file could not be found
00014     not_bmp_format,         ///< file is not a .bmp file
00015     not_ico_format,         ///< file is not a .ico file
00016     not_supported_format,   ///< file format is not yet supported
00017     image_too_big,          ///< image is too large for the screen
00018     not_enough_ram,         ///< could not allocate ram for scanline
00019 } RetCode_t;
00020 
00021 /// type that manages locations, which is typically an x or y pixel location,
00022 /// which can range from -N to +N (even if the screen is 0 to +n). @see textloc_t.
00023 typedef int16_t loc_t;
00024 
00025 /// type that manages text locations, which are row or column values in
00026 /// units of character, not pixel. @see loc_t.
00027 typedef uint16_t textloc_t;
00028 
00029 /// type that manages dimensions of width or height, which range from 0 to N.
00030 typedef uint16_t dim_t;
00031 
00032 /// type that manages x,y pairs
00033 typedef struct
00034 {
00035     loc_t x;             ///< x value in the point
00036     loc_t y;             ///< y value in the point
00037 } point_t;
00038 
00039 /// color type definition to let the compiler help keep us honest.
00040 /// 
00041 /// colors can be defined with the RGB(r,g,b) macro, and there
00042 /// are a number of predefined colors:
00043 /// - Black,    Blue,       Green,       Cyan,
00044 /// - Red,      Magenta,    Brown,       Gray,
00045 /// - Charcoal, BrightBlue, BrightGreen, BrightCyan,
00046 /// - Orange,   Pink,       Yellow,      White
00047 ///
00048 typedef uint16_t color_t;   
00049 
00050 /// background fill info for drawing Text, Rectangles, RoundedRectanges, Circles, Ellipses and Triangles.
00051 typedef enum
00052 {
00053     NOFILL,     ///< do not fill the object with the background color
00054     FILL        ///< fill the object space with the background color
00055 } fill_t;
00056 
00057 #endif // DISPLAYDEFS_H