Numworks Epsilon  1.4.1
Graphing Calculator Operating System
modkandinsky_impl.cpp
Go to the documentation of this file.
1 extern "C" {
2 #include "modkandinsky.h"
3 }
4 #include <kandinsky.h>
5 #include "port.h"
6 
7 /* KDIonContext::sharedContext needs to be set to the wanted Rect before
8  * calling kandinsky_get_pixel, kandinsky_set_pixel and kandinsky_draw_string.
9  * We do this here with displaySandbox(), which pushes the SandboxController on
10  * the stackViewController and forces the window to redraw itself.
11  * KDIonContext::sharedContext is set to the frame of the last object drawn. */
12 
14  return
17  mp_obj_get_int(red),
18  mp_obj_get_int(green),
19  mp_obj_get_int(blue)
20  )
21  );
22 }
23 
27  );
28  return MP_OBJ_NEW_SMALL_INT(c);
29 }
30 
36  );
37  return mp_const_none;
38 }
39 
43  mp_obj_str_get_str(text),
45  );
46  return mp_const_none;
47 }
48 
static ExecutionEnvironment * currentExecutionEnvironment()
Definition: port.cpp:30
void setPixel(KDPoint p, KDColor c)
#define mp_const_none
Definition: obj.h:614
KDPoint drawString(const char *text, KDPoint p, KDText::FontSize size=KDText::FontSize::Large, KDColor textColor=KDColorBlack, KDColor backgroundColor=KDColorWhite, int maxLength=-1)
Definition: context_text.cpp:9
static constexpr KDColor RGB888(uint8_t r, uint8_t g, uint8_t b)
Definition: color.h:16
mp_obj_t kandinsky_color(mp_obj_t red, mp_obj_t green, mp_obj_t blue)
mp_obj_t kandinsky_get_pixel(mp_obj_t x, mp_obj_t y)
mp_int_t mp_obj_get_int(mp_const_obj_t arg)
Definition: obj.c:225
Definition: point.h:6
c(generic_all_nodes)
#define MP_OBJ_NEW_SMALL_INT(small_int)
Definition: obj.h:87
static constexpr KDColor RGB16(uint16_t rgb)
Definition: color.h:10
static KDIonContext * sharedContext()
Definition: ion_context.cpp:4
mp_obj_t kandinsky_set_pixel(mp_obj_t x, mp_obj_t y, mp_obj_t color)
Definition: color.h:6
const char * mp_obj_str_get_str(mp_obj_t self_in)
Definition: objstr.c:2095
virtual void displaySandbox()
Definition: port.h:23
uint64_t mp_obj_t
Definition: obj.h:39
mp_obj_t kandinsky_draw_string(mp_obj_t text, mp_obj_t x, mp_obj_t y)
KDColor getPixel(KDPoint p)