Commit f674f7cfc019baaa6bf961cd4ed8b4aee4362f97
Committed by
Anatolij Gustschin
1 parent
945d069fb5
Exists in
master
and in
54 other branches
video: Provide an API to access video parameters
Create a basic API to provide access to video parameters such as screen size, and to position the cursor on the screen. Also add a prototype for video_display_bitmap() which was missing. Signed-off-by: Stefan Reinauer <reinauer@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Anatolij Gustschin <agust@denx.de>
Showing 2 changed files with 50 additions and 3 deletions Side-by-side Diff
common/cmd_bmp.c
... | ... | @@ -31,6 +31,7 @@ |
31 | 31 | #include <command.h> |
32 | 32 | #include <asm/byteorder.h> |
33 | 33 | #include <malloc.h> |
34 | +#include <video.h> | |
34 | 35 | |
35 | 36 | static int bmp_info (ulong addr); |
36 | 37 | |
... | ... | @@ -238,9 +239,7 @@ |
238 | 239 | #if defined(CONFIG_LCD) |
239 | 240 | ret = lcd_display_bitmap((ulong)bmp, x, y); |
240 | 241 | #elif defined(CONFIG_VIDEO) |
241 | - extern int video_display_bitmap (ulong, int, int); | |
242 | - | |
243 | - ret = video_display_bitmap ((unsigned long)bmp, x, y); | |
242 | + ret = video_display_bitmap((unsigned long)bmp, x, y); | |
244 | 243 | #else |
245 | 244 | # error bmp_display() requires CONFIG_LCD or CONFIG_VIDEO |
246 | 245 | #endif |
include/video.h
... | ... | @@ -15,5 +15,53 @@ |
15 | 15 | void video_putc (const char c); |
16 | 16 | void video_puts (const char *s); |
17 | 17 | |
18 | +/** | |
19 | + * Display a BMP format bitmap on the screen | |
20 | + * | |
21 | + * @param bmp_image Address of BMP image | |
22 | + * @param x X position to draw image | |
23 | + * @param y Y position to draw image | |
24 | + */ | |
25 | +int video_display_bitmap(ulong bmp_image, int x, int y); | |
26 | + | |
27 | +/** | |
28 | + * Get the width of the screen in pixels | |
29 | + * | |
30 | + * @return width of screen in pixels | |
31 | + */ | |
32 | +int video_get_pixel_width(void); | |
33 | + | |
34 | +/** | |
35 | + * Get the height of the screen in pixels | |
36 | + * | |
37 | + * @return height of screen in pixels | |
38 | + */ | |
39 | +int video_get_pixel_height(void); | |
40 | + | |
41 | +/** | |
42 | + * Get the number of text lines/rows on the screen | |
43 | + * | |
44 | + * @return number of rows | |
45 | + */ | |
46 | +int video_get_screen_rows(void); | |
47 | + | |
48 | +/** | |
49 | + * Get the number of text columns on the screen | |
50 | + * | |
51 | + * @return number of columns | |
52 | + */ | |
53 | +int video_get_screen_columns(void); | |
54 | + | |
55 | +/** | |
56 | + * Set the position of the text cursor | |
57 | + * | |
58 | + * @param col Column to place cursor (0 = left side) | |
59 | + * @param row Row to place cursor (0 = top line) | |
60 | + */ | |
61 | +void video_position_cursor(unsigned col, unsigned row); | |
62 | + | |
63 | +/* Clear the display */ | |
64 | +void video_clear(void); | |
65 | + | |
18 | 66 | #endif |