37 #ifndef __TUM_DRAW_H__
38 #define __TUM_DRAW_H__
58 #define WINDOW_TITLE "FreeRTOS Emulator"
65 #define SCREEN_WIDTH 640
72 #define SCREEN_HEIGHT 480
73 #endif //SCREEN_HEIGHT
83 #define TUMBlue (unsigned int)(0x0065bd)
84 #define Red (unsigned int)(0xFF0000)
85 #define Green (unsigned int)(0x00FF00)
86 #define Blue (unsigned int)(0x0000FF)
87 #define Yellow (unsigned int)(0xFFFF00)
88 #define Aqua (unsigned int)(0x00FFFF)
89 #define Fuchsia (unsigned int)(0xFF00FF)
90 #define White (unsigned int)(0xFFFFFF)
91 #define Black (unsigned int)(0x000000)
92 #define Gray (unsigned int)(0x808080)
94 #define Magenta Fuchsia
96 #define Lime (unsigned int)(0x00FF00)
97 #define Maroon (unsigned int)(0x800000)
98 #define Navy (unsigned int)(0x000080)
99 #define Olive (unsigned int)(0x808000)
100 #define Purple (unsigned int)(0x800080)
101 #define Silver (unsigned int)(0xC0C0C0)
102 #define Teal (unsigned int)(0x008080)
103 #define Orange (unsigned int)(0xFFA500)
104 #define Pink (unsigned int)(0xFFC0CB)
105 #define Skyblue (unsigned int)(0x87CEEB)
112 SPRITE_SEQUENCE_HORIZONTAL_POS,
113 SPRITE_SEQUENCE_HORIZONTAL_NEG,
114 SPRITE_SEQUENCY_VERTICAL_POS,
115 SPRITE_SEQUENCY_VERTICAL_NEG,
216 void tumDrawDuplicateBuffer(
void);
228 int tumDrawEllipse(
signed short x,
signed short y,
signed short rx,
229 signed short ry,
unsigned int colour);
245 int tumDrawArc(
signed short x,
signed short y,
signed short radius,
246 signed short start,
signed short end,
unsigned int colour);
260 int tumDrawText(
char *str,
signed short x,
signed short y,
unsigned int colour);
282 int tumDrawBox(
signed short x,
signed short y,
signed short w,
signed short h,
283 unsigned int colour);
296 signed short h,
unsigned int colour);
307 int tumDrawCircle(
signed short x,
signed short y,
signed short radius,
308 unsigned int colour);
321 int tumDrawLine(
signed short x1,
signed short y1,
signed short x2,
322 signed short y2,
unsigned char thickness,
unsigned int colour);
447 int tumDrawImage(
char *filename,
signed short x,
signed short y);
483 int tumDrawArrow(
signed short x1,
signed short y1,
signed short x2,
484 signed short y2,
signed short head_length,
485 unsigned char thickness,
unsigned int colour);
497 unsigned sprite_cols,
unsigned sprite_rows);
519 unsigned start_row,
unsigned start_col,
534 char *sequence_name,
unsigned frame_period_ms);
int tumDrawGetLoadedImageSize(image_handle_t img, int *w, int *h)
Retrieves bother the image's width and height when drawn to screen, ie. after scaling.
Definition: TUM_Draw.c:1500
sequence_handle_t tumDrawAnimationSequenceInstantiate(animation_handle_t animation, char *sequence_name, unsigned frame_period_ms)
Creates an instance of an animation from a loaded animation object and a sequence name of a sequence ...
Definition: TUM_Draw.c:573
int tumDrawAnimationDrawFrame(sequence_handle_t sequence, unsigned ms_timestep, int x, int y)
Draws the target intantiated animation sequence at a given location.
Definition: TUM_Draw.c:1580
char * tumGetErrorMessage(void)
Returns a string error message from the TUM Draw back end.
Definition: TUM_Draw.c:1023
signed short y
Definition: TUM_Draw.h:123
struct coord coord_t
Holds a pixel co-ordinate.
image_handle_t tumDrawLoadImage(char *filename)
Loads an image file from disk, loaded image file can be closed using tumDrawFreeLoadedImage()
Definition: TUM_Draw.c:1426
int tumDrawFreeLoadedImage(image_handle_t *img)
Closes a loaded image and frees all memory used by the image structure.
Definition: TUM_Draw.c:1431
int tumDrawSetGlobalXOffset(int offset)
Sets the global draw position offset's X axis value.
Definition: TUM_Draw.c:1659
int tumDrawGetLoadedImageWidth(image_handle_t img)
Retrieves the image's width when drawn to screen, ie. after scaling.
Definition: TUM_Draw.c:1482
int tumDrawBindThread(void)
Transfers the drawing ability to the calling thread/taskd.
Definition: TUM_Draw.c:1108
animation_handle_t tumDrawAnimationCreate(image_handle_t spritesheet, unsigned sprite_cols, unsigned sprite_rows)
Creates an animation object with an attached spritesheet that must be loaded prior as an image.
Definition: TUM_Draw.c:470
void * animation_handle_t
Handle used to reference a loaded animation spritesheet, an invalid spritesheet will have a NULL hand...
Definition: TUM_Draw.h:141
int tumDrawEllipse(signed short x, signed short y, signed short rx, signed short ry, unsigned int colour)
Draws an ellipse on the screen.
Definition: TUM_Draw.c:1208
int tumDrawGetGlobalXOffset(int *offset)
Retrieves a copy of the current global X axis drawing offset.
Definition: TUM_Draw.c:1689
signed short x
Definition: TUM_Draw.h:122
int tumGetImageSize(char *filename, int *w, int *h)
Gets the width and height of an image.
Definition: TUM_Draw.c:1535
int tumDrawLoadedImage(image_handle_t img, signed short x, signed short y)
Draws a loaded image to the screen.
Definition: TUM_Draw.c:1446
int tumDrawBox(signed short x, signed short y, signed short w, signed short h, unsigned int colour)
Draws a filled box on the screen.
Definition: TUM_Draw.c:1251
int tumGetTextSize(char *str, int *width, int *height)
Finds the width and height of a strings bounding box.
Definition: TUM_Draw.c:1200
int tumDrawInit(char *path)
Initializes the TUM Draw backend.
Definition: TUM_Draw.c:1028
void * sequence_handle_t
Returns an instance of an animation;.
Definition: TUM_Draw.h:150
int tumDrawFilledBox(signed short x, signed short y, signed short w, signed short h, unsigned int colour)
Draws an unfilled box on the screen.
Definition: TUM_Draw.c:1237
int tumDrawUpdateScreen(void)
Executes the queued draw jobs.
Definition: TUM_Draw.c:974
int tumDrawLine(signed short x1, signed short y1, signed short x2, signed short y2, unsigned char thickness, unsigned int colour)
Draws a line on the screen.
Definition: TUM_Draw.c:1309
int tumDrawPoly(coord_t *points, int n, unsigned int colour)
Draws a polygon on the screen.
Definition: TUM_Draw.c:1324
void tumDrawExit(void)
Exits the TUM Draw backend.
Definition: TUM_Draw.c:1160
Definition: TUM_Draw.c:106
int tumDrawArc(signed short x, signed short y, signed short radius, signed short start, signed short end, unsigned int colour)
Draws an arc on the screen.
Definition: TUM_Draw.c:1222
int tumDrawCircle(signed short x, signed short y, signed short radius, unsigned int colour)
Draws a filled circle on the screen.
Definition: TUM_Draw.c:1296
int tumDrawSetGlobalYOffset(int offset)
Sets the global draw position offset's Y axis value.
Definition: TUM_Draw.c:1674
sprite_sequence_direction
Defines the direction that the animation appears on the spritesheet.
Definition: TUM_Draw.h:111
int tumDrawTriangle(coord_t *points, unsigned int colour)
Draws a triangle on the screen.
Definition: TUM_Draw.c:1342
int tumDrawClear(unsigned int colour)
Sets the screen to a solid colour.
Definition: TUM_Draw.c:1280
int tumDrawImage(char *filename, signed short x, signed short y)
Draws an image on the screen.
Definition: TUM_Draw.c:1516
int tumDrawSetLoadedImageScale(image_handle_t img, float scale)
Scales a loaded image, the scale is a value where, for example, 1.0 represents the original image's s...
Definition: TUM_Draw.c:1462
int tumDrawGetLoadedImageHeight(image_handle_t img)
Retrieves the image's height when drawn to screen, ie. after scaling.
Definition: TUM_Draw.c:1491
image_handle_t tumDrawLoadScaledImage(char *filename, float scale)
Loads an image from disk and scales the image, loaded image file can be closed using tumDrawFreeLoade...
Definition: TUM_Draw.c:1359
Holds a pixel co-ordinate.
Definition: TUM_Draw.h:121
float tumDrawGetLoadedImageScale(image_handle_t img)
Retrieves the current scaling factor of an image.
Definition: TUM_Draw.c:1473
void * image_handle_t
Handle used to reference loaded images, an invalid image will have a NULL handle.
Definition: TUM_Draw.h:130
int tumDrawText(char *str, signed short x, signed short y, unsigned int colour)
Prints a string to the screen.
Definition: TUM_Draw.c:1176
int tumDrawGetGlobalYOffset(int *offset)
Retrieves a copy of the current global X axis drawing offset.
Definition: TUM_Draw.c:1704
int tumDrawArrow(signed short x1, signed short y1, signed short x2, signed short y2, signed short head_length, unsigned char thickness, unsigned int colour)
Draws an arrow on the screen.
Definition: TUM_Draw.c:1563
int tumDrawAnimationAddSequence(animation_handle_t animation, char *name, unsigned start_row, unsigned start_col, enum sprite_sequence_direction sprite_step_direction, unsigned frames)
Adds an animation sequence to a previously created animation.
Definition: TUM_Draw.c:519
int tumDrawScaledImage(char *filename, signed short x, signed short y, float scale)
Draws a scaled image on the screen.
Definition: TUM_Draw.c:1542
File containing some configuration for the FreeRTOS Emulator.