Generated by Doxygen 1.8.14
Neographics
context.h
1 #pragma once
2 #include <pebble.h>
3 #include "macros.h"
4 #include "types.h"
5 
6 /*-----------------------------------------------------------------------------.
7 | |
8 | GContext |
9 | |
10 | GContexts exist to store information about the graphics environment, |
11 | most importantly a pointer to the framebuffer, information about current |
12 | graphics settings, and information about the currently active graphics |
13 | origin and clipping box. |
14 | |
15 `-----------------------------------------------------------------------------*/
16 
28 typedef struct n_GContext {
29  n_GColor stroke_color;
30  n_GColor fill_color;
31  n_GColor text_color;
32  bool antialias;
33  bool stroke_caps;
34  uint16_t stroke_width;
35 #ifndef NGFX_IS_CORE
36  GContext * underlying_context; // This is necessary where direct framebuffer
37  // access doens't exist (for example, in the
38  // PebbleOS development/testing environment).
39  // In firmwares where neographics _is_ the
40  // underlying context, this is no longer necessary.
41 #endif
42  GBitmap * bitmap;
43  uint8_t * fbuf;
44  n_GRect offset;
45 } n_GContext;
46 
59 // void n_graphics_context_set_compositing_mode(n_GContext * ctx, ...);
63 void n_graphics_context_set_stroke_caps(n_GContext * ctx, bool caps);
67 void n_graphics_context_set_stroke_width(n_GContext * ctx, uint16_t width);
72 void n_graphics_context_set_antialiased(n_GContext * ctx, bool antialias);
73 
74 #ifndef NGFX_IS_CORE
75 
88 
89 #else
90 
94 GBitmap * n_graphics_capture_frame_buffer(n_GContext * ctx);
99 GBitmap * n_graphics_capture_frame_buffer_format(n_GContext * ctx, GBitmapFormat format);
103 bool n_graphics_release_frame_buffer(n_GContext * ctx, GBitmap * bitmap);
104 
105 #endif
106 
111 
112 #ifndef NGFX_IS_CORE
113 
117 #endif
118 
123 
124 
125 #ifdef NGFX_IS_CORE
126 
130 n_GContext * n_root_graphics_context_from_buffer(uint8_t * buf);
131 #endif
132 
void n_graphics_context_begin(n_GContext *ctx)
Definition: context.c:37
Definition: color.h:26
void n_graphics_context_set_stroke_color(n_GContext *ctx, n_GColor color)
Definition: context.c:5
void n_graphics_context_end(n_GContext *ctx)
Definition: context.c:44
n_GContext * n_graphics_context_from_buffer(uint8_t *buf)
Definition: context.c:99
void n_graphics_context_set_fill_color(n_GContext *ctx, n_GColor color)
Definition: context.c:9
Definition: context.h:28
void n_graphics_context_set_stroke_width(n_GContext *ctx, uint16_t width)
Definition: context.c:24
Definition: rect.h:22
void n_graphics_context_set_stroke_caps(n_GContext *ctx, bool caps)
Definition: context.c:30
void n_graphics_context_destroy(n_GContext *ctx)
Definition: context.c:113
struct n_GContext n_GContext
void n_graphics_context_set_text_color(n_GContext *ctx, n_GColor color)
Definition: context.c:13
void n_graphics_context_set_antialiased(n_GContext *ctx, bool antialias)
Definition: context.c:20
n_GContext * n_graphics_context_from_graphics_context(GContext *ctx)
Definition: context.c:106