Operator SDK
Build MIDI processing and UI modes for the Operator device
Loading...
Searching...
No Matches
op::draw Namespace Reference

Screen drawing primitives for mode UIs: rectangles, text, and bitmaps. More...

Functions

void draw_rect (int x, int y, int w, int h)
 Draw a 1px rectangle outline.
void fill_rect (int x, int y, int w, int h, bool on)
 Fill or clear a rectangle.
void draw_text (int x, int y, const char *text)
 Draw a NUL-terminated string in the standard 5x7 font.
void draw_text_large (int x, int y, const char *text)
 Draw a NUL-terminated string in the large 8x12 font.
void draw_bitmap (int x, int y, const uint8_t *data, int w, int h)
 Blit a 1bpp bitmap.
void set_pixel (int x, int y, bool on)
 Plot or clear a single pixel.

Detailed Description

Screen drawing primitives for mode UIs: rectangles, text, and bitmaps.

Function Documentation

◆ draw_bitmap()

void op::draw::draw_bitmap ( int x,
int y,
const uint8_t * data,
int w,
int h )
inline

Blit a 1bpp bitmap.

Forwards to op::api->draw_bitmap.

Parameters
xLeft edge in pixels.
yTop edge in pixels.
dataPage-addressed 1-bit pixel data.
wBitmap width in pixels.
hBitmap height in pixels.

◆ draw_rect()

void op::draw::draw_rect ( int x,
int y,
int w,
int h )
inline

Draw a 1px rectangle outline.

Forwards to op::api->draw_rect.

Parameters
xLeft edge in pixels.
yTop edge in pixels.
wWidth in pixels.
hHeight in pixels.

◆ draw_text()

void op::draw::draw_text ( int x,
int y,
const char * text )
inline

Draw a NUL-terminated string in the standard 5x7 font.

Forwards to op::api->draw_text.

Parameters
xLeft edge of the first glyph in pixels.
yTop edge in pixels.
textNUL-terminated string to draw.

◆ draw_text_large()

void op::draw::draw_text_large ( int x,
int y,
const char * text )
inline

Draw a NUL-terminated string in the large 8x12 font.

Forwards to op::api->draw_text_large.

Parameters
xLeft edge of the first glyph in pixels.
yTop edge in pixels.
textNUL-terminated string to draw.

◆ fill_rect()

void op::draw::fill_rect ( int x,
int y,
int w,
int h,
bool on )
inline

Fill or clear a rectangle.

Forwards to op::api->fill_rect.

Parameters
xLeft edge in pixels.
yTop edge in pixels.
wWidth in pixels.
hHeight in pixels.
onTrue sets the pixels, false clears them.

◆ set_pixel()

void op::draw::set_pixel ( int x,
int y,
bool on )
inline

Plot or clear a single pixel.

Forwards to op::api->set_pixel (the firmware bounds-checks and no-ops off-screen plots).

Parameters
xColumn in pixels.
yRow in pixels.
onTrue sets the pixel, false clears it.