EE445M RTOS
Taken at the University of Texas Spring 2015
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
graphics2d.c
Go to the documentation of this file.
1
#ifdef __COMPILE_TO_MICRO__
2
#include "rit128x96x4.h"
3
#endif
4
#include "
graphics2d.h
"
5
6
#define NDEBUG
7
8
#ifndef NDEBUG
9
#include <stdio.h>
10
#endif
11
21
unsigned
char
g_PackedDeviceBuffer
[
RIT_FB_WIDTH
*
RIT_FB_HEIGHT
] = {0};
22
23
unsigned
char
*
G2ConvertFBToRITFormat
(
framebuffer
fb) {
24
25
/* i is x, j is y */
26
unsigned
char
i, j;
27
unsigned
char
a, b;
28
29
#ifndef NDEBUG
30
printf(
"%s Unpacking framebuffer..."
, __FUNCTION__);
31
#endif
32
33
for
(j=0; j<
OLED_HEIGHT
; ++j) {
34
for
(i=0; i<
OLED_WIDTH
; i+=2) {
35
a = fb[i][j];
36
b = fb[i+1][j];
37
38
g_PackedDeviceBuffer
[(i/2)+j*
RIT_FB_WIDTH
] = (a<<4) | (b&0xF);
39
}
40
}
41
42
#ifndef NDEBUG
43
printf(
"%s Done unpacking framebuffer..."
, __FUNCTION__);
44
#endif
45
46
return
g_PackedDeviceBuffer
;
47
}
48
49
void
G2Draw
(
framebuffer
fb) {
50
51
G2ConvertFBToRITFormat
(fb);
52
#ifndef __GNUC__
53
RIT128x96x4ImageDraw(
g_PackedDeviceBuffer
, 0, 0,
OLED_WIDTH
,
OLED_HEIGHT
);
54
#endif
55
}
G2ConvertFBToRITFormat
unsigned char * G2ConvertFBToRITFormat(framebuffer fb)
Definition:
graphics2d.c:23
OLED_HEIGHT
#define OLED_HEIGHT
Definition:
defines.h:106
RIT_FB_WIDTH
#define RIT_FB_WIDTH
Definition:
defines.h:110
OLED_WIDTH
#define OLED_WIDTH
Definition:
defines.h:107
framebuffer
char ** framebuffer
Definition:
framebuffer.h:12
g_PackedDeviceBuffer
unsigned char g_PackedDeviceBuffer[RIT_FB_WIDTH *RIT_FB_HEIGHT]
The One Buffer To Rule Them All (TM)
Definition:
graphics2d.c:21
G2Draw
void G2Draw(framebuffer fb)
Definition:
graphics2d.c:49
graphics2d.h
RIT_FB_HEIGHT
#define RIT_FB_HEIGHT
Definition:
defines.h:109
lib
libgraphics2d
graphics2d.c
Generated on Fri Mar 13 2015 21:18:37 for EE445M RTOS by
1.8.9.1